MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
AbstractLinAlgPack::BasisSystemComposite Class Reference

Simple BasisSystem subclass the case where the client sets up seperate C and N matrices. More...

#include <AbstractLinAlgPack_BasisSystemComposite.hpp>

Inheritance diagram for AbstractLinAlgPack::BasisSystemComposite:
Inheritance graph
[legend]

Public types

typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< MatrixOp > > 
fcty_Gc_ptr_t
 
typedef Teuchos::RCP
< MatrixOpNonsing
C_ptr_t
 
typedef Teuchos::RCP< MatrixOpN_ptr_t
 

Static member functions

static void initialize_space_x (const VectorSpace::space_ptr_t &space_xD, const VectorSpace::space_ptr_t &space_xI, Range1D *var_dep, Range1D *var_indep, VectorSpace::space_ptr_t *space_x)
 Initialize the composite vector space for x = [ xD; xI ] as well as var_dep and var_indep. More...
 
static const fcty_Gc_ptr_t factory_Gc ()
 Return a matrix factory object for the composte Gc matrix object. More...
 
static void initialize_Gc (const VectorSpace::space_ptr_t &space_x, const Range1D &var_dep, const Range1D &var_indep, const VectorSpace::space_ptr_t &space_c, const C_ptr_t &C, const N_ptr_t &N, MatrixOp *Gc)
 Initialize the Gc matrix object given created from space_Gc()->create(). More...
 
static void get_C_N (MatrixOp *Gc, MatrixOpNonsing **C, MatrixOp **N)
 Get the non-const aggregate matrices C and N (or NULL pointers if not initialized). More...
 
static void get_C_N (const MatrixOp &Gc, const MatrixOpNonsing **C, const MatrixOp **N)
 Get the const aggregate matrices C and N. More...
 

Constructors / initializers

 BasisSystemComposite ()
 
 BasisSystemComposite (const VectorSpace::space_ptr_t &space_x, const VectorSpace::space_ptr_t &space_c, const mat_nonsing_fcty_ptr_t &factory_C, const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S)
 Calls this->initialize() in a way that is consistant with above helper functions. More...
 
 BasisSystemComposite (const VectorSpace::space_ptr_t &space_x, const Range1D &var_dep, const Range1D &var_indep, const VectorSpace::space_ptr_t &space_c, const mat_nonsing_fcty_ptr_t &factory_C, const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S, const mat_fcty_ptr_t &factory_D=Teuchos::null)
 Calls this->initialize() More...
 
void initialize (const VectorSpace::space_ptr_t &space_x, const Range1D &var_dep, const Range1D &var_indep, const VectorSpace::space_ptr_t &space_c, const mat_nonsing_fcty_ptr_t &factory_C, const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S, const mat_fcty_ptr_t &factory_D=Teuchos::null)
 Initialize. More...
 
virtual void set_uninitialized ()
 Set uninitialized. More...
 

Access

const VectorSpace::space_ptr_tspace_x () const
 
const VectorSpace::space_ptr_tspace_c () const
 

To be overridden by subclasses

virtual void update_D (const MatrixOpNonsing &C, const MatrixOp &N, MatrixOp *D, EMatRelations mat_rel) const
 Overridden by subclasses to update D if a specialized implementation is needed. More...
 

Overridden from BasisSystem

const mat_nonsing_fcty_ptr_t factory_C () const
 
const mat_fcty_ptr_t factory_D () const
 
Range1D var_dep () const
 
Range1D var_indep () const
 
void update_basis (const MatrixOp &Gc, MatrixOpNonsing *C, MatrixOp *D, MatrixOp *GcUP, EMatRelations mat_rel, std::ostream *out) const
 

Additional Inherited Members

- Public Types inherited from AbstractLinAlgPack::BasisSystem
enum  EMatRelations { MATRICES_INDEP_IMPS, MATRICES_ALLOW_DEP_IMPS }
 
typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< MatrixOpNonsing > > 
mat_nonsing_fcty_ptr_t
 
typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< MatrixOp > > 
mat_fcty_ptr_t
 
typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< MatrixSymOp > > 
mat_sym_fcty_ptr_t
 
