43 #ifndef SPARSE_VECTOR_SLICE_OP_H
44 #define SPARSE_VECTOR_SLICE_OP_H
46 #include "AbstractLinAlgPack_SparseVectorOp.hpp"
47 #include "DenseLinAlgPack_AssertOp.hpp"
48 #include "DenseLinAlgPack_DVectorOp.hpp"
50 namespace AbstractLinAlgPack {
80 value_type
dot(
const DVectorSlice& vs_rhs1,
const SparseVectorSlice<T_Ele>& sv_rhs2)
82 return dot_V_SV(vs_rhs1, sv_rhs2);
88 value_type
dot(
const SparseVectorSlice<T_Ele>& sv_rhs1,
const DVectorSlice& vs_rhs2)
90 return dot_SV_V(sv_rhs1, vs_rhs2);
96 value_type norm_1(
const SparseVectorSlice<T_Ele>& sv_rhs)
98 return norm_1_SV(sv_rhs);
102 template<
class T_Ele>
104 value_type norm_2(
const SparseVectorSlice<T_Ele>& sv_rhs)
106 return norm_2_SV(sv_rhs);
110 template<
class T_Ele>
112 value_type norm_inf(
const SparseVectorSlice<T_Ele>& sv_rhs)
114 return norm_inf_SV(sv_rhs);
118 template<
class T_Ele>
120 value_type max(
const SparseVectorSlice<T_Ele>& sv_rhs)
122 return max_SV(sv_rhs);
126 template<
class T_Ele>
128 value_type min(
const SparseVectorSlice<T_Ele>& sv_rhs)
130 return min_SV(sv_rhs);
134 template<
class T_Ele>
136 void Vp_StV(DVectorSlice* vs_lhs, value_type alpha,
const SparseVectorSlice<T_Ele>& sv_rhs)
138 Vp_StSV(vs_lhs, alpha, sv_rhs);
142 template<
class T_Ele>
144 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSlice& gms_rhs1
147 Vp_StMtSV(vs_lhs, alpha, gms_rhs1, trans_rhs1, sv_rhs2);
151 template<
class T_Ele>
153 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSliceTri& tri_gms_rhs1
156 Vp_StMtSV(vs_lhs, alpha, tri_gms_rhs1, trans_rhs1, sv_rhs2);
160 template<
class T_Ele>
162 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSliceSym& sym_gms_rhs1
165 Vp_StMtSV(vs_lhs, alpha, sym_gms_rhs1, trans_rhs1, sv_rhs2);
178 template<
class M,
class T_Ele>
180 void Vp_StMtSVS(DVectorSlice* vs_lhs, value_type alpha,
const M& M_rhs1
184 using DenseLinAlgPack::Vp_MtV_assert_sizes;
186 Vp_MtV_assert_sizes(vs_lhs->dim(), M_rhs1.rows(), M_rhs1.cols(), trans_rhs1, sv_rhs2.dim());
191 Vp_StMtV(vs_lhs,alpha,M_rhs1,trans_rhs1,sv_rhs2);
195 template<
class T_Ele>
197 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSlice& gms_rhs1
200 { Vp_StMtSVS(vs_lhs, alpha, gms_rhs1, trans_rhs1, sv_rhs2, beta); }
203 template<
class T_Ele>
205 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSliceTri& tri_gms_rhs1
208 { Vp_StMtSVS(vs_lhs, alpha, tri_gms_rhs1, trans_rhs1, sv_rhs2, beta); }
211 template<
class T_Ele>
213 void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha,
const DMatrixSliceSym& sym_gms_rhs1
216 { Vp_StMtSVS(vs_lhs, alpha, sym_gms_rhs1, trans_rhs1, sv_rhs2, beta); }
222 #endif // SPARSE_VECTOR_SLICE_OP_H
void Vt_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs *= alpha
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
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)
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2