Ipopt::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 <TNLP2FPNLP.hpp>

Inheritance diagram for Ipopt::TNLP2FPNLP:

Inheritance graph
[legend]
Collaboration diagram for Ipopt::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.
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)
 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
Index n_
 Number of variables in inds_ and vals_.
Index nMax_
 Size of inds_ and vals_ arrays.
Indexinds_
 Indices of the variables for which distance is minimized (i.e. indices of integer variables in a feasibility pump setting).
Numbervals_
 Values of the point to which we separate (if x is the point vals_[i] should be x[inds_[i]] ).

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 21 of file TNLP2FPNLP.hpp.


Constructor & Destructor Documentation

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

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

Default destructor.

Ipopt::TNLP2FPNLP::TNLP2FPNLP (  )  [private]

Default Constructor.

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

Copy Constructor.


Member Function Documentation

void Ipopt::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

virtual bool Ipopt::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 Ipopt::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 51 of file TNLP2FPNLP.hpp.

References tnlp_.

virtual bool Ipopt::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 59 of file TNLP2FPNLP.hpp.

References tnlp_.

virtual bool Ipopt::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 Ipopt::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 Ipopt::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 78 of file TNLP2FPNLP.hpp.

References tnlp_.

virtual bool Ipopt::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 85 of file TNLP2FPNLP.hpp.

References tnlp_.

virtual bool Ipopt::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 Ipopt::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 
) [virtual]

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

Implements Ipopt::TNLP.

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

Definition at line 110 of file TNLP2FPNLP.hpp.

References objectiveScalingFactor_.

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

Definition at line 114 of file TNLP2FPNLP.hpp.

References objectiveScalingFactor_.

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

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

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

Overloaded Equals Operator.


Member Data Documentation

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

pointer to the tminlp that is being adapted

Definition at line 144 of file TNLP2FPNLP.hpp.

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

Index Ipopt::TNLP2FPNLP::n_ [private]

Number of variables in inds_ and vals_.

Definition at line 149 of file TNLP2FPNLP.hpp.

Index Ipopt::TNLP2FPNLP::nMax_ [private]

Size of inds_ and vals_ arrays.

Definition at line 151 of file TNLP2FPNLP.hpp.

Index* Ipopt::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 153 of file TNLP2FPNLP.hpp.

Number* Ipopt::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 155 of file TNLP2FPNLP.hpp.

double Ipopt::TNLP2FPNLP::objectiveScalingFactor_ [private]

Scaling factor for the objective.

Definition at line 159 of file TNLP2FPNLP.hpp.

Referenced by getObjectiveScaling(), and setObjectiveScaling().


The documentation for this class was generated from the following file:
Generated on Fri May 16 21:16:55 2008 for Bonmin by  doxygen 1.4.7