GiNaC expressions in stl set

Kai Ludwig kai.ludwig at uni-tuebingen.de
Fri Feb 27 16:07:51 CET 2004


Hi,

there seems to be a problem with the stl set container:

int main()
{

GiNaC::symbol u1( "A" );
GiNaC::symbol u2( "B" );

std::set<GiNaC::symbol> spec;
spec.insert(u1);
spec.insert(u2);
spec.insert(u3);

std::set<GiNaC::symbol>::const_iterator s1 = spec.find(u1);
// s2 still points to u1 !
std::set<GiNaC::symbol>::const_iterator s2 = spec.find(u2);

GiNaC::ex f = pow((*s1),2) + (*s2) + 200*(*s1);
std::cout << "f= " <<  f << std::endl;

}

Kai

-- 
http://echempp.sourceforge.net

Kai Ludwig
Institut für Organische Chemie
Auf der Morgenstelle 18
72076 Tübingen
Tel.: 07071/29-73049
Mail: kai.ludwig at uni-tuebingen.de





More information about the GiNaC-list mailing list