MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
Default linear algebra implementation operations.

Functions

void LinAlgOpPack::assign (MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 M_lhs = op(M_rhs). More...
 
void LinAlgOpPack::M_StM (MatrixOp *M_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 gm_lhs = alpha * M_rhs. More...
 
void LinAlgOpPack::M_mM (MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 gm_lhs = - op(M_rhs). More...
 
void LinAlgOpPack::M_MpM (MatrixOp *M_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const MatrixOp &M_rhs2, BLAS_Cpp::Transp trans_rhs2)
 
void LinAlgOpPack::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). More...
 
void LinAlgOpPack::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). More...
 

Level 1 BLAS for Vectors

For these functions to work for the type V the following function must be defined:

// v_lhs += alpha * V_rhs
void Vp_StV(VectorMutable* v_lhs, value_type alpha, const V& V_rhs);

The rest of these level 1 BLAS functions implement the variations.

template<class V >
void LinAlgOpPack::Vp_V (VectorMutable *v_lhs, const V &V_rhs)
 v_lhs += V_rhs. More...
 
template<class V >
void LinAlgOpPack::assign (VectorMutable *v_lhs, const V &V_rhs)
 v_lhs = V_rhs. More...
 
template<class V >
void LinAlgOpPack::V_StV (VectorMutable *v_lhs, value_type alpha, const V &V_rhs)
 v_lhs = alpha * V_rhs. More...
 
template<class V >
void LinAlgOpPack::V_mV (VectorMutable *v_lhs, const V &V_rhs)
 v_lhs = - V_rhs. More...
 
template<class V1 , class V2 >
void LinAlgOpPack::V_VpV (VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
 
template<class V1 , class V2 >
void LinAlgOpPack::V_VmV (VectorMutable *v_lhs, const V1 &V1_rhs1, const V2 &V2_rhs2)
 v_lhs = V_rhs1 - V_rhs2. More...
 
template<class V >
void LinAlgOpPack::V_StVpV (VectorMutable *v_lhs, value_type alpha, const V &V_rhs1, const Vector &vs_rhs2)
 v_lhs = alpha * V_rhs1 + vs_rhs2. More...
 

Level 1 BLAS for Matrices

For these functions to work for the type M the following function must be defined:

// M_lhs += alpha * op(M_rhs) \ void Mp_StM(MatrixOp* v_lhs, value_type alpha, const V& V_rhs, BLAS_Cpp::Transp);

The rest of these level 1 BLAS functions implement the variations.

void LinAlgOpPack::Mp_M (MatrixOp *M_lhs, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
 M_lhs += op(M_rhs). More...
 

Detailed Description

These are template functions that can be used to perform simpler linear algebra operations given more elaborate ones. The idea is that for each combination of vector and matrix types, the BLAS like operations must be provided and then these template functions provide related linear algebra operations. The user can override these default implementations by defining the exact functions himself.

Warning! In general it is not allowed for the lhs argument to be used in the rhs expression. Concidering aliasing would make the operations much more complicated to implement. So unless you are sure that it is okay, do not use a vector or matrix object in both the lhs and rhs expressions.

Function Documentation

template<class V >
void LinAlgOpPack::Vp_V ( VectorMutable *  v_lhs,
const V &  V_rhs 
)
inline

v_lhs += V_rhs.

Calls: Vp_StV(v_lhs,1.0,V_rhs);

Definition at line 342 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V >
void LinAlgOpPack::assign ( VectorMutable *  v_lhs,
const V &  V_rhs 
)

v_lhs = V_rhs.

Calls: Vp_V(v_lhs,V_rhs);

Definition at line 442 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V >
void LinAlgOpPack::V_StV ( VectorMutable *  v_lhs,
value_type  alpha,
const V &  V_rhs 
)

v_lhs = alpha * V_rhs.

Calls: Vp_StV(v_lhs,alpha,V_rhs);

Definition at line 450 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V >
void LinAlgOpPack::V_mV ( VectorMutable *  v_lhs,
const V &  V_rhs 
)
inline

v_lhs = - V_rhs.

Calls: V_StV(v_lhs,-1.0,V_rhs);

Definition at line 349 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V1 , class V2 >
void LinAlgOpPack::V_VpV ( VectorMutable *  v_lhs,
const V1 &  V1_rhs1,
const V2 &  V2_rhs2 
)

v_lhs = V1_rhs1 + V2_rhs2.

Calls: Vp_V(v_lhs,V1_rhs1); Vp_V(v_lhs,V1_rhs2);

Definition at line 458 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V1 , class V2 >
void LinAlgOpPack::V_VmV ( VectorMutable *  v_lhs,
const V1 &  V1_rhs1,
const V2 &  V2_rhs2 
)

v_lhs = V_rhs1 - V_rhs2.

Calls: Vp_V(v_lhs,V1_rhs1); Vp_StV(v_lhs,-1.0,V2_rhs2);

Definition at line 468 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

template<class V >
void LinAlgOpPack::V_StVpV ( VectorMutable *  v_lhs,
value_type  alpha,
const V &  V_rhs1,
const Vector &  vs_rhs2 
)

v_lhs = alpha * V_rhs1 + vs_rhs2.

Calls: Vp_StV(v_lhs,alpha,V_rhs1);

Definition at line 478 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

void LinAlgOpPack::Mp_M ( MatrixOp *  M_lhs,
const MatrixOp &  M_rhs,
BLAS_Cpp::Transp  trans_rhs 
)
inline

M_lhs += op(M_rhs).

Calls: Mp_StM(M_lhs,1.0,M_rhs,trans_rhs);

Definition at line 358 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

void LinAlgOpPack::assign ( MatrixOp *  M_lhs,
const MatrixOp &  M_rhs,
BLAS_Cpp::Transp  trans_rhs 
)

M_lhs = op(M_rhs).

Calls: Mp_M(M_lhs,M_rhs,trans_rhs);

Definition at line 48 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.

void LinAlgOpPack::M_StM ( MatrixOp *  M_lhs,
value_type  alpha,
const MatrixOp &  M_rhs,
BLAS_Cpp::Transp  trans_rhs 
)

gm_lhs = alpha * M_rhs.

Calls: Mp_StM(&(*gm_lhs)(),alpha,M_rhs,trans_rhs);

Definition at line 57 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.

void LinAlgOpPack::M_mM ( MatrixOp *  M_lhs,
const MatrixOp &  M_rhs,
BLAS_Cpp::Transp  trans_rhs 
)
inline

gm_lhs = - op(M_rhs).

Calls: M_StM(&(*gm_lhs)(),-1.0,M_rhs,trans_rhs);

Definition at line 364 of file AbstractLinAlgPack_LinAlgOpPack.hpp.

void LinAlgOpPack::M_MpM ( 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).

Calls: Mp_M(M_lhs,M_rhs1,trans_rhs1); Mp_M(M_lhs,M_rhs2,trans_rhs2);

Definition at line 66 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.

void LinAlgOpPack::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).

Calls: Mp_M(M_lhs,M_rhs1,trans_rhs1); Mp_StM(M_lhs,-1.0,M_rhs2,trans_rhs2);

Definition at line 78 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.

void LinAlgOpPack::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).

Calls: Mp_StM(M_lhs,alpha,M_rhs1,trans_rhs1);

Definition at line 90 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.