Indeed, instead of ignoring the `check` keyword altogether over inexact 
fields, it would be useful to verify the solution when that is possible, 
such as for exact input over SR and for ball and intervall fields. I have 
opened #29729 <https://trac.sagemath.org/ticket/29729> for this. For 
general inexact rings though, the result cannot be verified, so it would 
not make sense to do the check by default.


Am Samstag, 23. Mai 2020 07:15:45 UTC+2 schrieb Dave Morris:
>
> From the documentation at 
> https://www.mathworks.com/help/matlab/ref/mldivide.html, it appears to me 
> that MATLAB gives a warning: "Warning: Matrix is close to singular or badly 
> scaled. Results may be inaccurate."  That seems to me to be a better 
> default behavior than what sage is doing now, but I think it would make 
> sense to let users choose to turn off the warning (and maybe also let them 
> upgrade it to an error).
>

 The generic implementation of `solve_right` does not provide this. I would 
suggest to use a type that has a specialized implementation for this, such 
as RDF, CDF, CBF. For example over RDF and CDF, a warning is issued if the 
input is ill-conditioned and an error is raised if the matrix is singular, 
which is a reasonable behavior:

sage: matrix(RDF, [[2/3, 1], [0.4, 0.6]]).solve_right(vector(RDF, [1, 1]))
/Applications/SageMath/src/bin/sage-ipython:1: LinAlgWarning: Ill-conditioned 
matrix (rcond=2.77556e-17): result may not be accurate.
  #!/usr/bin/env sage-python
(5404319552844596.0, -3602879701896396.0)
sage: matrix(RDF, [[0]]).solve_right(vector(RDF, [1]))
...
LinAlgError: Matrix is singular.

-- 
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/bf5e377d-630c-49f9-8347-4798dd6fd8bc%40googlegroups.com.

Reply via email to