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

Simple diagonal matrix class. More...

#include <AbstractLinAlgPack_MatrixSymDiagStd.hpp>

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

Classes

class  PostMod
 PostMod class to use with MemMngPack::AbstractFactorStd. More...
 

Private Member Functions

void copy_unique ()
 

Private Attributes

VectorSpace::vec_mut_ptr_t diag_
 
bool unique_
 

Constructors/initalizers

 MatrixSymDiagStd (const VectorSpace::vec_mut_ptr_t &diag=Teuchos::null, bool unique=true)
 Calls this->initialize(). More...
 
void initialize (const VectorSpace::vec_mut_ptr_t &diag, bool unique=true)
 Initialize given the diagonal vector (or no vector at all). More...
 

Access

VectorMutablediag ()
 Give non-const access to the diagonal vector. More...
 
const VectorSpace::vec_mut_ptr_tdiag_ptr () const
 
bool unique () const
 

Overridden from MatrixBase

size_type rows () const
 Returns 0 if not initalized (this->diag() == NULL). More...
 
size_type nz () const
 

Overridden from MatrixOp

const VectorSpacespace_rows () const
 
const VectorSpacespace_cols () const
 
MatrixOpoperator= (const MatrixOp &mwo_rhs)
 
bool Mp_StM (MatrixOp *g_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const
 Add to a mutable matrix lhs. More...
 
void Vp_StMtV (VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
 
void Vp_StMtV (VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2, value_type beta) const
 
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. More...
 
void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2) const
 
void V_InvMtV (VectorMutable *v_lhs, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2) const
 

Overridden from MatrixSymInitDiag

void init_identity (const VectorSpace &space_diag, value_type alpha)
 
void init_diagonal (const Vector &diag)
 

Overridden from MatrixSymDiag

const Vectordiag () const
 

Additional Inherited Members

- Public Types inherited from AbstractLinAlgPack::MatrixSymOp
enum  EMatRhsPlaceHolder { DUMMY_ARG }
 
- Public Types inherited from AbstractLinAlgPack::MatrixOp
enum  EMatNormType { MAT_NORM_INF, MAT_NORM_2, MAT_NORM_1, MAT_NORM_FORB }
 Type of matrix norm. More...
 
- Public Types inherited from AbstractLinAlgPack::MatrixSymNonsing
enum  EMatrixDummyArg { DUMMY_ARG }
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymInitDiag
virtual ~MatrixSymInitDiag ()
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymOpNonsing
MatrixSymOpNonsingoperator= (const MatrixSymOpNonsing &M)
 Calls operator=(MatrixOp&) More...
 
virtual mat_mswons_mut_ptr_t clone_mswons ()
 Clone the non-const matrix object (if supported). More...
 
virtual mat_mswons_ptr_t clone_mswons () const
 Clone the const matrix object (if supported). More...
 
mat_mut_ptr_t clone ()
 Returns this->clone_mswons(). More...
 
mat_ptr_t clone () const
 Returns this->clone_mswons(). More...
 
mat_mns_mut_ptr_t clone_mns ()
 Returns this->clone_mswons(). More...
 
mat_mns_ptr_t clone_mns () const
 Returns this->clone_mswons(). More...
 
mat_mswo_mut_ptr_t clone_mswo ()
 Returns this->clone_mswons(). More...
 
mat_mswo_ptr_t clone_mswo () const
 Returns this->clone_mswons(). More...
 
mat_msns_mut_ptr_t clone_msns ()
 Returns this->clone_mswons(). More...
 
mat_msns_ptr_t clone_msns () const
 Returns this->clone_mswons(). More...
 
mat_mwons_mut_ptr_t clone_mwons ()
 Returns this->clone_mswons(). More...
 
mat_mwons_ptr_t clone_mwons () const
 Returns this->clone_mswons(). More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymOp
virtual MatrixSymOpoperator= (const MatrixSymOp &M)
 Calls operator=(MatrixOp&) More...
 
size_type cols () const
 Returns this->rows() More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixOp
virtual void zero_out ()
 M_lhs = 0 : Zero out the matrix. More...
 
virtual void Mt_S (value_type alpha)
 M_lhs *= alpha : Multiply a matrix by a scalar. More...
 
virtual std::ostream & output (std::ostream &out) const
 Virtual output function. More...
 
const MatNorm calc_norm (EMatNormType requested_norm_type=MAT_NORM_1, bool allow_replacement=false) const
 Compute a norm of this matrix. More...
 
virtual mat_ptr_t sub_view (const Range1D &row_rng, const Range1D &col_rng) const
 Create a transient constant sub-matrix view of this matrix (if supported). More...
 
mat_ptr_t sub_view (const index_type &rl, const index_type &ru, const index_type &cl, const index_type &cu) const
 Inlined implementation calls this->sub_view(Range1D(rl,ru),Range1D(cl,cu)). More...
 
virtual mat_ptr_t perm_view (const Permutation *P_row, const index_type row_part[], int num_row_part, const Permutation *P_col, const index_type col_part[], int num_col_part) const
 Create a permuted view: M_perm = P_row' * M * P_col. More...
 
virtual mat_ptr_t perm_view_update (const Permutation *P_row, const index_type row_part[], int num_row_part, const Permutation *P_col, const index_type col_part[], int num_col_part, const mat_ptr_t &perm_view) const
 Reinitialize a permuted view: M_perm = P_row' * M * P_col. More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixBase
virtual ~MatrixBase ()
 Virtual destructor. More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixSymNonsing
- Public Member Functions inherited from AbstractLinAlgPack::MatrixNonsing
virtual value_type transVtInvMtV (const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
 result = vs_rhs1' * inv(op(M_rhs2)) * vs_rhs3 More...
 
virtual value_type transVtInvMtV (const SpVectorSlice &sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3) const
 result = sv_rhs1' * inv(op(M_rhs2)) * sv_rhs3 More...
 
virtual void M_StInvMtM (MatrixOp *m_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * inv(op(M_rhs1)) * op(mwo_rhs2) (right). More...
 
virtual void M_StMtInvM (MatrixOp *m_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, BLAS_Cpp::Transp trans_rhs2) const
 m_lhs = alpha * op(mwo_rhs1) * inv(op(M_rhs2)) (left). More...
 
- Public Member Functions inherited from AbstractLinAlgPack::MatrixOpNonsing
MatrixOpNonsingoperator= (const MatrixOpNonsing &M)
 Calls operator=(MatrixOp&) More...
 
const MatNorm calc_cond_num (EMatNormType requested_norm_type=MAT_NORM_1, bool allow_replacement=false) const
 Compute an estimate of the condition number of this matrix. More...
 
- Protected Member Functions inherited from AbstractLinAlgPack::MatrixSymOp
virtual void Mp_StPtMtP (MatrixSymOp *sym_lhs, value_type alpha, EMatRhsPlaceHolder dummy_place_holder, const GenPermMatrixSlice &gpms_rhs, BLAS_Cpp::Transp gpms_rhs_trans, value_type beta) const
 sym_lhs = alpha * op(gpms_rhs') * M * op(gpms_rhs) + beta * sym_lhs. More...
 
virtual void Mp_StMtMtM (MatrixSymOp *sym_lhs, value_type alpha, EMatRhsPlaceHolder dummy_place_holder, const MatrixOp &mwo_rhs, BLAS_Cpp::Transp mwo_rhs_trans, value_type beta) const
 sym_lhs = alpha * op(mwo_rhs') * M * op(mwo_rhs) + beta * sym_lhs. More...
 
- Protected Member Functions inherited from AbstractLinAlgPack::MatrixOp
virtual bool Mp_StM (value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 M_lhs += alpha * op(mwo_rhs) (BLAS xAXPY). More...
 
virtual bool Mp_StMtP (MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans) const
 mwo_lhs += alpha * op(M_rhs) * op(P_rhs). More...
 
virtual bool Mp_StMtP (value_type alpha, const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans)
 M_lhs += alpha * op(mwo_rhs) * op(P_rhs). More...
 
virtual bool Mp_StPtM (MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans, BLAS_Cpp::Transp M_trans) const
 mwo_lhs += alpha * op(P_rhs) * op(M_rhs). More...
 
virtual bool Mp_StPtM (value_type alpha, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans, const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans)
 M_lhs += alpha * op(P_rhs) * op(mwo_rhs). More...
 
virtual bool Mp_StPtMtP (MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs2, BLAS_Cpp::Transp P_rhs2_trans) const
 mwo_lhs += alpha * op(P_rhs1) * op(M_rhs) * op(P_rhs2). More...
 
virtual bool Mp_StPtMtP (value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs2, BLAS_Cpp::Transp P_rhs2_trans)
 M_lhs += alpha * op(P_rhs1) * op(mwo_rhs) * op(P_rhs2). More...
 
virtual void Vp_StPtMtV (VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_rhs2_trans, const Vector &v_rhs3, value_type beta) const
 v_lhs = alpha * op(P_rhs1) * op(M_rhs2) * v_rhs3 + beta * v_rhs More...
 
virtual void Vp_StPtMtV (VectorMutable *v_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_rhs2_trans, const SpVectorSlice &sv_rhs3, value_type beta) const
 v_lhs = alpha * op(P_rhs1) * op(M_rhs2) * sv_rhs3 + beta * v_rhs More...
 
virtual value_type transVtMtV (const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
 result = v_rhs1' * op(M_rhs2) * v_rhs3 More...
 
virtual value_type transVtMtV (const SpVectorSlice &sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3) const
 result = sv_rhs1' * op(M_rhs2) * sv_rhs3 More...
 
virtual void syr2k (BLAS_Cpp::Transp M_trans, value_type alpha, const GenPermMatrixSlice &P1, BLAS_Cpp::Transp P1_trans, const GenPermMatrixSlice &P2, BLAS_Cpp::Transp P2_trans, value_type beta, MatrixSymOp *symwo_lhs) const
 Perform a specialized rank-2k update of a dense symmetric matrix of the form: More...
 
virtual bool Mp_StMtM (MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta) const
 mwo_lhs = alpha * op(M_rhs1) * op(mwo_rhs2) + beta * mwo_lhs (left) (xGEMM). More...
 
virtual bool Mp_StMtM (MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, BLAS_Cpp::Transp trans_rhs2, value_type beta) const
 mwo_lhs = alpha * op(mwo_rhs1) * op(M_rhs2) + beta * mwo_lhs (right) (xGEMM) More...
 
virtual bool Mp_StMtM (value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta)
 M_lhs = alpha * op(mwo_rhs1) * op(mwo_rhs2) + beta * mwo_lhs (left) (xGEMM) More...
 
virtual bool syrk (const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta)
 Perform a rank-k update of a symmetric matrix of the form: More...
 
- Protected Member Functions inherited from AbstractLinAlgPack::MatrixSymNonsing
virtual void M_StMtInvMtM (MatrixSymOp *symwo_lhs, value_type alpha, const MatrixOp &mwo, BLAS_Cpp::Transp mwo_trans, EMatrixDummyArg) const
 symwo_lhs = alpha * op(mwo) * inv(M) * op(mwo)'. More...
 

Detailed Description

Simple diagonal matrix class.

ToDo: Implement clone_mswons() and deal with this->diag_ptr().count() > 1 by cloning vector if told to. This allows lazy evaluation of the clone_mswons() method.

Definition at line 57 of file AbstractLinAlgPack_MatrixSymDiagStd.hpp.

Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixSymDiagStd::MatrixSymDiagStd ( const VectorSpace::vec_mut_ptr_t diag = Teuchos::null,
bool  unique = true 
)

Calls this->initialize().

Definition at line 54 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

Member Function Documentation

void AbstractLinAlgPack::MatrixSymDiagStd::initialize ( const VectorSpace::vec_mut_ptr_t diag,
bool  unique = true 
)

Initialize given the diagonal vector (or no vector at all).

Parameters
diag[in] Vector to be used for the diagonal. If diag.get() == NULL then this will be uninitialized.
unique[in] Determines if the underlying diag vector is guaranteed to be unique and not shared.

Definition at line 66 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

VectorMutable & AbstractLinAlgPack::MatrixSymDiagStd::diag ( )

Give non-const access to the diagonal vector.

Preconditions:

ToDo: Finish documentation!

Definition at line 75 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

const VectorSpace::vec_mut_ptr_t & AbstractLinAlgPack::MatrixSymDiagStd::diag_ptr ( ) const

Definition at line 86 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

bool AbstractLinAlgPack::MatrixSymDiagStd::unique ( ) const
inline

Definition at line 210 of file AbstractLinAlgPack_MatrixSymDiagStd.hpp.

size_type AbstractLinAlgPack::MatrixSymDiagStd::rows ( ) const
virtual

Returns 0 if not initalized (this->diag() == NULL).

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 93 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

size_type AbstractLinAlgPack::MatrixSymDiagStd::nz ( ) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 98 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

const VectorSpace & AbstractLinAlgPack::MatrixSymDiagStd::space_rows ( ) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixSymOp.

Definition at line 109 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

const VectorSpace & AbstractLinAlgPack::MatrixSymDiagStd::space_cols ( ) const
virtual
MatrixOp & AbstractLinAlgPack::MatrixSymDiagStd::operator= ( const MatrixOp mwo_rhs)
virtual

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 114 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

bool AbstractLinAlgPack::MatrixSymDiagStd::Mp_StM ( MatrixOp g_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs 
) const
virtual

Add to a mutable matrix lhs.

Preconditions:

  • #dynamic_cast<MultiVectorMutable*>(m_lhs) != NULL#.

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 132 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

void AbstractLinAlgPack::MatrixSymDiagStd::Vp_StMtV ( VectorMutable v_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const Vector v_rhs2,
value_type  beta 
) const
virtual
void AbstractLinAlgPack::MatrixSymDiagStd::Vp_StMtV ( VectorMutable v_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const SpVectorSlice sv_rhs2,
value_type  beta 
) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 160 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

bool AbstractLinAlgPack::MatrixSymDiagStd::syrk ( BLAS_Cpp::Transp  M_trans,
value_type  alpha,
value_type  beta,
MatrixSymOp sym_lhs 
) const
virtual

Implements the symmetric rank-k update for all diagonal matrix lhs.

Returns
Returns true if dynamic_cast<MatrixSymDiagStd>(sym_lhs) != NULL. Otherwise, returns false.

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 183 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

void AbstractLinAlgPack::MatrixSymDiagStd::V_InvMtV ( VectorMutable v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const Vector v_rhs2 
) const
virtual

Overridden from MatrixOpNonsing

Implements AbstractLinAlgPack::MatrixNonsing.

Definition at line 169 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

void AbstractLinAlgPack::MatrixSymDiagStd::V_InvMtV ( VectorMutable v_lhs,
BLAS_Cpp::Transp  trans_rhs1,
const SpVectorSlice sv_rhs2 
) const
virtual

Reimplemented from AbstractLinAlgPack::MatrixNonsing.

Definition at line 176 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

void AbstractLinAlgPack::MatrixSymDiagStd::init_identity ( const VectorSpace space_diag,
value_type  alpha 
)
virtual
void AbstractLinAlgPack::MatrixSymDiagStd::init_diagonal ( const Vector diag)
virtual
const Vector & AbstractLinAlgPack::MatrixSymDiagStd::diag ( ) const
virtual
void AbstractLinAlgPack::MatrixSymDiagStd::copy_unique ( )
private

Definition at line 224 of file AbstractLinAlgPack_MatrixSymDiagStd.cpp.

Member Data Documentation

VectorSpace::vec_mut_ptr_t AbstractLinAlgPack::MatrixSymDiagStd::diag_
private

Definition at line 199 of file AbstractLinAlgPack_MatrixSymDiagStd.hpp.

bool AbstractLinAlgPack::MatrixSymDiagStd::unique_
private

Definition at line 200 of file AbstractLinAlgPack_MatrixSymDiagStd.hpp.


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