matrices

Christian Bauer Christian.Bauer at Uni-Mainz.DE
Fri Jan 23 18:08:13 CET 2004


Hi!

On Fri, Jan 23, 2004 at 05:12:11PM +0100, Emanuele Paolini wrote:
> I tried the following code:
>
> 	  matrix M(2,2);
> 	  matrix N(2,2);
> 	  matrix H=M*N;
> 
> and obtain the error:
> 	conversion from `GiNaC::ex' to non-scalar type `GiNaC::matrix' requested
> 
> Anyway I wonder if this is a desired behaviour of the library. I suppose that
> the object M*N is of type GiNaC::ex because of delayed evaluation of the
> product.

Yes, well, GiNaC is a symbolic expressions library, not a matrix library, and
thus the fundamental type is "ex".

I suppose we could implement an automatic evalm() when you assign an "ex" to
a matrix, but that would interfere with the existing matrix::operator=(const ex &)
that is used for matrix initialization...

Bye,
Christian

-- 
  / Physics is an algorithm
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-list mailing list