Bonmin 1.8.9
Loading...
Searching...
No Matches
Bonmin::BranchingTQP Class Reference

This is an adapter class that converts a TMINLP2TNLP object into a TNLP, which is now just a QP. More...

#include <BonBranchingTQP.hpp>

+ Inheritance diagram for Bonmin::BranchingTQP:
+ Collaboration diagram for Bonmin::BranchingTQP:

Public Member Functions

Constructors/Destructors
 BranchingTQP (Ipopt::SmartPtr< TMINLP2TNLP > tminlp2tnlp)
 
virtual ~BranchingTQP ()
 Default destructor.
 
methods to gather information about the NLP, only those

that need to be overloaded from TNLP

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)
 
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)
 
virtual bool get_constraints_linearity (Ipopt::Index m, LinearityType *const_types)
 Returns the constraint linearity.
 
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)
 Method called by Ipopt to get the starting point.
 
virtual bool eval_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number &obj_value)
 Returns the value of the objective function in x.
 
virtual bool eval_grad_f (Ipopt::Index n, const Ipopt::Number *x, bool new_x, Ipopt::Number *grad_f)
 Returns 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)
 Returns the vector of constraint values in x.
 
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)
 Returns the jacobian of the constraints.
 
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)
 Return the hessian of the lagrangian.
 
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)
 
const Ipopt::Number ObjVal ()
 Accessor Methods for QP data.
 
const Ipopt::NumberObjGrad ()
 
const Ipopt::NumberObjHessVals ()
 
const Ipopt::IndexObjHessIRow ()
 
const Ipopt::IndexObjHessJCol ()
 
const Ipopt::NumberConstrRhs ()
 
const Ipopt::NumberConstrJacVals ()
 
const Ipopt::IndexConstrJacIRow ()
 
const Ipopt::IndexConstrJacJCol ()
 
- Public Member Functions inherited from Ipopt::TNLP
 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_variables_linearity (Index n, LinearityType *var_types)
 
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_variables_linearity (Index n, LinearityType *var_types)
 
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
 
- Public Member Functions inherited from Ipopt::ReferencedObject
 ReferencedObject ()
 
virtual ~ReferencedObject ()
 
Index ReferenceCount () const
 
void AddRef (const Referencer *referencer) const
 
void ReleaseRef (const Referencer *referencer) const
 

Additional Inherited Members

- Public Types inherited from Ipopt::TNLP
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
 
- Public Attributes inherited from Ipopt::TNLP
 LINEAR
 
 NON_LINEAR
 
 C_STYLE
 
 FORTRAN_STYLE
 

Detailed Description

This is an adapter class that converts a TMINLP2TNLP object into a TNLP, which is now just a QP.

The QP is the linear quadratic of the TNLP at the optimal point. The purpose of the BranchingTQP is that it is used in a strong-branching framework, strong branching is only done for the QP approximation of the TNLP, not on the TNLP itself. The variables of the QP are the displacement from the reference point.

Definition at line 25 of file BonBranchingTQP.hpp.

Constructor & Destructor Documentation

◆ BranchingTQP()

Bonmin::BranchingTQP::BranchingTQP ( Ipopt::SmartPtr< TMINLP2TNLP > tminlp2tnlp)

◆ ~BranchingTQP()

virtual Bonmin::BranchingTQP::~BranchingTQP ( )
virtual

Default destructor.

Member Function Documentation

◆ get_nlp_info()

virtual bool Bonmin::BranchingTQP::get_nlp_info ( Ipopt::Index & n,
Ipopt::Index & m,
Ipopt::Index & nnz_jac_g,
Ipopt::Index & nnz_h_lag,
Ipopt::TNLP::IndexStyleEnum & index_style )
virtual

Implements Ipopt::TNLP.

◆ get_bounds_info()

virtual bool Bonmin::BranchingTQP::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 )
virtual

Implements Ipopt::TNLP.

◆ get_constraints_linearity()

