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

tvmet::XprMVProduct< E1, Rows, Cols, E2 > Class Template Reference

#include <tvmet/xpr/MVProduct.h>

Inheritance diagram for tvmet::XprMVProduct< E1, Rows, Cols, E2 >:

Inheritance graph
[legend]
Collaboration diagram for tvmet::XprMVProduct< E1, Rows, Cols, E2 >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
class tvmet::XprMVProduct< E1, Rows, Cols, E2 >

Expression for matrix-vector product using formula

\[ M\,v \]

.


Public Types

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

Public Member Functions

 XprMVProduct (const E1 &lhs, const E2 &rhs)
 Constructor.
value_type operator() (std::size_t j) const
 index operator, returns the expression by index.
void print_xpr (std::ostream &os, std::size_t l=0) const

Private Member Functions

 XprMVProduct ()
XprMVProductoperator= (const XprMVProduct &)

Static Private Member Functions

static value_type do_gemv (dispatch< true >, const E1 &lhs, const E2 &rhs, std::size_t j)
 Wrapper for meta gemm.
static value_type do_gemv (dispatch< false >, const E1 &lhs, const E2 &rhs, 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 Rows, std::size_t Cols, class E2>
typedef PromoteTraits< typename E1::value_type, typename E2::value_type >::value_type tvmet::XprMVProduct< E1, Rows, Cols, E2 >::value_type


Member Enumeration Documentation

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
anonymous enum

Complexity counter.

Enumerator:
ops_lhs 
ops_rhs 
M 
N 
ops_plus 
ops_muls 
ops 
use_meta 


Constructor & Destructor Documentation

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
tvmet::XprMVProduct< E1, Rows, Cols, E2 >::XprMVProduct (  )  [private]

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
tvmet::XprMVProduct< E1, Rows, Cols, E2 >::XprMVProduct ( const E1 &  lhs,
const E2 &  rhs 
) [inline, explicit]

Constructor.


Member Function Documentation

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
XprMVProduct& tvmet::XprMVProduct< E1, Rows, Cols, E2 >::operator= ( const XprMVProduct< E1, Rows, Cols, E2 > &   )  [private]

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
static value_type tvmet::XprMVProduct< E1, Rows, Cols, E2 >::do_gemv ( dispatch< true >  ,
const E1 &  lhs,
const E2 &  rhs,
std::size_t  j 
) [inline, static, private]

Wrapper for meta gemm.

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
static value_type tvmet::XprMVProduct< E1, Rows, Cols, E2 >::do_gemv ( dispatch< false >  ,
const E1 &  lhs,
const E2 &  rhs,
std::size_t  j 
) [inline, static, private]

Wrapper for loop gemm.

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
value_type tvmet::XprMVProduct< E1, Rows, Cols, E2 >::operator() ( std::size_t  j  )  const [inline]

index operator, returns the expression by index.

This is the vector style since a matrix*vector gives a vector.

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
void tvmet::XprMVProduct< E1, Rows, Cols, E2 >::print_xpr ( std::ostream &  os,
std::size_t  l = 0 
) const [inline]


Member Data Documentation

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
const E1 tvmet::XprMVProduct< E1, Rows, Cols, E2 >::m_lhs [private]

template<class E1, std::size_t Rows, std::size_t Cols, class E2>
const E2 tvmet::XprMVProduct< E1, Rows, Cols, E2 >::m_rhs [private]


Author: