Hello Vladimir, Thanks for your answer. Yes, if I use the code below it works. Could you explain me in few words why it should be so? Thanks, Luis New version: ########### ex A; A = symbolic_matrix(n,n, "A"); cout << "A(0,0) = " << ex_to<matrix>(A)(0,0) << endl; cout << "A(0,1) = " << ex_to<matrix>(A)(0,1) << endl; cout << "A(1,0) = " << ex_to<matrix>(A)(1,0) << endl; cout << "A(1,1) = " << ex_to<matrix>(A)(1,1) << endl; ########### ------------------------------------------------------------------------------------
On Mon, 19 Jan 2009 21:07:58 +0100 (CET), Luis Rivera <luis.rivera@laposte.net> >>said: LR> I have some problem accessing the elements of a symbolic matrix. LR> For example the code below creates a 2x2 symbolic matrix 'A' but LR> I can't access the individual elements.
A similar question was asked here recently:
http://www.ginac.de/pipermail/ginac-list/2008-November/001458.html
see if its answer would work for you.
Best wishes, Vladimir
Créez votre adresse électronique prenom.nom@laposte.net 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
Hello Luis,
On Mon, 19 Jan 2009 22:01:47 +0100 (CET), Luis Rivera <luis.rivera@laposte.net> said: LR> Thanks for your answer. Yes, if I use the code below it works. LR> Could you explain me in few words why it should be so?
To make a proper sense of expression A(0,0) the compiler should be told that A shall be considered a matrix. This also shall be done if you call class-specific methods for other GiNaC classes. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
participants (2)
-
Luis Rivera
-
Vladimir V. Kisil