ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
ConstrainedOptPack::DecompositionSystemVarReductImp Class Referenceabstract

Specialization node implementation subclass of DecompositionSystem for variable reduction decompositions. More...

#include <ConstrainedOptPack_DecompositionSystemVarReductImp.hpp>

Inheritance diagram for ConstrainedOptPack::DecompositionSystemVarReductImp:
Inheritance graph
[legend]

Public Member Functions

void initialize (const VectorSpace::space_ptr_t &space_x, const VectorSpace::space_ptr_t &space_c, const basis_sys_ptr_t &basis_sys)
 Initialize. More...
 
- Public Member Functions inherited from ConstrainedOptPack::DecompositionSystemVarReduct
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EExplicitImplicit, D_imp)
 Set whether to use explicit or implicit D = -inv(C)*N matrix. More...
 
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EExplicitImplicit, Uz_imp)
 Set whether to use explicit or implicit Uz = F + E * D matrix. More...
 
 DecompositionSystemVarReduct (EExplicitImplicit D_imp=MAT_IMP_AUTO, EExplicitImplicit Uz_imp=MAT_IMP_AUTO)
 
- Public Member Functions inherited from ConstrainedOptPack::DecompositionSystem
virtual ~DecompositionSystem ()
 
virtual Range1D equ_decomp () const
 Returns the range of the decomposed equalities. More...
 
virtual Range1D equ_undecomp () const
 Returns the range of the undecomposed equalities. More...
 
virtual const mat_fcty_ptr_t factory_Y () const =0
 Return a matrix factory object for Y More...
 
virtual const
mat_nonsing_fcty_ptr_t 
factory_R () const =0
 Return a matrix factory object for R. More...
 
virtual const mat_fcty_ptr_t factory_Uy () const =0
 Return a matrix factory object for Uy More...
 

Protected Member Functions

virtual void update_D_imp_used (EExplicitImplicit *D_imp_used) const
 Update D_imp_used. More...
 
virtual
mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t 
uninitialize_matrices (std::ostream *out, EOutputLevel olevel, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uy) const =0
 Overridden by subclasses to uninitialized Y, R and Uy then return C if referenced. More...
 
virtual void initialize_matrices (std::ostream *out, EOutputLevel olevel, const mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t &C_ptr, const mat_fcty_ptr_t::element_type::obj_ptr_t &D_ptr, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uy, EMatRelations mat_rel) const =0
 Overridden by subclasses to initialize Y, R and Uy given C and D. More...
 
virtual void print_update_matrices (std::ostream &out, const std::string &leading_str) const =0
 Print the sub-algorithm by which the matrices Y, R, Uy and Uy are updated. More...
 

Public types

typedef DecompositionSystem inherited
 
typedef Teuchos::RCP< const
BasisSystem > 
basis_sys_ptr_t
 

Constructors / initializers

 STANDARD_COMPOSITION_MEMBERS (BasisSystemTester, basis_sys_tester)
 Set the BasisSystem tester object. More...
 
 DecompositionSystemVarReductImp (const VectorSpace::space_ptr_t &space_x, const VectorSpace::space_ptr_t &space_c, const basis_sys_ptr_t &basis_sys, const basis_sys_tester_ptr_t &basis_sys_tester, EExplicitImplicit D_imp, EExplicitImplicit Uz_imp)
 Construct a variable reduction decomposition. More...
 

Access

const VectorSpace::space_ptr_t & space_x () const
 
const VectorSpace::space_ptr_t & space_c () const
 
const basis_sys_ptr_tbasis_sys () const
 

Basis manipulation

void get_basis_matrices (std::ostream *out, EOutputLevel olevel, ERunTests test_what, MatrixOp *Z, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uz, MatrixOp *Uy, Teuchos::RCP< MatrixOpNonsing > *C_ptr, Teuchos::RCP< MatrixOp > *D_ptr)
 Called by client to uninitialize decomposition matrices in prepairation for selecting a different basis. More...
 
void set_basis_matrices (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Teuchos::RCP< MatrixOpNonsing > &C_ptr, const Teuchos::RCP< MatrixOp > &D_ptr, MatrixOp *Uz, const basis_sys_ptr_t &basis_sys=Teuchos::null)
 Set updated basis matrices along with a possibly updated basis system object. More...
 
EExplicitImplicit D_imp_used () const
 Get the type of D matrix to be used or is being used (returns MAT_IMP_EXPLICIT or MAT_IMP_IMPLICIT only). More...
 

Overridden from DecompositionSystem

size_type n () const
 Returns this->space_x()->dim(). More...
 
size_type m () const
 Returns this->space_c()->dim(). More...
 
size_type r () const
 Returns this->basis_sys()->equ_decomp().size(). More...
 
const VectorSpace::space_ptr_t space_range () const
 Returns this->space_x()->sub_space(var_dep) More...
 
const VectorSpace::space_ptr_t space_null () const
 Returns this->space_x()->sub_space(var_indep) More...
 
const mat_fcty_ptr_t factory_Z () const
 
const mat_fcty_ptr_t factory_Uz () const
 
void update_decomp (std::ostream *out, EOutputLevel olevel, ERunTests test_what, const MatrixOp &Gc, MatrixOp *Z, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uz, MatrixOp *Uy, EMatRelations mat_rel) const
 Preconditions: More...
 
void print_update_decomp (std::ostream &out, const std::string &leading_str) const
 

Overridden from DecompositionSystemVarReduct

Range1D var_indep () const
 
Range1D var_dep () const
 

Detailed Description

Specialization node implementation subclass of DecompositionSystem for variable reduction decompositions.

This interface abstracts a variable reduction decomposition where:

 Gc' = [ C  N ] 
       [ E  F ]

 Z   = [ D ]
       [ I ]

 Uz  = F + E * D

     where:
          C = Gc(var_dep,equ_decomp)'     [nonsingular]
          N = Gc(var_indep,equ_decomp)'
          E = Gc(var_dep,equ_undecomp)'
          F = Gc(var_indep,equ_undecomp)'
          D = -inv(C) * N

Above, C is a r x r nonsingular matrix. Subclasses define how Y is defined which in turn determines how R and Uy are defined.

The implementation of this subclass is completly determined by an aggregate BasisSytem object. Since the BasisSystem interface does not allow any permutations of the basis to be performed ???.

Subclass implementors notes:

It is up to subclasses to override factory_R() and factory_Uy() in order to define the types for R and Uy respectively.

ToDo: Finish documentation!

Definition at line 92 of file ConstrainedOptPack_DecompositionSystemVarReductImp.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

ConstrainedOptPack::DecompositionSystemVarReductImp::DecompositionSystemVarReductImp ( const VectorSpace::space_ptr_t &  space_x,
const VectorSpace::space_ptr_t &  space_c,
const basis_sys_ptr_t basis_sys,
const basis_sys_tester_ptr_t &  basis_sys_tester,
EExplicitImplicit  D_imp,
EExplicitImplicit  Uz_imp 
)

Construct a variable reduction decomposition.

Calls this->initialize().

Preconditions:

  • ???

Postconditions:

Definition at line 55 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

Member Function Documentation

ConstrainedOptPack::DecompositionSystemVarReductImp::STANDARD_COMPOSITION_MEMBERS ( BasisSystemTester  ,
basis_sys_tester   
)

Set the BasisSystem tester object.

void ConstrainedOptPack::DecompositionSystemVarReductImp::initialize ( const VectorSpace::space_ptr_t &  space_x,
const VectorSpace::space_ptr_t &  space_c,
const basis_sys_ptr_t basis_sys 
)

Initialize.

Parameters
space_x[in] DVector space for variables x.
space_c[in] DVector space for general equalities c.
basis_sys[in] The BasisSystem object that defines the variable reduction that the decomposition is based on. This object must be fully initialized before this method is called. The object *basis_sys must not be altered while this is still using it. It is allowed for basis_sys.get() == NULL in which case this will not be fully initialized.

Preconditions:

  • ToDo: Spell these out!

Postconditions:

  • ToDo: Spell these out!

Definition at line 70 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

const VectorSpace::space_ptr_t& ConstrainedOptPack::DecompositionSystemVarReductImp::space_x ( ) const

const VectorSpace::space_ptr_t& ConstrainedOptPack::DecompositionSystemVarReductImp::space_c ( ) const

const basis_sys_ptr_t& ConstrainedOptPack::DecompositionSystemVarReductImp::basis_sys ( ) const

void ConstrainedOptPack::DecompositionSystemVarReductImp::get_basis_matrices ( std::ostream *  out,
EOutputLevel  olevel,
ERunTests  test_what,
MatrixOp *  Z,
MatrixOp *  Y,
MatrixOpNonsing *  R,
MatrixOp *  Uz,
MatrixOp *  Uy,
Teuchos::RCP< MatrixOpNonsing > *  C_ptr,
Teuchos::RCP< MatrixOp > *  D_ptr 
)

Called by client to uninitialize decomposition matrices in prepairation for selecting a different basis.

Parameters
Z[in/out] On output, Z will have all references to C and D removed.
Y[in/out] On output, Y will have all references to C and D removed.
R[in/out] On output, R will have all references to C and D removed.
Uz[in/out] If this->Uz_imp() == MAT_IMP_IMPLICIT then on output, Uz will have all references to C and D removed. If this->Uz_imp() == MAT_IMP_EXPLICIT then Uz will be unaltered and it is expected that the client will initialize it properly before the next call to this->set_basis_matrices().
Uy[in/out] On output, Uy will have all references to C and D removed.
C_ptr[out] On output, C_ptr->get() != NULL will point to the basis matrix to be updated by the client before the next call to this->set_basis_matrices(). It is guarrenteed that *C_ptr->get() will not be referenced by any other entity so that changing the basis matrix object will not impact other objects in unexpected ways.
D_ptr[out] If this->D_imp() == MAT_IMP_IMPLICIT then on output, D_ptr == NULL must be true. If this->D_imp() == MAT_IMP_EXPLICIT then D_ptr->get() != NULL will point to the direct sensitivity matrix and it is expected that the client will initialize it properly before the next call to this->set_basis_matrices(). It is guarrenteed that *D_ptr->get() will not be referenced by any other entity so that changing the basis matrix object will not impact other objects in unexpected ways.

Preconditions:

  • [this->D_imp() == MAT_IMP_IMPLICIT] D_ptr == NULL (throw std::invalid_argument)
  • [this->D_imp() == MAT_IMP_EXPLICIT] D_ptr != NULL (throw std::invalid_argument)

Postconditions:

  • C_ptr->get() != NULL
  • [this->D_imp() == MAT_IMP_EXPLICIT] D_ptr->get() != NULL

Definition at line 114 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

void ConstrainedOptPack::DecompositionSystemVarReductImp::set_basis_matrices ( std::ostream *  out,
EOutputLevel  olevel,
ERunTests  test_what,
const Teuchos::RCP< MatrixOpNonsing > &  C_ptr,
const Teuchos::RCP< MatrixOp > &  D_ptr,
MatrixOp *  Uz,
const basis_sys_ptr_t basis_sys = Teuchos::null 
)

Set updated basis matrices along with a possibly updated basis system object.

Parameters
C_ptr[in] C_ptr.get() points to basis matrix object returned from this->uninitialize_matrices() which must be updated to current basis for current Jacobian matrices.
D_ptr[in] If this->D_imp() == MAT_IMP_EXPLICIT, then D_ptr->get() points to direct sensitivity matrix object returned from this->uninitialize_matrices() which must be updated to current basis for current Jacobian matrices. If this->D_imp() == MAT_IMP_IMPLICIT then D_ptr must be NULL.
Uz[in] If this->D_imp() == MAT_IMP_EXPLICIT, then Uz points to the projected sensitivity matrix Uz which must be updated for the current basis for the current Jacobian matrices. If this->Uz_imp() == MAT_IMP_IMPLICIT then Uz must be NULL.
basis_sys[in] If the basis system has changed then set basis_sys.get() != NULL to pass in this new basis system object.

Preconditions:

  • C_ptr.get() != NULL (throw std::invalid_argument)
  • [this->D_imp() == MAT_IMP_IMPLICIT] D_ptr == NULL (throw std::invalid_argument)
  • [this->D_imp() == MAT_IMP_EXPLICIT] D_ptr != NULL (throw std::invalid_argument)
  • [this->D_imp() == MAT_IMP_EXPLICIT] D_ptr->get() != NULL (throw std::invalid_argument)

It is expected that immediatly after this method is called that this->updated_decomp() will be called to update the rest of the decomposition matrices for these basis matrices.

Definition at line 284 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

DecompositionSystemVarReductImp::EExplicitImplicit ConstrainedOptPack::DecompositionSystemVarReductImp::D_imp_used ( ) const
inline

Get the type of D matrix to be used or is being used (returns MAT_IMP_EXPLICIT or MAT_IMP_IMPLICIT only).

Definition at line 433 of file ConstrainedOptPack_DecompositionSystemVarReductImp.hpp.

size_type ConstrainedOptPack::DecompositionSystemVarReductImp::n ( ) const
virtual

Returns this->space_x()->dim().

Reimplemented from ConstrainedOptPack::DecompositionSystem.

Definition at line 306 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

size_type ConstrainedOptPack::DecompositionSystemVarReductImp::m ( ) const
virtual

Returns this->space_c()->dim().

Implements ConstrainedOptPack::DecompositionSystem.

Definition at line 314 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

size_type ConstrainedOptPack::DecompositionSystemVarReductImp::r ( ) const
virtual

Returns this->basis_sys()->equ_decomp().size().

Reimplemented from ConstrainedOptPack::DecompositionSystem.

Definition at line 322 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

const VectorSpace::space_ptr_t ConstrainedOptPack::DecompositionSystemVarReductImp::space_range ( ) const
virtual

Returns this->space_x()->sub_space(var_dep)

Implements ConstrainedOptPack::DecompositionSystem.

const VectorSpace::space_ptr_t ConstrainedOptPack::DecompositionSystemVarReductImp::space_null ( ) const
virtual

Returns this->space_x()->sub_space(var_indep)

Implements ConstrainedOptPack::DecompositionSystem.

const DecompositionSystem::mat_fcty_ptr_t ConstrainedOptPack::DecompositionSystemVarReductImp::factory_Z ( ) const
virtual
const DecompositionSystem::mat_fcty_ptr_t ConstrainedOptPack::DecompositionSystemVarReductImp::factory_Uz ( ) const
virtual
void ConstrainedOptPack::DecompositionSystemVarReductImp::update_decomp ( std::ostream *  out,
EOutputLevel  olevel,
ERunTests  test_what,
const MatrixOp &  Gc,
MatrixOp *  Z,
MatrixOp *  Y,
MatrixOpNonsing *  R,
MatrixOp *  Uz,
MatrixOp *  Uy,
EMatRelations  mat_rel 
) const
virtual

Preconditions:

  • this->space_x().get() != NULL (throw std::logic_error)
  • this->space_c().get() != NULL (throw std::logic_error)
  • [test_what == TEST] this->basis_sys_tester().get() != NULL (throw std::logic_error)

Implements ConstrainedOptPack::DecompositionSystem.

Definition at line 361 of file ConstrainedOptPack_DecompositionSystemVarReductImp.cpp.

void ConstrainedOptPack::DecompositionSystemVarReductImp::print_update_decomp ( std::ostream &  out,
const std::string &  leading_str 
) const
virtual
Range1D ConstrainedOptPack::DecompositionSystemVarReductImp::var_indep ( ) const
virtual
Range1D ConstrainedOptPack::DecompositionSystemVarReductImp::var_dep ( ) const
virtual
void ConstrainedOptPack::DecompositionSystemVarReductImp::update_D_imp_used ( EExplicitImplicit D_imp_used) const
protectedvirtual
virtual mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t ConstrainedOptPack::DecompositionSystemVarReductImp::uninitialize_matrices ( std::ostream *  out,
EOutputLevel  olevel,
MatrixOp *  Y,
MatrixOpNonsing *  R,
MatrixOp *  Uy 
) const
protectedpure virtual

Overridden by subclasses to uninitialized Y, R and Uy then return C if referenced.

Note that the returned smart pointer to C may have return.has_ownership() == false in which case this will not be a shared resource with any other object (at least not on this level).

ToDo: Finish documentatation! `

Implemented in ConstrainedOptPack::DecompositionSystemOrthogonal, and ConstrainedOptPack::DecompositionSystemCoordinate.

virtual void ConstrainedOptPack::DecompositionSystemVarReductImp::initialize_matrices ( std::ostream *  out,
EOutputLevel  olevel,
const mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t &  C_ptr,
const mat_fcty_ptr_t::element_type::obj_ptr_t &  D_ptr,
MatrixOp *  Y,
MatrixOpNonsing *  R,
MatrixOp *  Uy,
EMatRelations  mat_rel 
) const
protectedpure virtual

Overridden by subclasses to initialize Y, R and Uy given C and D.

If C_ptr.has_ownership() == false, then the subclass implementation of this method will use clone_mwons() to clone it so that the output matrices are independent.

ToDo: Finish documentatation! `

Implemented in ConstrainedOptPack::DecompositionSystemOrthogonal, and ConstrainedOptPack::DecompositionSystemCoordinate.

virtual void ConstrainedOptPack::DecompositionSystemVarReductImp::print_update_matrices ( std::ostream &  out,
const std::string &  leading_str 
) const
protectedpure virtual

Print the sub-algorithm by which the matrices Y, R, Uy and Uy are updated.

ToDo: Finish documentatation!

Implemented in ConstrainedOptPack::DecompositionSystemOrthogonal, and ConstrainedOptPack::DecompositionSystemCoordinate.


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