Comments (4)
The issue comes from
cdef np.ndarray _cast(self, np.ndarray arr):
if not issubclass(arr.dtype.type, np.number):
raise CholmodError("non-numeric dtype %s" % (arr.dtype,))
if self._complex:
# All numeric types can be upcast to complex:
return np.asfortranarray(arr, dtype=_complex_py_dtype)
else:
# Refuse to downcast complex types to real:
if issubclass(arr.dtype.type, np.complexfloating):
raise CholmodError("inconsistent use of complex array")
else:
return np.asfortranarray(arr, dtype=_real_py_dtype)
Specifically, 1d arrays are cast to 2d a bit earlier using d[:, None]
, which creates an array of strides (itemsize, 0)
. With numpy<1.12, asfortranarray
would then create a new array with strides (itemsize, len*itemsize)
. But with relaxed stride checking, this is no longer the case, i.e. the original array of strides (itemsize, 0)
is returned.
This then causes issue further down at
cdef object _init_view_dense(self, cholmod_dense *out, np.ndarray m):
if m.ndim != 2:
raise CholmodError("array has %s dimensions (expected 2)" % m.ndim)
m = self._cast(m)
out.nrow = m.shape[0]
out.ncol = m.shape[1] # oops, this is zero.
out.nzmax = m.size
out.d = m.strides[1] // m.itemsize
out.x = m.data
out.dtype = CHOLMOD_DOUBLE
out.xtype = self._xtype
return m
from scikit-sparse.
surely the issue must be with cholmod getting cranky at out.d == 0
, no? According to your analysis, m.shape[1]
is not zero, only m.strides[1]
is?
from scikit-sparse.
ah, I see your PR came to the same conclusion :-)
from scikit-sparse.
Version 0.4.1 is released. This should fix this bug. (See PR #28.)
from scikit-sparse.
Related Issues (20)
- Working With CHOLMOD Built from Source HOT 1
- convert csc_matrix or lil_matrix to tensor form
- Python 3.9 support (regenerate with new cython) HOT 2
- xx HOT 1
- Can't find "cholmod.h" while installing using pip on macOS HOT 2
- computing selective inverse efficiently
- Support GPU?
- Support Apple silicon? HOT 8
- There is a "Process finished with exit code -1073741819 (0xC0000005)" HOT 1
- Adding citations
- Adapt package to work with SciPy's 'LinearOperator' interface
- Scikit-sparse not (default) available for Ubuntu 22 HOT 2
- Python 3.10? HOT 1
- Solving poisson equation with Cholesky HOT 1
- Problems with installation
- Import Error: symbol not found when importing sksparse.cholmod HOT 2
- Support for Python 3.11 HOT 2
- Pip installation fails during cython compilation HOT 5
- tests/test_data intentionally not part of the PyPI tarball?
- ImportError: dlopen(.../cholmod.cpython-311-darwin.so): Library not loaded: @rpath/libblas.3.dylib HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scikit-sparse.