SourceForge Logo Tiny Vector Matrix library using Expression Templates Sourceforge Project Page

tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 > Class Template Reference

#include <tvmet/xpr/MMtProduct.h>

Inheritance diagram for tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >:

Inheritance graph
[legend]
Collaboration diagram for tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
class tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >

Expression for matrix-matrix product.

Using formula:

\[ M_1\,M_2^T \]

Note:
The number of cols of rhs matrix have to be equal to cols of rhs matrix. The result is a (Rows1 x Rows2) matrix.


Public Types

enum  {
  ops_lhs = E1::ops, ops_rhs = E2::ops, Rows2 = Cols1, M = Rows1 * Cols1 * Rows1,
  N = Rows1 * (Cols1 - 1) * Rows2, ops_plus = M * NumericTraits<value_type>::ops_plus, ops_muls = N * NumericTraits<value_type>::ops_muls, ops = ops_plus + ops_muls,
  use_meta = Rows1*Rows2 < TVMET_COMPLEXITY_MM_TRIGGER ? true : false
}
 Complexity counter. More...
typedef PromoteTraits< typename
E1::value_type, typename E2::value_type
>::value_type 
value_type

Public Member Functions

 XprMMtProduct (const E1 &lhs, const E2 &rhs)
 Constructor.
value_type operator() (std::size_t i, std::size_t j) const
 index operator for arrays/matrices
void print_xpr (std::ostream &os, std::size_t l=0) const

Private Member Functions

 XprMMtProduct ()
XprMMtProductoperator= (const XprMMtProduct &)

Static Private Member Functions

static value_type do_gemmt (dispatch< true >, const E1 &lhs, const E2 &rhs, std::size_t i, std::size_t j)
 Wrapper for meta gemm.
static value_type do_gemmt (dispatch< false >, const E1 &lhs, const E2 &rhs, std::size_t i, std::size_t j)
 Wrapper for loop gemm.

Private Attributes

const E1 m_lhs
const E2 m_rhs


Member Typedef Documentation

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
typedef PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::value_type


Member Enumeration Documentation

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
anonymous enum

Complexity counter.

Enumerator:
ops_lhs 
ops_rhs 
Rows2 
M 
N 
ops_plus 
ops_muls 
ops 
use_meta 


Constructor & Destructor Documentation

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::XprMMtProduct (  )  [private]

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::XprMMtProduct ( const E1 &  lhs,
const E2 &  rhs 
) [inline, explicit]

Constructor.


Member Function Documentation

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
XprMMtProduct& tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::operator= ( const XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 > &   )  [private]

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
static value_type tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::do_gemmt ( dispatch< true >  ,
const E1 &  lhs,
const E2 &  rhs,
std::size_t  i,
std::size_t  j 
) [inline, static, private]

Wrapper for meta gemm.

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
static value_type tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::do_gemmt ( dispatch< false >  ,
const E1 &  lhs,
const E2 &  rhs,
std::size_t  i,
std::size_t  j 
) [inline, static, private]

Wrapper for loop gemm.

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
value_type tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::operator() ( std::size_t  i,
std::size_t  j 
) const [inline]

index operator for arrays/matrices

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
void tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const [inline]


Member Data Documentation

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
const E1 tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::m_lhs [private]

template<class E1, std::size_t Rows1, std::size_t Cols1, class E2, std::size_t Cols2>
const E2 tvmet::XprMMtProduct< E1, Rows1, Cols1, E2, Cols2 >::m_rhs [private]


Author: