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

Fix #1 #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions pyLAPJV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ LAPJV_lap(PyObject *self, PyObject *args)
PyErr_SetString(PyExc_ValueError,"lap() requires a square matrix");
goto error;
}

npy_intp ret_dims[2];
ret_dims[0] = n;
ret_dims[1] = 0;
//get inputted matrix as a 1-D C array:
//buf = (cost *)NA_OFFSETDATA(costs);
buf = (cost*)PyArray_DATA(costs);
Expand Down Expand Up @@ -68,10 +70,10 @@ LAPJV_lap(PyObject *self, PyObject *args)
Py_XDECREF(costs);

return Py_BuildValue("(dOOOO)",lapcost,
PyArray_SimpleNewFromData(1,(npy_intp*)&n,COL_TYPE,rowsol),
PyArray_SimpleNewFromData(1,(npy_intp*)&n,ROW_TYPE,colsol),
PyArray_SimpleNewFromData(1,(npy_intp*)&n,COST_TYPE,u),
PyArray_SimpleNewFromData(1,(npy_intp*)&n,COST_TYPE,v)
PyArray_SimpleNewFromData(1,ret_dims,COL_TYPE,rowsol),
PyArray_SimpleNewFromData(1,ret_dims,ROW_TYPE,colsol),
PyArray_SimpleNewFromData(1,ret_dims,COST_TYPE,u),
PyArray_SimpleNewFromData(1,ret_dims,COST_TYPE,v)
);

error:
Expand Down