42 #ifndef MATRIX_SYM_POS_DEF_CHOL_FACTOR_H
43 #define MATRIX_SYM_POS_DEF_CHOL_FACTOR_H
58 namespace AbstractLinAlgPack {
119 class MatrixSymPosDefCholFactor
123 ,
virtual public MatrixExtractInvCholFactor
124 ,
virtual public MatrixSymSecant
125 ,
virtual public MatrixSymAddDelUpdateable
143 bool maintain_original =
true
144 ,
bool maintain_factor =
false
145 ,
bool allow_factor =
true
147 :maintain_original_(maintain_original)
148 ,maintain_factor_(maintain_factor)
149 ,allow_factor_(allow_factor)
152 void initialize(MatrixSymPosDefCholFactor* p)
const
156 ,maintain_original_,maintain_factor_,allow_factor_
160 bool maintain_original_;
161 bool maintain_factor_;
176 MatrixSymPosDefCholFactor();
182 MatrixSymPosDefCholFactor(
184 ,
const release_resource_ptr_t& release_resource_ptr =
Teuchos::null
186 ,
bool maintain_original =
true
187 ,
bool maintain_factor =
false
188 ,
bool allow_factor =
true
189 ,
bool set_full_view =
true
248 ,
const release_resource_ptr_t& release_resource_ptr =
Teuchos::null
250 ,
bool maintain_original =
true
251 ,
bool maintain_factor =
false
252 ,
bool allow_factor =
true
253 ,
bool set_full_view =
true
302 ,
bool maintain_original
305 ,
bool maintain_factor
311 void pivot_tols( PivotTolerances pivot_tols );
313 PivotTolerances pivot_tols()
const;
325 ,
bool *maintain_original
328 ,
bool *maintain_factor
334 bool allocates_storage()
const;
368 std::ostream&
output(std::ostream&
out)
const;
380 const MatrixOp &mwo_rhs
414 , EMatRhsPlaceHolder dummy_place_holder
483 void init_identity(
const VectorSpace& space_diag,
value_type alpha );
485 void init_diagonal(
const Vector& diag );
487 void secant_update(VectorMutable* s, VectorMutable* y, VectorMutable* Bs);
503 ,
bool force_factorization
505 ,PivotTolerances pivot_tols
510 Inertia inertia()
const;
512 void set_uninitialized();
517 ,
bool force_refactorization
518 ,EEigenValType add_eigen_val
519 ,PivotTolerances pivot_tols
524 ,
bool force_refactorization
525 ,EEigenValType drop_eigen_val
526 ,PivotTolerances pivot_tols
536 void serialize( std::ostream &
out )
const;
538 void unserialize( std::istream &in );
547 bool maintain_original_;
548 bool maintain_factor_;
549 bool factor_is_updated_;
550 bool allocates_storage_;
551 release_resource_ptr_t release_resource_ptr_;
561 PivotTolerances pivot_tols_;
567 void assert_storage()
const;
568 void allocate_storage(
size_type max_size)
const;
569 void assert_initialized()
const;
571 void update_factorization()
const;
572 std::string build_serialization_string()
const;
582 bool MatrixSymPosDefCholFactor::allocates_storage()
const
584 return allocates_storage_;
594 const DMatrixSlice& MatrixSymPosDefCholFactor::MU_store()
const
600 void MatrixSymPosDefCholFactor::get_view_setup(
603 ,
bool *maintain_original
606 ,
bool *maintain_factor
613 *maintain_original = maintain_original_;
614 *M_l_r = maintain_original_ ? M_l_r_ : 0;
615 *M_l_c = maintain_original_ ? M_l_c_ : 0;
616 *maintain_factor = maintain_factor_;
617 *U_l_r = maintain_factor_ ? U_l_r_ : 0;
618 *U_l_c = maintain_factor_ ? U_l_c_ : 0;
625 MU_store_(U_l_r_,U_l_r_+M_size_-1,U_l_c_+1,U_l_c_+M_size_)
634 MU_store_(U_l_r_,U_l_r_+M_size_-1,U_l_c_+1,U_l_c_+M_size_)
643 MU_store_(M_l_r_+1,M_l_r_+M_size_,M_l_c_,M_l_c_+M_size_-1)
652 MU_store_(M_l_r_+1,M_l_r_+M_size_,M_l_c_,M_l_c_+M_size_-1)
659 #endif // MATRIX_SYM_POS_DEF_CHOL_FACTOR_H
Mixin interface for objects that can be serialized to and from a stream.
void Vp_StPtMtV(VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs2, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta=1.0)
v_lhs = alpha * op(P_rhs1) * op(M_rhs2) * v_rhs3 + beta * v_rhs
RTOp_value_type value_type
size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return rows of a possible transposed matrix.
Abstract interface that allows the extraction of a non-const DenseLinAlgPack::DMatrixSliceSym view of...
Abstract base class for all serial polymorphic symmetric nonsingular matrices that can be used to com...
std::ostream & output(std::ostream &o, const COOMatrix &coom)
Output stream function for COOMatrix.
const DMatrixSliceSym sym(const DMatrixSlice &gms, BLAS_Cpp::Uplo uplo)
const DMatrixSliceTri tri(const DMatrixSlice &gms, BLAS_Cpp::Uplo uplo, BLAS_Cpp::Diag diag)
void Mp_StPtMtP(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs, const GenPermMatrixSlice &P_rhs2, BLAS_Cpp::Transp P_rhs2_trans)
mwo_lhs += alpha * op(P_rhs1) * op(M_rhs) * op(P_rhs2).
DMatrixSliceSym nonconst_sym(DMatrixSlice gms, BLAS_Cpp::Uplo uplo)
Return a symmetric matrix.
RTOp_index_type size_type
Abstract interface for releasing an object when it is not needed anymore {abstract}.
void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
Perform a rank-k update of a symmetric matrix of the form:
DenseLinAlgPack::DMatrixSliceTriEle DMatrixSliceTriEle
const LAPACK_C_Decl::f_int & M
void V_InvMtV(VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
v_lhs = inv(op(M_rhs1)) * v_rhs2
void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
SparseVectorSlice< SparseElement< index_type, value_type > > SpVectorSlice
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
int read_matrix(const std::string &filename, Epetra_Comm &Comm, const Epetra_Map *rowmap, Epetra_Map *colmap, const Epetra_Map *rangemap, const Epetra_Map *domainmap, Epetra_CrsMatrix *&mat)
DenseLinAlgPack::DMatrixSliceTri DMatrixSliceTri
DenseLinAlgPack::DMatrixSlice DMatrixSlice
DMatrixSliceTri nonconst_tri(DMatrixSlice gms, BLAS_Cpp::Uplo uplo, BLAS_Cpp::Diag diag)
Return a triangular matrix.
void M_StMtInvMtM(MatrixSymOp *sym_gms_lhs, value_type alpha, const MatrixOp &mwo, BLAS_Cpp::Transp mwo_trans, const MatrixSymNonsing &mswof, MatrixSymNonsing::EMatrixDummyArg mwo_rhs)
sym_gms_lhs = alpha * op(mwo) * inv(mswof) * op(mwo)'
DenseLinAlgPack::DMatrixSliceSym DMatrixSliceSym
Mix-in Interface for initializing a matrix with a dense symmetric matrix.