diff --git a/SparseDiffEngine b/SparseDiffEngine index 45f88d0..2f5cf0a 160000 --- a/SparseDiffEngine +++ b/SparseDiffEngine @@ -1 +1 @@ -Subproject commit 45f88d07c1a84fda4552247d29c2a03a5d59f961 +Subproject commit 2f5cf0ad036f8b182060f893d809fbd28d17009b diff --git a/pyproject.toml b/pyproject.toml index ab09d96..0f67ab0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build" [project] name = "sparsediffpy" version = "0.3.0" -description = "Python bindings for SparseDiffEngine automatic differentiation" +description = "Python bindings for SparseDiffEngine algorithmic differentiation" requires-python = ">=3.11" dependencies = ["numpy >= 2.0.0"] license = "Apache-2.0" diff --git a/sparsediffpy/_bindings/atoms/left_matmul.h b/sparsediffpy/_bindings/atoms/left_matmul.h index 597aa46..d3c19c9 100644 --- a/sparsediffpy/_bindings/atoms/left_matmul.h +++ b/sparsediffpy/_bindings/atoms/left_matmul.h @@ -95,7 +95,7 @@ static PyObject *py_make_left_matmul(PyObject *self, PyObject *args) } } - CSR_Matrix *A = new_csr_matrix(m, n, nnz); + CSR_matrix *A = new_CSR_matrix(m, n, nnz); memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double)); memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int)); memcpy(A->p, PyArray_DATA(indptr_array), (m + 1) * sizeof(int)); @@ -105,7 +105,7 @@ static PyObject *py_make_left_matmul(PyObject *self, PyObject *args) Py_DECREF(indptr_array); expr *node = new_left_matmul(param_node, child, A); - free_csr_matrix(A); + free_CSR_matrix(A); if (!node) { diff --git a/sparsediffpy/_bindings/atoms/linear.h b/sparsediffpy/_bindings/atoms/linear.h index 3465e05..cac75f9 100644 --- a/sparsediffpy/_bindings/atoms/linear.h +++ b/sparsediffpy/_bindings/atoms/linear.h @@ -40,7 +40,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args) } int nnz = (int) PyArray_SIZE(data_array); - CSR_Matrix *A = new_csr_matrix(m, n, nnz); + CSR_matrix *A = new_CSR_matrix(m, n, nnz); memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double)); memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int)); memcpy(A->p, PyArray_DATA(indptr_array), (m + 1) * sizeof(int)); @@ -59,7 +59,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args) NPY_ARRAY_IN_ARRAY); if (!b_array) { - free_csr_matrix(A); + free_CSR_matrix(A); return NULL; } b_data = (double *) PyArray_DATA(b_array); @@ -68,7 +68,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args) expr *node = new_linear(child, A, b_data); /* Clean up */ - free_csr_matrix(A); + free_CSR_matrix(A); Py_XDECREF(b_array); if (!node) diff --git a/sparsediffpy/_bindings/atoms/quad_form.h b/sparsediffpy/_bindings/atoms/quad_form.h index de7fe89..26b0ed1 100644 --- a/sparsediffpy/_bindings/atoms/quad_form.h +++ b/sparsediffpy/_bindings/atoms/quad_form.h @@ -40,7 +40,7 @@ static PyObject *py_make_quad_form(PyObject *self, PyObject *args) } int nnz = (int) PyArray_SIZE(data_array); - CSR_Matrix *Q = new_csr_matrix(m, n, nnz); + CSR_matrix *Q = new_CSR_matrix(m, n, nnz); memcpy(Q->x, PyArray_DATA(data_array), nnz * sizeof(double)); memcpy(Q->i, PyArray_DATA(indices_array), nnz * sizeof(int)); memcpy(Q->p, PyArray_DATA(indptr_array), (m + 1) * sizeof(int)); @@ -50,7 +50,7 @@ static PyObject *py_make_quad_form(PyObject *self, PyObject *args) Py_DECREF(indptr_array); expr *node = new_quad_form(child, Q); - free_csr_matrix(Q); + free_CSR_matrix(Q); if (!node) { diff --git a/sparsediffpy/_bindings/atoms/right_matmul.h b/sparsediffpy/_bindings/atoms/right_matmul.h index 86d7201..47a6cac 100644 --- a/sparsediffpy/_bindings/atoms/right_matmul.h +++ b/sparsediffpy/_bindings/atoms/right_matmul.h @@ -91,7 +91,7 @@ static PyObject *py_make_right_matmul(PyObject *self, PyObject *args) } } - CSR_Matrix *A = new_csr_matrix(m, n, nnz); + CSR_matrix *A = new_CSR_matrix(m, n, nnz); memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double)); memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int)); memcpy(A->p, PyArray_DATA(indptr_array), (m + 1) * sizeof(int)); @@ -101,7 +101,7 @@ static PyObject *py_make_right_matmul(PyObject *self, PyObject *args) Py_DECREF(indptr_array); expr *node = new_right_matmul(param_node, child, A); - free_csr_matrix(A); + free_CSR_matrix(A); if (!node) { diff --git a/sparsediffpy/_bindings/problem/hessian.h b/sparsediffpy/_bindings/problem/hessian.h index b9a31d8..cbc6428 100644 --- a/sparsediffpy/_bindings/problem/hessian.h +++ b/sparsediffpy/_bindings/problem/hessian.h @@ -13,7 +13,7 @@ * total_constraint_size) * * Returns: - * Tuple of (data, indices, indptr, (m, n)) for scipy.sparse.csr_matrix + * Tuple of (data, indices, indptr, (m, n)) for scipy.sparse.CSR_matrix */ static PyObject *py_problem_hessian(PyObject *self, PyObject *args) { @@ -50,7 +50,7 @@ static PyObject *py_problem_hessian(PyObject *self, PyObject *args) Py_DECREF(lagrange_arr); /* Extract CSR components and return as tuple */ - CSR_Matrix *H = prob->lagrange_hessian; + CSR_matrix *H = prob->lagrange_hessian; npy_intp nnz = H->nnz; npy_intp n_plus_1 = H->n + 1; @@ -97,7 +97,7 @@ static PyObject *py_get_hessian(PyObject *self, PyObject *args) return NULL; } - CSR_Matrix *H = prob->lagrange_hessian; + CSR_matrix *H = prob->lagrange_hessian; npy_intp nnz = H->nnz; npy_intp n_plus_1 = H->n + 1; @@ -144,7 +144,7 @@ static PyObject *py_get_problem_hessian_sparsity_coo(PyObject *self, PyObject *a return NULL; } - COO_Matrix *coo = prob->lagrange_hessian_coo; + COO_matrix *coo = prob->lagrange_hessian_coo; npy_intp nnz = coo->nnz; PyObject *rows = PyArray_SimpleNew(1, &nnz, NPY_INT32); @@ -201,7 +201,7 @@ static PyObject *py_problem_eval_hessian_vals_coo(PyObject *self, PyObject *args refresh_lower_triangular_coo(prob->lagrange_hessian_coo, prob->lagrange_hessian->x); - COO_Matrix *coo = prob->lagrange_hessian_coo; + COO_matrix *coo = prob->lagrange_hessian_coo; npy_intp nnz = coo->nnz; PyObject *data = PyArray_SimpleNew(1, &nnz, NPY_DOUBLE); diff --git a/sparsediffpy/_bindings/problem/jacobian.h b/sparsediffpy/_bindings/problem/jacobian.h index e348a36..73dc6f9 100644 --- a/sparsediffpy/_bindings/problem/jacobian.h +++ b/sparsediffpy/_bindings/problem/jacobian.h @@ -33,7 +33,7 @@ static PyObject *py_problem_jacobian(PyObject *self, PyObject *args) problem_jacobian(prob); - CSR_Matrix *jac = prob->jacobian; + CSR_matrix *jac = prob->jacobian; npy_intp nnz = jac->nnz; npy_intp m_plus_1 = jac->m + 1; @@ -79,7 +79,7 @@ static PyObject *py_get_jacobian(PyObject *self, PyObject *args) return NULL; } - CSR_Matrix *jac = prob->jacobian; + CSR_matrix *jac = prob->jacobian; npy_intp nnz = jac->nnz; npy_intp m_plus_1 = jac->m + 1; @@ -126,7 +126,7 @@ static PyObject *py_get_jacobian_sparsity_coo(PyObject *self, PyObject *args) return NULL; } - COO_Matrix *coo = prob->jacobian_coo; + COO_matrix *coo = prob->jacobian_coo; npy_intp nnz = coo->nnz; PyObject *rows = PyArray_SimpleNew(1, &nnz, NPY_INT32); @@ -163,7 +163,7 @@ static PyObject *py_problem_eval_jacobian_vals(PyObject *self, PyObject *args) problem_jacobian(prob); - CSR_Matrix *jac = prob->jacobian; + CSR_matrix *jac = prob->jacobian; npy_intp nnz = jac->nnz; PyObject *data = PyArray_SimpleNew(1, &nnz, NPY_DOUBLE);