Commit 213e8ff
Bindings for diag_mat, upper_tri, and vstack atoms (#7)
* Bindings for diag_mat, kron_left, upper_tri, and vstack atoms
Add Python C extension bindings for four new SparseDiffEngine atoms:
- diag_mat: extract diagonal from square matrix
- upper_tri: extract strict upper triangular elements
- kron_left: Kronecker product kron(C, X) with constant sparse C
- vstack: vertical stack of expressions (via transpose-hstack composition)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Update SparseDiffEngine submodule with main merge
Merges SparseDiffEngine main into adds-more-affine-atoms branch to
pick up folder restructuring and parameter support while preserving
diag_mat, upper_tri, and vstack atoms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* pin diffengine to tag
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 966b397 commit 213e8ff
File tree
5 files changed
+123
-1
lines changed- sparsediffpy/_bindings
- atoms
5 files changed
+123
-1
lines changedSubmodule SparseDiffEngine updated 98 files
- CMakeLists.txt+1-1
- include/atoms/affine.h+3-1
- include/atoms/bivariate_full_dom.h+17
- include/atoms/bivariate_restricted_dom.h+17
- include/atoms/elementwise_full_dom.h+17
- include/atoms/elementwise_restricted_dom.h+17
- include/atoms/non_elementwise_full_dom.h+1-1
- include/expr.h+1-1
- include/old-code/old_CSR.h+17
- include/old-code/old_CSR_sum.h+17
- include/old-code/old_affine.h+17
- include/problem.h+1-1
- include/subexpr.h+1-1
- include/utils/COO_Matrix.h+17
- include/utils/CSC_Matrix.h+17
- include/utils/CSR_Matrix.h+17
- include/utils/CSR_sum.h+17
- include/utils/Timer.h+17
- include/utils/Vec_macros.h+17
- include/utils/cblas_wrapper.h+17
- include/utils/dense_matrix.h+17
- include/utils/iVec.h+17
- include/utils/int_double_pair.h+1-1
- include/utils/linalg_dense_sparse_matmuls.h+17
- include/utils/linalg_sparse_matmuls.h+17
- include/utils/matrix.h+1-1
- include/utils/mini_numpy.h+17
- include/utils/tracked_alloc.h+17
- include/utils/utils.h+17
- src/atoms/affine/add.c+1-1
- src/atoms/affine/broadcast.c+1-1
- src/atoms/affine/diag_mat.c+40
- src/atoms/affine/diag_vec.c+1-1
- src/atoms/affine/hstack.c+1-1
- src/atoms/affine/index.c+1-1
- src/atoms/affine/left_matmul.c+1-1
- src/atoms/affine/neg.c+1-1
- src/atoms/affine/parameter.c+1-1
- src/atoms/affine/promote.c+1-1
- src/atoms/affine/reshape.c+1-1
- src/atoms/affine/right_matmul.c+1-1
- src/atoms/affine/scalar_mult.c+1-1
- src/atoms/affine/sum.c+1-1
- src/atoms/affine/trace.c+1-1
- src/atoms/affine/transpose.c+1-1
- src/atoms/affine/upper_tri.c+58
- src/atoms/affine/variable.c+1-1
- src/atoms/affine/vector_mult.c+1-1
- src/atoms/affine/vstack.c+1-1
- src/atoms/bivariate_full_dom/matmul.c+1-1
- src/atoms/bivariate_full_dom/multiply.c+1-1
- src/atoms/bivariate_restricted_dom/quad_over_lin.c+1-1
- src/atoms/bivariate_restricted_dom/rel_entr.c+1-1
- src/atoms/bivariate_restricted_dom/rel_entr_scalar_vector.c+1-1
- src/atoms/bivariate_restricted_dom/rel_entr_vector_scalar.c+1-1
- src/atoms/elementwise_full_dom/common.c+17
- src/atoms/elementwise_full_dom/exp.c+17
- src/atoms/elementwise_full_dom/hyperbolic.c+17
- src/atoms/elementwise_full_dom/logistic.c+17
- src/atoms/elementwise_full_dom/normal_cdf.c+17
- src/atoms/elementwise_full_dom/power.c+17
- src/atoms/elementwise_full_dom/trig.c+17
- src/atoms/elementwise_full_dom/xexp.c+17
- src/atoms/elementwise_restricted_dom/atanh.c+17
- src/atoms/elementwise_restricted_dom/common.c+17
- src/atoms/elementwise_restricted_dom/entr.c+17
- src/atoms/elementwise_restricted_dom/log.c+17
- src/atoms/elementwise_restricted_dom/tan.c+17
- src/atoms/other/prod.c+17
- src/atoms/other/prod_axis_one.c+17
- src/atoms/other/prod_axis_zero.c+17
- src/atoms/other/quad_form.c+17
- src/expr.c+1-1
- src/old-code/linear_op.c+1-1
- src/old-code/old_CSR.c+1-1
- src/old-code/old_CSR_sum.c+1-1
- src/problem.c+1-1
- src/utils/COO_Matrix.c+1-1
- src/utils/CSC_Matrix.c+1-1
- src/utils/CSR_Matrix.c+1-1
- src/utils/CSR_sum.c+1-1
- src/utils/dense_matrix.c+1-1
- src/utils/int_double_pair.c+1-1
- src/utils/linalg_dense_sparse_matmuls.c+1-1
- src/utils/linalg_sparse_matmuls.c+1-1
- src/utils/mini_numpy.c+1-1
- src/utils/sparse_matrix.c+1-1
- src/utils/tracked_alloc.c+17
- src/utils/utils.c+1-1
- tests/all_tests.c+14
- tests/forward_pass/affine/test_diag_mat.h+29
- tests/forward_pass/affine/test_upper_tri.h+41
- tests/jacobian_tests/affine/test_diag_mat.h+61
- tests/jacobian_tests/affine/test_index.h-2
- tests/jacobian_tests/affine/test_upper_tri.h+69
- tests/wsum_hess/affine/test_diag_mat.h+46
- tests/wsum_hess/affine/test_index.h-2
- tests/wsum_hess/affine/test_upper_tri.h+61
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
| 86 | + | |
| 87 | + | |
83 | 88 | | |
84 | 89 | | |
85 | 90 | | |
| |||
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
108 | 114 | | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
0 commit comments