@@ -8,7 +8,7 @@ void jacobian_init_elementwise(expr *node)
88 expr * child = node -> left ;
99
1010 /* if the variable is a child */
11- if (child -> var_id != -1 )
11+ if (child -> var_id != NOT_A_VARIABLE )
1212 {
1313 node -> jacobian = new_csr_matrix (node -> size , node -> n_vars , node -> size );
1414 for (int j = 0 ; j < node -> size ; j ++ )
@@ -18,7 +18,7 @@ void jacobian_init_elementwise(expr *node)
1818 }
1919 node -> jacobian -> p [node -> size ] = node -> size ;
2020 }
21- /* otherwise it should be a linear operator */
21+ /* otherwise it will be a linear operator */
2222 else
2323 {
2424 node -> jacobian = new_csr_matrix (child -> jacobian -> m , child -> jacobian -> n ,
@@ -31,13 +31,13 @@ void eval_jacobian_elementwise(expr *node)
3131{
3232 expr * child = node -> left ;
3333
34- if (child -> var_id != -1 )
34+ if (child -> var_id != NOT_A_VARIABLE )
3535 {
3636 node -> local_jacobian (node , node -> jacobian -> x );
3737 }
3838 else
3939 {
40- /* Child must be a linear operator */
40+ /* Child will be a linear operator */
4141 linear_op_expr * lin_child = (linear_op_expr * ) child ;
4242 node -> local_jacobian (node , node -> dwork );
4343 diag_csr_mult (node -> dwork , lin_child -> A_csr , node -> jacobian );
@@ -51,7 +51,7 @@ void wsum_hess_init_elementwise(expr *node)
5151 int i ;
5252
5353 /* if the variable is a child*/
54- if (id != -1 )
54+ if (id != NOT_A_VARIABLE )
5555 {
5656 node -> wsum_hess = new_csr_matrix (node -> n_vars , node -> n_vars , node -> size );
5757
@@ -78,13 +78,13 @@ void eval_wsum_hess_elementwise(expr *node, const double *w)
7878{
7979 expr * child = node -> left ;
8080
81- if (child -> var_id != -1 )
81+ if (child -> var_id != NOT_A_VARIABLE )
8282 {
8383 node -> local_wsum_hess (node , node -> wsum_hess -> x , w );
8484 }
8585 else
8686 {
87- /* Child must be a linear operator */
87+ /* Child will be a linear operator */
8888 linear_op_expr * lin_child = (linear_op_expr * ) child ;
8989 node -> local_wsum_hess (node , node -> dwork , w );
9090 ATDA_values (lin_child -> A_csc , node -> dwork , node -> wsum_hess );
0 commit comments