ICRS Eurobot 2013

Dependencies:   mbed mbed-rtos Servo QEI

Embed: (wiki syntax)

« Back to documentation index

gemm< Rows1, Cols1, Cols2 > Class Template Reference

gemm< Rows1, Cols1, Cols2 > Class Template Reference

class for matrix-matrix product using loop unrolling. More...

#include <tvmet/loop/Gemm.h>


Detailed Description

template<std::size_t Rows1, std::size_t Cols1, std::size_t Cols2>
class tvmet::loop::gemm< Rows1, Cols1, Cols2 >

class for matrix-matrix product using loop unrolling.

using formula

\[ M_1\,M_2 \]

Example:
 template<class T, std::size_t Rows1, std::size_t Cols1, std::size_t Cols2>
 inline
 void
 prod(const Matrix<T, Rows1, Cols1>& lhs, const Matrix<T, Cols1, Cols2>& rhs,
     Matrix<T, Rows1, Cols2>& dest)
 {
   for (std::size_t i = 0; i != Rows1; ++i) {
     for (std::size_t j = 0; j != Cols2; ++j) {
       dest(i, j) = tvmet::loop::gemm<Rows1, Cols1, Cols2>().prod(lhs, rhs, i, j);
     }
   }
 }
Note:
The number of rows of rhs matrix have to be equal to cols of lhs matrix. The result is a (Rows1 x Cols2) matrix.

Definition at line 59 of file loop/Gemm.h.