Hi, I wonder if it is possible to make symbols non-commutable. The reason is that I want to invert systems of matrices, [[A B], [C D]] where A, B, C and D are matrices. The matrices are invertible, but I do not want to say anything about their structure. I have made a subclass mystring of basic as described in sec. 6.3. and redefined return_type: unsigned return_type(void) const { return return_types::noncommutative; } and it works fine: (a+b)*(a+b) = a*a+a*b+b*a+b*b However, when I make a matrix of and try to solve it, the program abort. I have also tried to make a subclass of symbol, but this class does not seem to be as easy to subclass as basic. Any hints ? Kent-Andre Mardal
Hi! On Thu, Aug 21, 2003 at 10:24:31PM +0200, Kent-Andre Mardal wrote:
However, when I make a matrix of and try to solve it, the program abort.
Aborts with GiNaC usually mean an unhandled exception. Catch and print it, and it may give you a hint about where the problem is. Introducing noncommutative objects probably exceeds the domain on which the algorithm used by the linear solver is defined. Manually choosing a different algorithm (maybe "solve_algo::divfree"?) may fix this. Richy? Bye, Christian -- / Physics is an algorithm \/ http://www.uni-mainz.de/~bauec002/
Hi, On Mon, 25 Aug 2003, Christian Bauer wrote: [...]
Introducing noncommutative objects probably exceeds the domain on which the algorithm used by the linear solver is defined. Manually choosing a different algorithm (maybe "solve_algo::divfree"?) may fix this. Richy?
No. You might be able to bring the augmented matrix into *some* division free form but not having to divide doen't mean you don't have to care about whether the algorithm multiplies those matrix entries from the left or from the right. Besides, backsubstituting would leave the integral domain anyway and as soon as one enters the corresponding quotient field one would need to have an inverse handy -- likely for every denominator that appears during backsubstituting. I am not saying that it cannot be done. I don't know. But the algorithms provided in class matrix are not sufficient. HTH -richy. -- Richard B. Kreckel <Richard.Kreckel@GiNaC.DE> <http://www.ginac.de/~kreckel/>
participants (3)
-
Christian Bauer
-
Kent-Andre Mardal
-
Richard B. Kreckel