[GiNaC-list] symbolic matrix

Luis Rivera luis.rivera at laposte.net
Mon Jan 19 21:07:58 CET 2009


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 at 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 at laposte.net 
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.cebix.net/pipermail/ginac-list/attachments/20090119/856cd185/attachment.htm 


More information about the GiNaC-list mailing list