Bonmin::TNLP2FPNLP Class Reference

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>

Inheritance diagram for Bonmin::TNLP2FPNLP:

Inheritance graph
[legend]
Collaboration diagram for Bonmin::TNLP2FPNLP:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors/Destructors
 TNLP2FPNLP (const SmartPtr< TNLP > tnlp, double objectiveScalingFactor=100)
virtual ~TNLP2FPNLP ()
 Default destructor.
Methods to change the objective function
void set_dist2point_obj (int n, const Number *vals, const Index *inds)
 Set the point to which distance is minimized.
void setSigma (double sigma)
 Set the value for simgma.
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 (Index &n, Index &m, Index &nnz_jac_g, Index &nnz_h_lag, TNLP::IndexStyleEnum &index_style)
 get info from nlp_ and add hessian information
virtual bool get_bounds_info (Index n, Number *x_l, Number *x_u, Index m, Number *g_l, Number *g_u)
 This call is just passed onto tnlp_.
virtual bool get_starting_point (Index n, bool init_x, Number *x, bool init_z, Number *z_L, Number *z_U, Index m, bool init_lambda, Number *lambda)
 Passed onto tnlp_.
virtual bool eval_f (Index n, const Number *x, bool new_x, Number &obj_value)
 overloaded to return the value of the objective function
virtual bool eval_grad_f (Index n, const Number *x, bool new_x, Number *grad_f)
 overload this method to return the vector of the gradient of the objective w.r.t.
virtual bool eval_g (Index n, const Number *x, bool new_x, Index m, Number *g)
 passed onto tnlp_
virtual bool eval_jac_g (Index n, const Number *x, bool new_x, Index m, Index nele_jac, Index *iRow, Index *jCol, Number *values)
 Passed onto tnlp_.
virtual bool eval_h (Index n, const Number *x, bool new_x, Number obj_factor, Index m, const Number *lambda, bool new_lambda, Index nele_hess, Index *iRow, Index *jCol, Number *values)
 Evaluate the modified Hessian of the Lagrangian.
Solution Methods
virtual void finalize_solution (SolverReturn status, Index n, const Number *x, const Number *z_L, const Number *z_U, Index m, const Number *g, const Number *lambda, Number obj_value, const IpoptData *ip_data, IpoptCalculatedQuantities *ip_cq)
 This method is called when the algorithm is complete so the TNLP can store/write the solution.
Scaling of the objective function
void setObjectiveScaling (double value)
double getObjectiveScaling () const

Private Member Functions

Internal methods to help compute the distance, its gradient and hessian
double dist2point (const Number *x)
 Compute the norm-2 distance to the current point to which distance is minimized.
Default Compiler Generated Methods
(Hidden to avoid implicit creation/calling). These methods are not implemented and we do not want the compiler to implement them for us, so we declare them private and do not define them. This ensures that they will not be implicitly created/called.

 TNLP2FPNLP ()
 Default Constructor.
 TNLP2FPNLP (const TNLP2FPNLP &)
 Copy Constructor.
void operator= (const TNLP2FPNLP &)
 Overloaded Equals Operator.

Private Attributes

SmartPtr< TNLPtnlp_
 pointer to the tminlp that is being adapted
double objectiveScalingFactor_
 Scaling factor for the objective.
Data for storing the point the distance to which is minimized
vector< Indexinds_
 Indices of the variables for which distance is minimized (i.e. indices of integer variables in a feasibility pump setting).
vector< Numbervals_
 Values of the point to which we separate (if x is the point vals_[i] should be x[inds_[i]] ).
double lambda_
 value for the convex combination to take between original objective and distance function.
double sigma_
 Scaling for the original objective.
int norm_
 Norm to use (L_1 or L_2).

Detailed Description

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_dist2point_obj(int n, const double *, const int *)

Definition at line 22 of file BonTNLP2FPNLP.hpp.


Constructor & Destructor Documentation

Bonmin::TNLP2FPNLP::TNLP2FPNLP ( const SmartPtr< TNLP tnlp,
double  objectiveScalingFactor = 100 
)

virtual Bonmin::TNLP2FPNLP::~TNLP2FPNLP (  )  [virtual]

Default destructor.

Bonmin::TNLP2FPNLP::TNLP2FPNLP (  )  [private]

Default Constructor.

Bonmin::TNLP2FPNLP::TNLP2FPNLP ( const TNLP2FPNLP  )  [private]

Copy Constructor.


Member Function Documentation

void Bonmin::TNLP2FPNLP::set_dist2point_obj ( int  n,
const Number vals,
const Index inds 
)

Set the point to which distance is minimized.

The distance is minimize in a subspace define by a subset of coordinates

Parameters:
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

void Bonmin::TNLP2FPNLP::setSigma ( double  sigma  )  [inline]

Set the value for simgma.

Definition at line 44 of file BonTNLP2FPNLP.hpp.

References sigma_.

void Bonmin::TNLP2FPNLP::setLambda ( double  lambda  )  [inline]

Set the value for lambda.

Definition at line 48 of file BonTNLP2FPNLP.hpp.

References lambda_.

void Bonmin::TNLP2FPNLP::setNorm ( int  norm  )  [inline]

Set the value for simgma.

Definition at line 52 of file BonTNLP2FPNLP.hpp.

References norm_.

virtual bool Bonmin::TNLP2FPNLP::get_nlp_info ( Index n,
Index m,
Index nnz_jac_g,
Index nnz_h_lag,
TNLP::IndexStyleEnum index_style 
) [virtual]

