Hi,
this is what I would expect to see. I might be able to convince you
after you've tried this:
for(int i=0; i<4; i++) cout << idx[i] << " " << a[idx[i]] << endl
;-)
Cheers, Axel.
Allister Levi Sanchez wrote:
> Hi,
>
> I wanted to use TMath::Sort() so I tried a simple test first. I got a
> weird result:
> root [0] double a[4] = {0.34,-2.28,-0.1,4.2}
> root [2] Int_t idx[4]
> root [3] TMath::Sort(4,a,idx)
> root [4] for(int i=0; i<4; i++) cout << idx[i] << " " << a[i] << endl
> 3 0.34
> 0 -2.28
> 2 -0.1
> 1 4.2
>
> Is this the expected result? or is this a bug? I'm using ROOT 3.05/02
> binary distribution for gcc3.2 on my Red Hat 8.
>
> Best regards,
> Allister Levi Sanchez
>
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:10 MET