Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-24 Thread Markus Wageringel
Don't get me wrong. I would greatly prefer if RR would detect the ill-conditioned cases as well, but, as it stands, this is not implemented. Neither LU nor QR decompositions are supported for RR, so it is not easy to change this. The default implementation for solve_right just computes an

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-23 Thread Dave Morris
Although both behaviors may be reasonable, I don't like the fact that each line of the following code gives a completely different result depending on whether F = RR (returns a result that may be garbage, without warning) or F = RDF (gives an error, even though there may be a valid solution).

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-23 Thread Markus Wageringel
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 for this. For

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread 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,

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread Michael Orlitzky
On 5/22/20 6:40 PM, AlexGhitza wrote: > I would also argue that, despite the validity of the arguments regarding > inexact rings, this is a change in behavior that would have benefited > from a deprecation warning for a short while. We were pretty careful not to break anything in the sage

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread AlexGhitza
Hi, On Saturday, May 23, 2020 at 3:55:06 AM UTC+10, Michael Orlitzky wrote: > > > This was changed to "do what MATLAB does" because of the numerical > issues inherent to inexact rings. While > > m = matrix(SR, [0]) > > is singular and the system `m*x == [1]` has no solutions, with > > m =

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread Michael Orlitzky
On 5/22/20 3:39 PM, Nils Bruin wrote: > I think this might need some work: > > S=RealBallField(100) > M=Matrix(S,2,1,[1,1]) > M.solve_right(vector([1,2])) > > There's enough information here to conclude there is no solution; or in > a rather deranged way, perhaps it should give a rather large

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread Nils Bruin
I think this might need some work: S=RealBallField(100) M=Matrix(S,2,1,[1,1]) M.solve_right(vector([1,2])) There's enough information here to conclude there is no solution; or in a rather deranged way, perhaps it should give a rather large ball back so that the multiplication results in a

Re: [sage-devel] bug in matrix solve over inexact coefficients?

2020-05-22 Thread Michael Orlitzky
On 5/21/20 8:44 PM, AlexGhitza wrote: > Hi, > > I'm observing the following with version 9.1 (but not with 9.0 where the > behavior is correct): > > sage: m = matrix(SR, [0]) > sage: b = vector([1]) > sage: m.solve_right(b) > (0) > > This should of course raise > > ValueError: matrix equation

[sage-devel] bug in matrix solve over inexact coefficients?

2020-05-21 Thread AlexGhitza
Hi, I'm observing the following with version 9.1 (but not with 9.0 where the behavior is correct): sage: m = matrix(SR, [0]) sage: b = vector([1]) sage: m.solve_right(b) (0) This should of course raise ValueError: matrix equation has no solutions It seems to be specific to inexact