[Ipopt] Linear Constraints at Ipopt

Stefan Vigerske stefan at math.hu-berlin.de
Tue Mar 22 10:54:30 EDT 2011


Hi,

> I am working about a problem optimization wich has linear constraints. I
> have implemented these constraints like as the other (nonlinear) constraints
> using C++ interface (in methods eval_g and eval_jac_g of my TNLP class).
> However, I have saw, in the TNLP class, there is a method for constraints
> linearity (get_constraints_linearity). I would like to ask if is possible
> implementing my linear constraints using this method (instead of implemeting
> in eval_g). If yes, do I need include these constraints in the jacobian
> information, or the first derivative of these constraints is gotten in a
> automatic way? Again if yes, there is any convergence advantage in codifying
> at this way?

No, you need to implement linear constraints in eval_g and eval_jac_g.
The method get_constraints_linearity is just to tell Ipopt which 
constraints are linear, so it can safe some computations by knowing that 
for these constraints the gradient does not change (I guess).

> I am sorry if is a dummie question, but there is no example using the method
> get_constraints_linearity...

For each constraint i, i=0,...,m-1, you have to set
const_types[i] to Ipopt::TNLP::LINEAR, of constraint i is linear, or 
Ipopt::TNLP::NON+LINEAR otherwise.

You may also implement get_variables_linearity to tell Ipopt which 
variables appear only in linear parts of constraints and objective.

Stefan
>
>
>
>
>
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt


-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan



More information about the Ipopt mailing list