|
Tiny Vector Matrix library using Expression Templates | Sourceforge Project Page |
![]() |
Functions | |
template<class E , std::size_t Rows, std::size_t Cols> | |
bool | tvmet::all_elements (const XprMatrix< E, Rows, Cols > &e) |
check on statements for all elementsThis is for use with boolean operators like | |
template<class E , std::size_t Rows, std::size_t Cols> | |
bool | tvmet::any_elements (const XprMatrix< E, Rows, Cols > &e) |
check on statements for any elementsThis is for use with boolean operators like | |
template<class T , std::size_t Rows, std::size_t Cols> | |
XprMatrix< XprMatrixTranspose < MatrixConstReference< T, Rows, Cols > >, Cols, Rows > | tvmet::trans (const Matrix< T, Rows, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE |
Transpose the matrix. | |
template<class T , std::size_t Sz> | |
XprVector< XprMatrixDiag < MatrixConstReference< T, Sz, Sz >, Sz >, Sz > | tvmet::diag (const Matrix< T, Sz, Sz > &m) TVMET_CXX_ALWAYS_INLINE |
Returns the diagonal vector of the given square matrix. | |
template<class E , std::size_t Rows, std::size_t Cols> | |
Extremum< typename E::value_type, std::size_t, matrix_tag > | tvmet::maximum (const XprMatrix< E, Rows, Cols > &e) |
Find the maximum of a matrix expression. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
Extremum< T, std::size_t, matrix_tag > | tvmet::maximum (const Matrix< T, Rows, Cols > &m) TVMET_CXX_ALWAYS_INLINE |
Find the maximum of a matrix. | |
template<class E , std::size_t Rows, std::size_t Cols> | |
Extremum< typename E::value_type, std::size_t, matrix_tag > | tvmet::minimum (const XprMatrix< E, Rows, Cols > &e) |
Find the minimum of a matrix expression. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
Extremum< T, std::size_t, matrix_tag > | tvmet::minimum (const Matrix< T, Rows, Cols > &m) TVMET_CXX_ALWAYS_INLINE |
Find the minimum of a matrix. | |
template<class E , std::size_t Rows, std::size_t Cols> | |
E::value_type | tvmet::max (const XprMatrix< E, Rows, Cols > &e) |
Find the maximum of a matrix expression. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
T | tvmet::max (const Matrix< T, Rows, Cols > &m) TVMET_CXX_ALWAYS_INLINE |
Find the maximum of a matrix. | |
template<class E , std::size_t Rows, std::size_t Cols> | |
E::value_type | tvmet::min (const XprMatrix< E, Rows, Cols > &e) |
Find the minimum of a matrix expression. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
T | tvmet::min (const Matrix< T, Rows, Cols > &m) TVMET_CXX_ALWAYS_INLINE |
Find the minimum of a matrix. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
XprMatrix< XprIdentity< T, Rows, Cols >, Rows, Cols > | tvmet::identity () TVMET_CXX_ALWAYS_INLINE |
Fill a matrix to an identity matrix. | |
template<class T , std::size_t Rows, std::size_t Cols> | |
XprMatrix < MatrixConstReference< T, Rows, Cols >, Rows, Cols > | tvmet::cmatrix_ref (const T *mem) TVMET_CXX_ALWAYS_INLINE |
Creates an expression wrapper for a C like matrices. | |
template<class E , std::size_t Sz> | |
bool | tvmet::all_elements (const XprVector< E, Sz > &e) |
check on statements for all elementsThis is for use with boolean operators like | |
template<class E , std::size_t Sz> | |
bool | tvmet::any_elements (const XprVector< E, Sz > &e) |
check on statements for any elementsThis is for use with boolean operators like | |
template<class T , std::size_t Sz> | |
NumericTraits< T >::sum_type | tvmet::sum (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Compute the sum of the vector. | |
template<class T , std::size_t Sz> | |
NumericTraits< T >::sum_type | tvmet::product (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Compute the product of the vector elements. | |
template<class T , std::size_t Sz> | |
NumericTraits< T >::sum_type | tvmet::norm1 (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
The ![]() | |
template<class T , std::size_t Sz> | |
NumericTraits< T >::sum_type | tvmet::norm2 (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
The euklidian norm (or ![]() | |
template<class T , std::size_t Sz> | |
XprVector< XprBinOp< Fcnl_div < T, T >, VectorConstReference < T, Sz >, XprLiteral< T > >, Sz > | tvmet::normalize (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Normalize the given vector. | |
template<class E , std::size_t Sz> | |
Extremum< typename E::value_type, std::size_t, vector_tag > | tvmet::maximum (const XprVector< E, Sz > &e) |
Find the maximum of a vector expression. | |
template<class T , std::size_t Sz> | |
Extremum< T, std::size_t, vector_tag > | tvmet::maximum (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Find the maximum of a vector. | |
template<class E , std::size_t Sz> | |
Extremum< typename E::value_type, std::size_t, vector_tag > | tvmet::minimum (const XprVector< E, Sz > &e) |
Find the minimum of a vector expression. | |
template<class T , std::size_t Sz> | |
Extremum< T, std::size_t, vector_tag > | tvmet::minimum (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Find the minimum of a vector. | |
template<class E , std::size_t Sz> | |
E::value_type | tvmet::max (const XprVector< E, Sz > &e) |
Find the maximum of a vector expression. | |
template<class T , std::size_t Sz> | |
T | tvmet::max (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Find the maximum of a vector. | |
template<class E , std::size_t Sz> | |
E::value_type | tvmet::min (const XprVector< E, Sz > &e) |
Find the minimum of a vector expression. | |
template<class T , std::size_t Sz> | |
T | tvmet::min (const Vector< T, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
Find the minimum of a vector. | |
template<class T , std::size_t Sz> | |
XprVector < VectorConstReference< T, Sz > , Sz > | tvmet::cvector_ref (const T *mem) TVMET_CXX_ALWAYS_INLINE |
Creates an expression wrapper for a C like vector arrays. | |
template<class E , std::size_t Rows, std::size_t Cols> | |
XprMatrix< XprMatrixTranspose < XprMatrix< E, Rows, Cols > >, Cols, Rows > | tvmet::trans (const XprMatrix< E, Rows, Cols > &rhs) TVMET_CXX_ALWAYS_INLINE |
Transpose an expression matrix. | |
template<class E , std::size_t Sz> | |
XprVector< XprMatrixDiag < XprMatrix< E, Sz, Sz >, Sz > , Sz > | tvmet::diag (const XprMatrix< E, Sz, Sz > &m) TVMET_CXX_ALWAYS_INLINE |
Returns the diagonal vector of the given square matrix. | |
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 E , std::size_t Sz> | |
NumericTraits< typename E::value_type >::sum_type | tvmet::norm1 (const XprVector< E, Sz > &v) TVMET_CXX_ALWAYS_INLINE |
The ![]() | |
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 ![]() | |
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. |
bool tvmet::all_elements | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
check on statements for all elementsThis is for use with boolean operators like
all_elements(matrix > 0) { // true branch } else { // false branch }
References tvmet::meta::Matrix< Rows, Cols, M, N >::all_elements().
bool tvmet::all_elements | ( | const XprVector< E, Sz > & | e | ) | [inline] |
check on statements for all elementsThis is for use with boolean operators like
all_elements(vector > 0) { // true branch } else { // false branch }
References tvmet::meta::Vector< Sz, K >::all_elements().
bool tvmet::any_elements | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
check on statements for any elementsThis is for use with boolean operators like
any_elements(matrix > 0) { // true branch } else { // false branch }
References tvmet::meta::Matrix< Rows, Cols, M, N >::any_elements().
bool tvmet::any_elements | ( | const XprVector< E, Sz > & | e | ) | [inline] |
check on statements for any elementsThis is for use with boolean operators like
any_elements(vector > 0) { // true branch } else { // false branch }
References tvmet::meta::Vector< Sz, K >::any_elements().
XprMatrix< MatrixConstReference< T, Rows, Cols >, Rows, Cols > tvmet::cmatrix_ref | ( | const T * | mem | ) | [inline] |
Creates an expression wrapper for a C like matrices.
This is like creating a matrix of external data, as described at Construction and Initializing. With this function you wrap an expression around a C style matrix and you can operate directly with it as usual.
static float lhs[3][3] = { {-1, 0, 1}, { 1, 0, 1}, {-1, 0, -1} }; static float rhs[3][3] = { { 0, 1, 1}, { 0, 1, -1}, { 0, -1, 1} }; ... typedef Matrix<float, 3, 3> matrix_type; matrix_type M( cmatrix_ref<float, 3, 3>(&lhs[0][0]) * cmatrix_ref<float, 3, 3>(&rhs[0][0]) );
XprVector< VectorConstReference< T, Sz >, Sz > tvmet::cvector_ref | ( | const T * | mem | ) | [inline] |
Creates an expression wrapper for a C like vector arrays.
This is like creating a vector of external data, as described at Construction and Initializing. With this function you wrap an expression around a C style vector array and you can operate directly with it as usual.
static float vertices[N][3] = { {-1, 0, 1}, { 1, 0, 1}, ... }; ... typedef Vector<float, 3> vector_type; ... vector_type V( cross(cvector_ref<float, 3>(&vertices[0][0]), cvector_ref<float, 3>(&vertices[1][0])) );
XprVector< XprMatrixDiag< MatrixConstReference< T, Sz, Sz >, Sz >, Sz > tvmet::diag | ( | const Matrix< T, Sz, Sz > & | m | ) | [inline] |
Returns the diagonal vector of the given square matrix.
References tvmet::Matrix< T, NRows, NCols >::const_ref().
XprVector< XprMatrixDiag< XprMatrix< E, Sz, Sz >, Sz >, Sz > tvmet::diag | ( | const XprMatrix< E, Sz, Sz > & | m | ) | [inline] |
Returns the diagonal vector of the given square matrix.
XprMatrix< XprIdentity< typename M::value_type, M::Rows, M::Cols >, M::Rows, M::Cols > tvmet::identity | ( | ) | [inline] |
Fill a matrix to an identity matrix.
Fill a matrix to an identity matrix (convenience wrapper for matrix typedefs).
typedef Matrix<double,3,3> matrix_type;
...
matrix_type E( identity<double, 3, 3>() );
Note, we have to specify the type, number of rows and columns since ADL can't work here.
typedef Matrix<double,3,3> matrix_type;
...
matrix_type E( identity<matrix_type>() );
Note, we have to specify the matrix type, since ADL can't work here.
E::value_type tvmet::max | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
Find the maximum of a matrix expression.
Referenced by tvmet::NumericTraits< std::complex< long double > >::equals(), tvmet::NumericTraits< std::complex< double > >::equals(), tvmet::NumericTraits< std::complex< float > >::equals(), tvmet::NumericTraits< long double >::equals(), tvmet::NumericTraits< double >::equals(), tvmet::NumericTraits< float >::equals(), tvmet::NumericTraits< T >::equals(), tvmet::NumericTraits< std::complex< long double > >::norm_inf(), tvmet::NumericTraits< std::complex< double > >::norm_inf(), tvmet::NumericTraits< std::complex< float > >::norm_inf(), tvmet::NumericTraits< std::complex< unsigned long > >::norm_inf(), tvmet::NumericTraits< std::complex< long > >::norm_inf(), tvmet::NumericTraits< std::complex< unsigned int > >::norm_inf(), tvmet::NumericTraits< std::complex< int > >::norm_inf(), tvmet::NumericTraits< T >::norm_inf(), and tvmet::IoPrintHelper< C >::width().
T tvmet::max | ( | const Matrix< T, Rows, Cols > & | m | ) | [inline] |
Find the maximum of a matrix.
References tvmet::Matrix< T, NRows, NCols >::begin(), and tvmet::Matrix< T, NRows, NCols >::end().
E::value_type tvmet::max | ( | const XprVector< E, Sz > & | e | ) | [inline] |
Find the maximum of a vector expression.
T tvmet::max | ( | const Vector< T, Sz > & | v | ) | [inline] |
Find the maximum of a vector.
References tvmet::Vector< T, Sz >::begin(), and tvmet::Vector< T, Sz >::end().
Extremum< typename E::value_type, std::size_t, matrix_tag > tvmet::maximum | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
Find the maximum of a matrix expression.
Referenced by tvmet::maximum().
Extremum< typename E::value_type, std::size_t, vector_tag > tvmet::maximum | ( | const XprVector< E, Sz > & | e | ) | [inline] |
Find the maximum of a vector expression.
Extremum< T, std::size_t, vector_tag > tvmet::maximum | ( | const Vector< T, Sz > & | v | ) | [inline] |
Find the maximum of a vector.
References tvmet::Vector< T, Sz >::as_expr(), and tvmet::maximum().
Extremum< T, std::size_t, matrix_tag > tvmet::maximum | ( | const Matrix< T, Rows, Cols > & | m | ) | [inline] |
Find the maximum of a matrix.
References tvmet::Matrix< T, NRows, NCols >::as_expr(), and tvmet::maximum().
E::value_type tvmet::min | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
Find the minimum of a matrix expression.
Referenced by tvmet::NumericTraits< std::complex< long double > >::equals(), tvmet::NumericTraits< std::complex< double > >::equals(), tvmet::NumericTraits< std::complex< float > >::equals(), tvmet::NumericTraits< long double >::equals(), tvmet::NumericTraits< double >::equals(), tvmet::NumericTraits< float >::equals(), tvmet::NumericTraits< T >::equals(), and tvmet::IoPrintHelper< C >::width().
T tvmet::min | ( | const Matrix< T, Rows, Cols > & | m | ) | [inline] |
Find the minimum of a matrix.
References tvmet::Matrix< T, NRows, NCols >::begin(), and tvmet::Matrix< T, NRows, NCols >::end().
E::value_type tvmet::min | ( | const XprVector< E, Sz > & | e | ) | [inline] |
Find the minimum of a vector expression.
T tvmet::min | ( | const Vector< T, Sz > & | v | ) | [inline] |
Find the minimum of a vector.
References tvmet::Vector< T, Sz >::begin(), and tvmet::Vector< T, Sz >::end().
Extremum< T, std::size_t, matrix_tag > tvmet::minimum | ( | const Matrix< T, Rows, Cols > & | m | ) | [inline] |
Find the minimum of a matrix.
References tvmet::Matrix< T, NRows, NCols >::as_expr(), and tvmet::minimum().
Extremum< typename E::value_type, std::size_t, matrix_tag > tvmet::minimum | ( | const XprMatrix< E, Rows, Cols > & | e | ) | [inline] |
Find the minimum of a matrix expression.
Referenced by tvmet::minimum().
Extremum< T, std::size_t, vector_tag > tvmet::minimum | ( | const Vector< T, Sz > & | v | ) | [inline] |
Find the minimum of a vector.
References tvmet::Vector< T, Sz >::as_expr(), and tvmet::minimum().
Extremum< typename E::value_type, std::size_t, vector_tag > tvmet::minimum | ( | const XprVector< E, Sz > & | e | ) | [inline] |
Find the minimum of a vector expression.
NumericTraits< typename E::value_type >::sum_type tvmet::norm1 | ( | const XprVector< E, Sz > & | v | ) | [inline] |
The norm of a vector expression.
The norm of any vector is just the square root of the dot product of a vector with itself, or
References tvmet::sum().
NumericTraits< T >::sum_type tvmet::norm1 | ( | const Vector< T, Sz > & | v | ) | [inline] |
The norm of a vector v.
The norm of any vector is just the square root of the dot product of a vector with itself, or
References tvmet::sum().
NumericTraits< T >::sum_type tvmet::norm2 | ( | const Vector< T, Sz > & | v | ) | [inline] |
The euklidian norm (or norm) of a vector v.
The norm of any vector is just the square root of the dot product of a vector with itself, or
References tvmet::dot().
Referenced by tvmet::normalize().
NumericTraits< typename E::value_type >::sum_type tvmet::norm2 | ( | const XprVector< E, Sz > & | v | ) | [inline] |
The euklidian norm (or norm) of a vector expression.
The norm of any vector is just the square root of the dot product of a vector with itself, or
References tvmet::dot().
XprVector< XprBinOp< Fcnl_div< T, T >, VectorConstReference< T, Sz >, XprLiteral< T > >, Sz > tvmet::normalize | ( | const Vector< T, Sz > & | v | ) | [inline] |
Normalize the given vector.
using the equation:
References tvmet::Vector< T, Sz >::const_ref(), and tvmet::norm2().
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 | ) | [inline] |
Normalize the given vector expression.
using the equation:
References tvmet::norm2().
NumericTraits< T >::sum_type tvmet::product | ( | const Vector< T, Sz > & | v | ) | [inline] |
Compute the product of the vector elements.
Simply computer the product of the given vector as:
References tvmet::meta::Vector< Sz, K >::product().
NumericTraits< typename E::value_type >::sum_type tvmet::product | ( | const XprVector< E, Sz > & | v | ) | [inline] |
Compute the product of the vector elements.
Simply computer the product of the given vector expression as:
References tvmet::meta::Vector< Sz, K >::product().
NumericTraits< T >::sum_type tvmet::sum | ( | const Vector< T, Sz > & | v | ) | [inline] |
Compute the sum of the vector.
Simply compute the sum of the given vector as:
References tvmet::meta::Vector< Sz, K >::sum().
Referenced by tvmet::util::Gemm(), tvmet::norm1(), tvmet::loop::gemv< Rows, Cols >::prod(), tvmet::loop::gemtv< Rows, Cols >::prod(), tvmet::loop::gemtm< Rows1, Cols1, Cols2 >::prod(), tvmet::loop::gemmt< Rows1, Cols1, Cols2 >::prod(), and tvmet::loop::gemm< Rows1, Cols1, Cols2 >::prod().
NumericTraits< typename E::value_type >::sum_type tvmet::sum | ( | const XprVector< E, Sz > & | v | ) | [inline] |
Compute the sum of the vector expression.
Simply compute the sum of the given vector as:
References tvmet::meta::Vector< Sz, K >::sum().
XprMatrix< XprMatrixTranspose< XprMatrix< E, Rows, Cols > >, Cols, Rows > tvmet::trans | ( | const XprMatrix< E, Rows, Cols > & | rhs | ) | [inline] |
Transpose an expression matrix.
XprMatrix< XprMatrixTranspose< MatrixConstReference< T, Rows, Cols > >, Cols, Rows > tvmet::trans | ( | const Matrix< T, Rows, Cols > & | rhs | ) | [inline] |
Transpose the matrix.
References tvmet::Matrix< T, NRows, NCols >::const_ref().
Author: |