AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
Public Types
AbstractLinAlgPack::MultiVectorMutableDense Class Reference

MultiVectorMutable "Adapter" subclass for DenseLinAlgPack::DMatrixSlice or DenseLinAlgPack::DMatrix object. More...

#include <AbstractLinAlgPack_MultiVectorMutableDense.hpp>

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

List of all members.

Public Types

typedef Teuchos::RCP
< MemMngPack::ReleaseResource > 
release_resource_ptr_t
 

Constructors / initializers

 MultiVectorMutableDense (const size_type rows=0, const size_type cols=0)
 Calls this->initialize(rows,cols).
 MultiVectorMutableDense (DMatrixSlice gms, BLAS_Cpp::Transp gms_trans, const release_resource_ptr_t &gms_release)
 Calls this->initialize(gms,gms_trans,gms_release).
void initialize (const size_type rows, const size_type cols)
 Call this->initialize(v,v_release) with an allocated DenseLinAlgPack::DVector object.
void initialize (DMatrixSlice gms, BLAS_Cpp::Transp gms_trans, const release_resource_ptr_t &gms_release)
 Initialize with a dense matrix slice.

Access

DMatrixSlice set_gms ()
 Return the non-const dense matrix.
const DMatrixSlice get_gms () const
 Return a const dense matrix.
BLAS_Cpp::Transp gms_trans () const
 Return if underlying matrix is being viewed as the transpose or non-transposed.
const release_resource_ptr_tgms_release () const
 Return a RCP<> pointer to the object that will release the associated resource.

Overridden from MatrixOpGetGMS

const DMatrixSlice get_gms_view () const
 
void free_gms_view (const DMatrixSlice *gms_view) const
 

Overridden from MatrixOpGetGMSMutable

DMatrixSlice get_gms_view ()
 
void commit_gms_view (DMatrixSlice *gms_view)
 

Overridden from MatrixBase

size_type rows () const
 
size_type cols () const
 

Overridden from MatrixOp

void zero_out ()
 
void Mt_S (value_type alpha)
 
MatrixOpoperator= (const MatrixOp &mwo_rhs)
 
std::ostream & output (std::ostream &out) const
 
bool Mp_StM (MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const
 
bool Mp_StM (value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 
bool syrk (BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs) const
 
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
 
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
 

Overridden from MultiVector

access_by_t access_by () const
 
void apply_op (EApplyBy apply_by, const RTOpPack::RTOp &primary_op, const size_t num_multi_vecs, const MultiVector **multi_vecs, const size_t num_targ_multi_vecs, MultiVectorMutable **targ_multi_vecs, RTOpPack::ReductTarget *reduct_objs[], const index_type primary_first_ele, const index_type primary_sub_dim, const index_type primary_global_offset, const index_type secondary_first_ele, const index_type secondary_sub_dim) const
 
void apply_op (EApplyBy apply_by, const RTOpPack::RTOp &primary_op, const RTOpPack::RTOp &secondary_op, const size_t num_multi_vecs, const MultiVector **multi_vecs, const size_t num_targ_multi_vecs, MultiVectorMutable **targ_multi_vecs, RTOpPack::ReductTarget *reduct_obj, const index_type primary_first_ele, const index_type primary_sub_dim, const index_type primary_global_offset, const index_type secondary_first_ele, const index_type secondary_sub_dim) const
 

Overridden from MultiVectorMutable

vec_mut_ptr_t col (index_type j)
 
vec_mut_ptr_t row (index_type i)
 
vec_mut_ptr_t diag (int k)
 
multi_vec_mut_ptr_t mv_sub_view (const Range1D &row_rng, const Range1D &col_rng)
 

Overridden from MatrixOpSerial

void Vp_StMtV (DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2, value_type beta) const
 
void Vp_StMtV (DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const SpVectorSlice &sv_rhs2, value_type beta) const
 

Detailed Description

MultiVectorMutable "Adapter" subclass for DenseLinAlgPack::DMatrixSlice or DenseLinAlgPack::DMatrix object.

This class can be used either as a view of a DenseLinAlgPack::DMatrixSlice object or as a storage type for a DenseLinAlgPack::DMatrix object.

To create a storage type with the dimensions of rows x cols just call the constructor MatrixWithOpMutableDense(rows,cols) or after construction you can call this->initialize(rows,cols).

To simply create a view of a matrix or its transpose, say M, without ownership just call MatrixWithOpMutableDense(M(),M_trans,NULL) or after construction call this->initialize(M(),M_trans,NULL).

Alternately, this can be given a matrix with the responsibility to delete any associated memory by calling this->initialize() with a ReleaseResource object to perform the deallocation.

If this has been initialized by this->initialize(rows,cols) and if the client really needs to get at the DenseLinAlgPack::DMatrix object itself, then it can be obtained as:

 DMatrix* f( MultiVectorMutableDense* M )
 {
     return dynamic_cast<MemMngPack::ReleaseResource_ref_count_ptr<DMatrix&> >(*M.gms_release()).ptr.get();
 }

This is not pretty but it is not supposed to be. Of course the above function will return NULL the dynamic_cast<> fails or if there is no allocated DMatrix object to get.

Definition at line 83 of file AbstractLinAlgPack_MultiVectorMutableDense.hpp.


Member Typedef Documentation


Constructor & Destructor Documentation

AbstractLinAlgPack::MultiVectorMutableDense::MultiVectorMutableDense ( const size_type  rows = 0,
const size_type  cols = 0 
)

Calls this->initialize(rows,cols).

Definition at line 58 of file AbstractLinAlgPack_MultiVectorMutableDense.cpp.

AbstractLinAlgPack::MultiVectorMutableDense::MultiVectorMutableDense ( DMatrixSlice  gms,
BLAS_Cpp::Transp  gms_trans,
const release_resource_ptr_t gms_release 
)

Calls this->initialize(gms,gms_trans,gms_release).

Definition at line 66 of file AbstractLinAlgPack_MultiVectorMutableDense.cpp.


Member Function Documentation

void AbstractLinAlgPack::MultiVectorMutableDense::initialize ( const size_type  rows,
const size_type  cols 
)

Call this->initialize(v,v_release) with an allocated DenseLinAlgPack::DVector object.

Definition at line 75 of file AbstractLinAlgPack_MultiVectorMutableDense.cpp.

void AbstractLinAlgPack::MultiVectorMutableDense::initialize ( DMatrixSlice  gms,
BLAS_Cpp::Transp  gms_trans,
const release_resource_ptr_t gms_release 
)

Initialize with a dense matrix slice.

Note that solve of the method overrides have to allocate a temporary memory if gms_trans != no_trans (see get_gms_view() and output()).

Postconditions:

  • this->rows() = ( gms_trans = no_trans ? gms.rows() : gms.cols())
  • this->cols() = ( gms_trans = no_trans ? gms.cols() : gms.rows())

Definition at line 95 of file AbstractLinAlgPack_MultiVectorMutableDense.cpp.

DMatrixSlice AbstractLinAlgPack::MultiVectorMutableDense::set_gms ( ) [inline]

Return the non-const dense matrix.

Note that calling this method may result in the matrix implementation being modified. Therefore, no other methods on this object should be called until the DMatrixSlice returned from this method is discarded.

Definition at line 309 of file AbstractLinAlgPack_MultiVectorMutableDense.hpp.

const DMatrixSlice AbstractLinAlgPack::MultiVectorMutableDense::get_gms ( ) const [inline]

Return a const dense matrix.

Definition at line 316 of file AbstractLinAlgPack_MultiVectorMutableDense.hpp.

BLAS_Cpp::Transp AbstractLinAlgPack::MultiVectorMutableDense::gms_trans ( ) const [inline]

Return if underlying matrix is being viewed as the transpose or non-transposed.

Definition at line 323 of file AbstractLinAlgPack_MultiVectorMutableDense.hpp.

const MultiVectorMutableDense::release_resource_ptr_t & AbstractLinAlgPack::MultiVectorMutableDense::gms_release ( ) const [inline]

Return a RCP<> pointer to the object that will release the associated resource.

Definition at line 330 of file AbstractLinAlgPack_MultiVectorMutableDense.hpp.

const DMatrixSlice AbstractLinAlgPack::MultiVectorMutableDense::get_gms_view ( ) const [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::free_gms_view ( const DMatrixSlice *  gms_view) const [virtual]
DMatrixSlice AbstractLinAlgPack::MultiVectorMutableDense::get_gms_view ( )
void AbstractLinAlgPack::MultiVectorMutableDense::commit_gms_view ( DMatrixSlice *  gms_view)
size_type AbstractLinAlgPack::MultiVectorMutableDense::rows ( ) const [virtual]
size_type AbstractLinAlgPack::MultiVectorMutableDense::cols ( ) const [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::zero_out ( ) [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::Mt_S ( value_type  alpha) [virtual]
MatrixOp & AbstractLinAlgPack::MultiVectorMutableDense::operator= ( const MatrixOp mwo_rhs) [virtual]
std::ostream & AbstractLinAlgPack::MultiVectorMutableDense::output ( std::ostream &  out) const [virtual]
bool AbstractLinAlgPack::MultiVectorMutableDense::Mp_StM ( MatrixOp mwo_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs 
) const [virtual]
bool AbstractLinAlgPack::MultiVectorMutableDense::Mp_StM ( value_type  alpha,
const MatrixOp M_rhs,
BLAS_Cpp::Transp  trans_rhs 
) [virtual]
bool AbstractLinAlgPack::MultiVectorMutableDense::syrk ( BLAS_Cpp::Transp  M_trans,
value_type  alpha,
value_type  beta,
MatrixSymOp sym_lhs 
) const [virtual]
bool AbstractLinAlgPack::MultiVectorMutableDense::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 [virtual]

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 270 of file AbstractLinAlgPack_MultiVectorMutableDense.cpp.

bool AbstractLinAlgPack::MultiVectorMutableDense::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 [virtual]
MultiVectorMutableDense::access_by_t AbstractLinAlgPack::MultiVectorMutableDense::access_by ( ) const [virtual]
MultiVectorMutableDense::vec_mut_ptr_t AbstractLinAlgPack::MultiVectorMutableDense::col ( index_type  j) [virtual]
MultiVectorMutableDense::vec_mut_ptr_t AbstractLinAlgPack::MultiVectorMutableDense::row ( index_type  i) [virtual]
MultiVectorMutableDense::vec_mut_ptr_t AbstractLinAlgPack::MultiVectorMutableDense::diag ( int  k) [virtual]
MultiVectorMutableDense::multi_vec_mut_ptr_t AbstractLinAlgPack::MultiVectorMutableDense::mv_sub_view ( const Range1D &  row_rng,
const Range1D &  col_rng 
) [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::Vp_StMtV ( DVectorSlice *  vs_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const DVectorSlice &  vs_rhs2,
value_type  beta 
) const [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::Vp_StMtV ( DVectorSlice *  vs_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const SpVectorSlice sv_rhs2,
value_type  beta 
) const [virtual]
void AbstractLinAlgPack::MultiVectorMutableDense::apply_op ( EApplyBy  apply_by,
const RTOpPack::RTOp &  primary_op,
const size_t  num_multi_vecs,
const MultiVector **  multi_vecs,
const size_t  num_targ_multi_vecs,
MultiVectorMutable **  targ_multi_vecs,
RTOpPack::ReductTarget *  reduct_objs[],
const index_type  primary_first_ele,
const index_type  primary_sub_dim,
const index_type  primary_global_offset,
const index_type  secondary_first_ele,
const index_type  secondary_sub_dim 
) const [protected]
void AbstractLinAlgPack::MultiVectorMutableDense::apply_op ( EApplyBy  apply_by,
const RTOpPack::RTOp &  primary_op,
const RTOpPack::RTOp &  secondary_op,
const size_t  num_multi_vecs,
const MultiVector **  multi_vecs,
const size_t  num_targ_multi_vecs,
MultiVectorMutable **  targ_multi_vecs,
RTOpPack::ReductTarget *  reduct_obj,
const index_type  primary_first_ele,
const index_type  primary_sub_dim,
const index_type  primary_global_offset,
const index_type  secondary_first_ele,
const index_type  secondary_sub_dim 
) const [protected]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends