Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions sparsediffpy/_bindings/problem/hessian.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static PyObject *py_problem_hessian(PyObject *self, PyObject *args)
memcpy(PyArray_DATA((PyArrayObject *) indices), H->i, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) indptr), H->p, n_plus_1 * sizeof(int));

return Py_BuildValue("(OOO(ii))", data, indices, indptr, H->m, H->n);
return Py_BuildValue("(NNN(ii))", data, indices, indptr, H->m, H->n);
}

static PyObject *py_get_hessian(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -117,7 +117,7 @@ static PyObject *py_get_hessian(PyObject *self, PyObject *args)
memcpy(PyArray_DATA((PyArrayObject *) indices), H->i, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) indptr), H->p, n_plus_1 * sizeof(int));

return Py_BuildValue("(OOO(ii))", data, indices, indptr, H->m, H->n);
return Py_BuildValue("(NNN(ii))", data, indices, indptr, H->m, H->n);
}

static PyObject *py_get_problem_hessian_sparsity_coo(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -160,7 +160,7 @@ static PyObject *py_get_problem_hessian_sparsity_coo(PyObject *self, PyObject *a
memcpy(PyArray_DATA((PyArrayObject *) rows), coo->rows, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) cols), coo->cols, nnz * sizeof(int));

return Py_BuildValue("(OO(ii))", rows, cols, coo->m, coo->n);
return Py_BuildValue("(NN(ii))", rows, cols, coo->m, coo->n);
}

static PyObject *py_problem_eval_hessian_vals_coo(PyObject *self, PyObject *args)
Expand Down
8 changes: 4 additions & 4 deletions sparsediffpy/_bindings/problem/jacobian.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static PyObject *py_problem_jacobian(PyObject *self, PyObject *args)
PyObject *indices = PyArray_SimpleNew(1, &zero, NPY_INT32);
PyObject *indptr = PyArray_SimpleNew(1, &one, NPY_INT32);
((int *) PyArray_DATA((PyArrayObject *) indptr))[0] = 0;
return Py_BuildValue("(OOO(ii))", data, indices, indptr, 0, prob->n_vars);
return Py_BuildValue("(NNN(ii))", data, indices, indptr, 0, prob->n_vars);
}

problem_jacobian(prob);
Expand All @@ -53,7 +53,7 @@ static PyObject *py_problem_jacobian(PyObject *self, PyObject *args)
memcpy(PyArray_DATA((PyArrayObject *) indices), jac->i, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) indptr), jac->p, m_plus_1 * sizeof(int));

return Py_BuildValue("(OOO(ii))", data, indices, indptr, jac->m, jac->n);
return Py_BuildValue("(NNN(ii))", data, indices, indptr, jac->m, jac->n);
}

static PyObject *py_get_jacobian(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -99,7 +99,7 @@ static PyObject *py_get_jacobian(PyObject *self, PyObject *args)
memcpy(PyArray_DATA((PyArrayObject *) indices), jac->i, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) indptr), jac->p, m_plus_1 * sizeof(int));

return Py_BuildValue("(OOO(ii))", data, indices, indptr, jac->m, jac->n);
return Py_BuildValue("(NNN(ii))", data, indices, indptr, jac->m, jac->n);
}

static PyObject *py_get_jacobian_sparsity_coo(PyObject *self, PyObject *args)
Expand Down Expand Up @@ -142,7 +142,7 @@ static PyObject *py_get_jacobian_sparsity_coo(PyObject *self, PyObject *args)
memcpy(PyArray_DATA((PyArrayObject *) rows), coo->rows, nnz * sizeof(int));
memcpy(PyArray_DATA((PyArrayObject *) cols), coo->cols, nnz * sizeof(int));

return Py_BuildValue("(OO(ii))", rows, cols, coo->m, coo->n);
return Py_BuildValue("(NN(ii))", rows, cols, coo->m, coo->n);
}

static PyObject *py_problem_eval_jacobian_vals(PyObject *self, PyObject *args)
Expand Down
Loading