[GiNaC-list] Maps and sets of symbols?

John Pye john.pye at student.unsw.edu.au
Wed Sep 14 17:08:45 CEST 2005


Hi Alexei,

I _really_ wanted to use

std::map<symbol, symbol>

What's a better idea then?

I'm using it to keep track of variables which I've eliminated from a
system of nonlinear equations...

Cheers
JP

Sheplyakov Alexei wrote:

>On Thu, Sep 15, 2005 at 12:12:41AM +1000, John Pye wrote:
>  
>
>>I've got an application I'm working on which needs the ability to handle
>>STL maps and sets containing symbols. 
>>    
>>
>
>Use std::map<ex, foo, ex_is_less>, see http://www.ginac.de/FAQ.html#stlcontainers
>
>If you _really_ want to use std::map<symbol, foo, ...> 
>
>struct symbol_is_less 
>{
> inline const bool operator()(const symbol& a, const symbol& b)
> {
>   return ex_is_less()(a, b);
> }
>};
>
>Best regards,
>  Alexei
>
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>GiNaC-list mailing list
>GiNaC-list at ginac.de
>http://thep.physik.uni-mainz.de/mailman/listinfo/ginac-list
>  
>




More information about the GiNaC-list mailing list