MOOCHO Version of the Day
Public Member Functions
NLPInterfacePack::ExampleNLPDirect Class Reference

Simple example NLP subclass to illustrate how to implement the NLPDirect interface for a specialized NLP. More...

#include <NLPInterfacePack_ExampleNLPDirect.hpp>

Inheritance diagram for NLPInterfacePack::ExampleNLPDirect:
Inheritance graph

List of all members.

Public Member Functions

 ExampleNLPDirect (const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded)

Overridden public members from NLP

void initialize (bool test_setup)
bool is_initialized () const

Overridden public members from NLPDirect

Range1D var_dep () const
Range1D var_indep () const
const mat_fcty_ptr_t factory_D () const
void calc_point (const Vector &x, value_type *f, VectorMutable *c, bool recalc_c, VectorMutable *Gf, VectorMutable *py, VectorMutable *rGf, MatrixOp *GcU, MatrixOp *D, MatrixOp *Uz) const
void calc_semi_newton_step (const Vector &x, VectorMutable *c, bool recalc_c, VectorMutable *py) const

Detailed Description

Simple example NLP subclass to illustrate how to implement the NLPDirect interface for a specialized NLP.

For the NLP formulation see ExampleNLPObjGrad.

In this NLP we will select the first n/2 variables as the dependent or basis variables. Note that the variable bounds are on the dependent or independent variables variables if has_bounds = true. Otherwise there are no variable bounds. Also the starting point can be varied.

The implementation of this NLP subclass is actually independent from the vector space for the dependent and independent variables (same vector space). This implementation is defined entirely based on an arbitrary VectorSpace object that is passed to the constructor ExampleNLPDirect(). This NLP subclass uses a VectorSpaceBlocked object to represent the space for [ x_dep; x_indep ]

The quantities computed by this subclass include:

  py = -inv(C)*c
  D = -inv(C)*N
    Gc' = [ C , N ]
      [ x(m+1) - 1									]
      [				x(m+2) - 1						]
    C = [							.					]
      [								.				]
      [									x(m+m) - 1	]
      [ x(1) - 10										]
      [				x(2) - 10						]
    N = [							.					]
      [								.				]
      [									x(m) - 10	]

Here Gc is never computed explicitly.

To make this possible this subclass relies on some specialized RTOp operators which are implemented in C (for portability). These operator classes are declared in the header file NLPInterfacePack_ExampleNLPDirect.hpp and are documented here.

Definition at line 90 of file NLPInterfacePack_ExampleNLPDirect.hpp.

Constructor & Destructor Documentation

NLPInterfacePack::ExampleNLPDirect::ExampleNLPDirect ( const VectorSpace::space_ptr_t &  vec_space,
value_type  xo,
bool  has_bounds,
bool  dep_bounded 


vec_space[in] Smart pointer to a vector space object that will be used to define the spaces of dependent and independent variables.
xo[in] The initial starting guess for x.
has_bounds[in] If true, then the NLP will have bounds. If false then it will not have bounds.
dep_bouned[in] If true, then the bounds will be on the dependent variables. If false, then the bounds will be on the independent variable. This argument is ignored if has_bounds == false.

Definition at line 62 of file NLPInterfacePack_ExampleNLPDirect.cpp.

Member Function Documentation

void NLPInterfacePack::ExampleNLPDirect::initialize ( bool  test_setup) [virtual]

Reimplemented from NLPInterfacePack::NLPDirect.

Definition at line 84 of file NLPInterfacePack_ExampleNLPDirect.cpp.

bool NLPInterfacePack::ExampleNLPDirect::is_initialized ( ) const [virtual]

Reimplemented from NLPInterfacePack::ExampleNLPObjGrad.

Definition at line 99 of file NLPInterfacePack_ExampleNLPDirect.cpp.

Range1D NLPInterfacePack::ExampleNLPDirect::var_dep ( ) const [virtual]

Reimplemented from NLPInterfacePack::NLPDirect.

Definition at line 106 of file NLPInterfacePack_ExampleNLPDirect.cpp.

Range1D NLPInterfacePack::ExampleNLPDirect::var_indep ( ) const [virtual]

Reimplemented from NLPInterfacePack::NLPDirect.

Definition at line 111 of file NLPInterfacePack_ExampleNLPDirect.cpp.

const NLPDirect::mat_fcty_ptr_t NLPInterfacePack::ExampleNLPDirect::factory_D ( ) const [virtual]
void NLPInterfacePack::ExampleNLPDirect::calc_point ( const Vector &  x,
value_type *  f,
VectorMutable *  c,
bool  recalc_c,
VectorMutable *  Gf,
VectorMutable *  py,
VectorMutable *  rGf,
MatrixOp *  GcU,
MatrixOp *  D,
MatrixOp *  Uz 
) const [virtual]
void NLPInterfacePack::ExampleNLPDirect::calc_semi_newton_step ( const Vector &  x,
VectorMutable *  c,
bool  recalc_c,
VectorMutable *  py 
) const [virtual]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends