Bonmin 1.8.9
|
This is an adapter class to convert an NLP to a Feasibility Pump NLP by changing the objective function to the (2-norm) distance to a point. More...
#include <BonTNLP2FPNLP.hpp>
Public Member Functions | |
Constructors/Destructors | |
TNLP2FPNLP (const Ipopt::SmartPtr< Ipopt::TNLP > tnlp, double objectiveScalingFactor=100) | |
Build using tnlp as source problem. | |
TNLP2FPNLP (const Ipopt::SmartPtr< TNLP > tnlp, const Ipopt::SmartPtr< TNLP2FPNLP > other) | |
Build using tnlp as source problem and using other for all other parameters. | |
virtual | ~TNLP2FPNLP () |
Default destructor. | |
void | use (Ipopt::SmartPtr< TNLP > tnlp) |
Methods to select the objective function and extra constraints | |
void | set_use_feasibility_pump_objective (bool use_feasibility_pump_objective) |
Flag to indicate that we want to use the feasibility pump objective. | |
void | set_use_cutoff_constraint (bool use_cutoff_constraint) |
Flag to indicate that we want to use a cutoff constraint This constraint has the form f(x) <= (1-epsilon) f(x') | |
void | set_use_local_branching_constraint (bool use_local_branching_constraint) |
Flag to indicate that we want to use a local branching constraint. | |
Methods to provide the rhs of the extra constraints | |
void | set_cutoff (Ipopt::Number cutoff) |
Set the cutoff value to use in the cutoff constraint. | |
void | set_rhs_local_branching_constraint (double rhs_local_branching_constraint) |
Set the rhs of the local branching constraint. | |
Methods to change the objective function | |
void | set_dist_to_point_obj (size_t n, const Ipopt::Number *vals, const Ipopt::Index *inds) |
Set the point to which distance is minimized. | |
void | setSigma (double sigma) |
Set the value for sigma. | |
void | setLambda (double lambda) |
Set the value for lambda. | |
void | setNorm (int norm) |
Set the value for simgma. | |
methods to gather information about the NLP | |
virtual bool | get_nlp_info (Ipopt::Index &n, Ipopt::Index &m, Ipopt::Index &nnz_jac_g, Ipopt::Index &nnz_h_lag, Ipopt::TNLP::IndexStyleEnum &index_style) |
get info from nlp_ and add hessian information | |
virtual bool | get_bounds_info (Ipopt::Index n, Ipopt::Number *x_l, Ipopt::Number *x_u, Ipopt::Index m, Ipopt::Number *g_l, Ipopt::Number *g_u) |
This call is just passed onto tnlp_. | |
virtual bool | get_starting_point (Ipopt::Index n, bool init_x, Ipopt::Number *x, bool init_z, Ipopt::Number *z_L, Ipopt::Number *z_U, Ipopt::Index m, bool init_lambda, Ipopt::Number *lambda) |
Passed onto tnlp_. | |
virtual bool | eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value) |
overloaded to return the value of the objective function | |
virtual bool | eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f) |
overload this method to return the vector of the gradient of the objective w.r.t. | |
virtual bool | eval_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Number *g) |
overload to return the values of the left-hand side of the constraints | |
virtual bool | eval_jac_g (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Index m, Ipopt::Index nele_jac, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values) |
overload to return the jacobian of g | |
virtual bool | eval_h (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number obj_factor, Ipopt::Index m, const Ipopt::Number *lambda, bool new_lambda, Ipopt::Index nele_hess, Ipopt::Index *iRow, Ipopt::Index *jCol, Ipopt::Number *values) |
Evaluate the modified Hessian of the Lagrangian. | |
Solution Methods | |
virtual void | finalize_solution (Ipopt::SolverReturn status, Ipopt::Index n, const Ipopt::Number *x, const Ipopt::Number *z_L, const Ipopt::Number *z_U, Ipopt::Index m, const Ipopt::Number *g, const Ipopt::Number *lambda, Ipopt::Number obj_value, const Ipopt::IpoptData *ip_data, Ipopt::IpoptCalculatedQuantities *ip_cq) |
This method is called when the algorithm is complete so the TNLP can store/write the solution. | |
virtual bool | get_variables_linearity (Ipopt::Index n, LinearityType *var_types) |
virtual bool | get_constraints_linearity (Ipopt::Index m, LinearityType *const_types) |
overload this method to return the constraint linearity. | |
Scaling of the objective function | |
void | setObjectiveScaling (double value) |
double | getObjectiveScaling () const |
![]() | |
DECLARE_STD_EXCEPTION (INVALID_TNLP) | |
TNLP () | |
virtual | ~TNLP () |
virtual bool | get_var_con_metadata (Index n, StringMetaDataMapType &var_string_md, IntegerMetaDataMapType &var_integer_md, NumericMetaDataMapType &var_numeric_md, Index m, StringMetaDataMapType &con_string_md, IntegerMetaDataMapType &con_integer_md, NumericMetaDataMapType &con_numeric_md) |
virtual bool | get_scaling_parameters (Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling) |
virtual bool | get_warm_start_iterate (IteratesVector &warm_start_iterate) |
virtual Index | get_number_of_nonlinear_variables () |
virtual bool | get_list_of_nonlinear_variables (Index num_nonlin_vars, Index *pos_nonlin_vars) |
virtual void | finalize_metadata (Index n, const StringMetaDataMapType &var_string_md, const IntegerMetaDataMapType &var_integer_md, const NumericMetaDataMapType &var_numeric_md, Index m, const StringMetaDataMapType &con_string_md, const IntegerMetaDataMapType &con_integer_md, const NumericMetaDataMapType &con_numeric_md) |
virtual bool | intermediate_callback (AlgorithmMode mode, Index iter, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
bool | get_curr_iterate (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const |
bool | get_curr_violations (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const |
TNLP () | |
virtual | ~TNLP () |
virtual bool | get_var_con_metadata (Index n, StringMetaDataMapType &var_string_md, IntegerMetaDataMapType &var_integer_md, NumericMetaDataMapType &var_numeric_md, Index m, StringMetaDataMapType &con_string_md, IntegerMetaDataMapType &con_integer_md, NumericMetaDataMapType &con_numeric_md) |
virtual bool | get_scaling_parameters (Number &obj_scaling, bool &use_x_scaling, Index n, Number *x_scaling, bool &use_g_scaling, Index m, Number *g_scaling) |
virtual bool | get_warm_start_iterate (IteratesVector &warm_start_iterate) |
virtual Index | get_number_of_nonlinear_variables () |
virtual bool | get_list_of_nonlinear_variables (Index num_nonlin_vars, Index *pos_nonlin_vars) |
virtual void | finalize_metadata (Index n, const StringMetaDataMapType &var_string_md, const IntegerMetaDataMapType &var_integer_md, const NumericMetaDataMapType &var_numeric_md, Index m, const StringMetaDataMapType &con_string_md, const IntegerMetaDataMapType &con_integer_md, const NumericMetaDataMapType &con_numeric_md) |
virtual bool | intermediate_callback (AlgorithmMode mode, Index iter, Number obj_value, Number inf_pr, Number inf_du, Number mu, Number d_norm, Number regularization_size, Number alpha_du, Number alpha_pr, Index ls_trials, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq) |
bool | get_curr_iterate (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x, Number *z_L, Number *z_U, Index m, Number *g, Number *lambda) const |
bool | get_curr_violations (const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq, bool scaled, Index n, Number *x_L_violation, Number *x_U_violation, Number *compl_x_L, Number *compl_x_U, Number *grad_lag_x, Index m, Number *nlp_constraint_violation, Number *compl_g) const |
![]() | |
ReferencedObject () | |
virtual | ~ReferencedObject () |
Index | ReferenceCount () const |
void | AddRef (const Referencer *referencer) const |
void | ReleaseRef (const Referencer *referencer) const |
Additional Inherited Members | |
![]() | |
enum | LinearityType |
enum | IndexStyleEnum |
typedef std::map< std::string, std::vector< std::string > > | StringMetaDataMapType |
typedef std::map< std::string, std::vector< Index > > | IntegerMetaDataMapType |
typedef std::map< std::string, std::vector< Number > > | NumericMetaDataMapType |
![]() | |
LINEAR | |
NON_LINEAR | |
C_STYLE | |
FORTRAN_STYLE | |
This is an adapter class to convert an NLP to a Feasibility Pump NLP by changing the objective function to the (2-norm) distance to a point.
The extra function is set_dist_to_point_obj(size_t n, const double *, const int *)
Definition at line 22 of file BonTNLP2FPNLP.hpp.
Bonmin::TNLP2FPNLP::TNLP2FPNLP | ( | const Ipopt::SmartPtr< Ipopt::TNLP > | tnlp, |
double | objectiveScalingFactor = 100 ) |
Build using tnlp as source problem.
Bonmin::TNLP2FPNLP::TNLP2FPNLP | ( | const Ipopt::SmartPtr< TNLP > | tnlp, |
const Ipopt::SmartPtr< TNLP2FPNLP > | other ) |
Build using tnlp as source problem and using other for all other parameters.
|
virtual |
Default destructor.
|
inline |
Definition at line 36 of file BonTNLP2FPNLP.hpp.
|
inline |
Flag to indicate that we want to use the feasibility pump objective.
Definition at line 41 of file BonTNLP2FPNLP.hpp.
|
inline |
Flag to indicate that we want to use a cutoff constraint This constraint has the form f(x) <= (1-epsilon) f(x')
Definition at line 46 of file BonTNLP2FPNLP.hpp.
|
inline |
Flag to indicate that we want to use a local branching constraint.
Definition at line 50 of file BonTNLP2FPNLP.hpp.
void Bonmin::TNLP2FPNLP::set_cutoff | ( | Ipopt::Number | cutoff | ) |
Set the cutoff value to use in the cutoff constraint.
|
inline |
Set the rhs of the local branching constraint.
Definition at line 60 of file BonTNLP2FPNLP.hpp.
void Bonmin::TNLP2FPNLP::set_dist_to_point_obj | ( | size_t | n, |
const Ipopt::Number * | vals, | ||
const Ipopt::Index * | inds ) |
Set the point to which distance is minimized.
The distance is minimize in a subspace define by a subset of coordinates
n | number of coordinates on which distance is minimized |
inds | indices of the coordinates on which distance is minimized |
vals | values of the point for coordinates in ind |
|
inline |
Set the value for sigma.
Definition at line 76 of file BonTNLP2FPNLP.hpp.
|
inline |
Set the value for lambda.
Definition at line 80 of file BonTNLP2FPNLP.hpp.
|
inline |
Set the value for simgma.
Definition at line 84 of file BonTNLP2FPNLP.hpp.
|
virtual |
get info from nlp_ and add hessian information
Implements Ipopt::TNLP.
|
virtual |
This call is just passed onto tnlp_.
Implements Ipopt::TNLP.
|
inlinevirtual |
|
virtual |
overloaded to return the value of the objective function
Implements Ipopt::TNLP.
|
virtual |
overload this method to return the vector of the gradient of the objective w.r.t.
x
Implements Ipopt::TNLP.
|
virtual |
overload to return the values of the left-hand side of the constraints
Implements Ipopt::TNLP.
|
virtual |
overload to return the jacobian of g
Implements Ipopt::TNLP.
|
virtual |
Evaluate the modified Hessian of the Lagrangian.
Reimplemented from Ipopt::TNLP.
|
virtual |
This method is called when the algorithm is complete so the TNLP can store/write the solution.
Implements Ipopt::TNLP.
|
inlinevirtual |
Reimplemented from Ipopt::TNLP.
Definition at line 158 of file BonTNLP2FPNLP.hpp.
|
inlinevirtual |
overload this method to return the constraint linearity.
array should be alocated with length at least n. (default implementation just return false and does not fill the array).
Reimplemented from Ipopt::TNLP.
Definition at line 166 of file BonTNLP2FPNLP.hpp.
|
inline |
Definition at line 181 of file BonTNLP2FPNLP.hpp.
|
inline |
Definition at line 185 of file BonTNLP2FPNLP.hpp.