Changeset 9253
- Timestamp:
- 01/24/09 10:57:48 (16 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r9252 r9253 18 18 19 19 -*-*- END OF LINE -*-*- 20 21 2009/01/24 Thomas Bretz 22 23 * mbase/MMath.cc: 24 - added two explicit conversion to make it compile on my Ubuntu 25 - Replaced some Form by MString::Format 26 - included MString 27 28 20 29 21 30 2009/01/23 Daniela Dorner -
trunk/MagicSoft/Mars/mbase/MMath.cc
r9234 r9253 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.4 5 2009-01-21 14:22:39tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.46 2009-01-24 10:57:46 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 56 56 #endif 57 57 58 #include "MString.h" 59 58 60 //NamespaceImp(MMath); 59 61 … … 243 245 Double_t arr[n]; 244 246 for (int i=0; i<n; i++) 245 arr[i] = TMath::Abs(a[i]-med);247 arr[i] = (Double_t)TMath::Abs(Double_t(a[i])-med); 246 248 247 249 //return TMath::Median(n, arr)/0.67449896936; //MMath::GaussProb(x)=0.5 248 250 249 251 // Define where to divide (floor because the highest possible is n-1) 250 const Size div = TMath::FloorNint( n*prob);252 const Size div = TMath::FloorNint(Double_t(n)*prob); 251 253 252 254 // Calculate result … … 336 338 { 337 339 Element *cpy = new Element[n]; 338 Int_t *pos = new Int_t[n];340 Size *pos = new Size[n]; 339 341 340 342 memcpy(cpy, a, n*sizeof(Element)); … … 342 344 TMath::Sort(n, a, pos, down); 343 345 344 Int_t*idx = pos;346 Size *idx = pos; 345 347 346 348 for (Element *ptr=a; ptr<a+n; ptr++) … … 867 869 // Check if error starts with 1 or 2. In this case use one 868 870 // more valid digit 869 TString error = Form("%.0e", e);871 TString error = MString::Format("%.0e", e); 870 872 if (error[0]=='1' || error[0]=='2') 871 873 { 872 874 i++; 873 error = Form("%.1e", e);874 } 875 876 const char *fmt = Form("%%.%de", i);877 878 v = atof(Form(fmt, v));875 error = MString::Format("%.1e", e); 876 } 877 878 const char *fmt = MString::Format("%%.%de", i); 879 880 v = MString::Format(fmt, v).Atof(); 879 881 e = error.Atof(); 880 882 }
Note:
See TracChangeset
for help on using the changeset viewer.