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

BUG: sparse/dsolve: fix dense matrix fortran order bugs in superlu wrappers #3367

Merged
merged 4 commits into from
Feb 23, 2014

Conversation

pv
Copy link
Member

@pv pv commented Feb 21, 2014

The splu() SuperLU wrapper has been broken since time immemorial (< 0.7.2)
for matrix inputs, because of confusion in the C code between Fortran and C
order inputs.

This is fairly simple to fix, so let's fix it. This also allows passing in dense matrices
directly to SuperLU, without needing to loop on the Python side.

Fixes gh-3363

…appers

This also allows passing in dense matrices to SuperLU, without needing
to loop on the Python side.
@pv pv added prio-high and removed prio-high labels Feb 21, 2014
@pv pv added this to the 0.14.0 milestone Feb 21, 2014
@pv pv added PR and removed prio-high labels Feb 21, 2014
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 2344e41 on pv:splu-bugfix into * on scipy:master*.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling a18a98a on pv:splu-bugfix into 1b34692 on scipy:master.

static char solve_doc[] = (
"x = self.solve(b, trans)\n"
"\n"
"solves linear system of equations with one or sereral right hand sides.\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well fix the typo here (sereral).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fix it in gh-3375 :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@rgommers
Copy link
Member

Doesn't build with Bento (edit: also not with distutils):

[ 289/1158] c: scipy/optimize/Zeros/brenth.c -> build/scipy/optimize/Zeros/brenth.c.10.o
In file included from /home/rgommers/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:14:0,
                 from ../scipy/sparse/linalg/dsolve/_superluobject.h:19,
                 from ../scipy/sparse/linalg/dsolve/_superluobject.c:13:
../scipy/sparse/linalg/dsolve/_superluobject.c: In function ‘SciPyLU_solve’:
../scipy/sparse/linalg/dsolve/_superluobject.c:85:9: error: ‘NPY_ARRAY_F_CONTIGUOUS’ undeclared (first use in this function)
         NPY_ARRAY_F_CONTIGUOUS | NPY_ARRAY_ENSURECOPY);
         ^
/home/rgommers/.local/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:98:28: note: in definition of macro ‘PyArray_FROMANY’
                         (((flags) & NPY_ENSURECOPY) ?                         \
                            ^
compilation terminated due to -Wfatal-errors.
In file included from ../scipy/sparse/sparsetools/py3k.h:23:0,
                 from ../scipy/sparse/sparsetools/coo_wrap.cxx:3054:
/home/rgommers/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘PyObject* npy_PyFile_OpenFile(PyObject*, char*)’:
/home/rgommers/.local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_3kcompat.h:258:60: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
     return PyObject_CallFunction(open, "Os", filename, mode);

@rgommers
Copy link
Member

Since this builds on Travis, likely related to numpy version (I use 1.5.1).

@pv
Copy link
Member Author

pv commented Feb 23, 2014

The failure is due to Numpy 1.5. Fixed. (We should make one of the travis builds use this Numpy version, so these issues would be easier to catch.)

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 8b9cdef on pv:splu-bugfix into 1b34692 on scipy:master.

@rgommers
Copy link
Member

Works for me now, so in it goes. Thanks @pv

rgommers added a commit that referenced this pull request Feb 23, 2014
BUG: sparse/dsolve: fix dense matrix fortran order bugs in superlu wrappers
@rgommers rgommers merged commit 25125e5 into scipy:master Feb 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

splu does not work for non-vector inputs
3 participants