typedef Teuchos::RCP< const
Teuchos::AbstractFactory
< MatrixSymOpNonsing > > 
mat_sym_nonsing_fcty_ptr_t
 
- Public Member Functions inherited from AbstractLinAlgPack::BasisSystem
 BasisSystem (const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S)
 Required constructor (calls initialize()). More...
 
virtual void initialize (const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S)
 Initialize the factory objects for the special matrices for D'*D and S = I + D'*D. More...
 
virtual ~BasisSystem ()
 
virtual const mat_fcty_ptr_t factory_GcUP () const
 Return a matrix factory object for auxiliary sensitivity matrix GcUP = Gc(var_indep,equ_undecomp)' + Gc(var_dep,equ_undecomp)'*D. More...
 
virtual const mat_sym_fcty_ptr_t factory_transDtD () const
 Returns a matrix factory for the result of J = D'*D More...
 
virtual const
mat_sym_nonsing_fcty_ptr_t 
factory_S () const
 Returns a matrix factory for the result of S = I + D'*D More...
 
virtual Range1D equ_decomp () const
 Range of decomposed general equality constraints. More...
 
virtual Range1D equ_undecomp () const
 Range of undecomposed general equality constriants. More...
 

Detailed Description

Simple BasisSystem subclass the case where the client sets up seperate C and N matrices.

This interface is based an implementation where C and N are manipulated by the application and are concatenated into Gc = [ C'; N' ]. Here, there are no undecomposed equality constraints allowed.

For this implementation, the basis matrix C must override the method MatrixOp::operator=() for correct behavior. A smart implementation of the basis matrix subclass will use lazy evaluation and not copy data inside of MatrixOp::operator=() unless necessary later on.

Definition at line 60 of file AbstractLinAlgPack_BasisSystemComposite.hpp.

Member Typedef Documentation

Definition at line 69 of file AbstractLinAlgPack_BasisSystemComposite.hpp.

Definition at line 71 of file AbstractLinAlgPack_BasisSystemComposite.hpp.

Definition at line 73 of file AbstractLinAlgPack_BasisSystemComposite.hpp.

Constructor & Destructor Documentation

AbstractLinAlgPack::BasisSystemComposite::BasisSystemComposite ( )

Default constructor.

Definition at line 291 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

AbstractLinAlgPack::BasisSystemComposite::BasisSystemComposite ( const VectorSpace::space_ptr_t space_x,
const VectorSpace::space_ptr_t space_c,
const mat_nonsing_fcty_ptr_t factory_C,
const mat_sym_fcty_ptr_t factory_transDtD,
const mat_sym_nonsing_fcty_ptr_t factory_S 
)

Calls this->initialize() in a way that is consistant with above helper functions.

Definition at line 295 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

AbstractLinAlgPack::BasisSystemComposite::BasisSystemComposite ( const VectorSpace::space_ptr_t space_x,
const Range1D var_dep,
const Range1D var_indep,
const VectorSpace::space_ptr_t space_c,
const mat_nonsing_fcty_ptr_t factory_C,
const mat_sym_fcty_ptr_t factory_transDtD,
const mat_sym_nonsing_fcty_ptr_t factory_S,
const mat_fcty_ptr_t factory_D = Teuchos::null 
)

Calls this->initialize()

Definition at line 312 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

Member Function Documentation

void AbstractLinAlgPack::BasisSystemComposite::initialize_space_x ( const VectorSpace::space_ptr_t space_xD,
const VectorSpace::space_ptr_t space_xI,
Range1D var_dep,
Range1D var_indep,
VectorSpace::space_ptr_t space_x 
)
static

Initialize the composite vector space for x = [ xD; xI ] as well as var_dep and var_indep.

Parameters
space_xD[in/out] Vector space for the dependent variables. On output space_xD.count() will be incremented by 1.
space_xI[in/out] Vector space for the independent variables. It is allowed for space_xI.get()==NULL in which case there are no independent variables. If space_xI.get()!=NULL then on output space_xI.count() will be incremented by 1.
var_dep[out] Range for dependent variables in output space_x
var_indep[out] Range for independent variables in output space_x. Only applicable if space_xI.get()!=NULL.
space_x[out] If space_xI.get()!=NULL then on output this will be the newly formed composite vector space space_x = [ space_xD; space_xI ]. The object *space_x will be dependent on the objects *space_xD *space_xI. If the client wants *space_x to be independent from these vector space objects then space_x->clone() can be used. If space_xI.get()==NULL then on output *space_x=space_xD will just be performed.

