|
Self & | base () |
|
const Self & | base () const |
|
const Scalar & | coeff () const |
|
const Scalar & | coeff (const array< Index, NumIndices > &indices) const |
|
template<typename CustomIndices > |
const Scalar & | coeff (CustomIndices &indices) const |
|
template<typename... IndexTypes> |
const Scalar & | coeff (Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const |
|
const Scalar & | coeff (Index index) const |
|
Scalar & | coeffRef () |
|
Scalar & | coeffRef (const array< Index, NumIndices > &indices) |
|
template<typename CustomIndices > |
Scalar & | coeffRef (CustomIndices &indices) |
|
template<typename... IndexTypes> |
Scalar & | coeffRef (Index firstIndex, Index secondIndex, IndexTypes... otherIndices) |
|
Scalar & | coeffRef (Index index) |
|
Scalar * | data () |
|
const Scalar * | data () const |
|
Index | dimension (std::size_t n) const |
|
const Dimensions & | dimensions () const |
|
Scalar & | operator() () |
|
const Scalar & | operator() () const |
|
Scalar & | operator() (const array< Index, NumIndices > &indices) |
|
const Scalar & | operator() (const array< Index, NumIndices > &indices) const |
|
template<typename CustomIndices > |
Scalar & | operator() (CustomIndices &indices) |
|
template<typename CustomIndices > |
const Scalar & | operator() (CustomIndices &indices) const |
|
template<typename... IndexTypes> |
Scalar & | operator() (Index firstIndex, Index secondIndex, IndexTypes... otherIndices) |
|
template<typename... IndexTypes> |
const Scalar & | operator() (Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const |
|
Scalar & | operator() (Index index) |
|
const Scalar & | operator() (Index index) const |
|
template<typename OtherDerived > |
Tensor & | operator= (const OtherDerived &other) |
|
Tensor & | operator= (const Tensor &other) |
|
Tensor & | operator= (Self &&other) |
|
Scalar & | operator[] (Index index) |
|
const Scalar & | operator[] (Index index) const |
|
Index | rank () const |
|
void | resize () |
|
void | resize (const array< Index, NumIndices > &dimensions) |
|
void | resize (const DSizes< Index, NumIndices > &dimensions) |
|
template<typename FirstType , typename... OtherTypes> |
void | resize (const Eigen::IndexList< FirstType, OtherTypes... > &dimensions) |
|
template<typename std::ptrdiff_t... Indices> |
void | resize (const Sizes< Indices... > &dimensions) |
|
template<typename CustomDimension > |
void | resize (CustomDimension &dimensions) |
|
template<typename... IndexTypes> |
void | resize (Index firstDimension, IndexTypes... otherDimensions) |
|
Index | size () const |
|
| Tensor () |
|
| Tensor (const array< Index, NumIndices > &dimensions) |
|
| Tensor (const Self &other) |
|
template<typename OtherDerived > |
| Tensor (const TensorBase< OtherDerived, ReadOnlyAccessors > &other) |
|
template<typename OtherDerived > |
| Tensor (const TensorBase< OtherDerived, WriteAccessors > &other) |
|
template<typename... IndexTypes> |
| Tensor (Index firstDimension, IndexTypes... otherDimensions) |
|
| Tensor (Self &&other) |
|
template<typename Scalar_, int NumIndices_, int Options_, typename IndexType_>
class Eigen::Tensor< Scalar_, NumIndices_, Options_, IndexType_ >
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:
- Template Parameters
-
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.
- Template Parameters
-
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:
- Relation to other parts of Eigen:
- The midterm development goal for this class is to have a similar hierarchy as Eigen uses for matrices, so that taking blocks or using tensors in expressions is easily possible, including an interface with the vector/matrix code by providing .asMatrix() and .asVector() (or similar) methods for rank 2 and 1 tensors. However, currently, the Tensor class does not provide any of these features and is only available as a stand-alone class that just allows for coefficient access. Also, when fixed-size tensors are implemented, the number of template arguments is likely to change dramatically.
Storage orders
Definition at line 66 of file Tensor.h.