131 *Cmv =
dynamic_cast<MultiVectorMutable*
>(
C);
133 *
D =
dynamic_cast<const MatrixSymDiag*
>(&D_mwo);
134 if( !Cmv || !D || !(Cmv->access_by() & ( C_trans ==
no_trans ? MV::COL_ACCESS : MV::ROW_ACCESS ))
143 const Vector &D_diag = D->diag();
146 for(
size_type j = 1; j <= opC_cols; ++j ) {
150 opC_col_j = ( C_trans ==
no_trans ? Cmv->col(j) : Cmv->row(j) );
151 Vt_S( opC_col_j.get(), b );
159 namespace AbstractLinAlgPack {
178 ,
const size_t num_multi_vecs,
const MultiVector* multi_vecs[]
180 ,RTOpPack::ReductTarget* reduct_objs[]
194 prim_sub_dim = ( prim_sub_dim_in != 0 ? prim_sub_dim_in : prim_dim ),
195 sec_sub_dim = ( sec_sub_dim_in != 0 ? sec_sub_dim_in : sec_dim );
204 Workspace<MultiVector::vec_ptr_t> vecs_s(wss,num_multi_vecs);
205 Workspace<const Vector*> vecs(wss,num_multi_vecs);
206 Workspace<MultiVectorMutable::vec_mut_ptr_t> targ_vecs_s(wss,num_targ_multi_vecs);
207 Workspace<VectorMutable*> targ_vecs(wss,num_targ_multi_vecs);
209 {
for(
size_type j = sec_first_ele_in; j <= sec_first_ele_in - 1 + sec_sub_dim; ++j) {
211 {
for(
size_type k = 0; k < num_multi_vecs; ++k) {
212 vecs_s[k] = vec( *multi_vecs[k], j, apply_by );
213 vecs[k] = vecs_s[k].get();
215 {
for(
size_type k = 0; k < num_targ_multi_vecs; ++k) {
216 targ_vecs_s[k] = vec( targ_multi_vecs[k], j, apply_by );
217 targ_vecs[k] = targ_vecs_s[k].get();
222 ,num_multi_vecs, num_multi_vecs ? &vecs[0] : NULL
223 ,num_targ_multi_vecs, num_targ_multi_vecs ? &targ_vecs[0] : NULL
224 ,reduct_objs ? reduct_objs[j-1] : NULL
225 ,prim_first_ele_in, prim_sub_dim_in, prim_global_offset_in
237 ,
const size_t num_multi_vecs,
const MultiVector* multi_vecs[]
239 ,RTOpPack::ReductTarget *reduct_obj
253 sec_sub_dim = ( sec_sub_dim_in != 0 ? sec_sub_dim_in : sec_dim );
258 Workspace<Teuchos::RCP<RTOpPack::ReductTarget> > rcp_reduct_objs(wss,sec_sub_dim);
259 Workspace<RTOpPack::ReductTarget*> reduct_objs(wss,sec_sub_dim);
261 rcp_reduct_objs[k] = prim_op.reduct_obj_create();
262 reduct_objs[k] = &*rcp_reduct_objs[k];
268 ,num_multi_vecs, multi_vecs
269 ,num_targ_multi_vecs, targ_multi_vecs
271 ,prim_first_ele_in, prim_sub_dim_in, prim_global_offset_in
272 ,sec_first_ele_in, sec_sub_dim_in
278 sec_op.reduce_reduct_objs( *reduct_objs[k], Teuchos::ptr(reduct_obj) );
333 ,
const size_t num_multi_vecs
335 ,
const size_t num_targ_multi_vecs
337 ,RTOpPack::ReductTarget* reduct_objs[]
348 ,num_multi_vecs,multi_vecs,num_targ_multi_vecs,targ_multi_vecs
349 ,reduct_objs,primary_first_ele,primary_sub_dim,primary_global_offset
350 ,secondary_first_ele,secondary_sub_dim
352 else if(num_targ_multi_vecs)
355 ,num_multi_vecs,multi_vecs,num_targ_multi_vecs,targ_multi_vecs
356 ,reduct_objs,primary_first_ele,primary_sub_dim,primary_global_offset
357 ,secondary_first_ele,secondary_sub_dim
365 ,
const size_t num_multi_vecs
367 ,
const size_t num_targ_multi_vecs
369 ,RTOpPack::ReductTarget *reduct_obj
379 apply_by,primary_op,secondary_op
380 ,num_multi_vecs,multi_vecs,num_targ_multi_vecs,targ_multi_vecs
381 ,reduct_obj,primary_first_ele,primary_sub_dim,primary_global_offset
382 ,secondary_first_ele,secondary_sub_dim
384 else if(num_targ_multi_vecs)
386 apply_by,primary_op,secondary_op
387 ,num_multi_vecs,multi_vecs,num_targ_multi_vecs,targ_multi_vecs
388 ,reduct_obj,primary_first_ele,primary_sub_dim,primary_global_offset
389 ,secondary_first_ele,secondary_sub_dim
AbstractLinAlgPack::size_type size_type
mat_ptr_t clone() const
Returns this->mv_clone().
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
RTOp_index_type index_type
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
virtual access_by_t access_by() const =0
Return a bit field for the types of access that are the most convenient.
RTOp_value_type value_type
mat_ptr_t sub_view(const Range1D &row_rng, const Range1D &col_rng) const
Returns this->mv_sub_view(row_rng,col_rng) casted to a MatrixOp.
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
Provides a specialized implementation for mwo_rhs1 of type MatrixSymDiag.
virtual size_type cols() const
Return the number of columns in the matrix.
. One-based subregion index range class.
RTOpT< RTOp_value_type > RTOp
RTOp_index_type size_type
Teuchos::RCP< const MultiVector > multi_vec_ptr_t
void Mp_MtM_assert_compatibility(MatrixOp *m_lhs, BLAS_Cpp::Transp trans_lhs, const MatrixOp &m_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &m_rhs2, BLAS_Cpp::Transp trans_rhs2)
op(m_lhs) += op(m_rhs1) * op(m_rhs2)
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.
const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_dbl_prec const LAPACK_C_Decl::f_int const LAPACK_C_Decl::f_dbl_prec LAPACK_C_Decl::f_dbl_prec * C
const f_int f_dbl_prec a[]
Base class for all matrices that support basic matrix operations.
Interface for a collection of non-mutable vectors (multi-vector, matrix).
virtual vec_mut_ptr_t row(index_type i)=0
Get a mutable row vector.
Interface to all diagonal matrices {abstract}.
virtual multi_vec_ptr_t mv_sub_view(const Range1D &row_rng, const Range1D &col_rng) const
Returns a sub-view of the multi vector.
Transp trans_not(Transp _trans)
Return the opposite of the transpose argument.
Interface for a collection of mutable vectors (multi-vector, matrix).
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[]=NULL, const index_type primary_first_ele=1, const index_type primary_sub_dim=0, const index_type primary_global_offset=0, const index_type secondary_first_ele=1, const index_type secondary_sub_dim=0)
Apply a reduction/transformation operator column by column and return an array of the reduction objec...
friend 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)
virtual 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
Apply a reduction/transformation operator row by row, or column by column and return an array of the ...
virtual size_type rows() const
Return the number of rows in the matrix.
virtual multi_vec_ptr_t mv_clone() const
Clone the non-const multi-vector object.
virtual vec_ptr_t col(index_type j) const =0
Get a non-mutable column vector.
virtual vec_mut_ptr_t col(index_type j)=0
Get a mutable column vector.
virtual vec_ptr_t row(index_type i) const =0
Get a non-mutable row vector.
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)
TEUCHOSCORE_LIB_DLL_EXPORT Teuchos::RCP< WorkspaceStore > get_default_workspace_store()