why is GiNaC::symbol commutative??

Christian Bauer cbauer at thep.physik.uni-mainz.de
Tue Dec 3 19:50:08 CET 2002


Hi!

On Tue, Dec 03, 2002 at 03:25:00PM +0100, smilauer at volny.cz wrote:
> I would like to use symbols to represent matrices. Obvious solution
> (replacing symbols via some_ex.sub(some_symbol==some_matrix) does not work
> for multiplication of matrices. Other ways to do it?

1) Subclass symbol (see GiNaC tutorial, section 6.3.) and override
   return_type() to return 'return_types::noncommutative' and
   return_type_tinfo() to return 'TINFO_matrix'. These new symbols will
   then have the same commutativity properties as matrices.

2) Use dummy 1x1 numeric or symbolic matrices instead of symbols, and subs()
   the entrire matrices.

Bye,
Christian

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



More information about the GiNaC-list mailing list