Skip to content
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

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

Closed
highlando opened this issue Jun 17, 2013 · 1 comment
Closed
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.sparse.linalg
Milestone

Comments

@highlando
Copy link

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:

Docstring:
x = self.solve(b, trans)

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

parameters
----------

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))

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

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

x = Elu.solve([numpy.ones(5), numpy.ones(5)])
@pv
Copy link
Member

pv commented Feb 24, 2014

Fixed in gh-3367

@pv pv closed this as completed 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
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected Documentation Issues related to the SciPy documentation. Also check https://github.com/scipy/scipy.org scipy.sparse.linalg
Projects
None yet
Development

No branches or pull requests

2 participants