-
-
Notifications
You must be signed in to change notification settings - Fork 480
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
Remove solve_left_LU for matrix_double_dense, which was totally broken forever (?) #4932
Comments
comment:1
Yep, it looks like this might have happened in the transition to numpy and probably was my fault. Here are errors:
The first error comes from the code not computing LU before using the cached LU decomposition. The second error apparently comes from a mistake in calling scipy. |
comment:3
Okay, apparently lu_factor and lu in the scipy library return two completely different things. Some notes from some experimentation:
I say we cache the lu_factor results and then build the P,L,U from these results if needed. The strictly lower triangular part of the returned matrix is the L, the upper triangular part is the U, so that the returned matrix is (L-identity)+U. The pivot array gives the row swaps needed. For example, the following code constructs the new order of rows based on the pivot array piv:
The P matrix will then have a 1 in the (i,arr[i]) position (or the (arr[i],i) position...). THE LU MATRIX RETURNED FROM lu_factor MIGHT BE TRANSPOSED! It was in my case, for some reason. |
comment:4
However, the results from lu_factor also appear to give spurious answers, while the results from lu seem more correct numerically... |
comment:5
Replying to @jasongrout:
never mind; it seems like that comment is not true; I get the same spurious answers from lu() |
comment:6
Better luck in 3.3. Cheers, Michael |
comment:7
3.4 is for ReST tickets only. Cheers, Michael |
comment:8
I'm thinking of fixing this ticket as soon as I've got time for it. At any rate, one piece of opinion:
In addition, numerical matrices should have a |
comment:9
It appears "straight" LU decomposition in Do we want to try to support non-square systems with the straight LU decomposition? It would mean foregoing the built-in solve routine that extens the LU-factor decomposition, and possibly a decision would have to be made about what to cache: square (very compact) or non-square (more general). |
comment:10
According to: http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve The generic "solve" from So it does not appear to me that |
comment:11
Attachment: trac_4932-remove-solve-left-LU.patch.gz This routine needs lots of work, has been "Not Implemented" for a long time, and with two routines for solving systems available (#7852), this should be removed. Patch does just that. |
Author: Rob Beezer |
comment:12
Replying to @rbeezer:
The point behind this patch is that the LU decomposition is cached in the matrix so that multiple solves using this matrix are much faster because you don't have to compute the LU decomposition each time. |
comment:13
(I mean, the point behind this function...) |
comment:14
OK, that makes sense, I was reading the code, not the doc string. Three ideas:
|
Branch: u/jdemeyer/ticket/4932 |
Commit: |
New commits:
|
Reviewer: Jeroen Demeyer |
Changed branch from u/jdemeyer/ticket/4932 to |
Component: linear algebra
Author: Rob Beezer
Branch/Commit:
21b9712
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/4932
The text was updated successfully, but these errors were encountered: