42 #include "AbstractLinAlgPack_MultiVectorMutableCols.hpp"
43 #include "AbstractLinAlgPack_MatrixSymOpGetGMSSymMutable.hpp"
44 #include "AbstractLinAlgPack_LinAlgOpPack.hpp"
45 #include "AbstractLinAlgPack_SpVectorClass.hpp"
46 #include "Teuchos_dyn_cast.hpp"
47 #include "Teuchos_Assert.hpp"
49 namespace AbstractLinAlgPack {
62 this->
initialize(space_cols,space_rows,col_vecs);
73 const size_type num_cols = space_rows->dim();
74 col_vecs_.resize(num_cols);
76 for( size_type j = 1; j <= num_cols; ++j )
77 col_vecs_[j-1] = col_vecs[j-1];
80 for( size_type j = 1; j <= num_cols; ++j )
81 col_vecs_[j-1] = space_cols->create_member();
88 space_cols_ = Teuchos::null;
89 space_rows_ = Teuchos::null;
96 return space_cols_.get() ? space_cols_->dim() : 0;
101 return space_rows_.get() ? space_rows_->dim() : 0;
118 for( size_type j = 1; j <= col_vecs_.size(); ++j )
119 col_vecs_[j-1]->zero();
124 for( size_type j = 1; j <= col_vecs_.size(); ++j )
132 *mv_rhs =
dynamic_cast<const MultiVector*
>(&mwo_rhs);
135 for( size_type j = 1; j <= col_vecs_.size(); ++j )
136 *col_vecs_[j-1] = *mv_rhs->
col(j);
140 MatrixOp::mat_mut_ptr_t
144 return Teuchos::null;
151 return Teuchos::null;
156 ,
const Vector& x, value_type b
172 for( size_type j = 1; j <= col_vecs_.size(); ++j )
185 for( size_type j = 1; j <= col_vecs_.size(); ++j )
213 const size_type j = itr->index() + o;
227 for( size_type j = 1; j <= col_vecs_.size(); ++j )
246 const int num_vecs = this->col_vecs_.size();
248 num_vecs != DMatrixSliceSym().
rows(), std::logic_error
249 ,
"MultiVectorMutableCols::syrk(...) : Error, sizes do not match up!" );
251 if( DMatrixSliceSym().uplo() == BLAS_Cpp::upper ) {
252 for(
int i = 1; i <= num_vecs; ++i ) {
253 for(
int j = i; j <= num_vecs; ++j ) {
254 DMatrixSliceSym().gms()(i,j) = beta * DMatrixSliceSym().gms()(i,j) + alpha *
dot(*col_vecs_[i-1],*col_vecs_[j-1]);
259 for(
int i = 1; i <= num_vecs; ++i ) {
260 for(
int j = 1; j <= i; ++j ) {
261 DMatrixSliceSym().gms()(i,j) = beta * DMatrixSliceSym().gms()(i,j) + alpha *
dot(*col_vecs_[i-1],*col_vecs_[j-1]);
282 return col_vecs_[j-1];
288 return Teuchos::null;
294 return Teuchos::null;
301 const size_type
rows = this->
rows();
304 ,std::logic_error,
"Error, can't handle subrange on vectors yet!" );
308 space_cols_,space_rows_->sub_space(col_rng),&col_vecs_[col_rng.
lbound()-1]
difference_type offset() const
Return the offset for the indexes (ith real index = begin()[i-1]->index() + offset()# ...
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
bool syrk(BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
MatrixOp & operator=(const MatrixOp &mwo_rhs)
virtual MatrixOp & operator=(const MatrixOp &mwo_rhs)
M_lhs = mwo_rhs : Virtual assignment operator.
Abstract interface that allows the extraction of a non-const DenseLinAlgPack::DMatrixSliceSym view of...
ptrdiff_t difference_type
virtual void set_ele(index_type i, value_type val)
Set a specific element of a vector.
Interface adding operations specific for a symmetric matrix {abstract}.
vec_mut_ptr_t diag(int k)
Returns return.get() == NULL
void initialize(const Teuchos::RCP< const VectorSpace > &space_cols, const Teuchos::RCP< const VectorSpace > &space_rows, Teuchos::RCP< VectorMutable > col_vecs[]=NULL)
Initialize given the spaces for the columns and rows and possibly the column vectors.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
const VectorSpace & space_cols() const
Abstract interface for objects that represent a space for mutable coordinate vectors.
MultiVectorMutableCols()
Construct to initialized.
Helper class type that simplifies the usage of the MatrixSymOpGetGMSSymMutable interface for clients...
const VectorSpace & space_rows() const
access_by_t access_by() const
Returns return & COL_ACCESS == true only.
vec_mut_ptr_t col(index_type j)
Base class for all matrices that support basic matrix operations.
Interface for a collection of non-mutable vectors (multi-vector, matrix).
multi_vec_mut_ptr_t mv_sub_view(const Range1D &row_rng, const Range1D &col_rng)
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2
void set_uninitialized()
Set uninitalized.
virtual value_type get_ele(index_type i) const
Fetch an element in the vector.
Abstract interface for mutable coordinate vectors {abstract}.
Sparse storage element type.
virtual vec_ptr_t col(index_type j) const =0
Get a non-mutable column vector.
vec_mut_ptr_t row(index_type i)
Returns return.get() == NULL
friend void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
void Mt_S(value_type alpha)