46 #include "ConstrainedOptPack_DecompositionSystemOrthogonal.hpp"
47 #include "ConstrainedOptPack_MatrixIdentConcatStd.hpp"
48 #include "ConstrainedOptPack_MatrixDecompRangeOrthog.hpp"
49 #include "AbstractLinAlgPack_MatrixSymOpNonsing.hpp"
50 #include "AbstractLinAlgPack_MatrixSymInitDiag.hpp"
51 #include "AbstractLinAlgPack_MatrixComposite.hpp"
52 #include "AbstractLinAlgPack_MatrixOpSubView.hpp"
53 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
54 #include "Teuchos_AbstractFactoryStd.hpp"
55 #include "Teuchos_dyn_cast.hpp"
56 #include "Teuchos_Assert.hpp"
58 namespace ConstrainedOptPack {
61 const VectorSpace::space_ptr_t &space_x
62 ,
const VectorSpace::space_ptr_t &space_c
64 ,
const basis_sys_tester_ptr_t &basis_sys_tester
69 space_x, space_c, basis_sys, basis_sys_tester
78 namespace rcp = MemMngPack;
87 namespace rcp = MemMngPack;
103 *D_imp_used = MAT_IMP_EXPLICIT;
106 DecompositionSystem::mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t
115 namespace rcp = MemMngPack;
117 typedef DecompositionSystem::mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t
129 *Uy_cpst = Uy ? &
dyn_cast<MatrixOpSubView>(*Uy) : NULL;
136 C_ptr_t C_ptr = Teuchos::null;
138 C_ptr = Teuchos::rcp_const_cast<MatrixOpNonsing>( R_orth->
C_ptr() );
139 S_ptr_ = Teuchos::rcp_const_cast<MatrixSymOpNonsing>( R_orth->
S_ptr() );
151 Uy_cpst->initialize(Teuchos::null);
164 ,
const mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t &C
165 ,
const mat_fcty_ptr_t::element_type::obj_ptr_t &D
172 namespace rcp = MemMngPack;
175 typedef DecompositionSystem::mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t
177 typedef DecompositionSystem::mat_fcty_ptr_t::element_type::obj_ptr_t
201 if(mat_rel == MATRICES_INDEP_IMPS) {
204 D_ptr.get() == NULL, std::logic_error
205 ,
"DecompositionSystemOrthogonal::update_decomp(...) : Error, "
206 "The matrix class used for the direct sensitivity matrix D = inv(C)*N of type \'"
207 <<
typeName(*D) <<
"\' must return return.get() != NULL from the clone() method "
208 "since mat_rel == MATRICES_INDEP_IMPS!" );
212 ,
space_x()->sub_space(var_dep)->clone()
213 ,MatrixIdentConcatStd::BOTTOM
221 if(mat_rel == MATRICES_INDEP_IMPS) {
222 C_ptr = C->clone_mwons();
224 C_ptr.get() == NULL, std::logic_error
225 ,
"DecompositionSystemOrthogonal::update_decomp(...) : Error, "
226 "The matrix class used for the basis matrix C of type \'"
227 <<
typeName(*C) <<
"\' must return return.get() != NULL from the clone_mwons() method "
228 "since mat_rel == MATRICES_INDEP_IMPS!" );
231 if(mat_rel == MATRICES_INDEP_IMPS) {
234 D_ptr.get() == NULL, std::logic_error
235 ,
"DecompositionSystemOrthogonal::update_decomp(...) : Error, "
236 "The matrix class used for the direct sensitivity matrix D = inv(C)*N of type \'"
237 <<
typeName(*D) <<
"\' must return return.get() != NULL from the clone() method "
238 "since mat_rel == MATRICES_INDEP_IMPS!" );
240 if(S_ptr_.
get() == NULL) {
241 S_ptr_ =
basis_sys()->factory_S()->create();
245 dyn_cast<MatrixSymInitDiag>(*S_ptr_).init_identity(D_ptr->space_rows());
248 catch(
const MatrixNonsing::SingularMatrix& except ) {
251 ,
"DecompositionSystemOrthogonal::initialize_matrices(...) : Error, update of S failed : "
260 std::ostream& out,
const std::string& L )
const
263 << L <<
"*** Orthogonal decompositon Y, R and Uy matrices (class DecompositionSystemOrthogonal)\n"
264 << L <<
"Y = [ I; -D' ] (using class MatrixIdentConcatStd)\n"
265 << L <<
"R = C*(I + D*D')\n"
266 << L <<
"Uy = E - F*D'\n"
const mat_fcty_ptr_t factory_Uy() const
void print_update_matrices(std::ostream &out, const std::string &leading_str) const
EOutputLevel
Enumeration for the amount of output to create from update_decomp().
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
T_To & dyn_cast(T_From &from)
const basis_sys_ptr_t & basis_sys() const
void initialize(const C_ptr_t &C_ptr, const D_ptr_t &D_ptr, const S_ptr_t &S_ptr)
Initialize the matrix object.
const S_ptr_t & S_ptr() const
const mat_fcty_ptr_t factory_Y() const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
DecompositionSystemOrthogonal(const VectorSpace::space_ptr_t &space_x=Teuchos::null, const VectorSpace::space_ptr_t &space_c=Teuchos::null, const basis_sys_ptr_t &basis_sys=Teuchos::null, const basis_sys_tester_ptr_t &basis_sys_tester=Teuchos::null, EExplicitImplicit D_imp=MAT_IMP_EXPLICIT, EExplicitImplicit Uz_imp=MAT_IMP_EXPLICIT)
mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t uninitialize_matrices(std::ostream *out, EOutputLevel olevel, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uy) const
Concrete implementation class for a matrix vertically concatonated with an identity matrix...
void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
void update_D_imp_used(EExplicitImplicit *D_imp_used) const
Matrix subclass for variable reduction orthogonal matrix R = Gc(:,con_decomp)'*Y. ...
virtual void initialize(const VectorSpace::space_ptr_t &space_cols, const VectorSpace::space_ptr_t &space_rows, ETopBottom top_or_bottom, value_type alpha, const D_ptr_t &D_ptr, BLAS_Cpp::Transp D_trans)
Setup with a matrix object.
size_type r() const
Returns this->basis_sys()->equ_decomp().size().
void set_uninitialized()
Make uninitialized.
void initialize_matrices(std::ostream *out, EOutputLevel olevel, const mat_nonsing_fcty_ptr_t::element_type::obj_ptr_t &C, const mat_fcty_ptr_t::element_type::obj_ptr_t &D, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uy, EMatRelations mat_rel) const
const mat_nonsing_fcty_ptr_t factory_R() const
const VectorSpace::space_ptr_t & space_x() const
Specialization node implementation subclass of DecompositionSystem for variable reduction decompositi...
virtual void set_uninitialized()
Set the matrix to uninitialized.
const C_ptr_t & C_ptr() const
std::string typeName(const T &t)