42 #ifndef ABSTRACT_LIN_ALG_OP_PACK_H
43 #define ABSTRACT_LIN_ALG_OP_PACK_H
45 #include "AbstractLinAlgPack_Types.hpp"
46 #include "AbstractLinAlgPack_MatrixOpNonsing.hpp"
47 #include "AbstractLinAlgPack_VectorMutable.hpp"
48 #include "AbstractLinAlgPack_VectorStdOps.hpp"
49 #include "AbstractLinAlgPack_AssertOp.hpp"
51 namespace LinAlgOpPack {
54 typedef AbstractLinAlgPack::size_type
size_type;
56 typedef AbstractLinAlgPack::value_type value_type;
135 void Vp_V(VectorMutable* v_lhs,
const V& V_rhs);
142 void assign(VectorMutable* v_lhs,
const V& V_rhs);
149 void V_StV(VectorMutable* v_lhs, value_type alpha,
const V& V_rhs);
156 void V_mV(VectorMutable* v_lhs,
const V& V_rhs);
163 template <
class V1,
class V2>
164 void V_VpV(VectorMutable* v_lhs,
const V1& V1_rhs1,
const V2& V2_rhs2);
170 template <
class V1,
class V2>
171 void V_VmV(VectorMutable* v_lhs,
const V1& V1_rhs1,
const V2& V2_rhs2);
178 void V_StVpV(VectorMutable* v_lhs, value_type alpha,
const V& V_rhs1
179 ,
const Vector& vs_rhs2);
217 void M_StM(MatrixOp* M_lhs, value_type alpha,
const MatrixOp& M_rhs
266 void Vp_MtV(VectorMutable* v_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
274 void V_StMtV(VectorMutable* v_lhs, value_type alpha,
const MatrixOp& M_rhs1
282 void V_MtV(VectorMutable* v_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
302 void Mp_MtM(MatrixOp* M_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
309 void Mp_MtM(MatrixOp* M_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
316 void M_StMtM(MatrixOp* M_lhs, value_type alpha,
const MatrixOp& M_rhs1
323 void M_MtM(MatrixOp* M_lhs,
const MatrixOp& M_rhs1
350 V_StV(v_lhs,-1.0,V_rhs);
359 Mp_StM(M_lhs,1.0,M_rhs,trans_rhs);
365 M_StM(M_lhs,-1.0,M_rhs,trans_rhs);
374 void Vp_MtV(VectorMutable* v_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
377 Vp_StMtV(v_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2);
383 void Vp_MtV(VectorMutable* v_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
384 ,
const V& V_rhs2, value_type beta)
386 Vp_StMtV(v_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2,beta);
394 void Mp_MtM(MatrixOp* M_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
397 Mp_StMtM(M_lhs,1.0,M_rhs1,trans_rhs1,M_rhs2,trans_rhs2);
402 void Mp_MtM(MatrixOp* M_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
405 Mp_StMtM(M_lhs,1.0,M_rhs1,trans_rhs1,M_rhs2,trans_rhs2,beta);
410 void M_InvMtM(MatrixOp* M_lhs,
const MatrixNonsing& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
413 M_StInvMtM(M_lhs,1.0,M_rhs1,trans_rhs1,M_rhs2,trans_rhs2);
422 namespace LinAlgOpPack {
453 Vp_StV(v_lhs,alpha,V_rhs);
457 template <
class V1,
class V2>
467 template <
class V1,
class V2>
473 Vp_StV(v_lhs,-1.0,V2_rhs2);
483 Vp_StV(v_lhs,alpha,V_rhs1);
491 void V_StMtV(VectorMutable* v_lhs, value_type alpha,
const MatrixOp& M_rhs1
495 Vp_StMtV(v_lhs,alpha,M_rhs1,trans_rhs1,V_rhs2,0.0);
500 void V_MtV(VectorMutable* v_lhs,
const MatrixOp& M_rhs1,
BLAS_Cpp::Transp trans_rhs1
504 Vp_StMtV(v_lhs,1.0,M_rhs1,trans_rhs1,V_rhs2,0.0);
509 #endif // ABSTRACT_LIN_ALG_OP_PACK_H
void V_StVpV(VectorMutable *v_lhs, value_type alpha, const V &V_rhs1, const Vector &vs_rhs2)
v_lhs = alpha * V_rhs1 + vs_rhs2.
Abstract interface for immutable, finite dimensional, coordinate vectors {abstract}.
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=1.0)
mwo_lhs = alpha * op(mwo_rhs1) * op(mwo_rhs2) + beta * mwo_lhs (right) (xGEMM).
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
size_type rows(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
void M_mM(MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
gm_lhs = - op(M_rhs).
void V_StV(VectorMutable *v_lhs, value_type alpha, const V &V_rhs)
v_lhs = alpha * V_rhs.
void MopM_assert_compatibility(const MatrixOp &m_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &m_rhs2, BLAS_Cpp::Transp trans_rhs2)
op(m_rhs1) op op(m_rhs2)
void MtV_assert_compatibility(const MatrixOp &m_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
op(m_rhs1) * v_rhs2
void Vp_V_assert_compatibility(VectorMutable *v_lhs, const Vector &v_rhs)
v_lhs += op v_rhs
void M_MmM(MatrixOp *M_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2)
M_lhs = op(M_rhs1) - op(M_rhs2).
void assign(MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
M_lhs = op(M_rhs).
void V_mV(VectorMutable *v_lhs, const V &V_rhs)
v_lhs = - V_rhs.
void MtM_assert_compatibility(const MatrixOp &m_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &m_rhs2, BLAS_Cpp::Transp trans_rhs2)
op(m_lhs) += op(m_rhs1)
Abstract interface for objects that represent a space for mutable coordinate vectors.
void M_MpM(MatrixOp *M_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2)
void M_StM(MatrixOp *M_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
gm_lhs = alpha * M_rhs.
void V_VpV(VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
void syrk(const MatrixOp &mwo_rhs, BLAS_Cpp::Transp M_trans, value_type alpha, value_type beta, MatrixSymOp *sym_lhs)
Perform a rank-k update of a symmetric matrix of the form:
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 V_InvMtV(VectorMutable *v_lhs, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
v_lhs = inv(op(M_rhs1)) * v_rhs2
void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
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 Mp_M(MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
M_lhs += op(M_rhs).
Base class for all matrices that support basic matrix operations.
void Mt_S(MatrixOp *mwo_lhs, value_type alpha)
value_type dot(const Vector &v_rhs1, const Vector &v_rhs2)
result = v_rhs1' * v_rhs2
Abstract interface for mutable coordinate vectors {abstract}.
void Vp_S(VectorMutable *v_lhs, const value_type &alpha)
v_lhs += alpha
value_type sum(const Vector &v_rhs)
result = sum( v_rhs(i), i = 1,,,dim )
Abstract base class for all nonsingular polymorphic matrices that can be used to compute matrix-vecto...
void Vp_MtV_assert_compatibility(VectorMutable *v_lhs, const MatrixOp &m_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2)
v_lhs += op(m_rhs1) * v_rhs2
void M_StInvMtM(MatrixOp *m_lhs, value_type alpha, const MatrixNonsing &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &mwo_rhs2, BLAS_Cpp::Transp trans_rhs2)
m_lhs = alpha * inv(op(mwo_rhs1)) * op(mwo_rhs2) (right)
void M_StMpM(MatrixOp *M_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &gms_rhs2, BLAS_Cpp::Transp trans_rhs2)
M_lhs = alpha * op(M_rhs1) + op(gms_rhs2).
Abstract base class for all nonsingular polymorphic matrices that can solve for linear system with bu...
size_type cols(size_type rows, size_type cols, BLAS_Cpp::Transp _trans)
void V_VmV(VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
v_lhs = V_rhs1 - V_rhs2.
void Mp_M_assert_compatibility(MatrixOp *m_lhs, BLAS_Cpp::Transp trans_lhs, const MatrixOp &m_rhs, BLAS_Cpp::Transp trans_rhs)
op(m_lhs) += op op(m_rhs)
void Vp_V(VectorMutable *v_lhs, const V &V_rhs)
v_lhs += V_rhs.
void VopV_assert_compatibility(const Vector &v_rhs1, const Vector &v_rhs2)
v_rhs1 op v_rhs2