C++
C#
VB
JScript
All

# gemm

Copyright (C) 2005 IENT-RWTH Aachen

template<int TransA,int TransB,class G1,class G2,class G3> void gemm(const typename Matrix<G1>::value_type &a, const Matrix<G1> &A, const Matrix<G2> &B, const typename Matrix<G3>::value_type &b, Matrix<G3> &C)

C=a*mul(A,B)+b*C

Remarks

TransA and TransB are template arguments to transpose A and B. (0=No Transpose, 1=Transpose, 2=Conjugate Transpose)

Example

    gemm     (  A,B,  C);  // C =  mul(A,     B ), equivalent to gemm<0,0>(1,A,B,0,C)
    gemm     (2,A,B,  C);  // C =2*mul(A,     B ), equivalent to gemm<0,0>(2,A,B,0,C)
    gemm     (2,A,B,1,C);  // C+=2*mul(A,     B ), equivalent to gemm<0,0>(2,A,B,1,C)
    gemm<0,1>(  A,B,  C);  // C =  mul(A,trn (B)), equivalent to gemm<0,1>(1,A,B,0,C)
    gemm<0,1>(2,A,B,  C);  // C =2*mul(A,trn (B)), equivalent to gemm<0,1>(2,A,B,0,C)
    gemm<0,1>(2,A,B,1,C);  // C+=2*mul(A,trn (B))
    gemm<0,2>(  A,B,  C);  // C =  mul(A,htrn(B)), equivalent to gemm<0,2>(1,A,B,0,C)
    gemm<0,2>(2,A,B,  C);  // C =2*mul(A,htrn(B)), equivalent to gemm<0,2>(2,A,B,0,C)
    gemm<0,2>(2,A,B,1,C);  // C+=2*mul(A,htrn(B))