Adding another infix operator?(programing)
Hello, I am new to ginac. I have a computer algebra program which uses the infix operator "**" for a noncommutative multiplication (for example, a**b where a and b are symbols, but are thought of as representing matrices). (See http://math.ucsd.edu/~ncalg for more.) Is it possible/easy/hard to add a "**" infix operator to ginac? If so, where do I start looking in the code to do this. I would like to link my code up with ginac in the future. Mark Stankus mstankus@calpoly.edu
Hi! On Wed, Mar 20, 2002 at 01:49:50PM -0800, Mark Stankus wrote:
Is it possible/easy/hard to add a "**" infix operator to ginac?
Impossible because you can't define new operators in C++ (only overload existing ones). Besides, noncommutativity in GiNaC is a property of the objects, and the ordinary '*' operator is used for both commutative and noncommutative products (that's handled automatically). Symbols are commutative by default, but you can subclass your own, noncommutative symbols. For more information, see the GiNaC tutorial, section "Non-commutative objects". Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/
participants (2)
-
Christian Bauer
-
Mark Stankus