@@ -88,7 +88,7 @@ static void jacobian_init(expr *node)
8888
8989 /* initialize child's jacobian and precompute sparsity of its CSC */
9090 x -> jacobian_init (x );
91- lnode -> Jchild_CSC = csr_to_csc_fill_sparsity (x -> jacobian , node -> iwork );
91+ lnode -> Jchild_CSC = csr_to_csc_fill_sparsity (x -> jacobian , node -> work -> iwork );
9292
9393 /* precompute sparsity of this node's jacobian in CSC and CSR */
9494 lnode -> J_CSC = lnode -> A -> block_left_mult_sparsity (lnode -> A , lnode -> Jchild_CSC ,
@@ -106,7 +106,7 @@ static void eval_jacobian(expr *node)
106106
107107 /* evaluate child's jacobian and convert to CSC */
108108 x -> eval_jacobian (x );
109- csr_to_csc_fill_values (x -> jacobian , Jchild_CSC , node -> iwork );
109+ csr_to_csc_fill_values (x -> jacobian , Jchild_CSC , node -> work -> iwork );
110110
111111 /* compute this node's jacobian: */
112112 lnode -> A -> block_left_mult_values (lnode -> A , Jchild_CSC , J_CSC );
@@ -127,17 +127,17 @@ static void wsum_hess_init(expr *node)
127127 /* work for computing A^T w*/
128128 int n_blocks = ((left_matmul_expr * ) node )-> n_blocks ;
129129 int dim = ((left_matmul_expr * ) node )-> AT -> m * n_blocks ;
130- node -> dwork = (double * ) malloc (dim * sizeof (double ));
130+ node -> work -> dwork = (double * ) malloc (dim * sizeof (double ));
131131}
132132
133133static void eval_wsum_hess (expr * node , const double * w )
134134{
135135 /* compute A^T w*/
136136 Matrix * AT = ((left_matmul_expr * ) node )-> AT ;
137137 int n_blocks = ((left_matmul_expr * ) node )-> n_blocks ;
138- AT -> block_left_mult_vec (AT , w , node -> dwork , n_blocks );
138+ AT -> block_left_mult_vec (AT , w , node -> work -> dwork , n_blocks );
139139
140- node -> left -> eval_wsum_hess (node -> left , node -> dwork );
140+ node -> left -> eval_wsum_hess (node -> left , node -> work -> dwork );
141141 memcpy (node -> wsum_hess -> x , node -> left -> wsum_hess -> x ,
142142 node -> wsum_hess -> nnz * sizeof (double ));
143143}
@@ -180,13 +180,14 @@ expr *new_left_matmul(expr *u, const CSR_Matrix *A)
180180 (requiring size node->n_vars) and for transposing A (requiring size A->n).
181181 csc_to_csr_work is used for converting J_CSC to CSR (requiring
182182 node->size) */
183- node -> iwork = (int * ) malloc (MAX (A -> n , node -> n_vars ) * sizeof (int ));
183+ node -> work -> iwork = (int * ) malloc (MAX (A -> n , node -> n_vars ) * sizeof (int ));
184184 lnode -> csc_to_csr_work = (int * ) malloc (node -> size * sizeof (int ));
185185 lnode -> n_blocks = n_blocks ;
186186
187187 /* store A and AT */
188188 lnode -> A = new_sparse_matrix (A );
189- lnode -> AT = sparse_matrix_trans ((const Sparse_Matrix * ) lnode -> A , node -> iwork );
189+ lnode -> AT =
190+ sparse_matrix_trans ((const Sparse_Matrix * ) lnode -> A , node -> work -> iwork );
190191
191192 return node ;
192193}
@@ -220,7 +221,7 @@ expr *new_left_matmul_dense(expr *u, int m, int n, const double *data)
220221 node -> left = u ;
221222 expr_retain (u );
222223
223- node -> iwork = (int * ) malloc (MAX (n , node -> n_vars ) * sizeof (int ));
224+ node -> work -> iwork = (int * ) malloc (MAX (n , node -> n_vars ) * sizeof (int ));
224225 lnode -> csc_to_csr_work = (int * ) malloc (node -> size * sizeof (int ));
225226 lnode -> n_blocks = n_blocks ;
226227
0 commit comments