11#ifndef EIGEN_CXX11_TENSOR_TENSOR_H
12#define EIGEN_CXX11_TENSOR_TENSOR_H
62template<
typename Scalar_,
int NumIndices_,
int Options_,
typename IndexType_>
89#ifdef EIGEN_HAS_SFINAE
90 template<
typename CustomIndices>
91 struct isOfNormalIndex{
94 static const bool value = is_array | is_int;
113#if EIGEN_HAS_VARIADIC_TEMPLATES
114 template<
typename... IndexTypes>
131#ifdef EIGEN_HAS_SFINAE
132 template<
typename CustomIndices,
153#if EIGEN_HAS_VARIADIC_TEMPLATES
154 template<
typename... IndexTypes>
171#ifdef EIGEN_HAS_SFINAE
172 template<
typename CustomIndices,
193#if EIGEN_HAS_VARIADIC_TEMPLATES
194 template<
typename... IndexTypes>
225#ifdef EIGEN_HAS_SFINAE
226 template<
typename CustomIndices,
238 return coeff(indices);
260#if EIGEN_HAS_VARIADIC_TEMPLATES
261 template<
typename... IndexTypes>
298#ifdef EIGEN_HAS_SFINAE
299 template<
typename CustomIndices,
339#if EIGEN_HAS_VARIADIC_TEMPLATES
340 template<
typename... IndexTypes>
342 :
m_storage(firstDimension, otherDimensions...)
382 template<
typename OtherDerived>
387 Assign assign(*
this, other.
derived());
392 template<
typename OtherDerived>
397 Assign assign(*
this, other.
derived());
402 #if EIGEN_HAS_RVALUE_REFERENCES
420 Assign assign(*
this, other);
425 template<
typename OtherDerived>
430 Assign assign(*
this, other);
436#if EIGEN_HAS_VARIADIC_TEMPLATES
438 void resize(
Index firstDimension, IndexTypes... otherDimensions)
455 #ifdef EIGEN_INITIALIZE_COEFFS
456 bool size_changed =
size != this->
size();
480#ifdef EIGEN_HAS_INDEX_LIST
481 template <
typename FirstType,
typename... OtherTypes>
493#ifdef EIGEN_HAS_SFINAE
494 template<
typename CustomDimension,
503#ifndef EIGEN_EMULATE_CXX11_META_H
504 template <
typename std::ptrdiff_t... Indices>
514 template <std::
size_t V1, std::
size_t V2, std::
size_t V3, std::
size_t V4, std::
size_t V5>
537 array_apply_and_reduce<logical_and_op, greater_equal_zero_op>(indices) &&
int n
Definition BiCGSTAB_simple.cpp:1
int i
Definition BiCGSTAB_step_by_step.cpp:9
#define eigen_internal_assert(x)
Definition Macros.h:1043
#define EIGEN_DEVICE_FUNC
Definition Macros.h:976
#define eigen_assert(x)
Definition Macros.h:1037
#define EIGEN_STRONG_INLINE
Definition Macros.h:917
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
Definition PlainObjectBase.h:22
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:127
#define EIGEN_SFINAE_ENABLE_IF(__condition__)
Definition TensorMacros.h:43
SCALAR Scalar
Definition bench_gemm.cpp:46
Definition TensorAssign.h:62
The tensor base class.
Definition TensorBase.h:973
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & derived()
Definition TensorBase.h:1169
Definition TensorStorage.h:40
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T * data()
Definition TensorStorage.h:54
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex size() const
Definition TensorStorage.h:66
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const FixedDimensions & dimensions()
Definition TensorStorage.h:59
The tensor class.
Definition Tensor.h:64
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const Self &other)
Definition Tensor.h:334
static const int Options
Definition Tensor.h:82
TensorStorage< Scalar, Dimensions, Options > m_storage
Definition Tensor.h:87
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(const array< Index, NumIndices > &indices)
Definition Tensor.h:164
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(const array< Index, NumIndices > &indices) const
Definition Tensor.h:124
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor()
Definition Tensor.h:328
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff() const
Definition Tensor.h:141
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(Index i0, Index i1, Index i2, Index i3, Index i4) const
Definition Tensor.h:218
DSizes< Index, NumIndices_ > Dimensions
Definition Tensor.h:84
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index index)
Definition Tensor.h:308
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & operator=(const Tensor &other)
Definition Tensor.h:417
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()() const
Definition Tensor.h:247
EIGEN_DEVICE_FUNC void resize(const Sizes< Indices... > &dimensions)
Definition Tensor.h:506
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(Index i0, Index i1, Index i2) const
Definition Tensor.h:208
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index linearizedIndex(const array< Index, NumIndices > &indices) const
Definition Tensor.h:542
EIGEN_DEVICE_FUNC void resize(const array< Index, NumIndices > &dimensions)
Definition Tensor.h:447
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4)
Definition Tensor.h:363
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator[](Index index)
Definition Tensor.h:320
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(Index i0, Index i1) const
Definition Tensor.h:203
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()()
Definition Tensor.h:314
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & operator=(const OtherDerived &other)
Definition Tensor.h:427
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const array< Index, NumIndices > &dimensions)
Definition Tensor.h:376
@ Layout
Definition Tensor.h:77
@ CoordAccess
Definition Tensor.h:78
@ IsAligned
Definition Tensor.h:76
@ RawAccess
Definition Tensor.h:79
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3, Index i4)
Definition Tensor.h:285
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(const array< Index, NumIndices > &indices)
Definition Tensor.h:292
EIGEN_DEVICE_FUNC void resize(const DSizes< Index, NumIndices > &dimensions)
Definition Tensor.h:465
static const int NumIndices
Definition Tensor.h:83
Base::CoeffReturnType CoeffReturnType
Definition Tensor.h:73
bool checkIndexRange(const array< Index, NumIndices > &indices) const
Definition Tensor.h:527
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
Definition Tensor.h:104
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition Tensor.h:103
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef()
Definition Tensor.h:181
Self & base()
Definition Tensor.h:110
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2)
Definition Tensor.h:353
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const TensorBase< OtherDerived, WriteAccessors > &other)
Definition Tensor.h:394
TensorBase< Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > Base
Definition Tensor.h:67
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3)
Definition Tensor.h:280
Tensor< Scalar_, NumIndices_, Options_, IndexType_ > Self
Definition Tensor.h:66
EIGEN_DEVICE_FUNC void resize()
Definition Tensor.h:474
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator[](Index index) const
Definition Tensor.h:253
NumTraits< Scalar >::Real RealScalar
Definition Tensor.h:72
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3)
Definition Tensor.h:358
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
Definition Tensor.h:101
Scalar_ Scalar
Definition Tensor.h:71
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4, Index dim5)
Definition Tensor.h:368
internal::traits< Self >::Index Index
Definition Tensor.h:70
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(const array< Index, NumIndices > &indices) const
Definition Tensor.h:236
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(Index i0, Index i1, Index i2, Index i3) const
Definition Tensor.h:213
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition Tensor.h:187
Eigen::internal::nested< Self >::type Nested
Definition Tensor.h:68
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const TensorBase< OtherDerived, ReadOnlyAccessors > &other)
Definition Tensor.h:384
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & coeff(Index index) const
Definition Tensor.h:147
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar & operator()(Index index) const
Definition Tensor.h:241
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1)
Definition Tensor.h:270
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1)
Definition Tensor.h:348
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar * data() const
Definition Tensor.h:105
const Self & base() const
Definition Tensor.h:111
internal::traits< Self >::StorageKind StorageKind
Definition Tensor.h:69
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
Definition Tensor.h:100
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2)
Definition Tensor.h:275
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions & dimensions() const
Definition Tensor.h:102
Definition EmulateArray.h:21
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(const Expression &expr, const Device &device=Device())
Definition TensorExecutor.h:96
Definition TensorRef.h:81
@ ColMajor
Definition Constants.h:319
@ DontAlign
Definition Constants.h:325
@ RowMajor
Definition Constants.h:321
constexpr EIGEN_STRONG_INLINE auto array_zip_and_reduce(array< A, N > a, array< B, N > b) -> decltype(h_array_zip_and_reduce< Reducer, Op, A, B, N >(a, b, typename gen_numeric_list< int, N >::type()))
Definition CXX11Meta.h:434
constexpr EIGEN_STRONG_INLINE auto array_apply_and_reduce(array< A, N > a) -> decltype(h_array_apply_and_reduce< Reducer, Op, A, N >(a, typename gen_numeric_list< int, N >::type()))
Definition CXX11Meta.h:462
Namespace containing all symbols from the Eigen library.
Definition bench_norm.cpp:85
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
Definition BandTriangularSolver.h:13
Definition TensorDimensions.h:263
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfColMajor(const array< DenseIndex, NumDims > &indices) const
Definition TensorDimensions.h:378
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfRowMajor(const array< DenseIndex, NumDims > &indices) const
Definition TensorDimensions.h:381
Definition TensorDeviceDefault.h:17
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition NumTraits.h:233
Definition TensorDimensions.h:93
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition TensorEvaluator.h:29
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void run(Index, Index)
Definition PlainObjectBase.h:32
Definition CXX11Meta.h:315
Definition CXX11Meta.h:306
Definition CXX11Meta.h:301
Definition ForwardDeclarations.h:17