#4932: fix solve_left_LU for matrix_double_dense, which was totally broken
forever
(?)
----------------------------+-----------------------------------------------
Reporter: was | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.3
Component: linear algebra | Resolution:
Keywords: |
----------------------------+-----------------------------------------------
Comment (by jason):
Yep, it looks like this might have happened in the transition to numpy and
probably was my fault. Here are errors:
{{{
sage: A = matrix(RDF, 3,3, [1,2,5,7.6,2.3,1,1,2,-1]); A
[ 1.0 2.0 5.0]
[ 7.6 2.3 1.0]
[ 1.0 2.0 -1.0]
sage: b = vector(RDF,[1,2,3])
sage: A.solve_left(b)
(-0.113695090439, 1.39018087855, -0.333333333333)
sage: A.solve_left_LU(b)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/grout/<ipython console> in <module>()
/home/grout/sage/local/lib/python2.5/site-
packages/sage/matrix/matrix_double_dense.so in
sage.matrix.matrix_double_dense.Matrix_double_dense.solve_left_LU
(sage/matrix/matrix_double_dense.c:4930)()
TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType'
sage: A.LU()
([0.0 1.0 0.0]
[1.0 0.0 0.0]
[0.0 0.0 1.0],
[ 1.0 0.0 0.0]
[0.131578947368 1.0 0.0]
[0.131578947368 1.0 1.0],
[ 7.6 2.3 1.0]
[ 0.0 1.69736842105 4.86842105263]
[ 0.0 0.0 -6.0])
sage: A.solve_left_LU(b)
too many axes: 2 (effrank=2), expected rank=1
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (981, 0))
---------------------------------------------------------------------------
error Traceback (most recent call
last)
/home/grout/<ipython console> in <module>()
/home/grout/sage/local/lib/python2.5/site-
packages/sage/matrix/matrix_double_dense.so in
sage.matrix.matrix_double_dense.Matrix_double_dense.solve_left_LU
(sage/matrix/matrix_double_dense.c:4995)()
/home/grout/sage/local/lib/python2.5/site-packages/scipy/linalg/basic.pyc
in lu_solve((lu, piv), b, trans, overwrite_b)
48 raise ValueError, "incompatible dimensions."
49 getrs, = get_lapack_funcs(('getrs',),(lu,b1))
---> 50 x,info = getrs(lu,piv,b1,trans=trans,overwrite_b=overwrite_b)
51 if info==0:
52 return x
error: failed in converting 2nd argument `piv' of clapack.dgetrs to
C/Fortran array
}}}
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.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4932#comment:1>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---