Default linear algebra implementation operations.


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.
template<class V>
void LinAlgOpPack::assign (VectorMutable *v_lhs, const V &V_rhs)
 v_lhs = V_rhs.
template<class V>
void LinAlgOpPack::V_StV (VectorMutable *v_lhs, value_type alpha, const V &V_rhs)
 v_lhs = alpha * V_rhs.
template<class V>
void LinAlgOpPack::V_mV (VectorMutable *v_lhs, const V &V_rhs)
 v_lhs = - V_rhs.
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.
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.

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).

Functions

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

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 329 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 429 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 437 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 336 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 445 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 455 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 465 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 345 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 35 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 44 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 351 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 53 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 65 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 77 of file AbstractLinAlgPack_AbstractLinAlgOpPack.cpp.


Generated on Thu Sep 18 12:36:06 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1