-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve_left for RDF matrices is WRONG #7852
Comments
comment:1
This might be related to #4932. I'll put this on my list for the bug day coming up. |
Attachment: trac_7852-solve-linear-systems-CDF.patch.gz |
comment:2
Patch corrects the naming problem, and creates upgraded This required just a few touch-ups where the name had been wrong, or the improved accuracy changed results. |
Author: Rob Beezer |
comment:4
Without the patch, "solve_right" seems to work for nonsquare matrices over RDF, I guess because it's using the generic "solve_right" method from matrix2.pyx. With the patch, it looks like this won't work any more; is that right? Is there a good reason for not allowing square matrices? We could instead add a method For "solve_left", could we just remove the version from matrix_double_dense.pyx altogether, and just use the generic version? |
comment:5
Replying to @jhpalmieri: Yes, there is some tension in handling inexact matrices with routines designed for exact matrices (which is the root issue here, I believe). I'm hoping to get some guidance from the |
comment:6
|
comment:7
We could use a direct call to |
comment:8
Finally getting back to this one.
Rob |
comment:9
What I was talking about when I mentioned the fallback is a piece of generic code for solve_left that calls solve_right. Thus you only need to implement one version. And you should, because code duplication makes mistakes more likely and maintenance harder. I will change this when reviewing this, and then will wait for your approval. |
comment:10
I didn't touch the implementation of solve_right. I changed my mind for the following simple reason. While the code is quite short and easy to check the documentation is very different (left replaced by right). So it seems quite impractical to duplicate it. We should think about modifying the documentation so that it gets included in the reference manual. Also there is a pseudoregression in the code. Sage doesn't pretend it could solve equations with double dense matrices as right hand side. Scipy covers also this case, so we should open a new ticket for this. |
Reviewer: Martin Raum |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.7.2.alpha3 |
Dependencies: #11848 |
Attachment: trac_7852-fix_noise_errors_in_preparser_examples.reviewer.patch.gz Reviewer patch. Apply on top of main patch, which causes a signed zero on Itanium 2. |
Attachment: trac_7852-fix_noise_errors_in_polys.reviewer.patch.gz Reviewer patch. Apply on top of main patch, which causes doctests to fail on a couple of systems due to noisy zero terms. |
This comment has been minimized.
This comment has been minimized.
comment:15
Attached two reviewer patches fixing doctest errors on some systems. Third patch to fix doctest errors in The patch to the preparser examples requires #11848. |
Changed reviewer from Martin Raum to Martin Raum, Leif Leonhardy |
Reviewer patch. Apply on top of main patch, which causes another doctest to fail on a couple of systems due to a noisy zero in a vector result. |
This comment has been minimized.
This comment has been minimized.
comment:16
Attachment: trac_7852-fix_noisy_zero_error_in_matrix_double_dense.reviewer.patch.gz Third reviewer patch (fixing a doctest error in |
comment:17
The three reviewer patches apply, build and pass their tests once #11848 is applied to a recent alpha3 prerelease that already has the main patch. Currently passes all tests in This has a positive review from me based on the reviewer contributions, but is marked as closed right now anyway. I'll only retreat if something unexpected happens overnight. Leif - thank-you very much for getting these noisy tests cleaned up. Rob |
Changed author from Rob Beezer to Rob Beezer, Leif Leonhardy |
Changed reviewer from Martin Raum, Leif Leonhardy to Martin Raum, Leif Leonhardy, Rob Beezer |
Reviewer patch. Slightly adjust threshold for noisy zero terms in polynomials, needed on MacOS X 10.6 x86_64 with GCC 4.2.1. Apply on top of other patches (i.e., the other reviewer patch to |
comment:18
Attachment: trac_7852-adjust_noisy_zero_term_threshold_for_polys.reviewer.patch.gz I've attached yet another patch slightly increasing one epsilon, since one doctest still failed on MacOS X 10.6 (due to almost zero terms in a polynomial). |
This comment has been minimized.
This comment has been minimized.
comment:19
Yes, I meant to bring this up in the flurry of noisy doctest fixes. I have taken to not cutting it too fine on the zeros. For example, if I get a "zero" on the order of The latest patch looks good and applies and builds find, passing all tests in |
comment:20
Follow-up ticket further increasing the threshold for noisy zero terms in polynomials (from 2.5e-15, needed for |
Observe the docstring for solve_left for an RDF matrix:
But that is solve_right.
This was evidently introduced by maybe Grout's "Switch the RDF and CDF matrices to a numpy 1.2 backend; factor out common functionality to matrix_double_dense.pyx.".
Reported by Stephanie Dietzel
Apply
to the Sage library.
Depends on #11848
CC: @jasongrout
Component: linear algebra
Author: Rob Beezer, Leif Leonhardy
Reviewer: Martin Raum, Leif Leonhardy, Rob Beezer
Merged: sage-4.7.2.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/7852
The text was updated successfully, but these errors were encountered: