42 #ifndef COO_MATRIX_TMPL_OP_DEF_H
43 #define COO_MATRIX_TMPL_OP_DEF_H
51 namespace AbstractLinAlgPack {
60 template<
class T_COOM>
65 , coom_rhs.rows(), coom_rhs.cols(), trans_rhs );
66 typename T_COOM::difference_type
67 i_o = coom_rhs.row_offset(),
68 j_o = coom_rhs.col_offset();
70 for(
typename T_COOM::const_iterator itr = coom_rhs.begin(); itr != coom_rhs.end(); ++itr)
71 (*gms_lhs)(itr->row_i()+i_o,itr->col_j()+j_o) += alpha * itr->value();
73 for(
typename T_COOM::const_iterator itr = coom_rhs.begin(); itr != coom_rhs.end(); ++itr)
74 (*gms_lhs)(itr->col_j()+j_o,itr->row_i()+i_o) += alpha * itr->value();
78 template<
class T_COOM>
83 typename T_COOM::difference_type
84 i_o = coom_rhs1.row_offset(),
85 j_o = coom_rhs1.col_offset();
87 for(
typename T_COOM::const_iterator itr = coom_rhs1.begin(); itr != coom_rhs1.end(); ++itr)
88 (*vs_lhs)(itr->row_i()+i_o) += alpha * itr->value() * vs_rhs2(itr->col_j()+j_o);
90 for(
typename T_COOM::const_iterator itr = coom_rhs1.begin(); itr != coom_rhs1.end(); ++itr)
91 (*vs_lhs)(itr->col_j()+j_o) += alpha * itr->value() * vs_rhs2(itr->row_i()+i_o);
94 namespace UtilityPack {
97 template<
class T_COOM>
106 template<
class T_COOM>
111 , coom_rhs1.rows(), coom_rhs1.cols(), trans_rhs1
112 , gms_rhs2.
rows() ,gms_rhs2.
cols(), trans_rhs2 );
118 template<
class T_COOM>
123 , gms_rhs1.
rows() ,gms_rhs1.
cols(), trans_rhs1
124 , coom_rhs2.rows(), coom_rhs2.cols(), trans_rhs2 );
126 , trans_rhs1, coom_rhs2, trans_rhs2 );
151 namespace UtilityPack {
192 template<
class T_COOM>
201 typename T_COOM::difference_type
202 i_o = coom_rhs2.row_offset(),
203 j_o = coom_rhs2.col_offset();
204 for(
typename T_COOM::const_iterator itr = coom_rhs2.begin(); itr != coom_rhs2.end(); ++itr) {
205 size_type i =
rows( itr->row_i() + i_o , itr->col_j() + j_o , trans_rhs2 ),
206 j =
cols( itr->row_i() + i_o , itr->col_j() + j_o , trans_rhs2 );
209 ,
col(gms_rhs1,trans_rhs1,i) );
217 #endif // COO_MATRIX_TMPL_OP_DEF_H
void Vp_StV(DVectorSlice *vs_lhs, value_type alpha, const DVectorSlice &vs_rhs)
vs_lhs += alpha * vs_rhs (BLAS xAXPY)
size_type dim() const
Returns the number of elements of the VectorSliceTmpl.
void imp_Mp_StMtCOOM(DMatrixSlice &gms_lhs, BLAS_Cpp::Transp trans_lhs, value_type alpha, const DMatrixSlice &gms_rhs1, BLAS_Cpp::Transp trans_rhs1, const T_COOM &coom_rhs2, BLAS_Cpp::Transp trans_rhs2)
size_type cols() const
Return the number of columns.
RTOp_value_type value_type
size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return rows of a possible transposed matrix.
void Mp_StMtCOOM(DMatrixSlice *gms_lhs, value_type alpha, const DMatrixSlice &gms_rhs1, BLAS_Cpp::Transp trans_rhs1, const T_COOM &coom_rhs2, BLAS_Cpp::Transp trans_rhs2)
gms_lhs += alpha * op(gms_rhs1) * op(coom_rhs2) (left) (BLAS xGEMM)
void Mp_MtM_assert_sizes(size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs, size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type m_rhs2_rows, size_type m_rhs2_cols, BLAS_Cpp::Transp trans_rhs2)
op(m_lhs) += op(m_rhs1) * op(m_rhs2)
void Mp_M_assert_sizes(size_type m_lhs_rows, size_type m_lhs_cols, BLAS_Cpp::Transp trans_lhs, size_type m_rhs_rows, size_type m_rhs_cols, BLAS_Cpp::Transp trans_rhs)
op(m_lhs) += op op(m_rhs)
RTOp_index_type size_type
void Mp_StCOOMtM(DMatrixSlice *gms_lhs, value_type alpha, const T_COOM &coom_rhs1, BLAS_Cpp::Transp trans_rhs1, const DMatrixSlice &gms_rhs2, BLAS_Cpp::Transp trans_rhs2)
gms_lhs += alpha * op(coom_rhs1) * op(gms_rhs2) (right) (BLAS xGEMM)
DVectorSlice col(DMatrixSlice &gms, BLAS_Cpp::Transp trans, size_type j)
void Mp_StCOOM(DMatrixSlice *gms_lhs, value_type alpha, const T_COOM &coom_rhs, BLAS_Cpp::Transp trans_rhs)
gms_lhs += alpha * op(coom_rhs) (time = O(coom_rhs.nz(), space = O(1))
void Vp_StCOOMtV(DVectorSlice *vs_lhs, value_type alpha, const T_COOM &coom_rhs1, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2)
vs_lhs += alpha * op(coom_rhs1) * vs_rhs2 (BLAS xGEMV) (time = O(coom_rhs.nz(), space = O(1)) ...
Transp trans_not(Transp _trans)
Return the opposite of the transpose argument.
size_type rows() const
Return the number of rows.
void Vp_MtV_assert_sizes(size_type v_lhs_size, size_type m_rhs1_rows, size_type m_rhs1_cols, BLAS_Cpp::Transp trans_rhs1, size_type v_rhs2_size)
v_lhs += op(m_rhs1) * v_rhs2
size_type cols(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
Return columns of a possible transposed matrix.