In problem.c, we currently avoid evaluating the Hessian for affine expressions, and we only evaluate the Jacobian once in that case. Once we release the separate Python bindings, it might make sense to do something similar.
If an expression is affine and someone computes its Hessian, we could immediately return zero. For the Jacobian, we could add a flag indicating whether it has already been computed, to avoid recomputing it.
Just leaving this comment here so we remember to revisit it later.
In problem.c, we currently avoid evaluating the Hessian for affine expressions, and we only evaluate the Jacobian once in that case. Once we release the separate Python bindings, it might make sense to do something similar.
If an expression is affine and someone computes its Hessian, we could immediately return zero. For the Jacobian, we could add a flag indicating whether it has already been computed, to avoid recomputing it.
Just leaving this comment here so we remember to revisit it later.