21 return *(fData + i1) > *(fData + i2);
33 return *(fData + i1) < *(fData + i2);
52 for (
Int_t i = 0; i <
n; i++) {
58 for(
Int_t i = 0; i <
n; i++) { indexM[i] = i; }
61 cout <<
"TMath[kTRUE]\n\tindex = ";
62 for (
Int_t i = 0; i <
n; ++i )
63 cout << k[indexM[i]] <<
' ';
66 for(
Int_t i = 0; i <
n; i++) { indexS[i] = i; }
69 cout <<
"std::sort[CompareDesc]\n\tindex = ";
70 for (
Int_t i = 0; i <
n; ++i )
71 cout << k[indexS[i]] <<
' ';
75 equals &=
std::equal(indexM.begin(), indexM.end(), indexS.begin());
76 cout <<
"Equals? " << (
char*) (equals?
"OK":
"FAILED") << endl;
79 for(
Int_t i = 0; i <
n; i++) { indexM[i] = i; }
82 cout <<
"TMath[kFALSE]\n\tindex = ";
83 for (
Int_t i = 0; i <
n; ++i )
84 cout << k[indexM[i]] <<
' ';
87 for(
Int_t i = 0; i <
n; i++) { indexS[i] = i; }
90 cout <<
"std::sort[CompareAsc]\n\tindex = ";
91 for (
Int_t i = 0; i <
n; ++i )
92 cout << k[indexS[i]] <<
' ';
96 equals &=
std::equal(indexM.begin(), indexM.end(), indexS.begin());
97 cout <<
"Equals? " << (
char*) (equals?
"OK":
"FAILED") << endl;
104 return testSort<Int_t>(20);
bool equal(double d1, double d2, double stol=10000)
Random number generator class based on the maximally quidistributed combined Tausworthe generator by ...
bool operator()(int i1, int i2)
int equals(Double_t n1, Double_t n2, double ERRORLIMIT=1.E-10)
bool operator()(int i1, int i2)
virtual UInt_t Integer(UInt_t imax)
Returns a random integer on [ 0, imax-1 ].
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
bool testSort(const int n)