class method solve of splu return object corrupted or falsely documented #2572

highlando opened this Issue Jun 17, 2013 · 1 comment


None yet
2 participants

A sparse LU-decomposition Elu of a matrix E comes with the method solve to be used like

x = Elu.solve(b)

to get the solution x of the equation Ex=b .

The docstring in Elu.solve? says:

x = self.solve(b, trans)

solves linear system of equations with one or sereral right hand sides.


b        array, right hand side(s) of equation
x        array, solution vector(s)
trans    'N': solve A   * x == b
         'T': solve A^T * x == b
         'H': solve A^H * x == b
         (optional, default value 'N')

But except from 1d vectors, no other (numpy.ndarray) arguments are permitted.

The following code tests some generic cases:

import numpy 
import scipy.sparse
import scipy.sparse.linalg

E = scipy.sparse.eye(5)
Elu = scipy.sparse.linalg.splu(E)

x = Elu.solve(numpy.ones(5))

    x = Elu.solve(numpy.ones((5,1)))
except SystemError:
    print '2d vectors are not allowed'

    x = Elu.solve(numpy.ones((5,2)))
except SystemError:
    print 'arrays are not allowed'

x = Elu.solve([numpy.ones(5), numpy.ones(5)])

This comment has been minimized.

Show comment Hide comment

pv Feb 24, 2014


Fixed in gh-3367


pv commented Feb 24, 2014

Fixed in gh-3367

@pv pv closed this Feb 24, 2014

@pv pv added this to the 0.14.0 milestone Feb 24, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment