![]() |
Eigen-unsupported
3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)
|
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.
Options_ | A combination of either RowMajor or ColMajor, and of either AutoAlign or DontAlign. The former controls storage order, and defaults to column-major. The latter controls alignment, which is required for vectorization. It defaults to aligning tensors. Note that tensors currently do not support any operations that profit from vectorization. Support for such operations (i.e. adding two tensors etc.) is planned. |
You can access elements of tensors using normal subscripting:
This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_TENSOR_PLUGIN
, EIGEN_TENSORBASE_PLUGIN
, and EIGEN_READONLY_TENSORBASE_PLUGIN
.
Some notes:
Public Member Functions | |
void | resize (const array< Index, NumIndices > &dimensions) |
template<typename CustomDimension > | |
void | resize (CustomDimension &dimensions) |
Tensor (const array< Index, NumIndices > &dimensions) | |
|
inlineexplicit |
Normal Dimension
|
inline |
Normal Dimension
|
inline |
Custom Dimension