On Mon, 30 Sep 2013 17:19:40 +0200, Gunnar Birke <gunnar.birke@online.de> said:
GB> I can have an expression GiNaC::ex f, which contains something GB> like 3*x+2 where x is a symbol. So far so good, but how can I GB> handle things like f(2)? Let f be declared as GiNaC::ex and x be GiNaC::realsymbol. At some point a user may do an assignment f=3*x+2. If later he need the value which you denote by f(2), you need to return him f.subs(x==2). I cannot see a reason why you need to declare f as GiNaC::function, which shall not be confused with mathematical functions as maps X -> Y. -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk www: http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://www.worldscientific.com/worldscibooks/10.1142/p835