Re: Problem with function geev

Thibault Langlois <[email protected]> Tue, 09 Aug 2005 17:34:51 +0100
Newsgroups gmane.lisp.matlisp.user
Organization FCUL / DI
Message-ID <1123605291.26237.11.camel@wok>
On Wed, 2005-07-27 at 16:29 -0400, Raymond Toy wrote: 
> >>>>> "Thibault" == Thibault Langlois <[email protected]> writes:
> 
>     Thibault> #<The MATLISP-USER package, 1/9 internal, 0/2 external>
>     Thibault> * (setq m (make-real-matrix '((1 1 2) (2 2 4) (3 3 6))))
> 
>     Thibault> Warning:  Declaring M special.
> 
>     Thibault> #<REAL-MATRIX  3 x 3
>     Thibault>     1.0000      1.0000      2.0000     
>     Thibault>     2.0000      2.0000      4.0000     
>     Thibault>     3.0000      3.0000      6.0000     >
>     Thibault> * (geev m)
> 
> Just tried this (finally) using cvs matlisp and cmucl 2005-07.
> (geev m) returns
> 
> #<REAL-MATRIX  3 x 1
>     0.0000     
>     9.0000     
>    -5.24537E-16 >
> 
> which is pretty close to what matlab returns.
> 
> I'll have to look at the code some more.  Perhaps it's doing something
> wrong.  (There used to be a memory corruption error in some eigenvalue
> routine, but that's been fixed.)
> 
> Ray
> 

I have been trying to find where this bug occurs. First surprise, it
seems to be in fortran code, somewhere in the DLAMCH routine. I tried to
put some "PRINT *, 'some string'" in the code in order to localize the
point. Doing so I ended with a version of the file that make matlisp
work correctly ! 

Then I went to #lisp to see if someone involved was online. Consulting
the log at http://meme.b9.com I noticed that someone (aeacides) was also
looking at the same file and at the same point in the file ...

So, if I add the prints arround the loop, it works:

         PRINT *, 'before loop 2'
*+       WHILE( C.EQ.A )LOOP
   20    CONTINUE
         IF( C.EQ.A ) THEN
            B = 2*B
            C = DLAMC3( A, B )
            GO TO 20
         END IF
*+       END WHILE
         PRINT *, 'after loop 2'

if I comment the first and last lines it does not work. 

It looks like a nasty memory corruption bug. 

Thibault

PS: the problem is not related to the geev function and should affect
other matlisp functions.




-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf