Hello, I have some problem accessing the elements of a symbolic matrix. For example the code below creates a 2x2 symbolic matrix 'A' but I can't access the individual elements. The output I get when I run the small program below is: [luis@urubamba ~/GiNaC]#87 ./AA A(0,0) = [[A00,A01],[A10,A11]] matrix::operator(): index out of range What am I making wrong? Thanks for any hint. Luis #############################33 #include <iostream> #include <stdexcept> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main() { int j,k,n=2; try{ matrix A; A = symbolic_matrix(n,n, "A"); cout << "A(0,0) = " << A(0,0) << endl; cout << "A(0,1) = " << A(0,1) << endl; cout << "A(1,0) = " << A(1,0) << endl; cout << "A(1,1) = " << A(1,1) << endl; } catch (exception &z) { cerr << z.what() << endl; return 1; } return 0; } ######################### Créez votre adresse électronique prenom.nom@laposte.net 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
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 -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/
participants (2)
-
Luis Rivera
-
Vladimir V. Kisil