Skip to content

Commit 0ba795f

Browse files
authored
Reflect name changes in sparsediffengine (#14)
* change version temporarily and rename matrix structure * small edit * update version * Fix SparseDiffEngine: replace accidental symlink with submodule pointer at v0.3.0
1 parent 4bc2a79 commit 0ba795f

8 files changed

Lines changed: 20 additions & 20 deletions

File tree

SparseDiffEngine

Submodule SparseDiffEngine updated 163 files

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build"
55
[project]
66
name = "sparsediffpy"
77
version = "0.3.0"
8-
description = "Python bindings for SparseDiffEngine automatic differentiation"
8+
description = "Python bindings for SparseDiffEngine algorithmic differentiation"
99
requires-python = ">=3.11"
1010
dependencies = ["numpy >= 2.0.0"]
1111
license = "Apache-2.0"

sparsediffpy/_bindings/atoms/left_matmul.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static PyObject *py_make_left_matmul(PyObject *self, PyObject *args)
9595
}
9696
}
9797

98-
CSR_Matrix *A = new_csr_matrix(m, n, nnz);
98+
CSR_matrix *A = new_CSR_matrix(m, n, nnz);
9999
memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double));
100100
memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int));
101101
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)
105105
Py_DECREF(indptr_array);
106106

107107
expr *node = new_left_matmul(param_node, child, A);
108-
free_csr_matrix(A);
108+
free_CSR_matrix(A);
109109

110110
if (!node)
111111
{

sparsediffpy/_bindings/atoms/linear.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args)
4040
}
4141

4242
int nnz = (int) PyArray_SIZE(data_array);
43-
CSR_Matrix *A = new_csr_matrix(m, n, nnz);
43+
CSR_matrix *A = new_CSR_matrix(m, n, nnz);
4444
memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double));
4545
memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int));
4646
memcpy(A->p, PyArray_DATA(indptr_array), (m + 1) * sizeof(int));
@@ -59,7 +59,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args)
5959
NPY_ARRAY_IN_ARRAY);
6060
if (!b_array)
6161
{
62-
free_csr_matrix(A);
62+
free_CSR_matrix(A);
6363
return NULL;
6464
}
6565
b_data = (double *) PyArray_DATA(b_array);
@@ -68,7 +68,7 @@ static PyObject *py_make_linear(PyObject *self, PyObject *args)
6868
expr *node = new_linear(child, A, b_data);
6969

7070
/* Clean up */
71-
free_csr_matrix(A);
71+
free_CSR_matrix(A);
7272
Py_XDECREF(b_array);
7373

7474
if (!node)

sparsediffpy/_bindings/atoms/quad_form.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static PyObject *py_make_quad_form(PyObject *self, PyObject *args)
4040
}
4141

4242
int nnz = (int) PyArray_SIZE(data_array);
43-
CSR_Matrix *Q = new_csr_matrix(m, n, nnz);
43+
CSR_matrix *Q = new_CSR_matrix(m, n, nnz);
4444
memcpy(Q->x, PyArray_DATA(data_array), nnz * sizeof(double));
4545
memcpy(Q->i, PyArray_DATA(indices_array), nnz * sizeof(int));
4646
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)
5050
Py_DECREF(indptr_array);
5151

5252
expr *node = new_quad_form(child, Q);
53-
free_csr_matrix(Q);
53+
free_CSR_matrix(Q);
5454

5555
if (!node)
5656
{

sparsediffpy/_bindings/atoms/right_matmul.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static PyObject *py_make_right_matmul(PyObject *self, PyObject *args)
9191
}
9292
}
9393

94-
CSR_Matrix *A = new_csr_matrix(m, n, nnz);
94+
CSR_matrix *A = new_CSR_matrix(m, n, nnz);
9595
memcpy(A->x, PyArray_DATA(data_array), nnz * sizeof(double));
9696
memcpy(A->i, PyArray_DATA(indices_array), nnz * sizeof(int));
9797
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)
101101
Py_DECREF(indptr_array);
102102

103103
expr *node = new_right_matmul(param_node, child, A);
104-
free_csr_matrix(A);
104+
free_CSR_matrix(A);
105105

