[GiNaC-list] Non commutative symbols ?

Richard B. Kreckel kreckel at ginac.de
Tue Jun 30 22:43:10 CEST 2009


ahabrard wrote:
> Another problem with matrix of non commutative symbols, consider the
> following code:
>  matrix m(2,2);
>  m = x, y, y, x;
>  cout << m.inverse() << endl;
> Ginac stops with the following message:
> "Terminate called after throwing an instance of 'std::logic_error'
>   what():  add::eval(): sum of non-commutative objects has non-zero numeric
> term
> Abort trap"
> Anyone knows the reason ?

Internally, the .inverse() method is performing matrix elimination. With 
non-commutative elements, it would have to keep track of the order of 
terms but it doesn't really know how to do that. If you know how to do 
such things, you should consider writing a patch.

Richard B. Kreckel

More information about the GiNaC-list mailing list