MOOCHO
Version of the Day
|
Simple example NLP subclass to illustrate how to implement the NLPFirstOrder
interface for a specialized NLP
.
More...
#include <NLPInterfacePack_ExampleNLPFirstOrder.hpp>
Public Member Functions | |
ExampleNLPFirstOrder (const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded) | |
Constructor (see ExampleNLPDirect::ExampleNLPDirect()). More... | |
Public Member Functions inherited from NLPInterfacePack::ExampleNLPObjGrad | |
ExampleNLPObjGrad (const VectorSpace::space_ptr_t &vec_space, value_type xo, bool has_bounds, bool dep_bounded) | |
Constructor. More... | |
virtual Range1D | var_dep () const |
virtual Range1D | var_indep () 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 Vector & | xinit () const |
const Vector & | xl () const |
const Vector & | xu () 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 public members from NLP | |
void | initialize (bool test_setup) |
bool | is_initialized () const |
Overridden public members from NLPFirstOrder | |
void | set_Gc (MatrixOp *Gc) |
Overridden to check the concrete type of Gc. More... | |
const NLPFirstOrder::mat_fcty_ptr_t | factory_Gc () const |
const basis_sys_ptr_t | basis_sys () const |
Returns an ExampleBasisSystem. More... | |
Overridden protected members from NLPFirstOrder | |
void | imp_calc_Gc (const Vector &x, bool newx, const FirstOrderInfo &first_order_info) const |
Simple example NLP subclass to illustrate how to implement the NLPFirstOrder
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.
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 subclass inherits from the subclass ExampleNLPDirect
mostly out of lazyness but also to show how flexible these interfaces can be using mutiple inheritance.
ToDo: Finish documentation!
Definition at line 73 of file NLPInterfacePack_ExampleNLPFirstOrder.hpp.
NLPInterfacePack::ExampleNLPFirstOrder::ExampleNLPFirstOrder | ( | const VectorSpace::space_ptr_t & | vec_space, |
value_type | xo, | ||
bool | has_bounds, | ||
bool | dep_bounded | ||
) |
Constructor (see ExampleNLPDirect::ExampleNLPDirect()).
Definition at line 58 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::NLPFirstOrder.
Definition at line 99 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
virtual |
Reimplemented from NLPInterfacePack::ExampleNLPObjGrad.
Definition at line 111 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
virtual |
Overridden to check the concrete type of Gc.
Reimplemented from NLPInterfacePack::NLPFirstOrder.
Definition at line 78 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
virtual |
Implements NLPInterfacePack::NLPFirstOrder.
Definition at line 86 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
virtual |
Returns an ExampleBasisSystem.
Reimplemented from NLPInterfacePack::NLPFirstOrder.
Definition at line 92 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.
|
protectedvirtual |
Implements NLPInterfacePack::NLPFirstOrder.
Definition at line 118 of file NLPInterfacePack_ExampleNLPFirstOrder.cpp.