Request for a sample source file to create 8x8 matrix of real numbers.

Christian Bauer cbauer at student.physik.uni-mainz.de
Sat Jan 19 14:55:25 CET 2002


Hi!

On Sat, Jan 19, 2002 at 10:48:15AM +0530, Ananda Murthy R S wrote:
> I hereby request anybody to give me sample code to create an 8x8 matrix of 
> real numbers using GiNaC and to print it.

Here's a complete example:

---- snip ----
#include <iostream>
#include <ginac/ginac.h>
using namespace GiNaC;

int main(void)
{
    matrix M(8, 8);

    M(0, 0) = 42.0;
    M(0, 2) = -7.6;
    M(7, 7) = 3.141;
    // etc...

    cout << M << endl;

    return 0;
}
---- snap ----

You can find more elaborate examples and documentation in the GiNaC tutorial:
  http://www.ginac.de/tutorial/tutorial_4.html#SEC23

Bye,
Christian

-- 
  / Coding on PowerPC and proud of it
\/ http://www.uni-mainz.de/~bauec002/



More information about the GiNaC-list mailing list