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



>>>>> ">" == 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