44 #include "AbstractLinAlgPack_MatrixSymDiagStd.hpp"
45 #include "AbstractLinAlgPack_MultiVectorMutable.hpp"
46 #include "AbstractLinAlgPack_VectorMutable.hpp"
47 #include "AbstractLinAlgPack_VectorStdOps.hpp"
48 #include "AbstractLinAlgPack_SpVectorClass.hpp"
49 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
50 #include "Teuchos_Assert.hpp"
52 namespace AbstractLinAlgPack {
80 !diag, std::logic_error
81 ,
"MatrixSymDiagStd::diag(): Error, the diagonal vector has not been set! " );
95 return diag_.
get() ? diag_->dim() : 0;
100 return diag_.
get() ? diag_->nz() : 0;
106 return diag_->space();
110 return diag_->space();
120 p_M == NULL, std::logic_error
121 ,
"MatrixSymDiagStd::operator=(M): Error, the matrix M with concrete type "
122 "\'" <<
typeName(M) <<
"\' does not support the MatrixSymDiagStd type! " );
124 if( p_M ==
this )
return *
this;
127 unique_ = p_M->unique_;
141 M_diag = M_mv_lhs->
diag(0);
150 ,
const Vector& v_rhs2, value_type beta)
const
171 ,
const Vector& v_rhs2)
const
191 if(!B_sd)
return false;
224 void MatrixSymDiagStd::copy_unique()
227 diag_ = diag_->clone();
virtual const VectorSpace & space() const =0
Return the vector space that this vector belongs to.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
void init_diagonal(const Vector &diag)
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
friend void V_InvMtV(VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
MatrixOp & operator=(const MatrixOp &mwo_rhs)
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
MatrixSymDiagStd(const VectorSpace::vec_mut_ptr_t &diag=Teuchos::null, bool unique=true)
Calls this->initialize().
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
bool Mp_StM(MatrixOp *g_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const
Add to a mutable matrix lhs.
void ele_wise_divide(const value_type &alpha, const Vector &v_rhs1, const Vector &v_rhs2, VectorMutable *v_lhs)
v_lhs(i) = alpha * v_rhs1(i) / v_rhs2(i), i = 1,,,dim.
Interface adding operations specific for a symmetric matrix {abstract}.
bool syrk(BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs) const
Implements the symmetric rank-k update for all diagonal matrix lhs.
Abstract interface for objects that represent a space for mutable coordinate vectors.
Simple diagonal matrix class.
void ele_wise_prod(const value_type &alpha, const Vector &v_rhs1, const Vector &v_rhs2, VectorMutable *v_lhs)
v_lhs(i) += alpha * v_rhs1(i) * v_rhs2(i), i = 1,,,dim.
void initialize(const VectorSpace::vec_mut_ptr_t &diag, bool unique=true)
Initialize given the diagonal vector (or no vector at all).
virtual vec_mut_ptr_t diag(int k)=0
Get a mutable diagonal vector.
Base class for all matrices that support basic matrix operations.
const VectorSpace::vec_mut_ptr_t & diag_ptr() const
Interface for a collection of mutable vectors (multi-vector, matrix).
void V_InvMtV(VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const
void init_identity(const VectorSpace &space_diag, value_type alpha)
Abstract interface for mutable coordinate vectors {abstract}.
virtual vec_mut_ptr_t create_member() const =0
Create a vector member from the vector space.
const VectorSpace & space_cols() const
size_type rows() const
Returns 0 if not initalized (this->diag() == NULL).
friend 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)
VectorMutable & diag()
Give non-const access to the diagonal vector.
std::string typeName(const T &t)
const VectorSpace & space_rows() const