106106
if (!node)
107107
{

sparsediffpy/_bindings/problem/hessian.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* total_constraint_size)
1414
*
1515
* Returns:
16-
* Tuple of (data, indices, indptr, (m, n)) for scipy.sparse.csr_matrix
16+
* Tuple of (data, indices, indptr, (m, n)) for scipy.sparse.CSR_matrix
1717
*/
1818
static PyObject *py_problem_hessian(PyObject *self, PyObject *args)
1919
{
@@ -50,7 +50,7 @@ static PyObject *py_problem_hessian(PyObject *self, PyObject *args)
5050
Py_DECREF(lagrange_arr);
5151

5252
/* Extract CSR components and return as tuple */
53-
CSR_Matrix *H = prob->lagrange_hessian;
53+
CSR_matrix *H = prob->lagrange_hessian;
5454
npy_intp nnz = H->nnz;
5555
npy_intp n_plus_1 = H->n + 1;
5656

@@ -97,7 +97,7 @@ static PyObject *py_get_hessian(PyObject *self, PyObject *args)
9797
return NULL;
9898
}
9999

100-
CSR_Matrix *H = prob->lagrange_hessian;
100+
CSR_matrix *H = prob->lagrange_hessian;
101101
npy_intp nnz = H->nnz;
102102
npy_intp n_plus_1 = H->n + 1;
103103

@@ -144,7 +144,7 @@ static PyObject *py_get_problem_hessian_sparsity_coo(PyObject *self, PyObject *a
144144
return NULL;
145145
}
146146

147-
COO_Matrix *coo = prob->lagrange_hessian_coo;
147+
COO_matrix *coo = prob->lagrange_hessian_coo;
148148
npy_intp nnz = coo->nnz;
149149

150150
PyObject *rows = PyArray_SimpleNew(1, &nnz, NPY_INT32);
@@ -201,7 +201,7 @@ static PyObject *py_problem_eval_hessian_vals_coo(PyObject *self, PyObject *args
201201
refresh_lower_triangular_coo(prob->lagrange_hessian_coo,
202202
prob->lagrange_hessian->x);
203203

204-
COO_Matrix *coo = prob->lagrange_hessian_coo;
204+
COO_matrix *coo = prob->lagrange_hessian_coo;
205205
npy_intp nnz = coo->nnz;
206206

207207
PyObject *data = PyArray_SimpleNew(1, &nnz, NPY_DOUBLE);

sparsediffpy/_bindings/problem/jacobian.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static PyObject *py_problem_jacobian(PyObject *self, PyObject *args)
3333

3434
problem_jacobian(prob);
3535

36-
CSR_Matrix *jac = prob->jacobian;
36+
CSR_matrix *jac = prob->jacobian;
3737
npy_intp nnz = jac->nnz;
3838
npy_intp m_plus_1 = jac->m + 1;
3939

@@ -79,7 +79,7 @@ static PyObject *py_get_jacobian(PyObject *self, PyObject *args)
7979
return NULL;
8080
}
8181

82-
CSR_Matrix *jac = prob->jacobian;
82+
CSR_matrix *jac = prob->jacobian;
8383
npy_intp nnz = jac->nnz;
8484
npy_intp m_plus_1 = jac->m + 1;
8585

@@ -126,7 +126,7 @@ static PyObject *py_get_jacobian_sparsity_coo(PyObject *self, PyObject *args)
126126
return NULL;
127127
}
128128

129-
COO_Matrix *coo = prob->jacobian_coo;
129+
COO_matrix *coo = prob->jacobian_coo;
130130
npy_intp nnz = coo->nnz;
131131

132132
PyObject *rows = PyArray_SimpleNew(1, &nnz, NPY_INT32);
@@ -163,7 +163,7 @@ static PyObject *py_problem_eval_jacobian_vals(PyObject *self, PyObject *args)
163163

164164
problem_jacobian(prob);
165165

166-
CSR_Matrix *jac = prob->jacobian;
166+
CSR_matrix *jac = prob->jacobian;
167167
npy_intp nnz = jac->nnz;
168168

169169
PyObject *data = PyArray_SimpleNew(1, &nnz, NPY_DOUBLE);

0 commit comments

Comments
 (0)