NLPInterfacePack::ExampleNLPBanded Class Reference

Simple scalable serial NLP subclass. More...

#include <NLPInterfacePack_ExampleNLPBanded.hpp>

Inheritance diagram for NLPInterfacePack::ExampleNLPBanded:

[legend]
List of all members.

Constructors / initializers

 ExampleNLPBanded (size_type nD, size_type nI, size_type bw=1, size_type mU=0, size_type mI=0, value_type xo=0.1, value_type xDl=-NLP::infinite_bound(), value_type xDu=+NLP::infinite_bound(), value_type xIl=-NLP::infinite_bound(), value_type xIu=+NLP::infinite_bound(), value_type hl=-NLP::infinite_bound(), value_type hu=+NLP::infinite_bound(), bool nlp_selects_basis=false, value_type diag_scal=10.0, value_type diag_vary=1.0, bool sym_basis=false, value_type f_offset=0.0, value_type co=0.0, bool ignore_constraints=false)
 Constructor.

Overridden public members from NLP

void initialize (bool test_setup)
 
bool is_initialized () const
 
value_type max_var_bounds_viol () const
 

Overridden from NLPVarReductPerm

bool nlp_selects_basis () const
 

Overridden protected methods from NLPSerialPreprocess

bool imp_nlp_has_changed () const
 
size_type imp_n_orig () const
 
size_type imp_m_orig () const
 
size_type imp_mI_orig () const
 
const DVectorSlice imp_xinit_orig () const
 
bool imp_has_var_bounds () const
 
const DVectorSlice imp_xl_orig () const
 
const DVectorSlice imp_xu_orig () const
 
const DVectorSlice imp_hl_orig () const
 
const DVectorSlice imp_hu_orig () const
 
void imp_calc_f_orig (const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const
 
void imp_calc_c_orig (const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const
 
void imp_calc_h_orig (const DVectorSlice &x_full, bool newx, const ZeroOrderInfoSerial &zero_order_info) const
 
void imp_calc_Gf_orig (const DVectorSlice &x_full, bool newx, const ObjGradInfoSerial &obj_grad_info) const
 
bool imp_get_next_basis (IVector *var_perm_full, IVector *equ_perm_full, size_type *rank_full, size_type *rank)
 
void imp_report_orig_final_solution (const DVectorSlice &x_orig, const DVectorSlice *lambda_orig, const DVectorSlice *lambdaI_orig, const DVectorSlice *nu_orig, bool is_optimal) const
 

Overridden protected methods from NLPSerialPreprocessExplJac

size_type imp_Gc_nz_orig () const
 
size_type imp_Gh_nz_orig () const
 
void imp_calc_Gc_orig (const DVectorSlice &x_full, bool newx, const FirstOrderExplInfo &first_order_expl_info) const
 
void imp_calc_Gh_orig (const DVectorSlice &x_full, bool newx, const FirstOrderExplInfo &first_order_expl_info) const
 

Private Member Functions

void assert_is_initialized () const
 
void inform_new_point (bool newx) const
 
 ExampleNLPBanded ()
 ExampleNLPBanded (const ExampleNLPBanded &)
ExampleNLPBandedoperator= (const ExampleNLPBanded &)

Private Attributes

bool is_initialized_
bool nlp_selects_basis_
bool basis_selection_was_given_
bool has_var_bounds_
value_type f_offset_
size_type nD_
size_type nI_
size_type bw_
size_type mU_
size_type mI_
bool ignore_constraints_
size_type Gc_orig_nz_
size_type Gh_orig_nz_
DVector xinit_orig_
DVector xl_orig_
DVector xu_orig_
DVector hl_orig_
DVector hu_orig_
DVector co_orig_
bool c_orig_updated_
value_type diag_scal_
value_type diag_vary_
value_type fu_

Detailed Description

Simple scalable serial NLP subclass.

This example NLP is a scalable problem where the basis of the jacobian of the equality constraints is a banded (band width = bw) symmetric positive definite matrix. Both the number of dependnet and independent variables can be varied.

To setup this NLP, the client specifies:

This NLP is defined as:

    min    f(x) = (1/2) * sum( x(i)^2, for i = 1..n )
    s.t.
           c(j) = ( ds(j)*x(j)                                 \
                    - sum( 3/(k)*x(j-k), k=1...klu(j) )        |
                    - sum( fu/(k)*x(j+k), k=1...kuu(j) )       | for j  = 1...nD
                   ) * (x(nD+q(j)) + 1)^2                      |
                   + co(j) == 0                                /

            c(nD+jU) = c(jU) + co(nD+jU)  == 0                 } for jU = 1...mU

            hl(jI) <= x(jI) - x(nD+q(jI)) <= hu(jI)            } for jI = 1...mI

            xl(i) <= x(i) <= xu(i)                             } for i  = 1...n

    where:

        n = nD + nI

        m = nD + mU

        mI = mI

        ds(j) = diag_scal * ( (diag_vary - 1)/(nD -1) * (j - 1) + 1 )

             / 3  : if sym_basis = true
        fu = |
             \ 6  : if sym_basis = false

                                 / 2  : if floor((j-1)/nI) < nD % nI
        q(j) = floor((j-1)/nI) + |
                                 \ 1  : if floor((j-1)/nI) >= nD % nI

                                                                  
                  / bw-1 : if j - bw >= 0                         \
        klu(j) =  |                                               |
                  \ j-1  : if j - bw <= 1                         |
                                                                  | for j=1...nD
                  / bw-1 : if j + bw-1 <= nD                      |
        kuu(j) =  |                                               |
                  \ nD-j : if j - bw <= 1                         /
 
