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

Closed
highlando opened this Issue Jun 17, 2013 · 1 comment

Comments

Projects
None yet
2 participants
@highlando

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

This comment has been minimized.

Show comment Hide comment
@pv

pv Feb 24, 2014

Member

Fixed in gh-3367

Member

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