Over inexact rings, it is generally impossible to determine the rank or to 
check whether a square matrix is singular, so such a check should not be 
done at all, IMO. This implies that the `check` keyword should be ignored. 
This is also what https://trac.sagemath.org/ticket/13932 is about. For 
inexact rings like RDF/CDF, the Matlab behavior is consistent and 
predictable. In particular, the answer does not depend on numerical noise. 
In other words, for near-singular square matrices, the method should _not_ 
attempt to find a least-squares solution, but continue the computation as 
if the matrix was regular (which may lead to a warning or error). 
Otherwise, the output of the method would just be very unpredictable, so 
one would always have to check which type of solution it decided to return.

For inexact rings other than RDF/CDF, other notions of "approximate 
solution" may be more appropriate, but that does not seem to be a problem 
as long as it clearly documented.

For exact rings, it is possible to determine the rank and whether an exact 
solution exists. Therefore, I would expect the method to always return an 
exact solution if it exists and raise an error otherwise, regardless of 
whether the matrix is square or not. The `check` keyword is, in my 
understanding, a detail that helps speed up a computation if one already 
knows a priori that what it would check is unnecessary. Otherwise, the 
output may just be wrong.

I will try to reply to your changes on the ticket soon.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/54c30868-5900-40fb-bac6-d131cfd78112%40googlegroups.com.

Reply via email to