Unable to create 3x8 matrix having real numbers.
Hello: The program given below is not compiling. //Creating a 3x8 Matrix #include <iostream> #include <ginac/ginac.h> using namespace GiNaC; using namespace std; int main() { matrix A(3,8, lst(-2.902280128, 4.902280128, 3.698135576 , -1.091710896, -1.339597088, -3.833588112, 0.1354525359, 0.1354525359, 14.57598539, 8.663631092, 4.471485536, -6.163631092, -1.031929416, 1.692145555, -11.85191042, 0.5280631913, -13.01717766, 5.242845433, 6.808655713, 0.3658471056, -1.250335699, -9.401666250, 5.593010537, -0.1838540200)); cout << "A = " << A << endl; return 0; } But if I change it to a 2 x 8 matrix as shown below it is compiling. //Creating a 2x8 Matrix #include <iostream> #include <ginac/ginac.h> using namespace GiNaC; using namespace std; int main() { matrix A(2,8, lst(-2.902280128, 4.902280128, 3.698135576 , -1.091710896, -1.339597088, -3.833588112, 0.1354525359, 0.1354525359, 14.57598539, 8.663631092, 4.471485536, -6.163631092, -1.031929416, 1.692145555, -11.85191042, 0.5280631913)); cout << "A = " << A << endl; return 0; } Can somebody tell me what is the problem? Is there any limit on the dimensions of the matrix that can be created in GiNaC? I am runnilng GiNaC on Linux-Mandrake 8.1. Thanks in advance, Sincerely, Ananda Murthy R S
Hi, On Sun, 13 Jan 2002, Ananda Murthy R S wrote: [...]
Can somebody tell me what is the problem? Is there any limit on the dimensions of the matrix that can be created in GiNaC? [...]
No, there is no limit on the dimension of the matrix, but lst() is a call to a constructor and we can only have a finite number of such precompiled ctors. We have to draw a line somewhere. We chose to draw it at 16, because 4x4 matrices were rather natural and important. Just don't create your matrices like this if you need bigger ones. Have a look at the check directory and how large matrices are created in there for inspiration. Particularly, the Lewis-Wester test O, M1, M2 and maybe some others. Regards -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
participants (2)
-
Ananda Murthy R S
-
Richard B. Kreckel