Re: [Maxima-bugs] [ maxima-Bugs-988701 ] incorrect matrix inversion



Greetings!  With 5.9.0 on latest gcl stable, 2.6.2, I get:
(sid)camm@intech66:/fix/g/camm/maxima/maxima-5.9.0$ maxima
GCL (GNU Common Lisp)  2.6.2 CLtL1   Jun 29 2004 18:53:13
Source License: LGPL(gcl,gmp), GPL(unexec,bfd)
Binary License:  GPL due to GPL'ed components: (READLINE BFD UNEXEC)
Modifications of this banner must retain notice of a compatible license
Dedicated to the memory of W. Schelter

Use (help) to get some basic information on how to use GCL.
Maxima restarted.
(C4) matrix([1,0,0],[-.3,1,0],[0,-.3,1]);

			      [	  1	 0    0 ]
			      [		        ]
(D4) 			      [ - 0.3	 1    0 ]
			      [		        ]
			      [	  0    - 0.3  1 ]
(C5) invert(%);

			      [ 1.0    0    0  ]
			      [		       ]
(D5) 			      [ 0.3   1.0   0  ]
			      [		       ]
			      [ 0.09  0.3  1.0 ]
(C6) 

Can we pin down the maxima and gcl versions a bit more?  If there is a
bug, I want to fix it soon, as it appears we have to put out a 2.6.3
errata release.

Take care,

Raymond Toy <raymond.toy@ericsson.com> writes:

> >>>>> ">" == SourceForge net <noreply@sourceforge.net> writes:
> 
> Moving the discussion from the bug tracker to here.
> 
>     >> Bugs item #988701, was opened at 2004-07-10 19:56
> 
>     >> Category: None
>     >> Group: None
>     >> Status: Open
>     >> Resolution: None
>     >> Priority: 5
>     >> Submitted By: Nobody/Anonymous (nobody)
>     >> Assigned to: Nobody/Anonymous (nobody)
>     >> Summary: incorrect matrix inversion
> 
>     >> Initial Comment:
>     >> invert matrix mistake:
> 
>     >> Maxima 5.9.0.9beta1 http://maxima.sourceforge.net
>     >> Using Lisp Kyoto Common Lisp GCL 2.6.2 (aka GCL)
>     >> Distributed under the GNU Public License. See the file
>     >> COPYING.
>     >> Dedicated to the memory of William Schelter.
>     >> This is a development version of Maxima. The function
>     >> bug_report()
>     >> provides bug reporting information.
>     >> (%i1) matrix([1,0,0],[-.3,1,0],[0,-.3,1]);
>     >> 			      [	  1	 0    0 ]
>     >> 			      [		        ]
>     >> (%o1) 			      [ - 0.3	 1    0 ]
>     >> 			      [		        ]
>     >> 			      [	  0    - 0.3  1 ]
>     >> (%i2) invert(%o1);
>     >> 			[      1	    0	    0 ]
>     >> 			[			      ]
>     >> (%o2) 		        [ - 288387008	    1	    0 ]
>     >> 			[			      ]
>     >> 			[  288385392   - 288386992  1 ]
> 
> 
> After some playing around, this looks very much to be a problem with
> gcl.  I tried this with gcl 2.7.0 (some CVS version from some time
> ago), and see this error (with different bad values).  clisp and cmucl
> produce the correct values.
> 
> I've tracked it down to this in $adjoint in src/invert.lisp:
> 
>          (MASET (MUL* (POWER -1 (f+ $I $J))
>                       (SIMPLIFY ($DETERMINANT (SIMPLIFY ($MINOR $MAT
>                                                                 $J
>                                                                 $I)))))
>                 $ADJ
>                 $I
>                 $J)))))
> 
> Everything is done correctly, except MUL*.  It returns the bogus
> values.  If you just load invert.lisp into a running maxima, you get
> the correct values.  If you compile the file and then load it, you get
> broken values.
> 
> However, I haven't been able to figure out what's wrong with MUL*.
> You can trace it, but it never gets called, so something is replacing
> the call to MUL* with something else.
> 
> Ray
> 
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
> 
> 
> 

-- 
Camm Maguire			     			camm@enhanced.com
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah