Skip to content
Snippets Groups Projects
Commit b72b50e7 authored by Martyn Gigg's avatar Martyn Gigg
Browse files

Fix final use PyArray_SHAPE.

parent 0364d394
Branches add_pycharm_environment_file
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ Kernel::Matrix<double> PyObjectToMatrix::operator()() { ...@@ -63,7 +63,7 @@ Kernel::Matrix<double> PyObjectToMatrix::operator()() {
PyArrayObject *ndarray = (PyArrayObject *)PyArray_View( PyArrayObject *ndarray = (PyArrayObject *)PyArray_View(
(PyArrayObject *)m_obj.ptr(), PyArray_DescrFromType(NPY_DOUBLE), (PyArrayObject *)m_obj.ptr(), PyArray_DescrFromType(NPY_DOUBLE),
&PyArray_Type); &PyArray_Type);
const auto shape = PyArray_SHAPE(ndarray); const auto shape = PyArray_DIMS(ndarray);
npy_intp nx(shape[0]), ny(shape[1]); npy_intp nx(shape[0]), ny(shape[1]);
Kernel::Matrix<double> matrix(nx, ny); Kernel::Matrix<double> matrix(nx, ny);
for (npy_intp i = 0; i < nx; i++) { for (npy_intp i = 0; i < nx; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment