expressions inside a user-defined class.

Christian Bauer Christian.Bauer at Uni-Mainz.DE
Fri May 3 17:42:20 CEST 2002


Hi!

On 2002.05.03 17:04 Juan Jose Arribas wrote:
> class fext {
> public:
>      string funcionstr;
>      ex funcion ;
>      symbol tiempo ;
>      lst l ;
> public:
>      fext (string &);  // Constructor 
>      double valor(double);
> };
> 
> fext::fext (string & funcionc)
>     {
>     funcionstr = string(funcionc) ;
>     tiempo = symbol("t") ;

You can't assign symbols to each other in GiNaC. You should either use an "ex tiempo"
as the member variable, or initialize the "symbol tiempo" in the constructor like this:

  fext::fext(string & functionc) : tiempo("t")
  {
     [...]

(The symbol class shouldn't have an assignment operator in the first place. I thought
we had removed it but it probably reappeared with the introduction of the
GINAC_IMPLEMENT_REGISTERED_CLASS macros. I think We should fix that.)

Bye,
Christian

-- 
  / Coding on PowerPC and proud of it
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-list mailing list