#include <AbstractLinAlgPack_BasisSystem.hpp>
Inheritance diagram for AbstractLinAlgPack::BasisSystem:
Public types | |
| typedef Teuchos::RefCountPtr< const Teuchos::AbstractFactory< MatrixOpNonsing > > | mat_nonsing_fcty_ptr_t |
| | |
| typedef Teuchos::RefCountPtr< const Teuchos::AbstractFactory< MatrixOp > > | mat_fcty_ptr_t |
| | |
| typedef Teuchos::RefCountPtr< const Teuchos::AbstractFactory< MatrixSymOp > > | mat_sym_fcty_ptr_t |
| | |
| typedef Teuchos::RefCountPtr< const Teuchos::AbstractFactory< MatrixSymOpNonsing > > | mat_sym_nonsing_fcty_ptr_t |
| | |
| enum | EMatRelations |
| More... | |
Matrix factories | |
| virtual const mat_nonsing_fcty_ptr_t | factory_C () const =0 |
Return a matrix factory object for basis C = [ Gc(var_dep,equ_decomp)'; Gh(var_dep,inequ_decomp)' ]. | |
| virtual const mat_fcty_ptr_t | factory_D () const =0 |
Return a matrix factory object for sensitivity matrix D = -inv(C)*N. | |
| 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. | |
| virtual const mat_sym_fcty_ptr_t | factory_transDtD () const |
Returns a matrix factory for the result of J = D'*D. | |
| virtual const mat_sym_nonsing_fcty_ptr_t | factory_S () const |
Returns a matrix factory for the result of S = I + D'*D. | |
Return the ranges for variable and constraint partitioning | |
| virtual Range1D | var_dep () const =0 |
| Range of dependent (basic) variables. | |
| virtual Range1D | var_indep () const =0 |
| Range of independnet (nonbasic) variables. | |
| virtual Range1D | equ_decomp () const |
| Range of decomposed general equality constraints. | |
| virtual Range1D | equ_undecomp () const |
| Range of undecomposed general equality constriants. | |
Update matrices | |
| virtual void | update_basis (const MatrixOp &Gc, MatrixOpNonsing *C, MatrixOp *D, MatrixOp *GcUP, EMatRelations mat_rel=MATRICES_INDEP_IMPS, std::ostream *out=NULL) const =0 |
| Update a basis and posssibly the direct sensitivity matrix for a set of Jacobian matrices. | |
Public Member Functions | |
| BasisSystem (const mat_sym_fcty_ptr_t &factory_transDtD, const mat_sym_nonsing_fcty_ptr_t &factory_S) | |
Required constructor (calls initialize()). | |
| 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. | |
| virtual | ~BasisSystem () |
| | |
Overview:
This interface is designed to take the Jacobian for a sub-set of equality constraints
and to create a basis matrix. Assume we have the folloing linealrized equality constraints:
The C++ identifier given to
is Gc.
In this basis interface we will assume that d, c and h are sorted such that we define the following sets (given the partitioning matrices
,
, ):
d(var_dep) (
) : Dependent (i.e. basis) variables. d(var_indep) (
) : Independent (i.e. nonbasic) variables. c(equ_decomp) (
) : Decomposed equality constriants. c(equ_undecomp) (
): Undecomposed equality constriants.
C = Gc(var_dep,equ_decomp)'
N = Gc(var_indep,equ_decomp)'
D:
D = -inv(C)*N
GcUP = Gc(var_indep,equ_undecomp)' + Gc(var_dep,equ_undecomp)' * D
This interface allows a client to create the basis matrix C and optionally the direct sensitivity matrix D = -inv(C)*N and the auxiliary projected sensistivity matrix GcUP (shown above). These matrix objects are independent from this BasisSystem object or from other C, D, or GcUP objects. Therefore, a BasisSystem object can be thought of as an "Abstract Factory" for basis matrices and auxillary matrices. Note that a BasisSystem object will not compute the matrices D, GcUP unless specifically asked.
Note that the purpose of this interface is to abstract client code away from the details of how the matrix Gc is represented and implemented and how the basis matrix C is formed and implemented. The complexity of these matrices could vary from simple dense serial matrices all the way up massively parallel matrices using iterative solvers for C running on computers with thousands of nodes.
This interface also allows clients to compute the matrices J = D'*D and S = I + D'*D.
Client usage:
The matrix objects for C, D, GcUP, D'*D and S=I+D'*D are created by the client using the AbstractFactory<> objects returned from factory_C(), factory_D(), factory_GcUP(), factory_transDtD() and factory_S() respectively. These methods return smart pointers to these matrix factory objects and these objects are ment to have a lifetime that extends up to and beyond the lifetime of the BasisSystem object that created them. Note that the matrix objects returned by these matrix factory objects are not to be considered usable until they have passed through update_basis() or receive some other appropriate initialization.
The ranges of the dependent and independent variables, and decomposed and undecomposed equality constriants are returned by the methods var_dep(), var_indep(), equ_decomp() andequ_undecomp() respectively. There are a few obvious assertions for the values that these ranges can take on. Assuming that Gc is non-null when passed to update_basis(), the following assertions apply:
var_dep().size() == equ_decomp().size() + inequ_decomp().size() var_dep().size() + var_indep().size() == Gc.rows() equ_decomp().size() + equ_undecomp().size() == Gc.cols()
Note that the client should not rely on var_dep(), var_indep(), equ_decomp(), or equ_undecomp() until after the first call to update_basis(). This allows a BasisSystem object to adjust itself to accommodate the input matrix Gc.
A fully initialized BasisSystem object will be setup to work with specific types and sizes of input matrices Gc and Gh. Therefore, the client should be able to get accrate values from var_dep(), var_indep(), equ_decomp(), or equ_undecomp() even before the first call to update_basis(). The BasisSystem object must therefore be initialized in some way to accommodate input matrices Gc and Gh of a specific dimension.
Note that This interface is completely worthless unless var_dep() returns some valid range (i.e. a basis matrix exists). If var_dep().size() == 0 then this is an indication that this is uninitialzed and therefore only the factory methods can be called!
The method update_basis() is used by the client to update the basis matrix C and perhaps the direct sensitivity matrix D and it's auxillary projected sensistivity matrix GcUP Strictly speaking, it would be possible to form the matrix D externally through the MatrixNonsing interface using the returned C and an N matrix object, but this may not take advantage of any special application specific tricks that can be used to form D. Note that this interface does not return a nonbasis matrix object for N. However, this matrix object will be needed for an implicit D matrix object that the client will undoubtably want to create. Creating such a matrix object is simple given the method MatrixOp::sub_view(). The following code example shows how to create a matrix object for N (given the matrix Gc input to bs.update_basis(Gc,...) and bs):
Teuchos::RefCountPtr<const MatrixOp> create_N( const AbstractLinAlgPack::MatrixOp &Gc ,const AbstractLinAlgPack::BasisSystem &bs ) { namespace mmp = MemMngPack; return Teuchos::rcp( new MatrixOpSubView( Gc.sub_view(bs.var_indep(),bs.equ_decomp()), BLAS_Cpp::trans ) ); }
op(D)*v = op(-inv(C)*N)*v = -inv(C)*(N*v) or -N'*(inv(C')*v)
The client can also form matrices of the form S = I + D'*D as follows:
Teuchos::RefCountPtr<MatrixSymOpNonsing> S = basis_sys.factory_S()->create(); Teuchos::dyn_cast<MatrixSymInitDiag>(*S).init_identity(D.space_rows()); syrk(D,BLAS_Cpp::trans,1.0,1.0,S.get();
S must then be fully initialized and ready to go.Subclass developer's notes:
The default implementation (of the methods that have default implementations) assume that there are no undecomposed equality constriants.
ToDo: Finish documentation!
Definition at line 215 of file AbstractLinAlgPack_BasisSystem.hpp.
|
|
Definition at line 223 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
|
Definition at line 226 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
|
Definition at line 229 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
|
Definition at line 232 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
|
Definition at line 237 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
||||||||||||
|
Required constructor (calls
Definition at line 34 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Definition at line 261 of file AbstractLinAlgPack_BasisSystem.hpp. |
|
||||||||||||
|
Initialize the factory objects for the special matrices for Postconditions:
Definition at line 42 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Return a matrix factory object for basis
Implemented in AbstractLinAlgPack::BasisSystemComposite, and AbstractLinAlgPack::BasisSystemPermDirectSparse. |
|
|
Return a matrix factory object for sensitivity matrix
It is allowed for this to return Implemented in AbstractLinAlgPack::BasisSystemComposite, and AbstractLinAlgPack::BasisSystemPermDirectSparse. |
|
|
Return a matrix factory object for auxiliary sensitivity matrix
It is allowed for this to return Reimplemented in AbstractLinAlgPack::BasisSystemPermDirectSparse. Definition at line 62 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Returns a matrix factory for the result of The resulting matrix is symmetric but is assumed to be singular. Postconditions:
Definition at line 68 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Returns a matrix factory for the result of The resulting matrix is symmetric and is guarrenteed to be nonsingular. Postconditions:
Definition at line 74 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Range of dependent (basic) variables.
If there are no dependent variables then
If Implemented in AbstractLinAlgPack::BasisSystemComposite, and AbstractLinAlgPack::BasisSystemPermDirectSparse. |
|
|
Range of independnet (nonbasic) variables.
It is possible that the basis matrix may take up all of the degrees of freedom with Implemented in AbstractLinAlgPack::BasisSystemComposite, and AbstractLinAlgPack::BasisSystemPermDirectSparse. |
|
|
Range of decomposed general equality constraints.
If there are no decomposed general equality constriants then
The default implementation return Reimplemented in AbstractLinAlgPack::BasisSystemPermDirectSparse. Definition at line 51 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
|
Range of undecomposed general equality constriants.
If there are no undecomposed equality constriants then
The default implementation return Reimplemented in AbstractLinAlgPack::BasisSystemPermDirectSparse. Definition at line 57 of file AbstractLinAlgPack_BasisSystem.cpp. |
|
||||||||||||||||||||||||||||
|
Update a basis and posssibly the direct sensitivity matrix for a set of Jacobian matrices.
Postconditions:
This method with throw a Implemented in AbstractLinAlgPack::BasisSystemComposite, and AbstractLinAlgPack::BasisSystemPermDirectSparse. |
1.3.9.1