matrices
Emanuele Paolini
paolini at math.unifi.it
Fri Jan 23 17:12:11 CET 2004
Hi all. I'm trying to use ginac for some calculation involving small matrices
with symbolic values.
I tried the following code:
#include <ginac/ginac.h>
using namespace GiNaC;
main() {
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
I can solve the problem using
matrix H=M.mul(N);
instead.
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. But, in principle, it should be possible, for the library, to
understand (at run time, of course) if an object of type ex is a matrix or can
be converted to a matrix using evalm().
Thank you for your attention,
E. Paolini
Dipartimento di Matematica
Universita` di Firenze
More information about the GiNaC-list
mailing list