Namespace ae108::tensor
Namespace List > ae108 > tensor
Multi dimensional arrays based on std::array. More...
Public Types
Type | Name |
---|---|
typedef typename detail::TensorImpl< T, Sizes... >::type | Tensor An alias for an array of arrays. For instance, in the case of a matrix, the first size parameter is the number of rows and the second size parameter is the number of columns. |
Public Functions
Type | Name |
---|---|
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, Cols_,(Rows_==1 &&Cols_ > 1) ? Eigen::RowMajor :Eigen::ColMajor > > | as_matrix_of_columns (std::array< std::array< ValueType_, Rows_ >, Cols_ > & data) Interprets the input as a an array of colums and returns an Eigen matrix. |
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, Cols_,(Rows_==1 &&Cols_ > 1) ? Eigen::RowMajor :Eigen::ColMajor > > | as_matrix_of_columns (const std::array< std::array< ValueType_, Rows_ >, Cols_ > & data) Interprets the input as a an array of colums and returns a constant Eigen matrix. |
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, Cols_,(Cols_==1 &&Rows_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > | as_matrix_of_rows (std::array< std::array< ValueType_, Cols_ >, Rows_ > & data) Interprets the input as a an array of colums and returns an Eigen matrix. |
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, Cols_,(Cols_==1 &&Rows_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > | as_matrix_of_rows (const std::array< std::array< ValueType_, Cols_ >, Rows_ > & data) Interprets the input as a an array of colums and returns a constant Eigen matrix. |
Eigen::Map< Eigen::Matrix< ValueType_, A_ *B_, C_ *D_,(C_ *D_==1 &&A_ *B_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > | as_two_tensor (std::array< std::array< std::array< std::array< ValueType_, D_ >, C_ >, B_ >, A_ > & data) Interprets the input 4-tensor as a row-major 2-tensor matrix. |
Eigen::Map< const Eigen::Matrix< ValueType_, A_ *B_, C_ *D_,(C_ *D_==1 &&A_ *B_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > | as_two_tensor (const std::array< std::array< std::array< std::array< ValueType_, D_ >, C_ >, B_ >, A_ > & data) Interprets the input 4-tensor as a row-major 2-tensor matrix. |
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, 1 > > | as_vector (std::array< ValueType_, Rows_ > & data) Interprets the input as a vector and returns an Eigen vector. |
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, 1 > > | as_vector (const std::array< ValueType_, Rows_ > & data) Interprets the input as a vector and returns a constant Eigen vector. |
Eigen::Map< Eigen::Matrix< ValueType_, Rows_ *Cols_, 1 > > | as_vector (std::array< std::array< ValueType_, Cols_ >, Rows_ > & data) Interprets the input as a vector of columns stacked on top of each other and returns an Eigen vector. |
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_ *Cols_, 1 > > | as_vector (const std::array< std::array< ValueType_, Cols_ >, Rows_ > & data) Interprets the input as a vector of columns stacked on top of each other and returns a constant Eigen vector. |
std::decay_t< T > | differentiate (F && f, T && t) Calls a Boost library function to perform finite difference differentiation. Only supports differentiation of real-valued functions of one real-valued parameter. |
std::array< typename EigenType_::Scalar, EigenType_::ColsAtCompileTime *EigenType_::RowsAtCompileTime > | to_array (const EigenType_ & vec) Converts an Eigen column or row vector to a std::array. |
Detailed Description
Library about multi dimensional arrays ae108::tensor::Tensor which Eigen can operate on via ae108::tensor::as_vector / ae108::tensor::as_matrix_of_columns / ae108::tensor::as_matrix_of_rows views.
Public Types Documentation
typedef Tensor
An alias for an array of arrays. For instance, in the case of a matrix, the first size parameter is the number of rows and the second size parameter is the number of columns.
using ae108::tensor::Tensor = typedef typename detail::TensorImpl<T, Sizes...>::type;
Template parameters:
T
The value type.
Remark:
The values are stored in row-major format. For instance, a matrix is stored as an array of rows.
Public Functions Documentation
function as_matrix_of_columns
Interprets the input as a an array of colums and returns an Eigen matrix.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, Cols_,(Rows_==1 &&Cols_ > 1) ? Eigen::RowMajor :Eigen::ColMajor > > ae108::tensor::as_matrix_of_columns (
std::array< std::array< ValueType_, Rows_ >, Cols_ > & data
)
function as_matrix_of_columns
Interprets the input as a an array of colums and returns a constant Eigen matrix.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, Cols_,(Rows_==1 &&Cols_ > 1) ? Eigen::RowMajor :Eigen::ColMajor > > ae108::tensor::as_matrix_of_columns (
const std::array< std::array< ValueType_, Rows_ >, Cols_ > & data
)
function as_matrix_of_rows
Interprets the input as a an array of colums and returns an Eigen matrix.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, Cols_,(Cols_==1 &&Rows_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > ae108::tensor::as_matrix_of_rows (
std::array< std::array< ValueType_, Cols_ >, Rows_ > & data
)
function as_matrix_of_rows
Interprets the input as a an array of colums and returns a constant Eigen matrix.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, Cols_,(Cols_==1 &&Rows_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > ae108::tensor::as_matrix_of_rows (
const std::array< std::array< ValueType_, Cols_ >, Rows_ > & data
)
function as_two_tensor
Interprets the input 4-tensor as a row-major 2-tensor matrix.
template<class ValueType_, std::size_t A_, std::size_t B_, std::size_t C_, std::size_t D_>
Eigen::Map< Eigen::Matrix< ValueType_, A_ *B_, C_ *D_,(C_ *D_==1 &&A_ *B_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > ae108::tensor::as_two_tensor (
std::array< std::array< std::array< std::array< ValueType_, D_ >, C_ >, B_ >, A_ > & data
)
function as_two_tensor
Interprets the input 4-tensor as a row-major 2-tensor matrix.
template<class ValueType_, std::size_t A_, std::size_t B_, std::size_t C_, std::size_t D_>
Eigen::Map< const Eigen::Matrix< ValueType_, A_ *B_, C_ *D_,(C_ *D_==1 &&A_ *B_ !=1) ? Eigen::ColMajor :Eigen::RowMajor > > ae108::tensor::as_two_tensor (
const std::array< std::array< std::array< std::array< ValueType_, D_ >, C_ >, B_ >, A_ > & data
)
function as_vector
Interprets the input as a vector and returns an Eigen vector.
template<class ValueType_, std::size_t Rows_>
Eigen::Map< Eigen::Matrix< ValueType_, Rows_, 1 > > ae108::tensor::as_vector (
std::array< ValueType_, Rows_ > & data
)
function as_vector
Interprets the input as a vector and returns a constant Eigen vector.
template<class ValueType_, std::size_t Rows_>
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_, 1 > > ae108::tensor::as_vector (
const std::array< ValueType_, Rows_ > & data
)
function as_vector
Interprets the input as a vector of columns stacked on top of each other and returns an Eigen vector.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< Eigen::Matrix< ValueType_, Rows_ *Cols_, 1 > > ae108::tensor::as_vector (
std::array< std::array< ValueType_, Cols_ >, Rows_ > & data
)
function as_vector
Interprets the input as a vector of columns stacked on top of each other and returns a constant Eigen vector.
template<class ValueType_, std::size_t Rows_, std::size_t Cols_>
Eigen::Map< const Eigen::Matrix< ValueType_, Rows_ *Cols_, 1 > > ae108::tensor::as_vector (
const std::array< std::array< ValueType_, Cols_ >, Rows_ > & data
)
function differentiate
Calls a Boost library function to perform finite difference differentiation. Only supports differentiation of real-valued functions of one real-valued parameter.
template<class T, class F>
std::decay_t< T > ae108::tensor::differentiate (
F && f,
T && t
)
function to_array
Converts an Eigen column or row vector to a std::array.
template<class EigenType_>
std::array< typename EigenType_::Scalar, EigenType_::ColsAtCompileTime *EigenType_::RowsAtCompileTime > ae108::tensor::to_array (
const EigenType_ & vec
)
The documentation for this class was generated from the following file tensor/src/include/ae108/tensor/as_matrix_of_columns.h