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 assignment;
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;
50 
51  TensorLazyEvaluatorReadOnly(const Expr& expr, const Device& device) : m_impl(expr, device), m_dummy(Scalar(0)) {
54  }
56  m_impl.cleanup();
57  }
58 
59  EIGEN_DEVICE_FUNC virtual const Dimensions& dimensions() const {
60  return m_dims;
61  }
62  EIGEN_DEVICE_FUNC virtual const Scalar* data() const {
63  return m_impl.data();
64  }
65 
66  EIGEN_DEVICE_FUNC virtual const Scalar coeff(DenseIndex index) const {
67  return m_impl.coeff(index);
68  }
70  eigen_assert(false && "can't reference the coefficient of a rvalue");
71  return m_dummy;
72  };
73 
74  protected:
76  Dimensions m_dims;
78 };
79 
80 template <typename Dimensions, typename Expr, typename Device>
81 class TensorLazyEvaluatorWritable : public TensorLazyEvaluatorReadOnly<Dimensions, Expr, Device> {
82  public:
84  typedef typename Base::Scalar Scalar;
87 
88  TensorLazyEvaluatorWritable(const Expr& expr, const Device& device) : Base(expr, device) {
89  }
91  }
92 
94  return this->m_impl.coeffRef(index);
95  }
96 };
97 
98 template <typename Dimensions, typename Expr, typename Device>
99 class TensorLazyEvaluator : public internal::conditional<bool(internal::is_lvalue<Expr>::value),
100  TensorLazyEvaluatorWritable<Dimensions, Expr, Device>,
101  TensorLazyEvaluatorReadOnly<Dimensions, const Expr, Device> >::type {
102  public:
106  typedef typename Base::Scalar Scalar;
107 
108  TensorLazyEvaluator(const Expr& expr, const Device& device) : Base(expr, device) {
109  }
111  }
112 };
113 
114 } // namespace internal
115 
116 
124 template<typename PlainObjectType> class TensorRef : public TensorBase<TensorRef<PlainObjectType> >
125 {
126  public:
128  typedef typename PlainObjectType::Base Base;
134  typedef typename Base::CoeffReturnType CoeffReturnType;
135  typedef Scalar* PointerType;
137 
138  static const Index NumIndices = PlainObjectType::NumIndices;
139  typedef typename PlainObjectType::Dimensions Dimensions;
140 
141  enum {
142  IsAligned = false,
143  PacketAccess = false,
144  BlockAccess = false,
146  Layout = PlainObjectType::Layout,
147  CoordAccess = false, // to be implemented
148  RawAccess = false
149  };
150 
151  //===- Tensor block evaluation strategy (see TensorBlock.h) -----------===//
153  //===------------------------------------------------------------------===//
154 
156  }
157 
158  template <typename Expression>
159  EIGEN_STRONG_INLINE TensorRef(const Expression& expr) : m_evaluator(new internal::TensorLazyEvaluator<Dimensions, Expression, DefaultDevice>(expr, DefaultDevice())) {
160  m_evaluator->incrRefCount();
161  }
162 
163  template <typename Expression>
164  EIGEN_STRONG_INLINE TensorRef& operator = (const Expression& expr) {
165  unrefEvaluator();
167  m_evaluator->incrRefCount();
168  return *this;
169  }
170 
172  unrefEvaluator();
173  }
174 
176  eigen_assert(m_evaluator->refCount() > 0);
177  m_evaluator->incrRefCount();
178  }
179 
181  if (this != &other) {
182  unrefEvaluator();
183  m_evaluator = other.m_evaluator;
184  eigen_assert(m_evaluator->refCount() > 0);
185  m_evaluator->incrRefCount();
186  }
187  return *this;
188  }
189 
191  EIGEN_STRONG_INLINE Index rank() const { return m_evaluator->dimensions().size(); }
193  EIGEN_STRONG_INLINE Index dimension(Index n) const { return m_evaluator->dimensions()[n]; }
195  EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_evaluator->dimensions(); }
197  EIGEN_STRONG_INLINE Index size() const { return m_evaluator->dimensions().TotalSize(); }
199  EIGEN_STRONG_INLINE const Scalar* data() const { return m_evaluator->data(); }
200 
203  {
204  return m_evaluator->coeff(index);
205  }
206 
207 #if EIGEN_HAS_VARIADIC_TEMPLATES
208  template<typename... IndexTypes> EIGEN_DEVICE_FUNC
209  EIGEN_STRONG_INLINE const Scalar operator()(Index firstIndex, IndexTypes... otherIndices) const
210  {
211  const std::size_t num_indices = (sizeof...(otherIndices) + 1);
212  const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
213  return coeff(indices);
214  }
215  template<typename... IndexTypes> EIGEN_DEVICE_FUNC
216  EIGEN_STRONG_INLINE Scalar& coeffRef(Index firstIndex, IndexTypes... otherIndices)
217  {
218  const std::size_t num_indices = (sizeof...(otherIndices) + 1);
219  const array<Index, num_indices> indices{{firstIndex, otherIndices...}};
220  return coeffRef(indices);
221  }
222 #else
223 
226  {
228  indices[0] = i0;
229  indices[1] = i1;
230  return coeff(indices);
231  }
234  {
236  indices[0] = i0;
237  indices[1] = i1;
238  indices[2] = i2;
239  return coeff(indices);
240  }
243  {
245  indices[0] = i0;
246  indices[1] = i1;
247  indices[2] = i2;
248  indices[3] = i3;
249  return coeff(indices);
250  }
253  {
255  indices[0] = i0;
256  indices[1] = i1;
257  indices[2] = i2;
258  indices[3] = i3;
259  indices[4] = i4;
260  return coeff(indices);
261  }
264  {
266  indices[0] = i0;
267  indices[1] = i1;
268  return coeffRef(indices);
269  }
272  {
274  indices[0] = i0;
275  indices[1] = i1;
276  indices[2] = i2;
277  return coeffRef(indices);
278  }
281  {
283  indices[0] = i0;
284  indices[1] = i1;
285  indices[2] = i2;
286  indices[3] = i3;
287  return coeffRef(indices);
288  }
291  {
293  indices[0] = i0;
294  indices[1] = i1;
295  indices[2] = i2;
296  indices[3] = i3;
297  indices[4] = i4;
298  return coeffRef(indices);
299  }
300 #endif
301 
302  template <std::size_t NumIndices> EIGEN_DEVICE_FUNC
304  {
305  const Dimensions& dims = this->dimensions();
306  Index index = 0;
307  if (PlainObjectType::Options & RowMajor) {
308  index += indices[0];
309  for (size_t i = 1; i < NumIndices; ++i) {
310  index = index * dims[i] + indices[i];
311  }
312  } else {
313  index += indices[NumIndices-1];
314  for (int i = NumIndices-2; i >= 0; --i) {
315  index = index * dims[i] + indices[i];
316  }
317  }
318  return m_evaluator->coeff(index);
319  }
320  template <std::size_t NumIndices> EIGEN_DEVICE_FUNC
322  {
323  const Dimensions& dims = this->dimensions();
324  Index index = 0;
325  if (PlainObjectType::Options & RowMajor) {
326  index += indices[0];
327  for (size_t i = 1; i < NumIndices; ++i) {
328  index = index * dims[i] + indices[i];
329  }
330  } else {
331  index += indices[NumIndices-1];
332  for (int i = NumIndices-2; i >= 0; --i) {
333  index = index * dims[i] + indices[i];
334  }
335  }
336  return m_evaluator->coeffRef(index);
337  }
338 
341  {
342  return m_evaluator->coeff(index);
343  }
344 
347  {
348  return m_evaluator->coeffRef(index);
349  }
350 
351  private:
353  if (m_evaluator) {
354  m_evaluator->decrRefCount();
355  if (m_evaluator->refCount() == 0) {
356  delete m_evaluator;
357  }
358  }
359  }
360 
362 };
363 
364 
365 // evaluator for rvalues
366 template<typename Derived, typename Device>
367 struct TensorEvaluator<const TensorRef<Derived>, Device>
368 {
369  typedef typename Derived::Index Index;
370  typedef typename Derived::Scalar Scalar;
373  typedef typename Derived::Dimensions Dimensions;
376 
377  enum {
378  IsAligned = false,
379  PacketAccess = false,
380  BlockAccess = false,
383  CoordAccess = false, // to be implemented
384  RawAccess = false
385  };
386 
387  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
389  //===--------------------------------------------------------------------===//
390 
392  : m_ref(m)
393  { }
394 
395  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Dimensions& dimensions() const { return m_ref.dimensions(); }
396 
398  return true;
399  }
400 
402 
404  return m_ref.coeff(index);
405  }
406 
408  return m_ref.coeffRef(index);
409  }
410 
411  EIGEN_DEVICE_FUNC const Scalar* data() const { return m_ref.data(); }
412 
413  protected:
415 };
416 
417 
418 // evaluator for lvalues
419 template<typename Derived, typename Device>
420 struct TensorEvaluator<TensorRef<Derived>, Device> : public TensorEvaluator<const TensorRef<Derived>, Device>
421 {
422  typedef typename Derived::Index Index;
423  typedef typename Derived::Scalar Scalar;
426  typedef typename Derived::Dimensions Dimensions;
427 
429 
430  enum {
431  IsAligned = false,
432  PacketAccess = false,
433  BlockAccess = false,
435  RawAccess = false
436  };
437 
438  //===- Tensor block evaluation strategy (see TensorBlock.h) -------------===//
440  //===--------------------------------------------------------------------===//
441 
443  { }
444 
446  return this->m_ref.coeffRef(index);
447  }
448 };
449 
450 
451 
452 } // end namespace Eigen
453 
454 #endif // EIGEN_CXX11_TENSOR_TENSOR_REF_H
Eigen::TensorEvaluator::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorEvaluator.h:73
Eigen::internal::TensorLazyEvaluatorReadOnly::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorRef.h:48
Eigen::TensorRef::PointerType
Scalar * PointerType
Definition: TensorRef.h:135
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorRef.h:425
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:225
Eigen::TensorRef< PlainObjectType >
Eigen::internal::TensorLazyEvaluatorReadOnly::dimensions
virtual const EIGEN_DEVICE_FUNC Dimensions & dimensions() const
Definition: TensorRef.h:59
Eigen::internal::TensorBlockNotImplemented
Definition: TensorBlock.h:617
Eigen::internal::TensorLazyEvaluator
Definition: TensorRef.h:99
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1, Index i2, Index i3, Index i4)
Definition: TensorRef.h:290
d
static const double d[K][N]
Definition: igam.h:11
Eigen::internal::TensorLazyEvaluatorReadOnly::m_dummy
Scalar m_dummy
Definition: TensorRef.h:77
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:105
Eigen::array
Definition: EmulateArray.h:21
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1)
Definition: TensorRef.h:263
Eigen::internal::TensorLazyEvaluatorReadOnly::TensorLazyEvaluatorReadOnly
TensorLazyEvaluatorReadOnly(const Expr &expr, const Device &device)
Definition: TensorRef.h:51
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:445
Eigen::internal::TensorLazyEvaluatorReadOnly::m_dims
Dimensions m_dims
Definition: TensorRef.h:76
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::TensorRef::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorRef.h:195
Eigen::internal::is_lvalue
Definition: XprHelper.h:659
Eigen::internal::TensorLazyBaseEvaluator::m_refcount
int m_refcount
Definition: TensorRef.h:38
Eigen::TensorRef::~TensorRef
~TensorRef()
Definition: TensorRef.h:171
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: TensorRef.h:395
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::PacketReturnType
PacketType< CoeffReturnType, Device >::type PacketReturnType
Definition: TensorRef.h:372
Eigen::TensorRef::rank
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
Definition: TensorRef.h:191
Eigen::TensorEvaluator::Layout
@ Layout
Definition: TensorEvaluator.h:50
Eigen::internal::TensorLazyBaseEvaluator::dimensions
virtual const EIGEN_DEVICE_FUNC Dimensions & dimensions() const =0
type
Definition: pytypes.h:1525
Eigen::internal::TensorLazyBaseEvaluator::incrRefCount
void incrRefCount()
Definition: TensorRef.h:29
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index i0, Index i1, Index i2, Index i3) const
Definition: TensorRef.h:242
Eigen::TensorRef::TensorRef
EIGEN_STRONG_INLINE TensorRef()
Definition: TensorRef.h:155
Eigen::TensorRef::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorRef.h:152
Eigen::RowMajor
@ RowMajor
Definition: Constants.h:321
Eigen::TensorRef::data
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
Definition: TensorRef.h:199
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::m_ref
TensorRef< Derived > m_ref
Definition: TensorRef.h:414
Eigen::TensorRef::PacketAccess
@ PacketAccess
Definition: TensorRef.h:143
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >
Definition: TensorRef.h:367
Eigen::internal::TensorLazyEvaluatorReadOnly::~TensorLazyEvaluatorReadOnly
virtual ~TensorLazyEvaluatorReadOnly()
Definition: TensorRef.h:55
Eigen::TensorRef::TensorRef
TensorRef(const TensorRef &other)
Definition: TensorRef.h:175
Eigen::TensorRef::TensorRef
EIGEN_STRONG_INLINE TensorRef(const Expression &expr)
Definition: TensorRef.h:159
Eigen::internal::TensorLazyBaseEvaluator::coeff
virtual const EIGEN_DEVICE_FUNC Scalar coeff(DenseIndex index) const =0
Eigen::internal::TensorLazyEvaluatorWritable::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex index)
Definition: TensorRef.h:93
Eigen::internal::TensorLazyBaseEvaluator::operator=
TensorLazyBaseEvaluator & operator=(const TensorLazyBaseEvaluator &other)
Eigen::TensorEvaluator::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType dest)
Definition: TensorEvaluator.h:75
Eigen::internal::TensorLazyEvaluator::~TensorLazyEvaluator
virtual ~TensorLazyEvaluator()
Definition: TensorRef.h:110
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:346
test_eigen_tensor.indices
indices
Definition: test_eigen_tensor.py:33
Eigen::DefaultDevice
Definition: TensorDeviceDefault.h:17
Eigen::internal::TensorLazyEvaluatorReadOnly
Definition: TensorRef.h:43
n
int n
Definition: BiCGSTAB_simple.cpp:1
Eigen::internal::TensorLazyEvaluatorReadOnly::data
virtual const EIGEN_DEVICE_FUNC Scalar * data() const
Definition: TensorRef.h:62
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: TensorRef.h:407
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorRef.h:388
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::TensorRef::dimension
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(Index n) const
Definition: TensorRef.h:193
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Scalar
Derived::Scalar Scalar
Definition: TensorRef.h:370
Eigen::TensorRef::size
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition: TensorRef.h:197
Eigen::TensorRef::Scalar
internal::traits< PlainObjectType >::Scalar Scalar
Definition: TensorRef.h:132
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Dimensions
Derived::Dimensions Dimensions
Definition: TensorRef.h:426
Eigen::internal::TensorLazyBaseEvaluator::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex index)=0
Eigen::internal::TensorLazyEvaluatorReadOnly::EvalType
TensorEvaluator< Expr, Device > EvalType
Definition: TensorRef.h:49
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::data
const EIGEN_DEVICE_FUNC Scalar * data() const
Definition: TensorRef.h:411
Eigen::TensorRef::PreferBlockAccess
@ PreferBlockAccess
Definition: TensorRef.h:145
Eigen::TensorRef::StorageKind
internal::traits< PlainObjectType >::StorageKind StorageKind
Definition: TensorRef.h:130
Eigen::TensorRef::CoordAccess
@ CoordAccess
Definition: TensorRef.h:147
Eigen::internal::TensorLazyEvaluatorWritable
Definition: TensorRef.h:81
Eigen::internal::TensorLazyEvaluatorReadOnly::m_impl
TensorEvaluator< Expr, Device > m_impl
Definition: TensorRef.h:72
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3)
Definition: TensorRef.h:280
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Index
Derived::Index Index
Definition: TensorRef.h:422
Eigen::TensorRef::Nested
Eigen::internal::nested< Self >::type Nested
Definition: TensorRef.h:129
Eigen::TensorEvaluator::data
EIGEN_DEVICE_FUNC EvaluatorPointerType data() const
Definition: TensorEvaluator.h:181
Eigen::TensorRef::Self
TensorRef< PlainObjectType > Self
Definition: TensorRef.h:127
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::internal::TensorLazyBaseEvaluator::data
virtual const EIGEN_DEVICE_FUNC Scalar * data() const =0
Eigen::TensorEvaluator::PreferBlockAccess
@ PreferBlockAccess
Definition: TensorEvaluator.h:49
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::evalSubExprsIfNeeded
EIGEN_STRONG_INLINE bool evalSubExprsIfNeeded(EvaluatorPointerType)
Definition: TensorRef.h:397
Eigen::internal::TensorLazyEvaluatorReadOnly::coeffRef
virtual EIGEN_DEVICE_FUNC Scalar & coeffRef(DenseIndex)
Definition: TensorRef.h:69
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::CoeffReturnType
Derived::Scalar CoeffReturnType
Definition: TensorRef.h:424
Eigen::internal::TensorLazyBaseEvaluator::decrRefCount
void decrRefCount()
Definition: TensorRef.h:30
Eigen::TensorRef::m_evaluator
internal::TensorLazyBaseEvaluator< Dimensions, Scalar > * m_evaluator
Definition: TensorRef.h:361
m
Matrix3f m
Definition: AngleAxis_mimic_euler.cpp:1
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Index
Derived::Index Index
Definition: TensorRef.h:369
Eigen::Triplet< double >
Eigen::internal::TensorLazyEvaluatorWritable::TensorLazyEvaluatorWritable
TensorLazyEvaluatorWritable(const Expr &expr, const Device &device)
Definition: TensorRef.h:88
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorRef.h:403
Eigen::internal::TensorLazyEvaluatorWritable::Base
TensorLazyEvaluatorReadOnly< Dimensions, Expr, Device > Base
Definition: TensorRef.h:83
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:252
Eigen::StorageMemory
Definition: TensorForwardDeclarations.h:37
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index i0, Index i1, Index i2)
Definition: TensorRef.h:271
size_t
std::size_t size_t
Definition: wrap/pybind11/include/pybind11/detail/common.h:490
Eigen::internal::TensorLazyEvaluatorWritable::Scalar
Base::Scalar Scalar
Definition: TensorRef.h:84
Eigen::TensorRef::RawAccess
@ RawAccess
Definition: TensorRef.h:148
Eigen::TensorEvaluator::BlockAccess
@ BlockAccess
Definition: TensorEvaluator.h:48
Eigen::TensorRef::unrefEvaluator
EIGEN_STRONG_INLINE void unrefEvaluator()
Definition: TensorRef.h:352
Eigen::internal::TensorLazyEvaluator::Scalar
Base::Scalar Scalar
Definition: TensorRef.h:106
Eigen::TensorEvaluator::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType & coeffRef(Index index)
Definition: TensorEvaluator.h:99
i0
double i0(double x)
Definition: i0.c:149
Eigen::TensorRef::PointerArgType
PointerType PointerArgType
Definition: TensorRef.h:136
Eigen::TensorRef::Layout
@ Layout
Definition: TensorRef.h:146
Eigen::TensorRef::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar coeff(const array< Index, NumIndices > &indices) const
Definition: TensorRef.h:303
array
Definition: numpy.h:821
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::CoeffReturnType
Derived::Scalar CoeffReturnType
Definition: TensorRef.h:371
Eigen::internal::TensorLazyEvaluatorReadOnly::Storage
StorageMemory< Scalar, Device > Storage
Definition: TensorRef.h:47
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Dimensions
Derived::Dimensions Dimensions
Definition: TensorRef.h:373
Eigen::TensorEvaluator::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorEvaluator.h:92
i1
double i1(double x)
Definition: i1.c:150
Eigen::TensorRef::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar coeff(Index index) const
Definition: TensorRef.h:340
Eigen::TensorRef::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: TensorRef.h:133
Eigen::TensorRef::Index
internal::traits< PlainObjectType >::Index Index
Definition: TensorRef.h:131
Eigen::DenseIndex
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
Definition: Meta.h:66
Eigen::internal::TensorLazyEvaluatorReadOnly::coeff
virtual const EIGEN_DEVICE_FUNC Scalar coeff(DenseIndex index) const
Definition: TensorRef.h:66
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::TensorBlock
internal::TensorBlockNotImplemented TensorBlock
Definition: TensorRef.h:439
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::Storage
StorageMemory< CoeffReturnType, Device > Storage
Definition: TensorRef.h:374
Eigen::internal::conditional
Definition: Meta.h:109
Eigen::internal::TensorLazyEvaluatorWritable::Storage
StorageMemory< Scalar, Device > Storage
Definition: TensorRef.h:85
Eigen::TensorRef::IsAligned
@ IsAligned
Definition: TensorRef.h:142
Eigen::internal::TensorLazyEvaluatorWritable::~TensorLazyEvaluatorWritable
virtual ~TensorLazyEvaluatorWritable()
Definition: TensorRef.h:90
Eigen::TensorEvaluator::coeff
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const
Definition: TensorEvaluator.h:94
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(TensorRef< Derived > &m, const Device &d)
Definition: TensorRef.h:442
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorRef.h:375
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::cleanup
EIGEN_STRONG_INLINE void cleanup()
Definition: TensorRef.h:401
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:108
Eigen::TensorRef::BlockAccess
@ BlockAccess
Definition: TensorRef.h:144
Eigen::TensorRef::Base
PlainObjectType::Base Base
Definition: TensorRef.h:128
Eigen::TensorRef::NumIndices
static const Index NumIndices
Definition: TensorRef.h:138
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Scalar
Derived::Scalar Scalar
Definition: TensorRef.h:423
internal
Definition: BandTriangularSolver.h:13
Eigen::TensorRef::operator=
EIGEN_STRONG_INLINE TensorRef & operator=(const Expression &expr)
Definition: TensorRef.h:164
NULL
#define NULL
Definition: ccolamd.c:609
Eigen::internal::TensorLazyBaseEvaluator::TensorLazyBaseEvaluator
TensorLazyBaseEvaluator()
Definition: TensorRef.h:20
Eigen::TensorEvaluator::IsAligned
@ IsAligned
Definition: TensorEvaluator.h:46
Eigen::TensorRef::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(const array< Index, NumIndices > &indices)
Definition: TensorRef.h:321
Eigen::TensorRef::CoeffReturnType
Base::CoeffReturnType CoeffReturnType
Definition: TensorRef.h:134
Eigen::TensorEvaluator< TensorRef< Derived >, Device >::Base
TensorEvaluator< const TensorRef< Derived >, Device > Base
Definition: TensorRef.h:428
Eigen::internal::TensorLazyEvaluatorWritable::EvaluatorPointerType
Storage::Type EvaluatorPointerType
Definition: TensorRef.h:86
Eigen::internal::TensorLazyEvaluatorReadOnly::Scalar
TensorEvaluator< Expr, Device >::Scalar Scalar
Definition: TensorRef.h:46
Eigen::TensorEvaluator::PacketAccess
@ PacketAccess
Definition: TensorEvaluator.h:47
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:233
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
Eigen::TensorRef::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar operator()(Index index) const
Definition: TensorRef.h:202
Eigen::TensorEvaluator< const TensorRef< Derived >, Device >::TensorEvaluator
EIGEN_STRONG_INLINE TensorEvaluator(const TensorRef< Derived > &m, const Device &)
Definition: TensorRef.h:391
Eigen::TensorRef::Dimensions
PlainObjectType::Dimensions Dimensions
Definition: TensorRef.h:139
Scalar
SCALAR Scalar
Definition: bench_gemm.cpp:46
Eigen::Index
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74


gtsam
Author(s):
autogenerated on Thu Dec 19 2024 04:05:41