Hi, I only just started using ginac and there's some things about matrices and their relation to expressions that I do not understand. As for instance: why does GiNaC::unity_matrix return a GiNaC::ex ? or why does A + B with A and B both a GiNaC::matrix return a GiNaC::ex? And how do I convert such a GiNaC::ex to a matrix? Can this be done? Greetings, Johan Rutgeerts
Hi! On Thu, Feb 27, 2003 at 05:43:16PM +0100, Johan Rutgeerts wrote:
why does GiNaC::unity_matrix return a GiNaC::ex ?
"ex" is the natural type for passing around symbolic objects in GiNaC. It's lightweight and has automatic free store management.
or why does A + B with A and B both a GiNaC::matrix return a GiNaC::ex?
Matrix expressions in GiNaC remain unevaluated unless you call evalm() (it mimics Maple in this respect). Or use matrix::add().
And how do I convert such a GiNaC::ex to a matrix? Can this be done?
ex_to<matrix>() Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
Johan Rutgeerts