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 #include #include 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.
participants (1)
-
Luis Rivera