@@ -70,16 +70,17 @@ static bool is_affine(const expr *node)
7070expr * new_parameter (int d1 , int d2 , int param_id , int n_vars , const double * values )
7171{
7272 parameter_expr * pnode = (parameter_expr * ) calloc (1 , sizeof (parameter_expr ));
73- init_expr (& pnode -> base , d1 , d2 , n_vars , forward , jacobian_init , eval_jacobian ,
74- is_affine , wsum_hess_init , eval_wsum_hess , NULL );
73+ expr * node = & pnode -> base ;
74+ init_expr (node , d1 , d2 , n_vars , forward , jacobian_init , eval_jacobian , is_affine ,
75+ wsum_hess_init , eval_wsum_hess , NULL );
7576 pnode -> param_id = param_id ;
7677
77- /* If values provided (fixed constant), copy them now */
78+ /* If values provided (fixed constant), copy them now.
79+ Otherwise values will be populated by problem_update_params. */
7880 if (values != NULL )
7981 {
80- memcpy (pnode -> base . value , values , pnode -> base . size * sizeof (double ));
82+ memcpy (node -> value , values , node -> size * sizeof (double ));
8183 }
82- /* Otherwise values will be populated by problem_update_params */
8384
84- return & pnode -> base ;
85+ return node ;
8586}
0 commit comments