get info from nlp_ and add hessian information

Implements Ipopt::TNLP.

virtual bool Bonmin::TNLP2FPNLP::get_bounds_info ( Index  n,
Number x_l,
Number x_u,
Index  m,
Number g_l,
Number g_u 
) [inline, virtual]

This call is just passed onto tnlp_.

Implements Ipopt::TNLP.

Definition at line 65 of file BonTNLP2FPNLP.hpp.

References tnlp_.

virtual bool Bonmin::TNLP2FPNLP::get_starting_point ( Index  n,
bool  init_x,
Number x,
bool  init_z,
Number z_L,
Number z_U,
Index  m,
bool  init_lambda,
Number lambda 
) [inline, virtual]

Passed onto tnlp_.

Implements Ipopt::TNLP.

Definition at line 73 of file BonTNLP2FPNLP.hpp.

References tnlp_.

virtual bool Bonmin::TNLP2FPNLP::eval_f ( Index  n,
const Number x,
bool  new_x,
Number obj_value 
) [virtual]

overloaded to return the value of the objective function

Implements Ipopt::TNLP.

virtual bool Bonmin::TNLP2FPNLP::eval_grad_f ( Index  n,
const Number x,
bool  new_x,
Number grad_f 
) [virtual]

overload this method to return the vector of the gradient of the objective w.r.t.

x

Implements Ipopt::TNLP.

virtual bool Bonmin::TNLP2FPNLP::eval_g ( Index  n,
const Number x,
bool  new_x,
Index  m,
Number g 
) [inline, virtual]

passed onto tnlp_

Implements Ipopt::TNLP.

Definition at line 92 of file BonTNLP2FPNLP.hpp.

References tnlp_.

virtual bool Bonmin::TNLP2FPNLP::eval_jac_g ( Index  n,
const Number x,
bool  new_x,
Index  m,
Index  nele_jac,
Index iRow,
Index jCol,
Number values 
) [inline, virtual]

Passed onto tnlp_.

Implements Ipopt::TNLP.

Definition at line 99 of file BonTNLP2FPNLP.hpp.

References tnlp_.

virtual bool Bonmin::TNLP2FPNLP::eval_h ( Index  n,
const Number x,
bool  new_x,
Number  obj_factor,
Index  m,
const Number lambda,
bool  new_lambda,
Index  nele_hess,
Index iRow,
Index jCol,
Number values 
) [virtual]

Evaluate the modified Hessian of the Lagrangian.

Reimplemented from Ipopt::TNLP.

virtual void Bonmin::TNLP2FPNLP::finalize_solution ( SolverReturn  status,
Index  n,
const Number x,
const Number z_L,
const Number z_U,
Index  m,
const Number g,
const Number lambda,
Number  obj_value,
const IpoptData ip_data,
IpoptCalculatedQuantities ip_cq 
) [virtual]

This method is called when the algorithm is complete so the TNLP can store/write the solution.

Implements Ipopt::TNLP.

void Bonmin::TNLP2FPNLP::setObjectiveScaling ( double  value  )  [inline]

Definition at line 126 of file BonTNLP2FPNLP.hpp.

References objectiveScalingFactor_.

double Bonmin::TNLP2FPNLP::getObjectiveScaling (  )  const [inline]

Definition at line 130 of file BonTNLP2FPNLP.hpp.

References objectiveScalingFactor_.

double Bonmin::TNLP2FPNLP::dist2point ( const Number x  )  [private]

Compute the norm-2 distance to the current point to which distance is minimized.

void Bonmin::TNLP2FPNLP::operator= ( const TNLP2FPNLP  )  [private]

Overloaded Equals Operator.


Member Data Documentation

SmartPtr<TNLP> Bonmin::TNLP2FPNLP::tnlp_ [private]

pointer to the tminlp that is being adapted

Definition at line 160 of file BonTNLP2FPNLP.hpp.

Referenced by eval_g(), eval_jac_g(), get_bounds_info(), and get_starting_point().

vector<Index> Bonmin::TNLP2FPNLP::inds_ [private]

Indices of the variables for which distance is minimized (i.e. indices of integer variables in a feasibility pump setting).

Definition at line 165 of file BonTNLP2FPNLP.hpp.

vector<Number> Bonmin::TNLP2FPNLP::vals_ [private]

Values of the point to which we separate (if x is the point vals_[i] should be x[inds_[i]] ).

Definition at line 167 of file BonTNLP2FPNLP.hpp.

double Bonmin::TNLP2FPNLP::lambda_ [private]

value for the convex combination to take between original objective and distance function.

( take lambda_ * distance + (1-lambda) sigma f(x).

Definition at line 170 of file BonTNLP2FPNLP.hpp.

Referenced by setLambda().

double Bonmin::TNLP2FPNLP::sigma_ [private]

Scaling for the original objective.

Definition at line 172 of file BonTNLP2FPNLP.hpp.

Referenced by setSigma().

int Bonmin::TNLP2FPNLP::norm_ [private]

Norm to use (L_1 or L_2).

Definition at line 174 of file BonTNLP2FPNLP.hpp.

Referenced by setNorm().

double Bonmin::TNLP2FPNLP::objectiveScalingFactor_ [private]

Scaling factor for the objective.

Definition at line 178 of file BonTNLP2FPNLP.hpp.

Referenced by getObjectiveScaling(), and setObjectiveScaling().


The documentation for this class was generated from the following file:
Generated on Thu Jun 26 03:21:25 2008 for Bonmin by  doxygen 1.4.7