[GiNaC-list] Maps and sets of symbols?
john.pye at student.unsw.edu.au
Wed Sep 14 16:12:41 CEST 2005
I've got an application I'm working on which needs the ability to handle
STL maps and sets containing symbols. In order to be able to use these
classes, I have to define an ordering (a less-than operator) for
symbols. At the moment I use the 'get_name' method and then compare
symbol names as strings, but this isn't really ideal, since it takes a a
lot of processing, plus GiNaC is quite happy to tolerate more than one
symbol with the same name, so my map/set should be as well.
I notice that GiNaC's symbol class has a 'serial number' as one of its
properties. Is there any way I can access that value via a public
method? Or is there another method suggested for creating sets and maps
//// Ordering for symbols based on name (there should be a better way)/
bool *operator*()(const GiNaC::symbol &a, const GiNaC::symbol &b) const;
More information about the GiNaC-list