Pass the information of linear/nonlinear constraints in C and Python interfaces
This info is used in l1RelaxedProblem: if no trust-region constraint is present, we do not need to relax the linear constraints.
cc @amontoison
Maybe we can add an option to specify that we hav a constant Jacobian like in Ipopt?
Ideally, we want to pass a vector of size number_constraints where component $i$ is whether constraint $c_i$ is linear (L) or nonlinear (N). If no such vector is passed, we assume that all the constraints are nonlinear.
I like this idea, we could also specify if some constraints are quadratic this way, which allow to not recompute all the Hessian of the Lagrangian. Ipopt doesn't do that but KNITRO yes.
Update: We need to update the API of Uno to only compute a partial part of the Hessian of the Lagrangian if a mix of nonlinear / quadratic constraints (it is an issue). But if we only have quadratic constraints, it is free for us.
Oh yeah! Perhaps the easiest way is to partition the constraints directly in the C interface:
uno_set_linear_constraints(...);
uno_set_quadratic_constraints(...);
uno_set_nonlinear_constraints(...);
For the Hessian it's perhaps not so straightforward because it also contains the objective contribution. Perhaps it is the modeler's/the modeling framework's responsibility to not recompute the Hessian of linear/quadratic constraints? In this case, Uno would still ask for the whole Hessian evaluation (objective + all constraints), which would be aggregated on the modeling side (some parts of it being constant).
I like a lot:
uno_set_linear_constraints(...);
uno_set_quadratic_constraints(...);
uno_set_nonlinear_constraints(...);
and by default uno_set_constraints(...) is full non-linear constraints.