MOOCHO (Single Doxygen Collection) Version of the Day
Public Member Functions | Private Member Functions | Private Attributes
NLPInterfacePack::ExampleNLPObjGrad Class Reference

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

#include <NLPInterfacePack_ExampleNLPObjGrad.hpp>

Inheritance diagram for NLPInterfacePack::ExampleNLPObjGrad:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ExampleNLPObjGrad (const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded)
 Constructor.

Private Member Functions

void assert_is_initialized () const
 

Private Attributes

VectorSpace::space_ptr_t vec_space_
VectorSpace::space_ptr_t vec_space_comp_
Range1D var_dep_
Range1D var_indep_
bool initialized_
value_type obj_scale_
bool has_bounds_
bool force_xinit_in_bounds_
size_type n_
VectorSpace::vec_mut_ptr_t xinit_
VectorSpace::vec_mut_ptr_t xl_
VectorSpace::vec_mut_ptr_t xu_

Helper methods to be used by subclasses.

virtual Range1D var_dep () const
 
virtual Range1D var_indep () const
 

Overridden public members from NLP

void initialize (bool test_setup)
 
bool is_initialized () const
 
size_type n () const
 
size_type m () const
 
vec_space_ptr_t space_x () const
 
vec_space_ptr_t space_c () const
 
size_type num_bounded_x () const
 
void force_xinit_in_bounds (bool force_xinit_in_bounds)
 
bool force_xinit_in_bounds () const
 
const Vectorxinit () const
 
const Vectorxl () const
 
const Vectorxu () const
 
value_type max_var_bounds_viol () const
 
void scale_f (value_type scale_f)
 
value_type scale_f () const
 
void report_final_solution (const Vector &x, const Vector *lambda, const Vector *nu, bool optimal)
 

Overridden protected members from NLP

void imp_calc_f (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
 
void imp_calc_c (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
 
void imp_calc_h (const Vector &x, bool newx, const ZeroOrderInfo &zero_order_info) const
 This implementation does nothing (should never be called though).

Overridden protected members from NLPObjGrad

void imp_calc_Gf (const Vector &x, bool newx, const ObjGradInfo &obj_grad_info) const
 

Detailed Description

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

The example NLP we will use is a scalable problem where the basis of the jacobian of the constraints is a diagonal matrix (however it is not computed here).


    min    f(x) = (1/2) * sum( x(i)^2, for i = 1..n )
    s.t.   c(x)(j) = x(j) * (x(m+j) -1) - 10 * x(m+j) = 0, for j = 1..m
          0.01 < x(i) < 20, for i = p...p+m

    where:
        m = n/2
        p = 1 if dep_bounded == true or m+1 if dep_bounded = false
 

This is not really a fully functional NLP in the sense that there is no derivative information for the constraints.

Definition at line 72 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.


Constructor & Destructor Documentation

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

Constructor.

Parameters:
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 75 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.


Member Function Documentation

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

Reimplemented in NLPInterfacePack::ExampleNLPDirect.

Definition at line 231 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

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

Reimplemented in NLPInterfacePack::ExampleNLPDirect.

Definition at line 236 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::initialize ( bool  test_setup) [virtual]
bool NLPInterfacePack::ExampleNLPObjGrad::is_initialized ( ) const [virtual]
size_type NLPInterfacePack::ExampleNLPObjGrad::n ( ) const [virtual]

Reimplemented from NLPInterfacePack::NLP.

Definition at line 147 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

size_type NLPInterfacePack::ExampleNLPObjGrad::m ( ) const [virtual]

Reimplemented from NLPInterfacePack::NLP.

Definition at line 153 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

NLP::vec_space_ptr_t NLPInterfacePack::ExampleNLPObjGrad::space_x ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 159 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

NLP::vec_space_ptr_t NLPInterfacePack::ExampleNLPObjGrad::space_c ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 164 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

size_type NLPInterfacePack::ExampleNLPObjGrad::num_bounded_x ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 169 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::force_xinit_in_bounds ( bool  force_xinit_in_bounds) [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 174 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

bool NLPInterfacePack::ExampleNLPObjGrad::force_xinit_in_bounds ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 179 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

const Vector & NLPInterfacePack::ExampleNLPObjGrad::xinit ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 184 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

const Vector & NLPInterfacePack::ExampleNLPObjGrad::xl ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 190 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

const Vector & NLPInterfacePack::ExampleNLPObjGrad::xu ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 196 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

value_type NLPInterfacePack::ExampleNLPObjGrad::max_var_bounds_viol ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 202 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::scale_f ( value_type  scale_f) [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 207 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

value_type NLPInterfacePack::ExampleNLPObjGrad::scale_f ( ) const [virtual]

Implements NLPInterfacePack::NLP.

Definition at line 213 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::report_final_solution ( const Vector x,
const Vector lambda,
const Vector nu,
bool  optimal 
) [virtual]

Reimplemented from NLPInterfacePack::NLP.

Definition at line 219 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::imp_calc_f ( const Vector x,
bool  newx,
const ZeroOrderInfo zero_order_info 
) const [protected, virtual]

Implements NLPInterfacePack::NLP.

Definition at line 243 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::imp_calc_c ( const Vector x,
bool  newx,
const ZeroOrderInfo zero_order_info 
) const [protected, virtual]

Implements NLPInterfacePack::NLP.

Definition at line 254 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::imp_calc_h ( const Vector x,
bool  newx,
const ZeroOrderInfo zero_order_info 
) const [protected]

This implementation does nothing (should never be called though).

Definition at line 273 of file NLPInterfacePack_ExampleNLPObjGrad.cpp.

void NLPInterfacePack::ExampleNLPObjGrad::imp_calc_Gf ( const Vector x,
bool  newx,
const ObjGradInfo obj_grad_info 
) const [protected, virtual]
void NLPInterfacePack::ExampleNLPObjGrad::assert_is_initialized ( ) const [inline, private]

Member Data Documentation

VectorSpace::space_ptr_t NLPInterfacePack::ExampleNLPObjGrad::vec_space_ [private]

Definition at line 181 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

VectorSpace::space_ptr_t NLPInterfacePack::ExampleNLPObjGrad::vec_space_comp_ [private]

Definition at line 182 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 183 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 184 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 187 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 188 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 189 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

Definition at line 191 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::ExampleNLPObjGrad::xinit_ [private]

Definition at line 192 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::ExampleNLPObjGrad::xl_ [private]

Definition at line 193 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.

VectorSpace::vec_mut_ptr_t NLPInterfacePack::ExampleNLPObjGrad::xu_ [private]

Definition at line 194 of file NLPInterfacePack_ExampleNLPObjGrad.hpp.


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