In the above formuation, the sums are not computed if the upper bounds on k are zero. The term co(j) is an adjustable term that can be used to manipulate the solution. Note that if co(nD+jI) != 0 above, then the undecomposed dependent equality constraints are inconsistent with the decomposed equalities and therefore the NLP is infeasible. An infeasible NLP can also be created by manipulating xl(i), xu(i), hl(jI), hu(jI) and co(j).

For the above NLP, the Jacobian of the decomposed equalities has Jacobian elements:

                      /  -3/(j-i) * (x(nD+q(j)) + 1)^2         : i - klu(i) <= j < i
                      |
                      |  ds(j) * (x(nD+q(j)) + 1)^2            : i == j
   d(c(j))/d(x(i)) =  |
                      |  -3/(i-j) * (x(nD+q(j)) + 1)^2         : i < j <= i + kuu(i)
                      |
                      |  2 * (c(j) - co(j)) / (x(nD+q(j)) + 1) : i == nD + q
                      | 
                      \  0                                     : otherwise
                      
                      , for j = 1...nD, i = 1...nD+nI
 
The above definition shows that for the independent variables, the Jacobian elements are written in terms of the constraint c(j). This fact is exploited in the computational routines when this->multi_calc() == true.

For nD == 7, nI == 2, bw = 2 with floor(nD/nI) = 3 and nD % nI = 1, the Jacobian Gc' looks like:

   1 | x  x                 x    |
   2 | x  x  x              x    |
   3 |    x  x  x           x    |
   4 |       x  x  x        x    |
   5 |          x  x  x        x |
   6 |             x  x  x     x |
   7 |                x  x     x |
       -  -  -  -  -  -  -  -  -
       1  2  3  4  5  6  7  8  9
 

ToDo: Finish documentation!

Definition at line 143 of file NLPInterfacePack_ExampleNLPBanded.hpp.


Constructor & Destructor Documentation

NLPInterfacePack::ExampleNLPBanded::ExampleNLPBanded ( size_type  nD,
size_type  nI,
size_type  bw = 1,
size_type  mU = 0,
size_type  mI = 0,
value_type  xo = 0.1,
value_type  xDl = -NLP::infinite_bound(),
value_type  xDu = +NLP::infinite_bound(),
value_type  xIl = -NLP::infinite_bound(),
value_type  xIu = +NLP::infinite_bound(),
value_type  hl = -NLP::infinite_bound(),
value_type  hu = +NLP::infinite_bound(),
bool  nlp_selects_basis = false,
value_type  diag_scal = 10.0,
value_type  diag_vary = 1.0,
bool  sym_basis = false,
value_type  f_offset = 0.0,
value_type  co = 0.0,
bool  ignore_constraints = false 
)

