TensorRef.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2014 Benoit Steiner <benoit.steiner.goog@gmail.com>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_REF_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_REF_H
12 
13 namespace Eigen {
14 
15 namespace internal {
16 
17 template <typename Dimensions, typename Scalar>
19  public:
22 
23  EIGEN_DEVICE_FUNC virtual const Dimensions& dimensions() const = 0;
24  EIGEN_DEVICE_FUNC virtual const Scalar* data() const = 0;
25 
26  EIGEN_DEVICE_FUNC virtual const Scalar coeff(DenseIndex index) const = 0;
27  EIGEN_DEVICE_FUNC virtual Scalar& coeffRef(DenseIndex index) = 0;
28 
29  void incrRefCount() { ++m_refcount; }
30  void decrRefCount() { --m_refcount; }
31  int refCount() const { return m_refcount; }
32 
33  private:
34  // No copy, no assigment;
37 
39 };
40 
41 
42 template <typename Dimensions, typename Expr, typename Device>
43 class TensorLazyEvaluatorReadOnly : public TensorLazyBaseEvaluator<Dimensions, typename TensorEvaluator<Expr, Device>::Scalar> {
44  public:
45  // typedef typename TensorEvaluator<Expr, Device>::Dimensions Dimensions;
47 
48  TensorLazyEvaluatorReadOnly(const Expr& expr, const Device& device) : m_impl(expr, device), m_dummy(Scalar(0)) {
51  }
53  m_impl.cleanup();
54  }
55 
56  EIGEN_DEVICE_FUNC virtual const Dimensions& dimensions() const {
57  return m_dims;
58  }
59  EIGEN_DEVICE_FUNC virtual const Scalar* data() const {
60  return m_impl.data();
61  }
62 
63  EIGEN_DEVICE_FUNC virtual const Scalar coeff(DenseIndex index) const {
64  return m_impl.coeff(index);
65  }
66  EIGEN_DEVICE_FUNC virtual Scalar& coeffRef(DenseIndex /*index*/) {
67  eigen_assert(false && "can't reference the coefficient of a rvalue");
68  return m_dummy;
69  };
70 
71  protected:
73  Dimensions m_dims;
75 };
76 
77 template <typename Dimensions, typename Expr, typename Device>
78 class TensorLazyEvaluatorWritable : public TensorLazyEvaluatorReadOnly<Dimensions, Expr, Device> {
79  public:
81  typedef typename Base::Scalar Scalar;
82 
83  TensorLazyEvaluatorWritable(const Expr& expr, const Device& device) : Base(expr, device) {
84  }
86  }
87 
88  EIGEN_DEVICE_FUNC virtual Scalar& coeffRef(DenseIndex index) {
89  return this->m_impl.coeffRef(index);
90  }
91 };
92 
93 template <typename Dimensions, typename Expr, typename Device>
94 class TensorLazyEvaluator : public internal::conditional<bool(internal::is_lvalue<Expr>::value),
95  TensorLazyEvaluatorWritable<Dimensions, Expr, Device>,
96  TensorLazyEvaluatorReadOnly<Dimensions, const Expr, Device> >::type {
97  public:
101  typedef typename Base::Scalar Scalar;
102 
103  TensorLazyEvaluator(const Expr& expr, const Device& device) : Base(expr, device) {
104  }
106  }
107 };
108 
109 } // namespace internal
110 
111 
119 template<typename PlainObjectType> class TensorRef : public TensorBase<TensorRef<PlainObjectType> >
120 {
121  public:
123  typedef typename PlainObjectType::Base Base;
129  typedef typename Base::CoeffReturnType CoeffReturnType;
130  typedef Scalar* PointerType;
132 
133  static const Index NumIndices = PlainObjectType::NumIndices;
134  typedef typename PlainObjectType::Dimensions Dimensions;
135 
136  enum {
137  IsAligned = false,
138  PacketAccess = false,
139  Layout = PlainObjectType::Layout,
140  CoordAccess = false, // to be implemented
141  RawAccess = false
142  };
143 
145  }
146 
147  template <typename Expression>
148  EIGEN_STRONG_INLINE TensorRef(const Expression& expr) : m_evaluator(new internal::TensorLazyEvaluator<Dimensions, Expression, DefaultDevice>(expr, DefaultDevice())) {
149  m_evaluator->incrRefCount();
150  }
151 
152  template <typename Expression>
153  EIGEN_STRONG_INLINE TensorRef& operator = (const Expression& expr) {
154  unrefEvaluator();
156  m_evaluator->incrRefCount();
157  return *this;
158  }
159 
161  unrefEvaluator();
162  }
163 
164  TensorRef(const TensorRef& other) : m_evaluator(other.m_evaluator) {
165  eigen_assert(m_evaluator->refCount() > 0);
166  m_evaluator->incrRefCount();
167  }
168 
169  TensorRef& operator = (const TensorRef& other) {
170  if (this != &other) {
171  unrefEvaluator();
172  m_evaluator = other.m_evaluator;
173  eigen_assert(m_evaluator->refCount() > 0);
174  m_evaluator->incrRefCount();
175  }
176  return *this;
177  }
178 
179  EIGEN_DEVICE_FUNC
180  EIGEN_STRONG_INLINE Index rank() const { return m_evaluator->dimensions().size(); }
181  EIGEN_DEVICE_FUNC
182  EIGEN_STRONG_INLINE Index dimension(Index n) const { return m_evaluator->dimensions()[n]; }
183  EIGEN_DEVICE_FUNC
184  EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_evaluator->dimensions(); }
185  EIGEN_DEVICE_FUNC
186  EIGEN_STRONG_INLINE Index size() const { return m_evaluator->dimensions().TotalSize(); }
187  EIGEN_DEVICE_FUNC
188  EIGEN_STRONG_INLINE const Scalar* data() const { return m_evaluator->data(); }
189 
190  EIGEN_DEVICE_FUNC
192  {
193  return m_evaluator->coeff(index);
194  }
195 
196 #if EIGEN_HAS_VARIADIC_TEMPLATES
197  template<typename... IndexTypes> EIGEN_DEVICE_FUNC
198  EIGEN_STRONG_INLINE const Scalar operator()(Index firstIndex, IndexTypes... otherIndices) const
199  {
200  const std::size_t num_indices = (sizeof...(otherIndices) + 1);
201  const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
202  return coeff(indices);
203  }
204  template<typename... IndexTypes> EIGEN_DEVICE_FUNC
205  EIGEN_STRONG_INLINE Scalar& coeffRef(Index firstIndex, IndexTypes... otherIndices)
206  {
207  const std::size_t num_indices = (sizeof...(otherIndices) + 1);
208  const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
209  return coeffRef(indices);
210  }
211 #else
212 
213  EIGEN_DEVICE_FUNC
215  {
216  array<Index, 2> indices;
217  indices[0] = i0;
218  indices[1] = i1;
219  return coeff(indices);
220  }
221  EIGEN_DEVICE_FUNC
223  {
224  array<Index, 3> indices;
225  indices[0] = i0;
226  indices[1] = i1;
227  indices[2] = i2;
228  return coeff(indices);
229  }
230  EIGEN_DEVICE_FUNC
232  {
233  array<Index, 4> indices;
234  indices[0] = i0;
235  indices[1] = i1;
236  indices[2] = i2;
237  indices[3] = i3;
238  return coeff(indices);
239  }
240  EIGEN_DEVICE_FUNC
242  {
243  array<Index, 5> indices;
244  indices[0] = i0;
245  indices[1] = i1;
246  indices[2] = i2;
247  indices[3] = i3;
248  indices[4] = i4;
249  return coeff(indices);
250  }
251  EIGEN_DEVICE_FUNC
253  {
254  array<Index, 2> indices;
255  indices[0] = i0;
256  indices[1] = i1;
257  return coeffRef(indices);
258  }
259  EIGEN_DEVICE_FUNC
261  {
262  array<Index, 3> indices;
263  indices[0] = i0;
264  indices[1] = i1;
265  indices[2] = i2;
266  return coeffRef(indices);
267  }
268  EIGEN_DEVICE_FUNC
270  {
271  array<Index, 4> indices;
272  indices[0] = i0;
273  indices[1] = i1;
274  indices[2] = i2;
275  indices[3] = i3;
276  return coeffRef(indices);
277  }
278  EIGEN_DEVICE_FUNC
280  {
281  array<Index, 5> indices;
282  indices[0] = i0;
283  indices[1] = i1;
284  indices[2] = i2;
285  indices[3] = i3;
286  indices[4] = i4;
287  return coeffRef(indices);
288  }
289 #endif
290 
291  template <std::size_t NumIndices> EIGEN_DEVICE_FUNC
293  {
294  const Dimensions& dims = this->dimensions();
295  Index index = 0;
296  if (PlainObjectType::Options & RowMajor) {
297  index += indices[0];
298  for (size_t i = 1; i < NumIndices; ++i) {
299  index = index * dims[i] + indices[i];
300  }
301  } else {
302  index += indices[NumIndices-1];
303  for (int i = NumIndices-2; i >= 0; --i) {
304  index = index * dims[i] + indices[i];
305  }
306  }
307  return m_evaluator->coeff(index);
308  }
309  template <std::size_t NumIndices> EIGEN_DEVICE_FUNC
311  {
312  const Dimensions& dims = this->dimensions();
313  Index index = 0;
314  if (PlainObjectType::Options & RowMajor) {
315  index += indices[0];
316  for (size_t i = 1; i < NumIndices; ++i) {
317  index = index * dims[i] + indices[i];
318  }
319  } else {
320  index += indices[NumIndices-1];
321  for (int i = NumIndices-2; i >= 0; --i) {
322  index = index * dims[i] + indices[i];
323  }
324  }
325  return m_evaluator->coeffRef(index);
326  }
327 
328  EIGEN_DEVICE_FUNC
330  {
331  return m_evaluator->coeff(index);
332  }
333 
334  EIGEN_DEVICE_FUNC
336  {
337  return m_evaluator->coeffRef(index);
338  }
339 
340  private:
342  if (m_evaluator) {
343  m_evaluator->decrRefCount();
344  if (m_evaluator->refCount() == 0) {
345  delete m_evaluator;
346  }
347  }
348  }
349 
351 };
352 
353 
354 // evaluator for rvalues
355 template<typename Derived, typename Device>
356 struct TensorEvaluator<const TensorRef<Derived>, Device>
357 {
358  typedef typename Derived::Index Index;
359  typedef typename Derived::Scalar Scalar;
362  typedef typename Derived::Dimensions Dimensions;
363 
364  enum {
365  IsAligned = false,
366  PacketAccess = false,
368  CoordAccess = false, // to be implemented
369  RawAccess = false
370  };
371 
372  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const TensorRef<Derived>& m, const Device&)
373  : m_ref(m)
374  { }
375 
376  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_ref.dimensions(); }
377 
379  return true;
380  }
381 
382  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup() { }
383 
384  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const {
385  return m_ref.coeff(index);
386  }
387 
388  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
389  return m_ref.coeffRef(index);
390  }
391 
392  EIGEN_DEVICE_FUNC Scalar* data() const { return m_ref.data(); }
393 
394  protected:
396 };
397 
398 
399 // evaluator for lvalues
400 template<typename Derived, typename Device>
401 struct TensorEvaluator<TensorRef<Derived>, Device> : public TensorEvaluator<const TensorRef<Derived>, Device>
402 {
403  typedef typename Derived::Index Index;
404  typedef typename Derived::Scalar Scalar;
407  typedef typename Derived::Dimensions Dimensions;
408 
410 
411  enum {
412  IsAligned = false,
413  PacketAccess = false,
414  RawAccess = false
415  };
416 
417  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(TensorRef<Derived>& m, const Device& d) : Base(m, d)
418  { }
419 
420  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) {
421  return this->m_ref.coeffRef(index);
422  }
423 };
424 
425 
426 
427 } // end namespace Eigen
428 
429 #endif // EIGEN_CXX11_TENSOR_TENSOR_REF_H
Eigen::TensorEvaluator::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorEvaluator.h:54
Eigen::TensorRef::PointerType
Scalar * PointerType
Definition: TensorRef.h:130
Eigen
Definition: common.h:73
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorRef.h:406
Eigen::internal::TensorLazyBaseEvaluator::refCount
int refCount() const
Definition: TensorRef.h:31
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index i0, Index i1) const
Definition: TensorRef.h:214
Eigen::TensorRef< PlainObjectType >
Eigen::internal::TensorLazyEvaluatorReadOnly::dimensions
virtual const EIGEN_DEVICE_FUNC Dimensions & dimensions() const
Definition: TensorRef.h:56
Eigen::internal::TensorLazyEvaluator
Definition: TensorRef.h:94
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1, Index i2, Index i3, Index i4)
Definition: TensorRef.h:279
Eigen::internal::TensorLazyEvaluatorReadOnly::m_dummy
Scalar m_dummy
Definition: TensorRef.h:74
Eigen::internal::TensorLazyEvaluator::Base
internal::conditional< bool(internal::is_lvalue< Expr >::value), TensorLazyEvaluatorWritable< Dimensions, Expr, Device >, TensorLazyEvaluatorReadOnly< Dimensions, const Expr, Device > >::type Base
Definition: TensorRef.h:100
Eigen::array
Definition: EmulateArray.h:21
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::TensorEvaluator
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(const TensorRef< Derived > &m, const Device &)
Definition: TensorRef.h:372
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1)
Definition: TensorRef.h:252
Eigen::internal::TensorLazyEvaluatorReadOnly::TensorLazyEvaluatorReadOnly
TensorLazyEvaluatorReadOnly(const Expr &expr, const Device &device)
Definition: TensorRef.h:48
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:420
Eigen::internal::TensorLazyEvaluatorReadOnly::m_dims
Dimensions m_dims
Definition: TensorRef.h:73
Eigen::TensorEvaluator::PacketAccess
@ PacketAccess
Definition: TensorEvaluator.h:42
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::evalSubExprsIfNeeded
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(Scalar *)
Definition: TensorRef.h:378
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:579
Eigen::TensorRef::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorRef.h:184
Eigen::internal::is_lvalue
Definition: XprHelper.h:639
Eigen::internal::TensorLazyBaseEvaluator::m_refcount
int m_refcount
Definition: TensorRef.h:38
Eigen::TensorRef::~TensorRef
~TensorRef()
Definition: TensorRef.h:160
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorRef.h:376
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorRef.h:361
Eigen::TensorRef::rank
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
Definition: TensorRef.h:180
Eigen::internal::TensorLazyBaseEvaluator::dimensions
virtual const EIGEN_DEVICE_FUNC Dimensions & dimensions() const =0
Eigen::PacketType::type
internal::packet_traits< Scalar >::type type
Definition: TensorMeta.h:51
Eigen::internal::TensorLazyBaseEvaluator::incrRefCount
void incrRefCount()
Definition: TensorRef.h:29
Eigen::TensorEvaluator::data
EIGEN_DEVICE_FUNC internal::traits< Derived >::template MakePointer< Scalar >::Type data() const
Definition: TensorEvaluator.h:111
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index i0, Index i1, Index i2, Index i3) const
Definition: TensorRef.h:231
Eigen::TensorRef::PacketAccess
@ PacketAccess
Definition: TensorRef.h:138
Eigen::TensorRef::TensorRef
EIGEN_STRONG_INLINE TensorRef()
Definition: TensorRef.h:144
Scalar
SCALAR Scalar
Definition: common.h:84
Eigen::RowMajor
@ RowMajor
Definition: Constants.h:322
Eigen::TensorRef::data
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
Definition: TensorRef.h:188
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::m_ref
TensorRef< Derived > m_ref
Definition: TensorRef.h:395
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >
Definition: TensorRef.h:356
Eigen::internal::TensorLazyEvaluatorReadOnly::~TensorLazyEvaluatorReadOnly
virtual ~TensorLazyEvaluatorReadOnly()
Definition: TensorRef.h:52
Eigen::TensorRef::TensorRef
TensorRef(const TensorRef &other)
Definition: TensorRef.h:164
Eigen::TensorRef::TensorRef
EIGEN_STRONG_INLINE TensorRef(const Expression &expr)
Definition: TensorRef.h:148
Eigen::internal::TensorLazyBaseEvaluator::coeff
virtual const EIGEN_DEVICE_FUNC Scalar coeff(DenseIndex index) const =0
Eigen::TensorRef::CoordAccess
@ CoordAccess
Definition: TensorRef.h:140
Eigen::internal::TensorLazyEvaluatorWritable::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex index)
Definition: TensorRef.h:88
Eigen::internal::TensorLazyBaseEvaluator::operator=
TensorLazyBaseEvaluator & operator=(const TensorLazyBaseEvaluator &other)
Eigen::TensorEvaluator::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorEvaluator.h:71
Eigen::internal::TensorLazyEvaluator::~TensorLazyEvaluator
virtual ~TensorLazyEvaluator()
Definition: TensorRef.h:105
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:335
Eigen::TensorEvaluator::cleanup
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:64
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::data
EIGEN_DEVICE_FUNC Scalar * data() const
Definition: TensorRef.h:392
Eigen::DefaultDevice
Definition: TensorDeviceDefault.h:17
Eigen::TensorRef::IsAligned
@ IsAligned
Definition: TensorRef.h:137
Eigen::internal::TensorLazyEvaluatorReadOnly
Definition: TensorRef.h:43
Eigen::internal::TensorLazyEvaluatorReadOnly::data
virtual const EIGEN_DEVICE_FUNC Scalar * data() const
Definition: TensorRef.h:59
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:388
Eigen::internal::true_type
Definition: Meta.h:54
Eigen::TensorRef::dimension
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(Index n) const
Definition: TensorRef.h:182
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Scalar
Derived::Scalar Scalar
Definition: TensorRef.h:359
Eigen::TensorRef::size
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition: TensorRef.h:186
Eigen::TensorRef::Scalar
internal::traits< PlainObjectType >::Scalar Scalar
Definition: TensorRef.h:127
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Dimensions
Derived::Dimensions Dimensions
Definition: TensorRef.h:407
Eigen::internal::TensorLazyBaseEvaluator::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex index)=0
Eigen::TensorRef::StorageKind
internal::traits< PlainObjectType >::StorageKind StorageKind
Definition: TensorRef.h:125
Eigen::internal::TensorLazyEvaluatorWritable
Definition: TensorRef.h:78
Eigen::internal::TensorLazyEvaluatorReadOnly::m_impl
TensorEvaluator< Expr, Device > m_impl
Definition: TensorRef.h:69
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3)
Definition: TensorRef.h:269
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Index
Derived::Index Index
Definition: TensorRef.h:403
Eigen::TensorRef::Nested
Eigen::internal::nested< Self >::type Nested
Definition: TensorRef.h:124
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::cleanup
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void cleanup()
Definition: TensorRef.h:382
Eigen::TensorRef::Self
TensorRef< PlainObjectType > Self
Definition: TensorRef.h:122
Eigen::TensorEvaluator::IsAligned
@ IsAligned
Definition: TensorEvaluator.h:41
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:494
Eigen::internal::TensorLazyBaseEvaluator::data
virtual const EIGEN_DEVICE_FUNC Scalar * data() const =0
Eigen::TensorRef::RawAccess
@ RawAccess
Definition: TensorRef.h:141
Eigen::internal::TensorLazyEvaluatorReadOnly::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex)
Definition: TensorRef.h:66
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::CoeffReturnType
Derived::Scalar CoeffReturnType
Definition: TensorRef.h:405
Eigen::internal::TensorLazyBaseEvaluator::decrRefCount
void decrRefCount()
Definition: TensorRef.h:30
Eigen::TensorRef::m_evaluator
internal::TensorLazyBaseEvaluator< Dimensions, Scalar > * m_evaluator
Definition: TensorRef.h:350
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Index
Derived::Index Index
Definition: TensorRef.h:358
Eigen::internal::TensorLazyEvaluatorWritable::TensorLazyEvaluatorWritable
TensorLazyEvaluatorWritable(const Expr &expr, const Device &device)
Definition: TensorRef.h:83
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorRef.h:384
Eigen::internal::TensorLazyEvaluatorWritable::Base
TensorLazyEvaluatorReadOnly< Dimensions, Expr, Device > Base
Definition: TensorRef.h:80
Eigen::internal::TensorLazyBaseEvaluator::~TensorLazyBaseEvaluator
virtual ~TensorLazyBaseEvaluator()
Definition: TensorRef.h:21
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index i0, Index i1, Index i2, Index i3, Index i4) const
Definition: TensorRef.h:241
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1, Index i2)
Definition: TensorRef.h:260
Eigen::TensorEvaluator::Layout
@ Layout
Definition: TensorEvaluator.h:43
Eigen::internal::TensorLazyEvaluatorWritable::Scalar
Base::Scalar Scalar
Definition: TensorRef.h:81
Eigen::TensorRef::unrefEvaluator
EIGEN_STRONG_INLINE void unrefEvaluator()
Definition: TensorRef.h:341
Eigen::internal::TensorLazyEvaluator::Scalar
Base::Scalar Scalar
Definition: TensorRef.h:101
Eigen::TensorRef::PointerArgType
PointerType PointerArgType
Definition: TensorRef.h:131
Eigen::TensorRef::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar coeff(const array< Index, NumIndices > &indices) const
Definition: TensorRef.h:292
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::CoeffReturnType
Derived::Scalar CoeffReturnType
Definition: TensorRef.h:360
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Dimensions
Derived::Dimensions Dimensions
Definition: TensorRef.h:362
Eigen::TensorRef::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar coeff(Index index) const
Definition: TensorRef.h:329
Eigen::TensorRef::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: TensorRef.h:128
Eigen::TensorRef::Index
internal::traits< PlainObjectType >::Index Index
Definition: TensorRef.h:126
Eigen::DenseIndex
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: Meta.h:25
Eigen::internal::TensorLazyEvaluatorReadOnly::coeff
virtual const EIGEN_DEVICE_FUNC Scalar coeff(DenseIndex index) const
Definition: TensorRef.h:63
Eigen::internal::conditional
Definition: Meta.h:58
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::TensorEvaluator
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorEvaluator(TensorRef< Derived > &m, const Device &d)
Definition: TensorRef.h:417
Eigen::TensorRef::Layout
@ Layout
Definition: TensorRef.h:139
Eigen::internal::TensorLazyEvaluatorWritable::~TensorLazyEvaluatorWritable
virtual ~TensorLazyEvaluatorWritable()
Definition: TensorRef.h:85
Eigen::TensorEvaluator::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:66
Eigen::TensorEvaluator
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Eigen::internal::TensorLazyEvaluator::TensorLazyEvaluator
TensorLazyEvaluator(const Expr &expr, const Device &device)
Definition: TensorRef.h:103
Eigen::TensorRef::Base
PlainObjectType::Base Base
Definition: TensorRef.h:123
Eigen::TensorRef::NumIndices
static const Index NumIndices
Definition: TensorRef.h:133
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Scalar
Derived::Scalar Scalar
Definition: TensorRef.h:404
internal
Definition: BandTriangularSolver.h:13
Eigen::TensorRef::operator=
EIGEN_STRONG_INLINE TensorRef & operator=(const Expression &expr)
Definition: TensorRef.h:153
n
PlainMatrixType mat * n
Definition: eigenvalues.cpp:41
Eigen::internal::TensorLazyBaseEvaluator::TensorLazyBaseEvaluator
TensorLazyBaseEvaluator()
Definition: TensorRef.h:20
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(const array< Index, NumIndices > &indices)
Definition: TensorRef.h:310
Eigen::TensorRef::CoeffReturnType
Base::CoeffReturnType CoeffReturnType
Definition: TensorRef.h:129
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Base
TensorEvaluator< const TensorRef< Derived >, Device > Base
Definition: TensorRef.h:409
Eigen::internal::TensorLazyEvaluatorReadOnly::Scalar
TensorEvaluator< Expr, Device >::Scalar Scalar
Definition: TensorRef.h:46
Eigen::internal::TensorLazyBaseEvaluator
Definition: TensorRef.h:18
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index i0, Index i1, Index i2) const
Definition: TensorRef.h:222
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:150
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index index) const
Definition: TensorRef.h:191
Eigen::TensorRef::Dimensions
PlainObjectType::Dimensions Dimensions
Definition: TensorRef.h:134
Eigen::TensorEvaluator::evalSubExprsIfNeeded
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(CoeffReturnType *dest)
Definition: TensorEvaluator.h:56
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:01