[GiNaC-list] a function without any arguments with GiNaC?

Michael Hoffmann michael.hoffmann at unibw.de
Mon Jul 27 15:24:09 CEST 2009


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!



More information about the GiNaC-list mailing list