Constructor.

ToDo: Finish documentation!

Definition at line 40 of file NLPInterfacePack_ExampleNLPBanded.cpp.

NLPInterfacePack::ExampleNLPBanded::ExampleNLPBanded (  )  [private]

NLPInterfacePack::ExampleNLPBanded::ExampleNLPBanded ( const ExampleNLPBanded  )  [private]


Member Function Documentation

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

Reimplemented from NLPInterfacePack::NLPSerialPreprocessExplJac.

Definition at line 127 of file NLPInterfacePack_ExampleNLPBanded.cpp.

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

Reimplemented from NLPInterfacePack::NLPSerialPreprocessExplJac.

Definition at line 138 of file NLPInterfacePack_ExampleNLPBanded.cpp.

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

Implements NLPInterfacePack::NLP.

Definition at line 143 of file NLPInterfacePack_ExampleNLPBanded.cpp.

bool NLPInterfacePack::ExampleNLPBanded::nlp_selects_basis (  )  const [virtual]

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 363 of file NLPInterfacePack_ExampleNLPBanded.cpp.

bool NLPInterfacePack::ExampleNLPBanded::imp_nlp_has_changed (  )  const [protected, virtual]

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 150 of file NLPInterfacePack_ExampleNLPBanded.cpp.

size_type NLPInterfacePack::ExampleNLPBanded::imp_n_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 155 of file NLPInterfacePack_ExampleNLPBanded.cpp.

size_type NLPInterfacePack::ExampleNLPBanded::imp_m_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 160 of file NLPInterfacePack_ExampleNLPBanded.cpp.

size_type NLPInterfacePack::ExampleNLPBanded::imp_mI_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 166 of file NLPInterfacePack_ExampleNLPBanded.cpp.

const DVectorSlice NLPInterfacePack::ExampleNLPBanded::imp_xinit_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 172 of file NLPInterfacePack_ExampleNLPBanded.cpp.

bool NLPInterfacePack::ExampleNLPBanded::imp_has_var_bounds (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 177 of file NLPInterfacePack_ExampleNLPBanded.cpp.

const DVectorSlice NLPInterfacePack::ExampleNLPBanded::imp_xl_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 182 of file NLPInterfacePack_ExampleNLPBanded.cpp.

const DVectorSlice NLPInterfacePack::ExampleNLPBanded::imp_xu_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 187 of file NLPInterfacePack_ExampleNLPBanded.cpp.

const DVectorSlice NLPInterfacePack::ExampleNLPBanded::imp_hl_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 192 of file NLPInterfacePack_ExampleNLPBanded.cpp.

const DVectorSlice NLPInterfacePack::ExampleNLPBanded::imp_hu_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocess.

Definition at line 197 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_f_orig ( const DVectorSlice x_full,
bool  newx,
const ZeroOrderInfoSerial &  zero_order_info 
) const [protected]

Definition at line 202 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_c_orig ( const DVectorSlice x_full,
bool  newx,
const ZeroOrderInfoSerial &  zero_order_info 
) const [protected]

Definition at line 213 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_h_orig ( const DVectorSlice x_full,
bool  newx,
const ZeroOrderInfoSerial &  zero_order_info 
) const [protected]

Definition at line 258 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_Gf_orig ( const DVectorSlice x_full,
bool  newx,
const ObjGradInfoSerial &  obj_grad_info 
) const [protected]

Definition at line 282 of file NLPInterfacePack_ExampleNLPBanded.cpp.

bool NLPInterfacePack::ExampleNLPBanded::imp_get_next_basis ( IVector *  var_perm_full,
IVector *  equ_perm_full,
size_type rank_full,
size_type rank 
) [protected, virtual]

Reimplemented from NLPInterfacePack::NLPSerialPreprocess.

Definition at line 293 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_report_orig_final_solution ( const DVectorSlice x_orig,
const DVectorSlice lambda_orig,
const DVectorSlice lambdaI_orig,
const DVectorSlice nu_orig,
bool  is_optimal 
) const [protected]

Definition at line 352 of file NLPInterfacePack_ExampleNLPBanded.cpp.

size_type NLPInterfacePack::ExampleNLPBanded::imp_Gc_nz_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocessExplJac.

Definition at line 370 of file NLPInterfacePack_ExampleNLPBanded.cpp.

size_type NLPInterfacePack::ExampleNLPBanded::imp_Gh_nz_orig (  )  const [protected, virtual]

Implements NLPInterfacePack::NLPSerialPreprocessExplJac.

Definition at line 375 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_Gc_orig ( const DVectorSlice x_full,
bool  newx,
const FirstOrderExplInfo &  first_order_expl_info 
) const [protected]

Definition at line 380 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::imp_calc_Gh_orig ( const DVectorSlice x_full,
bool  newx,
const FirstOrderExplInfo &  first_order_expl_info 
) const [protected]

Definition at line 459 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::assert_is_initialized (  )  const [private]

Definition at line 508 of file NLPInterfacePack_ExampleNLPBanded.cpp.

void NLPInterfacePack::ExampleNLPBanded::inform_new_point ( bool  newx  )  const [private]

Definition at line 513 of file NLPInterfacePack_ExampleNLPBanded.cpp.

ExampleNLPBanded& NLPInterfacePack::ExampleNLPBanded::operator= ( const ExampleNLPBanded  )  [private]


Member Data Documentation

bool NLPInterfacePack::ExampleNLPBanded::is_initialized_ [private]

Definition at line 303 of file NLPInterfacePack_ExampleNLPBanded.hpp.

bool NLPInterfacePack::ExampleNLPBanded::nlp_selects_basis_ [private]

Definition at line 305 of file NLPInterfacePack_ExampleNLPBanded.hpp.

bool NLPInterfacePack::ExampleNLPBanded::basis_selection_was_given_ [private]

Definition at line 306 of file NLPInterfacePack_ExampleNLPBanded.hpp.

bool NLPInterfacePack::ExampleNLPBanded::has_var_bounds_ [private]

Definition at line 308 of file NLPInterfacePack_ExampleNLPBanded.hpp.

value_type NLPInterfacePack::ExampleNLPBanded::f_offset_ [private]

Definition at line 310 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::nD_ [private]

Definition at line 312 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::nI_ [private]

Definition at line 313 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::bw_ [private]

Definition at line 314 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::mU_ [private]

Definition at line 315 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::mI_ [private]

Definition at line 316 of file NLPInterfacePack_ExampleNLPBanded.hpp.

bool NLPInterfacePack::ExampleNLPBanded::ignore_constraints_ [private]

Definition at line 318 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::Gc_orig_nz_ [private]

Definition at line 320 of file NLPInterfacePack_ExampleNLPBanded.hpp.

size_type NLPInterfacePack::ExampleNLPBanded::Gh_orig_nz_ [private]

Definition at line 321 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::xinit_orig_ [private]

Definition at line 323 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::xl_orig_ [private]

Definition at line 324 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::xu_orig_ [private]

Definition at line 325 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::hl_orig_ [private]

Definition at line 326 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::hu_orig_ [private]

Definition at line 327 of file NLPInterfacePack_ExampleNLPBanded.hpp.

DVector NLPInterfacePack::ExampleNLPBanded::co_orig_ [private]

Definition at line 329 of file NLPInterfacePack_ExampleNLPBanded.hpp.

bool NLPInterfacePack::ExampleNLPBanded::c_orig_updated_ [mutable, private]

Definition at line 331 of file NLPInterfacePack_ExampleNLPBanded.hpp.

value_type NLPInterfacePack::ExampleNLPBanded::diag_scal_ [private]

Definition at line 333 of file NLPInterfacePack_ExampleNLPBanded.hpp.

value_type NLPInterfacePack::ExampleNLPBanded::diag_vary_ [private]

Definition at line 334 of file NLPInterfacePack_ExampleNLPBanded.hpp.

value_type NLPInterfacePack::ExampleNLPBanded::fu_ [private]

Definition at line 335 of file NLPInterfacePack_ExampleNLPBanded.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:54:20 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7