Sorting list

From: Olivier Meplan (meplan@isn.in2p3.fr)
Date: Mon Apr 26 1999 - 10:31:32 MEST


Hi rooters!

I am try to nodify the program example of TOrdCollection...
But I want to apply this to an object having 2 values x and y.
The sorted list will be :
 x1 y1
 x1 y2
 x2 y3
 x3 y4
...

with x1<x2<x3  and y1<y2 (y3 and y4 may be greater or smaller than y1
and y2).


In the example the Compare member function for the objet class
containnig only 1 value is:


Int_t	Compare(TObject *obj) { 
        				if (fX == ((Value*)obj)->fX)
                                      		return 0;
                                   	else if (fX < ((Value*)obj)->fX)
                                      		return -1;
                                   	else
                                      		return 1;
                                       }
};


How can I do in my case to define such a Compare member fuction?

Thank you
Olivier Meplan



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:32 MET