Preconditions:

  • space_xD.get() != NULL (throw std::invalid_argument)
  • var_dep != NULL (throw std::invalid_argument)
  • [space_xI.get() != NULL] var_indep != NULL (throw std::invalid_argument)

Postconditions:

  • var_dep->size() == space_xD->dim()
  • [space_xI.get()!=NULL] var_indep->size() == space_xI->dim()
  • [space_xI.get()!=NULL] var_dep and var_indep are non-overlapping ranges.
  • [space_xI.get()!=NULL] space_x->dim() == var_dep->size() + var_indep->size() [space_xI.get()!=NULL] space_x->sub_space(*var_dep).get() == space_xD.get() [space_xI.get()!=NULL] space_x->sub_space(*var_indep).get() == space_xI.get()
  • [space_xI.get()==NULL] space_x->dim() == var_dep->size() [space_xI.get()-=NULL] space_x->sub_space(*var_dep).get() == space_xD.get()

Definition at line 86 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

const BasisSystemComposite::fcty_Gc_ptr_t AbstractLinAlgPack::BasisSystemComposite::factory_Gc ( )
static

Return a matrix factory object for the composte Gc matrix object.

Definition at line 123 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::initialize_Gc ( const VectorSpace::space_ptr_t space_x,
const Range1D var_dep,
const Range1D var_indep,
const VectorSpace::space_ptr_t space_c,
const C_ptr_t C,
const N_ptr_t N,
MatrixOp Gc 
)
static

Initialize the Gc matrix object given created from space_Gc()->create().

Initializes the composite matrix object:

Gc = [ C'; N' ]
Parameters
space_x[in] Vector space for the variables (returned from initialize_space_x()).
var_dep[in] Range for dependent variables in space_x.
var_indep[in] Range for independent variables in space_x.
space_c[in] Vector space for the equality constraints.
C[in/out] Nonsingular basis matrix, initialized and ready to go. On output C.count() will be incremented by 1.
N[in/out] Non-basis matrix, initialized and ready to go. On output N.count() will be incremented by 1.
Gc[in/out] Composite matrix object that on output is initialized with. C and N.

Preconditions:

  • space_x.get() != NULL (throw std::invalid_argument)
  • space_c.get() != NULL (throw std::invalid_argument)
  • C.get() != NULL (throw std::invalid_argument)
  • [space_x->dim() > space_c->dim()] N.get() != NULL (throw std::invalid_argument)
  • [space_x->dim() == space_c->dim()] N.get() == NULL (throw std::invalid_argument)
  • Gc != NULL (throw std::invalid_argument)

Postconditions:

  • &return->space_cols() == space_x.get()
  • &return->space_rows() == space_c.get()
  • ToDo: Finish!

Definition at line 129 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::get_C_N ( MatrixOp Gc,
MatrixOpNonsing **  C,
MatrixOp **  N 
)
static

Get the non-const aggregate matrices C and N (or NULL pointers if not initialized).

Parameters
Gc[in] Composite matrix object Gc = [ C'; N' ]
C[out] Pointer to basis matrix object C. If Gc has not been initialized then *C == NULL on output.
N[out] Pointer to nonbasis matrix object N. If Gc has not been initialized then *N == NULL on output. Preconditions:
  • Gc != NULL (throw std::invalid_argument)
  • C != NULL (throw std::invalid_argument)
  • [Gc->rows() < Gc->cols()] N != NULL (throw std::invalid_argument)
  • [Gc->rows() == Gc->cols()] N == NULL (throw std::invalid_argument)

Definition at line 201 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::get_C_N ( const MatrixOp Gc,
const MatrixOpNonsing **  C,
const MatrixOp **  N 
)
static

Get the const aggregate matrices C and N.

Parameters
Gc[in] Composite matrix object Gc = [ C'; N' ]. If this matrix object has not been initialized with C and N matrix objects then an exception is thown.
C[out] Pointer to basis matrix object C.
N[out] Pointer to nonbasis matrix object N.