virtual bool Bonmin::BranchingTQP::get_constraints_linearity ( Ipopt::Index m,
LinearityType * const_types )
virtual

Returns the constraint linearity.

array should be alocated with length at least n. Since this is a QP, all constraints are linear.

Reimplemented from Ipopt::TNLP.

◆ get_starting_point()

virtual bool Bonmin::BranchingTQP::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 )
virtual

Method called by Ipopt to get the starting point.

The bools init_x and init_lambda are both inputs and outputs. As inputs, they indicate whether or not the algorithm wants you to initialize x and lambda respectively. If, for some reason, the algorithm wants you to initialize these and you cannot, set the respective bool to false.

Implements Ipopt::TNLP.

◆ eval_f()

virtual bool Bonmin::BranchingTQP::eval_f ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Number & obj_value )
virtual

Returns the value of the objective function in x.

Implements Ipopt::TNLP.

◆ eval_grad_f()

virtual bool Bonmin::BranchingTQP::eval_grad_f ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Number * grad_f )
virtual

Returns the vector of the gradient of the objective w.r.t.

x

Implements Ipopt::TNLP.

◆ eval_g()

virtual bool Bonmin::BranchingTQP::eval_g ( Ipopt::Index n,
const Ipopt::Number * x,
bool new_x,
Ipopt::Index m,
Ipopt::Number * g )
virtual

Returns the vector of constraint values in x.

Implements Ipopt::TNLP.

◆ eval_jac_g()

virtual bool Bonmin::BranchingTQP::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 )
virtual

Returns the jacobian of the constraints.

The vectors iRow and jCol only need to be set once. The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL.

Implements Ipopt::TNLP.

◆ eval_h()

virtual bool Bonmin::BranchingTQP::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 )
virtual

Return the hessian of the lagrangian.

The vectors iRow and jCol only need to be set once (during the first call). The first call is used to set the structure only (iRow and jCol will be non-NULL, and values will be NULL) For subsequent calls, iRow and jCol will be NULL. This matrix is symmetric - specify the lower diagonal only

Reimplemented from Ipopt::TNLP.

◆ finalize_solution()

virtual void Bonmin::BranchingTQP::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 )
virtual

Implements Ipopt::TNLP.

◆ ObjVal()

const Ipopt::Number Bonmin::BranchingTQP::ObjVal ( )
inline

Accessor Methods for QP data.

Definition at line 102 of file BonBranchingTQP.hpp.

◆ ObjGrad()

const Ipopt::Number * Bonmin::BranchingTQP::ObjGrad ( )
inline

Definition at line 106 of file BonBranchingTQP.hpp.

◆ ObjHessVals()

const Ipopt::Number * Bonmin::BranchingTQP::ObjHessVals ( )
inline

Definition at line 110 of file BonBranchingTQP.hpp.

◆ ObjHessIRow()

const Ipopt::Index * Bonmin::BranchingTQP::ObjHessIRow ( )
inline

Definition at line 114 of file BonBranchingTQP.hpp.

◆ ObjHessJCol()

const Ipopt::Index * Bonmin::BranchingTQP::ObjHessJCol ( )
inline

Definition at line 118 of file BonBranchingTQP.hpp.

◆ ConstrRhs()

const Ipopt::Number * Bonmin::BranchingTQP::ConstrRhs ( )
inline

Definition at line 122 of file BonBranchingTQP.hpp.

◆ ConstrJacVals()

const Ipopt::Number * Bonmin::BranchingTQP::ConstrJacVals ( )
inline

Definition at line 126 of file BonBranchingTQP.hpp.

◆ ConstrJacIRow()

const Ipopt::Index * Bonmin::BranchingTQP::ConstrJacIRow ( )
inline

Definition at line 130 of file BonBranchingTQP.hpp.

◆ ConstrJacJCol()

const Ipopt::Index * Bonmin::BranchingTQP::ConstrJacJCol ( )
inline

Definition at line 134 of file BonBranchingTQP.hpp.


The documentation for this class was generated from the following file: