Re: linsolve



Hi Fabrizio,

I recommend algsys instead of linsolve. 
A lengthy discourse follows. 8^)

> I found that am getting a strange error from "linsolve" 
> whenever it finds that the system has no solution 
> it outputs a warning about the inconsistency (which is okay) 
> followed by the error message [...]
> instead of the empty list of solutions as I would expect.

As it happens this behavior is governed by an obscure
global flag, solve_inconsistent_error .
If you set that to "false", linsolve returns an
empty list when the equations are inconsistent.
(I didn't know that til I went and looked at the code.
Maybe the linsolve documentation should mention it.)

On a related note -- maybe you don't really want to call
linsolve after all. The description of linsolve in Equations.texi
suggests that linsolve accepts polynomial equations
as arguments, although it doesn't seem to be able to solve them
correctly. Attempting a few trivial examples of polynomial
eqns, I get incorrect results; linsolve can't even solve
linear equations correctly -- see SF bug # 887025 for an
example. So I wonder what purpose linsolve is serving, 
as the documented capability of it is subsumed by algsys,
and it has bugs. (Dunno about algsys; no response from SF
at the moment.)

There's also solve, which calls linsolve, and so it has
the same bugs, and fast_linsolve in share/affine/polya.lisp,
which won't load because of a syntax error.

For what it's worth,
Robert Dodier


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/