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

Namespaces | Defines | Functions | Variables
include/tvmet/MatrixOperators.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  tvmet
 

The namespace for the Tiny Vector Matrix using Expression Templates Libary.


namespace  tvmet::element_wise
 

Operators inside this namespace does elementwise operations.


Defines

#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_DECLARE_MACRO(NAME, OP, POD)
#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_DECLARE_MACRO(NAME, OP, TP)
#define TVMET_DECLARE_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP, POD)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP, TP)
#define TVMET_IMPLEMENT_MACRO(NAME, OP)

Functions

template<class T , std::size_t Rows, std::size_t Cols>
std::ostream & tvmet::operator<< (std::ostream &os, const Matrix< T, Rows, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE
 Overload operator for i/o.
 tvmet::TVMET_DECLARE_MACRO (add_eq,+=) TVMET_DECLARE_MACRO(sub_eq
std::size_t Cols2 XprMatrix
< XprMMProduct
< MatrixConstReference< T1,
Rows1, Cols1 >, Rows1, Cols1,
MatrixConstReference< T2,
Cols1, Cols2 >, Cols2 >, Rows1,
Cols2 > 
tvmet::operator* (const Matrix< T1, Rows1, Cols1 > &lhs, const Matrix< T2, Cols1, Cols2 > &rhs) TVMET_CXX_ALWAYS_INLINE
template<class E1 , std::size_t Rows1, std::size_t Cols1, class T2 , std::size_t Cols2>
XprMatrix< XprMMProduct
< XprMatrix< E1, Rows1, Cols1 >
, Rows1, Cols1,
MatrixConstReference< T2,
Cols1, Cols2 >, Cols2 >, Rows1,
Cols2 > 
tvmet::operator* (const XprMatrix< E1, Rows1, Cols1 > &lhs, const Matrix< T2, Cols1, Cols2 > &rhs) TVMET_CXX_ALWAYS_INLINE
 Evaluate the product of XprMatrix and Matrix.
template<class T1 , std::size_t Rows1, std::size_t Cols1, class E2 , std::size_t Cols2>
XprMatrix< XprMMProduct
< MatrixConstReference< T1,
Rows1, Cols1 >, Rows1, Cols1,
XprMatrix< E2, Cols1, Cols2 >
, Cols2 >, Rows1, Cols2 > 
tvmet::operator* (const Matrix< T1, Rows1, Cols1 > &lhs, const XprMatrix< E2, Cols1, Cols2 > &rhs) TVMET_CXX_ALWAYS_INLINE
 Evaluate the product of Matrix and XprMatrix.
template<class T1 , std::size_t Rows, std::size_t Cols, class T2 >
XprVector< XprMVProduct
< MatrixConstReference< T1,
Rows, Cols >, Rows, Cols,
VectorConstReference< T2, Cols >
>, Rows > 
tvmet::operator* (const Matrix< T1, Rows, Cols > &lhs, const Vector< T2, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE
 multiply a Matrix with a Vector.
template<class T1 , class E2 , std::size_t Rows, std::size_t Cols>
XprVector< XprMVProduct
< MatrixConstReference< T1,
Rows, Cols >, Rows, Cols,
XprVector< E2, Cols > >, Rows > 
tvmet::operator* (const Matrix< T1, Rows, Cols > &lhs, const XprVector< E2, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE
 Function for the matrix-vector-product.
template<class E1 , class T2 , std::size_t Rows, std::size_t Cols>
XprVector< XprMVProduct
< XprMatrix< E1, Rows, Cols >
, Rows, Cols,
VectorConstReference< T2, Cols >
>, Rows > 
tvmet::operator* (const XprMatrix< E1, Rows, Cols > &lhs, const Vector< T2, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the product of an XprMatrix with a Vector.
 tvmet::TVMET_IMPLEMENT_MACRO (add_eq,+=) TVMET_IMPLEMENT_MACRO(sub_eq

Variables

std::size_t tvmet::Rows1
std::size_t std::size_t tvmet::Cols1

Define Documentation

#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
Value:
template<class T1, class T2, std::size_t Rows, std::size_t Cols>    \
Matrix<T1, Rows, Cols>&               \
operator OP (Matrix<T1, Rows, Cols>& lhs,           \
       const Matrix<T2, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;  \
                    \
template<class T, class E, std::size_t Rows,  std::size_t Cols>     \
Matrix<T, Rows, Cols>&                \
operator OP (Matrix<T, Rows, Cols>& lhs,          \
       const XprMatrix<E, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>         \
XprMatrix<                    \
  XprBinOp<                   \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,          \
    MatrixConstReference< std::complex<T>, Rows, Cols>,         \
    XprLiteral<std::complex<T> >              \
  >,                      \
  Rows, Cols                    \
>                     \
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs,       \
       const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;     \
                      \
template<class T, std::size_t Rows, std::size_t Cols>         \
XprMatrix<                    \
  XprBinOp<                   \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,          \
    XprLiteral< std::complex<T> >,              \
    MatrixConstReference< std::complex<T>, Rows, Cols>          \
  >,                      \
  Rows, Cols                    \
>                     \
operator OP (const std::complex<T>& lhs,            \
       const Matrix< std::complex<T>, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
Value:
template <class T, std::size_t Rows, std::size_t Cols>      \
XprMatrix<                \
  XprUnOp<                \
    Fcnl_##NAME<T>,             \
    MatrixConstReference<T, Rows, Cols>         \
  >,                  \
  Rows, Cols                \
>                 \
operator OP (const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
#define TVMET_DECLARE_MACRO (   NAME,
  OP,
  POD 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>     \
XprMatrix<                \
  XprBinOp<               \
    Fcnl_##NAME<T, POD >,           \
    MatrixConstReference<T, Rows, Cols>,        \
    XprLiteral<POD >              \
  >,                  \
  Rows, Cols                \
>                 \
operator OP (const Matrix<T, Rows, Cols>& lhs,        \
       POD rhs) TVMET_CXX_ALWAYS_INLINE;        \
                  \
template<class T, std::size_t Rows, std::size_t Cols>     \
XprMatrix<                \
  XprBinOp<               \
    Fcnl_##NAME< POD, T>,           \
    XprLiteral< POD >,              \
    MatrixConstReference<T, Rows, Cols>         \
  >,                  \
  Rows, Cols                \
>                 \
operator OP (POD lhs,               \
       const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  OP 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>         \
XprMatrix<                    \
  XprBinOp<                   \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,          \
    MatrixConstReference< std::complex<T>, Rows, Cols>,         \
    XprLiteral<std::complex<T> >              \
  >,                      \
  Rows, Cols                    \
>                     \
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs,       \
       const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;     \
                      \
template<class T, std::size_t Rows, std::size_t Cols>         \
XprMatrix<                    \
  XprBinOp<                   \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,          \
    XprLiteral< std::complex<T> >,              \
    MatrixConstReference< std::complex<T>, Rows, Cols>          \
  >,                      \
  Rows, Cols                    \
>                     \
operator OP (const std::complex<T>& lhs,            \
       const Matrix< std::complex<T>, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  OP,
  TP 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>       \
XprMatrix<                  \
  XprBinOp<                 \
    Fcnl_##NAME<T, TP >,              \
    MatrixConstReference<T, Rows, Cols>,          \
    XprLiteral<TP >               \
  >,                    \
  Rows, Cols                  \
>                   \
operator OP (const Matrix<T, Rows, Cols>& lhs, TP rhs) TVMET_CXX_ALWAYS_INLINE; \
                    \
template<class T, std::size_t Rows, std::size_t Cols>       \
XprMatrix<                  \
  XprBinOp<                 \
    Fcnl_##NAME< TP, T>,              \
    XprLiteral< TP >,               \
    MatrixConstReference<T, Rows, Cols>           \
  >,                    \
  Rows, Cols                  \
>                   \
operator OP (TP lhs, const Matrix<T, Rows, Cols>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
Value:
template<class T1, class T2, std::size_t Rows, std::size_t Cols>    \
inline                    \
Matrix<T1, Rows, Cols>&               \
operator OP (Matrix<T1, Rows, Cols>& lhs, const Matrix<T2, Rows, Cols>& rhs) {  \
  return lhs.M_##NAME(rhs);             \
}                   \
                    \
template<class T, class E, std::size_t Rows,  std::size_t Cols>     \
inline                    \
Matrix<T, Rows, Cols>&                \
operator OP (Matrix<T, Rows, Cols>& lhs, const XprMatrix<E, Rows, Cols>& rhs) { \
  return lhs.M_##NAME(rhs);             \
}
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
Value:
template <class T, std::size_t Rows, std::size_t Cols>           \
inline                       \
XprMatrix<                     \
  XprUnOp<                     \
    Fcnl_##NAME<T>,                  \
    MatrixConstReference<T, Rows, Cols>              \
  >,                       \
  Rows, Cols                     \
>                      \
operator OP (const Matrix<T, Rows, Cols>& rhs) {           \
  typedef XprUnOp<                   \
    Fcnl_##NAME<T>,                  \
    MatrixConstReference<T, Rows, Cols>              \
  >                expr_type;    \
  return XprMatrix<expr_type, Rows, Cols>(expr_type(rhs.const_ref())); \
}
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP,
  POD 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>   \
inline                \
XprMatrix<              \
  XprBinOp<             \
    Fcnl_##NAME<T, POD >,         \
    MatrixConstReference<T, Rows, Cols>,      \
    XprLiteral<POD >            \
  >,                \
  Rows, Cols              \
>               \
operator OP (const Matrix<T, Rows, Cols>& lhs, POD rhs) { \
  return NAME (lhs, rhs);         \
}               \
                \
template<class T, std::size_t Rows, std::size_t Cols>   \
inline                \
XprMatrix<              \
  XprBinOp<             \
    Fcnl_##NAME< POD, T>,         \
    XprLiteral< POD >,            \
    MatrixConstReference<T, Rows, Cols>       \
  >,                \
  Rows, Cols              \
>               \
operator OP (POD lhs, const Matrix<T, Rows, Cols>& rhs) { \
  return NAME (lhs, rhs);         \
}
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
Value:
template<class T, std::size_t Rows, std::size_t Cols>   \
inline                \
XprMatrix<              \
  XprBinOp<             \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,    \
    MatrixConstReference< std::complex<T>, Rows, Cols>,   \
    XprLiteral<std::complex<T> >        \
  >,                \
  Rows, Cols              \
>               \
operator OP (const Matrix< std::complex<T>, Rows, Cols>& lhs, \
       const std::complex<T>& rhs) {      \
  return NAME (lhs, rhs);         \
}               \
                \
template<class T, std::size_t Rows, std::size_t Cols>   \
inline                \
XprMatrix<              \
  XprBinOp<             \
    Fcnl_##NAME< std::complex<T>, std::complex<T> >,    \
    XprLiteral< std::complex<T> >,        \
    MatrixConstReference< std::complex<T>, Rows, Cols>    \
  >,                \
  Rows, Cols              \
>               \
operator OP (const std::complex<T>& lhs,      \
       const Matrix< std::complex<T>, Rows, Cols>& rhs) { \
  return NAME (lhs, rhs);         \
}
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP,
  TP 
)
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
#define TVMET_IMPLEMENT_MACRO (   NAME,
  OP 
)
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Author: