MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Protected Types | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MoochoPack::NLPAlgoState Class Reference

Reduced space SQP state encapsulation interface. More...

#include <MoochoPack_NLPAlgoState.hpp>

Inheritance diagram for MoochoPack::NLPAlgoState:
Inheritance graph
[legend]

Classes

class  InvalidType
 Thrown if an iteration quantity is of an invalid type. More...
 
struct  iq_id_encap
 

Protected Types

enum  { NUM_VEC_SPACE_TYPES = 5 }
 
enum  EVecSpaceType { VST_SPACE_X = 0, VST_SPACE_C = 1, VST_SPACE_RANGE = 2, VST_SPACE_NULL = 3 }
 

Protected Member Functions

void update_iq_id (const std::string &iq_name, iq_id_encap *iq_id) const
 
void update_index_type_iq_id (const std::string &iq_name, iq_id_encap *iq_id)
 
void update_value_type_iq_id (const std::string &iq_name, iq_id_encap *iq_id)
 
void update_vector_iq_id (const std::string &iq_name, const VectorSpace::space_ptr_t &vec_space, EVecSpaceType vec_space_type, iq_id_encap *iq_id)
 

Private Types

typedef std::deque< iq_id_typeiq_vector_list_t
 

Private Member Functions

void update_vector_factories (EVecSpaceType vec_space_type, const vec_space_ptr_t &vec_space)
 
 NLPAlgoState (const NLPAlgoState &)
 
NLPAlgoStateoperator= (const NLPAlgoState &)
 

Private Attributes

vec_space_ptr_t space_range_
 
vec_space_ptr_t space_null_
 
iq_vector_list_t vector_iqs_lists_ [NUM_VEC_SPACE_TYPES]
 

Public Types

typedef Teuchos::RCP< const
VectorSpace > 
vec_space_ptr_t
 

Constructors/initializers

 STANDARD_COMPOSITION_MEMBERS (DecompositionSystem, decomp_sys)
 Set the DecompositionSystem object that all share. More...
 
 STANDARD_CONST_COMPOSITION_MEMBERS (VectorSpace, space_x)
 Set the VectorSpace of x. More...
 
 STANDARD_CONST_COMPOSITION_MEMBERS (VectorSpace, space_c)
 Set the VectorSpace of c. More...
 
void set_space_range (const vec_space_ptr_t &space_range)
 Set the VectorSpace of the range space (py). More...
 
vec_space_ptr_tget_space_range ()
 
const vec_space_ptr_tget_space_range () const
 
const VectorSpace & space_range () const
 
void set_space_null (const vec_space_ptr_t &space_null)
 Set the VectorSpace of the null space (pz). More...
 
vec_space_ptr_tget_space_null ()
 
const vec_space_ptr_tget_space_null () const
 
const VectorSpace & space_null () const
 
 NLPAlgoState (const decomp_sys_ptr_t &decomp_sys=Teuchos::null, const vec_space_ptr_t &space_x=Teuchos::null, const vec_space_ptr_t &space_c=Teuchos::null, const vec_space_ptr_t &space_range=Teuchos::null, const vec_space_ptr_t &space_null=Teuchos::null)
 Construct. More...
 
virtual ~NLPAlgoState ()
 

Decomposition information

Scaled KKT error for optimality ||rGL||

Scaled KKT error for feasibility ||c|| and ||hl <= h <= hu|| Scaled KKT error for complementarity (bounds) GL: Gradient of the Lagrangian ( n x 1 ) rGL: Reduced gradient of the Lagrangian ( (n-m) x 1 ) lambda: Lagrange multipliers for the equality constraints 'c' ( m x 1 ) nu: Difference between Lagrange multipiers for the upper and lower bounds ( n x 1 )

 STANDARD_MEMBER_COMPOSITION_MEMBERS (Range1D, var_dep)
 Range of dependent variables [1,r]. More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (Range1D, var_indep)
 Range of independent varaibles [r+1,n]. More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (Range1D, equ_decomp)
 Range of decomposed equality constraints [1,r]. More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (Range1D, equ_undecomp)
 Range of undecomposed equality constraints [r+1,m]. More...
 

Basis Pivot Info (variable reduction decompositions only)

 STANDARD_COMPOSITION_MEMBERS (Permutation, P_var_current)
 Current permutation for variables. More...
 
 STANDARD_COMPOSITION_MEMBERS (Permutation, P_var_last)
 Previous permutation for variables. More...
 
 STANDARD_COMPOSITION_MEMBERS (Permutation, P_equ_current)
 Current permutation for equality constraints. More...
 
 STANDARD_COMPOSITION_MEMBERS (Permutation, P_equ_last)
 Previous permutation for equality constraints. More...
 

Additional Inherited Members

- Public Types inherited from IterationPack::AlgorithmState
enum  { DOES_NOT_EXIST = INT_MAX }
 
typedef size_t iq_id_type
 
typedef Teuchos::RCP
< IterQuantity
IQ_ptr
 
- Public Member Functions inherited from IterationPack::AlgorithmState
virtual ~AlgorithmState ()
 
 AlgorithmState (size_t reserve_size=0)
 Construct with an initial guess for the number of iteration quantities. More...
 
void k (int k)
 
int k () const
 
int incr_k ()
 
virtual size_t num_iter_quant () const
 Return the number of iteration quantities. More...
 
virtual iq_id_type set_iter_quant (const std::string &iq_name, const IQ_ptr &iq)
 Inserts the iteration quantity through a RCP<...> object. More...
 
virtual void erase_iter_quant (const std::string &iq_name)
 Removes the iteration quantity with name iq_name. More...
 
virtual iq_id_type get_iter_quant_id (const std::string &iq_name) const
 Return the iteration quantity id (iq_id) for the iteration quantity. More...
 
virtual IQ_ptrget_iter_quant (iq_id_type iq_id)
 Returns the RCP<...> for the iteration quantiy with iq_id. More...
 
virtual const IQ_ptrget_iter_quant (iq_id_type iq_id) const
 
virtual IterQuantityiter_quant (const std::string &iq_name)
 Iteration quantity encapsulation object access with via iq_name. More...
 
virtual const IterQuantityiter_quant (const std::string &iq_name) const
 
virtual IterQuantityiter_quant (iq_id_type iq_id)
 Iteration quantity encapsulation object access via iq_id. More...
 
virtual const IterQuantityiter_quant (iq_id_type iq_id) const
 
virtual void next_iteration (bool incr_k=true)
 iteration quantity forwarding. More...
 
virtual void dump_iter_quant (std::ostream &out) const
 iteration quantity information dumping. More...
 

Detailed Description

Reduced space SQP state encapsulation interface.

This in an interface to a set of data specific to a reduced space SQP algorithms. The iteration quantites are abstracted within IterQuantityAccess<> objects. A set of boilerplate macros are used to add the necessary declarations and implemetations of these iteration quantity access functions. As shown by these macros the access methods are declared virtual so that subclasses can override these methods. Otherwise, much of these could have been declared inline.

The implementation defined in this class uses IterQuantityAccessContiguous<> for iteration quantities of type index_type, value_type and VectorMutable with a default of one storage location. The default implementation is able to create the VectorMutable iteration quantities by using VectorSpace objects that the client sets this up with.

For all other types of iteration quantities (i.e. MatrixOp etc.) the client is responsible for setting the iteration quantity object of type IterQuantityAccess<>. The client can also change the type of class used for any iteration quantity by simply calling AlgorithmState::set_iter_quant(...).

The number of storage locations for any iteration quantity of type IterQuantityAccessContiguous<> can be changed by fetching the iteration quantity using the access methods defined here and then using dynamic_cast<> and calling the IterQuantityAccessContiguous<>::resize(...) method.

Note that the underlying AlgorithmState object will not know about the iteration quantity objects with default implementations until the access functions have been called at least once.

ToDo: Finish documentation.

Definition at line 264 of file MoochoPack_NLPAlgoState.hpp.

Member Typedef Documentation

Definition at line 277 of file MoochoPack_NLPAlgoState.hpp.

Definition at line 527 of file MoochoPack_NLPAlgoState.hpp.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
NUM_VEC_SPACE_TYPES 

Definition at line 485 of file MoochoPack_NLPAlgoState.hpp.

Enumerator
VST_SPACE_X 
VST_SPACE_C 
VST_SPACE_RANGE 
VST_SPACE_NULL 

Definition at line 486 of file MoochoPack_NLPAlgoState.hpp.

Constructor & Destructor Documentation

MoochoPack::NLPAlgoState::NLPAlgoState ( const decomp_sys_ptr_t &  decomp_sys = Teuchos::null,
const vec_space_ptr_t space_x = Teuchos::null,
const vec_space_ptr_t space_c = Teuchos::null,
const vec_space_ptr_t space_range = Teuchos::null,
const vec_space_ptr_t space_null = Teuchos::null 
)

Construct.

Initializes num_basis() == 0

Definition at line 115 of file MoochoPack_NLPAlgoState.cpp.

virtual MoochoPack::NLPAlgoState::~NLPAlgoState ( )
inlinevirtual

Definition at line 340 of file MoochoPack_NLPAlgoState.hpp.

MoochoPack::NLPAlgoState::NLPAlgoState ( const NLPAlgoState )
private

Member Function Documentation

MoochoPack::NLPAlgoState::STANDARD_COMPOSITION_MEMBERS ( DecompositionSystem  ,
decomp_sys   
)

Set the DecompositionSystem object that all share.

MoochoPack::NLPAlgoState::STANDARD_CONST_COMPOSITION_MEMBERS ( VectorSpace  ,
space_x   
)

Set the VectorSpace of x.

MoochoPack::NLPAlgoState::STANDARD_CONST_COMPOSITION_MEMBERS ( VectorSpace  ,
space_c   
)

Set the VectorSpace of c.

void MoochoPack::NLPAlgoState::set_space_range ( const vec_space_ptr_t space_range)

Set the VectorSpace of the range space (py).

Calling this method will cause all of the vector iteration quantity objects set in this space to be updated with this vector space (factory) object.

Definition at line 103 of file MoochoPack_NLPAlgoState.cpp.

NLPAlgoState::vec_space_ptr_t & MoochoPack::NLPAlgoState::get_space_range ( )
inline

Definition at line 557 of file MoochoPack_NLPAlgoState.hpp.

const NLPAlgoState::vec_space_ptr_t & MoochoPack::NLPAlgoState::get_space_range ( ) const
inline

Definition at line 561 of file MoochoPack_NLPAlgoState.hpp.

const VectorSpace & MoochoPack::NLPAlgoState::space_range ( ) const
inline

Definition at line 565 of file MoochoPack_NLPAlgoState.hpp.

void MoochoPack::NLPAlgoState::set_space_null ( const vec_space_ptr_t space_null)

Set the VectorSpace of the null space (pz).

Calling this method will cause all of the vector iteration quantity objects set in this space to be updated with this vector space (factory) object.

Definition at line 109 of file MoochoPack_NLPAlgoState.cpp.

NLPAlgoState::vec_space_ptr_t & MoochoPack::NLPAlgoState::get_space_null ( )
inline

Definition at line 569 of file MoochoPack_NLPAlgoState.hpp.

const NLPAlgoState::vec_space_ptr_t & MoochoPack::NLPAlgoState::get_space_null ( ) const
inline

Definition at line 573 of file MoochoPack_NLPAlgoState.hpp.

const VectorSpace & MoochoPack::NLPAlgoState::space_null ( ) const
inline

Definition at line 577 of file MoochoPack_NLPAlgoState.hpp.

MoochoPack::NLPAlgoState::STANDARD_MEMBER_COMPOSITION_MEMBERS ( Range1D  ,
var_dep   
)

Range of dependent variables [1,r].

MoochoPack::NLPAlgoState::STANDARD_MEMBER_COMPOSITION_MEMBERS ( Range1D  ,
var_indep   
)

Range of independent varaibles [r+1,n].

MoochoPack::NLPAlgoState::STANDARD_MEMBER_COMPOSITION_MEMBERS ( Range1D  ,
equ_decomp   
)

Range of decomposed equality constraints [1,r].

MoochoPack::NLPAlgoState::STANDARD_MEMBER_COMPOSITION_MEMBERS ( Range1D  ,
equ_undecomp   
)

Range of undecomposed equality constraints [r+1,m].

MoochoPack::NLPAlgoState::STANDARD_COMPOSITION_MEMBERS ( Permutation  ,
P_var_current   
)

Current permutation for variables.

MoochoPack::NLPAlgoState::STANDARD_COMPOSITION_MEMBERS ( Permutation  ,
P_var_last   
)

Previous permutation for variables.

MoochoPack::NLPAlgoState::STANDARD_COMPOSITION_MEMBERS ( Permutation  ,
P_equ_current   
)

Current permutation for equality constraints.

MoochoPack::NLPAlgoState::STANDARD_COMPOSITION_MEMBERS ( Permutation  ,
P_equ_last   
)

Previous permutation for equality constraints.

void MoochoPack::NLPAlgoState::update_iq_id ( const std::string &  iq_name,
iq_id_encap iq_id 
) const
protected

Definition at line 186 of file MoochoPack_NLPAlgoState.cpp.

void MoochoPack::NLPAlgoState::update_index_type_iq_id ( const std::string &  iq_name,
iq_id_encap iq_id 
)
protected

Definition at line 201 of file MoochoPack_NLPAlgoState.cpp.

void MoochoPack::NLPAlgoState::update_value_type_iq_id ( const std::string &  iq_name,
iq_id_encap iq_id 
)
protected

Definition at line 231 of file MoochoPack_NLPAlgoState.cpp.

void MoochoPack::NLPAlgoState::update_vector_iq_id ( const std::string &  iq_name,
const VectorSpace::space_ptr_t &  vec_space,
EVecSpaceType  vec_space_type,
iq_id_encap iq_id 
)
protected

Definition at line 261 of file MoochoPack_NLPAlgoState.cpp.

void MoochoPack::NLPAlgoState::update_vector_factories ( EVecSpaceType  vec_space_type,
const vec_space_ptr_t vec_space 
)
private

Definition at line 294 of file MoochoPack_NLPAlgoState.cpp.

NLPAlgoState& MoochoPack::NLPAlgoState::operator= ( const NLPAlgoState )
private

Member Data Documentation

vec_space_ptr_t MoochoPack::NLPAlgoState::space_range_
private

Definition at line 532 of file MoochoPack_NLPAlgoState.hpp.

vec_space_ptr_t MoochoPack::NLPAlgoState::space_null_
private

Definition at line 533 of file MoochoPack_NLPAlgoState.hpp.

iq_vector_list_t MoochoPack::NLPAlgoState::vector_iqs_lists_[NUM_VEC_SPACE_TYPES]
private

Definition at line 535 of file MoochoPack_NLPAlgoState.hpp.


The documentation for this class was generated from the following files: