I was using the function TMath::Sort in ROOTv 5.34/30 then I tried to use range based loops to loop over the index (which is the thing that is sorted) but the gcc version in that ROOT version does not support range based loops. So I setup ROOTv 6.05/01 and I found out that TMath::Sort is not there anymore. Why was this function not implemented in ROOT6? Shouldn’t that make ROOT not backwards compatible?
I am using ROOTv 6.02/12 from CVMFS in both OSX 10.10.5 and ScientificLinux 6 and I cant get this function to appear, either when I type “TMath::S” and then do tab or when I use it. This is the list of functions that are working.
root [0] TMath::S
Sigma
SigmaUncertainty
Sign
Sign
Sign
Sign
Sign
Sign
SignalingNaN
Sin
SinH
Sqrt
Sqrt2
StruveH0
StruveH1
StruveL0
StruveL1
Student
StudentI
StudentQuantile
array and index are not good names. This macro works for me
{
float a[4]={2, 1, 5, 4};
long long size = 4;
long long ind[4];
TMath::Sort(size,a,ind);
for (int i = 0; i < size; ++i)
std::cout << "INDEX "<< ind[i] << std::endl;
}
Yes, it works. That is strange, those names work in ROOT5 but not in ROOT6 and the message does not seem to tell anything about the name of those arrays.