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

Namespaces | Defines | Functions
include/tvmet/xpr/VectorFunctions.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.


Defines

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

Functions

 tvmet::TVMET_DECLARE_MACRO (add) TVMET_DECLARE_MACRO(sub) namespace element_wise
template<class E , std::size_t Sz>
NumericTraits< typename
E::value_type >::sum_type 
tvmet::sum (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE
 Compute the sum of the vector expression.
template<class E , std::size_t Sz>
NumericTraits< typename
E::value_type >::sum_type 
tvmet::product (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE
 Compute the product of the vector elements.
template<class E1 , class E2 , std::size_t Sz>
PromoteTraits< typename
E1::value_type, typename
E2::value_type >::value_type 
tvmet::dot (const XprVector< E1, Sz > &lhs, const XprVector< E2, Sz > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the dot/inner productCompute the dot product as:

\[ \sum_{i = 0}^{Sz - 1} ( lhs[i] * rhs[i] ) \]

where lhs is a column vector and rhs is a row vector, both vectors have the same dimension.

template<class T , class E , std::size_t Sz>
PromoteTraits< T, typename
E::value_type >::value_type 
tvmet::dot (const Vector< T, Sz > &lhs, const XprVector< E, Sz > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the dot/inner productCompute the dot product as:

\[ \sum_{i = 0}^{Sz - 1} ( lhs[i] * rhs[i] ) \]

where lhs is a column vector and rhs is a row vector, both vectors have the same dimension.

template<class E , class T , std::size_t Sz>
PromoteTraits< T, typename
E::value_type >::value_type 
tvmet::dot (const XprVector< E, Sz > &lhs, const Vector< T, Sz > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the dot/inner productCompute the dot product as:

\[ \sum_{i = 0}^{Sz - 1} ( lhs[i] * rhs[i] ) \]

where lhs is a column vector and rhs is a row vector, both vectors have the same dimension.

template<class E1 , class E2 >
Vector< typename PromoteTraits
< typename E1::value_type,
typename E2::value_type >
::value_type, 3 > 
tvmet::cross (const XprVector< E1, 3 > &lhs, const XprVector< E2, 3 > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the cross/outer product.
template<class T , class E >
Vector< typename PromoteTraits
< T, typename E::value_type >
::value_type, 3 > 
tvmet::cross (const Vector< T, 3 > &lhs, const XprVector< E, 3 > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the cross/outer product.
template<class E , class T >
Vector< typename PromoteTraits
< T, typename E::value_type >
::value_type, 3 > 
tvmet::cross (const XprVector< E, 3 > &lhs, const Vector< T, 3 > &rhs) TVMET_CXX_ALWAYS_INLINE
 Compute the cross/outer product.
template<class E , std::size_t Sz>
NumericTraits< typename
E::value_type >::sum_type 
tvmet::norm1 (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE
 The $l_1$ norm of a vector expression.
template<class E , std::size_t Sz>
NumericTraits< typename
E::value_type >::sum_type 
tvmet::norm2 (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE
 The euklidian norm (or $l_2$ norm) of a vector expression.
template<class E , std::size_t Sz>
XprVector< XprBinOp< Fcnl_div
< typename E::value_type,
typename E::value_type >
, XprVector< E, Sz >
, XprLiteral< typename
E::value_type > >, Sz > 
tvmet::normalize (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE
 Normalize the given vector expression.
 tvmet::TVMET_IMPLEMENT_MACRO (add) TVMET_IMPLEMENT_MACRO(sub) namespace element_wise
template<class T1 , class E2 >
Vector< typename PromoteTraits
< T1, typename E2::value_type >
::value_type, 3 > 
tvmet::cross (const Vector< T1, 3 > &lhs, const XprVector< E2, 3 > &rhs)

Define Documentation

#define TVMET_DECLARE_MACRO (   NAME)
Value:
template<class E1, class E2, std::size_t Sz>        \
XprVector<                \
  XprBinOp<               \
    Fcnl_##NAME<typename E1::value_type, typename E2::value_type>,  \
    XprVector<E1, Sz>,              \
    XprVector<E2, Sz>             \
  >,                  \
  Sz                  \
>                 \
NAME (const XprVector<E1, Sz>& lhs,         \
      const XprVector<E2, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME,
  POD 
)
Value:
template<class E, std::size_t Sz>       \
XprVector<              \
  XprBinOp<             \
    Fcnl_##NAME< typename E::value_type, POD >,     \
    XprVector<E, Sz>,           \
    XprLiteral< POD >           \
  >,                \
  Sz                \
>               \
NAME (const XprVector<E, Sz>& lhs,        \
      POD rhs) TVMET_CXX_ALWAYS_INLINE;       \
                \
template<class E, std::size_t Sz>       \
XprVector<              \
  XprBinOp<             \
    Fcnl_##NAME< POD, typename E::value_type>,      \
    XprLiteral< POD >,            \
    XprVector<E, Sz>            \
  >,                \
  Sz                \
>               \
NAME (POD lhs,              \
      const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_DECLARE_MACRO (   NAME)
Value:
template<class E, std::size_t Sz, class T>      \
XprVector<              \
  XprBinOp<             \
    Fcnl_##NAME< typename E::value_type, std::complex<T> >, \
    XprVector<E, Sz>,           \
    XprLiteral< std::complex<T> >       \
  >,                \
  Sz                \
>               \
NAME (const XprVector<E, Sz>& lhs,        \
      const std::complex<T>& rhs) TVMET_CXX_ALWAYS_INLINE;  \
                \
template<class E, std::size_t Sz, class T>      \
XprVector<              \
  XprBinOp<             \
    Fcnl_##NAME< std::complex<T>, typename E::value_type>,  \
    XprLiteral< std::complex<T> >,        \
    XprVector<E, Sz>            \
  >,                \
  Sz                \
>               \
NAME (const std::complex<T>& lhs,         \
      const XprVector<E, Sz>& rhs) TVMET_CXX_ALWAYS_INLINE;
#define TVMET_IMPLEMENT_MACRO (   NAME)
Value:
template<class E1, class E2, std::size_t Sz>        \
inline                  \
XprVector<                \
  XprBinOp<               \
    Fcnl_##NAME<typename E1::value_type, typename E2::value_type>,  \
    XprVector<E1, Sz>,              \
    XprVector<E2, Sz>             \
  >,                  \
  Sz                  \
>                 \
NAME (const XprVector<E1, Sz>& lhs, const XprVector<E2, Sz>& rhs) { \
  typedef XprBinOp<             \
    Fcnl_##NAME<typename E1::value_type, typename E2::value_type>,  \
    XprVector<E1, Sz>,              \
    XprVector<E2, Sz>             \
  >                expr_type; \
  return XprVector<expr_type, Sz>(expr_type(lhs, rhs));     \
}
#define TVMET_IMPLEMENT_MACRO (   NAME,
  POD 
)
#define TVMET_IMPLEMENT_MACRO (   NAME)
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Defines

Author: