manpagez: man pages & more
info ginac
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.5 Adding classes

The structure<T> template provides an way to extend GiNaC with custom algebraic classes that is easy to use but has its limitations, the most severe of which being that you can't add any new member functions to structures. To be able to do this, you need to write a new class definition from scratch.

This section will explain how to implement new algebraic classes in GiNaC by giving the example of a simple 'string' class. After reading this section you will know how to properly declare a GiNaC class and what the minimum required member functions are that you have to implement. We only cover the implementation of a 'leaf' class here (i.e. one that doesn't contain subexpressions). Creating a container class like, for example, a class representing tensor products is more involved but this section should give you enough information so you can consult the source to GiNaC's predefined classes if you want to implement something more complicated.


© manpagez.com 2000-2024
Individual documents may contain additional copyright information.