![]() |
Eigen-unsupported
3.3.3
|
The tensor class.
The Tensor class is the work-horse for all dense tensors within Eigen.
The Tensor class encompasses only dynamic-size objects so far.
The first two template parameters are required:
Scalar_ | Numeric type, e.g. float, double, int or std::complex<float>. User defined scalar types are supported as well (see here). |
NumIndices_ | Number of indices (i.e. rank of the tensor) |
The remaining template parameters are optional -- in most cases you don't have to worry about them.
You can access elements of tensors using normal subscripting:
Eigen::Tensor<double, 4> t(10, 10, 10, 10); t(0, 1, 2, 3) = 42.0;
This class can be extended with the help of the plugin mechanism described on the page TopicCustomizingEigen by defining the preprocessor symbol EIGEN_TENSOR_PLUGIN
.
Some notes:
TopicStorageOrders
Public Member Functions | |
void | resize (const array< Index, NumIndices > &dimensions) |
template<typename std::ptrdiff_t... Indices> | |
void | resize (const Sizes< Indices...> &dimensions) |
Tensor (const array< Index, NumIndices > &dimensions) |
Eigen::Tensor< Scalar_, NumIndices_, Options_, IndexType_ >::Tensor | ( | const array< Index, NumIndices > & | dimensions | ) | [inline, explicit] |
Normal Dimension
void Eigen::Tensor< Scalar_, NumIndices_, Options_, IndexType_ >::resize | ( | const array< Index, NumIndices > & | dimensions | ) | [inline] |
Normal Dimension
void Eigen::Tensor< Scalar_, NumIndices_, Options_, IndexType_ >::resize | ( | const Sizes< Indices...> & | dimensions | ) | [inline] |
Custom Dimension