Preconditions:

  • Gc is setup with non-null C and N matrix objects (throw std::logic_error).
  • C != NULL (throw std::invalid_argument)
  • [Gc->rows() < Gc->cols()] N != NULL (throw std::invalid_argument)
  • [Gc->rows() == Gc->cols()] N == NULL (throw std::invalid_argument)

Definition at line 247 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::initialize ( const VectorSpace::space_ptr_t space_x,
const Range1D var_dep,
const Range1D var_indep,
const VectorSpace::space_ptr_t space_c,
const mat_nonsing_fcty_ptr_t factory_C,
const mat_sym_fcty_ptr_t factory_transDtD,
const mat_sym_nonsing_fcty_ptr_t factory_S,
const mat_fcty_ptr_t factory_D = Teuchos::null 
)

Initialize.

Parameters
space_x[in] Smart pointer to vector space for x.
var_dep[in] Range for dependent variables xD.
var_indep[in] Range for independent variables xI.
factory_C[in] Smart pointer to factory object for basis matrix C.
factory_transDtD[in] Smart point to the factory object for the matrix J = D'*D. Only valid if var_dep.size() < space_x->dim().
factory_S[in] Smart point to the factory object for the matrix S = I + D'*D. Only valid if var_dep.size() < space_x->dim().
factory_D[in] Smart pointer to factory object for direct sensitivity matrix D. If factory_D == NULL then an AbstractFactoryStd<> object will be used which calls space_xD->create_members(space_xI->dim()). which in turn of course creates MultiVectorMutable objects. Only valid if var_dep.size() < space_x->dim().

Preconditions:

  • space_xD.get() != NULL (throw std::invalid_argument)
  • space_xI.get() != NULL (throw std::invalid_argument)
  • factory_C.get() != NULL (throw std::invalid_argument)
  • [var_dep.size() < space_x->dim()] factory_S.get() != NULL (throw std::invalid_argument)

Postconditions:

  • this->var_dep() == [1,space_xD->dim()]
  • [var_dep.size() < space_x->dim()] this->var_indep() == [space_xD->dim()+1,space_xD->dim()+space_xI->dim()
  • this->equ_decomp() == [1,space_xD->dim()]
  • this->equ_undecomp().size() == 0
  • this->factory_C().get() != NULL
  • [var_dep.size() < space_x->dim()] this->factory_S().get() == factory_S.get()
  • [var_dep.size() == space_x->dim()] this->factory_S().get() == NULL
  • [var_dep.size() < space_x->dim()] this->factory_D().get() != NULL
  • [var_dep.size() == space_x->dim()] this->factory_D().get() == NULL

Definition at line 330 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::set_uninitialized ( )
virtual

Set uninitialized.

Postconditions:

Definition at line 381 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

const VectorSpace::space_ptr_t & AbstractLinAlgPack::BasisSystemComposite::space_x ( ) const

Definition at line 393 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

const VectorSpace::space_ptr_t & AbstractLinAlgPack::BasisSystemComposite::space_c ( ) const

Definition at line 399 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

void AbstractLinAlgPack::BasisSystemComposite::update_D ( const MatrixOpNonsing C,
const MatrixOp N,
MatrixOp D,
EMatRelations  mat_rel 
) const
virtual

Overridden by subclasses to update D if a specialized implementation is needed.

The default implementation just relies on the MultiVectorMutable interface and the M_StInvMtV() method.

Definition at line 406 of file AbstractLinAlgPack_BasisSystemComposite.cpp.

const BasisSystem::mat_nonsing_fcty_ptr_t AbstractLinAlgPack::BasisSystemComposite::factory_C ( ) const
virtual
const BasisSystem::mat_fcty_ptr_t AbstractLinAlgPack::BasisSystemComposite::factory_D ( ) const
virtual
Range1D AbstractLinAlgPack::BasisSystemComposite::var_dep ( ) const
virtual
Range1D AbstractLinAlgPack::BasisSystemComposite::var_indep ( ) const
virtual
void AbstractLinAlgPack::BasisSystemComposite::update_basis ( const MatrixOp Gc,
MatrixOpNonsing C,
MatrixOp D,
MatrixOp GcUP,
EMatRelations  mat_rel,
std::ostream *  out 
) const
virtual

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