27 Jul
2009
27 Jul
'09
3:24 p.m.
Hallo, how can I make a function without any arguments with GiNaC? I just need a function returned a symbolic matrix. It's the same matrix every time. How I have to declare such a function? minimal example: #include <stdio.h> #include <stdlib.h> #include <iostream> #include <math.h> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; REGISTER_FUNCTION (symbolic_matrix, dummy()); { symbol a("a"), b("b"), c("c"); GiNaC::matrix D(2,2), E(2,2); D = a, b, 0, c; E = sin(a), cos(b), -sin(c), cos(a); GiNaC::ex h = D.mul(E) ; return h; } Thank you very match, Michael Hoffmann P.S. : sorry for my english!