58 namespace AbstractLinAlgPack {
67 this->
initialize(M_full,rng_rows,rng_cols,M_trans);
77 namespace rcp = MemMngPack;
81 M_rows = M_full->rows(),
82 M_cols = M_full->cols();
84 rng_rows = RangePack::full_range(rng_rows_in,1,M_rows),
85 rng_cols = RangePack::full_range(rng_cols_in,1,M_cols);
87 rng_rows.
ubound() > M_rows, std::invalid_argument
88 ,
"MatrixOpSubView::initialize(...): Error, "
89 "rng_rows = ["<<rng_rows.
lbound()<<
","<<rng_rows.
ubound()<<
"] is of range of "
90 "[1,M_full->rows()] = [1,"<<M_rows<<
"]" );
93 ,
"MatrixOpSubView::initialize(...): Error, "
95 "[1,M_full->cols()] = [1,"<<M_cols<<
"]" );
101 ? M_full->space_cols().sub_space(rng_rows)->clone()
102 : M_full->space_rows().sub_space(
rng_cols)->clone() );
104 ? M_full->space_rows().sub_space(
rng_cols)->clone()
105 : M_full->space_cols().sub_space(rng_rows)->clone() );
121 return ( M_full_.get()
128 return ( M_full_.get()
135 return ( M_full_.get()
136 ? ( rng_rows_.full_range() && rng_cols_.full_range()
167 if( rng_rows_.full_range() && rng_cols_.full_range() ) {
172 true, std::logic_error,
"MatrixOpSubView::zero_out(): "
173 "Error, this method can not be implemented with a sub-view" );
179 if( rng_rows_.full_range() && rng_cols_.full_range() ) {
180 M_full_->Mt_S(alpha);
184 true, std::logic_error,
"MatrixOpSubView::Mt_S(alpha): "
185 "Error, this method can not be implemented with a sub-view" );
242 m_lhs,alpha,P_rhs1,P_rhs1_trans,M_trans,P_rhs2,P_rhs2_trans);
272 alpha,P_rhs,P_rhs_trans,M_rhs,M_trans);
284 alpha,P_rhs1,P_rhs1_trans,M_rhs,M_trans,P_rhs2,P_rhs2_trans);
304 if( rng_rows_.full_range() && rng_cols_.full_range() ) {
307 ,*M_full_, M_trans_trans
327 op_op_rng_rows = ( M_trans_trans ==
no_trans ? rng_rows_ : rng_cols_ ),
328 op_op_rng_cols = ( M_trans_trans ==
no_trans ? rng_cols_ : rng_rows_ );
330 xt = ( M_trans_trans ==
no_trans ? M_full_->space_rows() : M_full_->space_cols() ).create_member(),
331 yt = ( M_trans_trans ==
no_trans ? M_full_->space_cols() : M_full_->space_rows() ).create_member();
333 *xt->sub_view(op_op_rng_cols) = x;
354 v_lhs,alpha,P_rhs1,P_rhs1_trans,M_rhs2_trans,v_rhs3,beta);
365 v_lhs,alpha,P_rhs1,P_rhs1_trans,M_rhs2_trans,sv_rhs3,beta);
370 ,
const Vector& v_rhs3)
const
392 M_trans,alpha,P1,P1_trans,P2,P2_trans,beta,sym_lhs);
404 m_lhs,alpha,trans_rhs1,mwo_rhs2,trans_rhs2,beta);
413 m_lhs,alpha,mwo_rhs1,trans_rhs1,trans_rhs2,beta);
424 alpha,mvw_rhs1,trans_rhs1,mwo_rhs2,trans_rhs2,beta);
439 M_full_.get() == NULL, std::logic_error
440 ,
"Error, the MatrixOpSubView object has not been initialize!" );
virtual size_type nz() const
Return the number of nonzero elements in the matrix.
virtual vec_mut_ptr_t sub_view(const Range1D &rng)
Create a mutable abstract view of a vector object.
bool syrk(BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs) const
friend void syr2k(const MatrixOp &M, 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)
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
RTOp_index_type index_type
const VectorSpace & space_rows() const
MatrixOpSubView(const mat_ptr_t &M_full=Teuchos::null, const Range1D &rng_rows=Range1D(), const Range1D &rng_cols=Range1D(), BLAS_Cpp::Transp M_trans=BLAS_Cpp::no_trans)
Calls this->initialize(...)
void Vp_StPtMtV(VectorMutable *vs_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
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
BLAS_Cpp::Transp M_trans()
RTOp_value_type value_type
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Index ubound() const
Return upper bound of the range.
size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return rows of a possible transposed matrix.
MatrixOp::mat_ptr_t sub_view(const Range1D &row_rng, const Range1D &col_rng) const
bool Mp_StM(MatrixOp *mwo_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs) const
void assert_initialized() const
void V_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs = alpha * op(M_rhs1) * V_rhs2.
friend value_type transVtMtV(const Vector &v_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3)
friend 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)
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
Interface adding operations specific for a symmetric matrix {abstract}.
virtual std::ostream & output(std::ostream &out) const
Virtual output function.
std::ostream & output(std::ostream &out) const
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
. One-based subregion index range class.
value_type transVtMtV(const Vector &v_rhs1, BLAS_Cpp::Transp trans_rhs2, const Vector &v_rhs3) const
RTOp_index_type size_type
Abstract interface for objects that represent a space for mutable coordinate vectors.
void initialize(const mat_ptr_t &M_full, const Range1D &rng_rows=Range1D(), const Range1D &rng_cols=Range1D(), BLAS_Cpp::Transp M_trans=BLAS_Cpp::no_trans)
Initialize the view of a matrix.
friend void Mp_StMtM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &mwo_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2, value_type beta)
const VectorSpace & space_cols() const
const LAPACK_C_Decl::f_int & M
MatrixOp & operator=(const MatrixOp &M)
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)
void Mt_S(value_type alpha)
friend void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
const f_int f_dbl_prec a[]
Base class for all matrices that support basic matrix operations.
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
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
static const Range1D Invalid
Range1D(INVALID)
Transp trans_not(Transp _trans)
Return the opposite of the transpose argument.
Index lbound() const
Return lower bound of the range.
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
friend void Mp_StMtP(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp M_trans, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans)
Abstract interface for mutable coordinate vectors {abstract}.
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
friend void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
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)
void Vp_StMtV(VectorMutable *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
size_type cols(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return columns of a possible transposed matrix.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Concrete matrix type to represent general permutation (mapping) matrices.
friend void Mp_StPtM(MatrixOp *mwo_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs, BLAS_Cpp::Transp P_rhs_trans, const MatrixOp &M_rhs, BLAS_Cpp::Transp M_trans)
friend 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)
void Vp_V(VectorMutable *v_lhs, const V &V_rhs)
v_lhs += V_rhs.