Tensor.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 // Copyright (C) 2013 Christian Seiler <christian@iwakd.de>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_CXX11_TENSOR_TENSOR_H
12 #define EIGEN_CXX11_TENSOR_TENSOR_H
13 
14 namespace Eigen {
15 
62 template<typename Scalar_, int NumIndices_, int Options_, typename IndexType_>
63 class Tensor : public TensorBase<Tensor<Scalar_, NumIndices_, Options_, IndexType_> >
64 {
65  public:
71  typedef Scalar_ Scalar;
74 
75  enum {
76  IsAligned = bool(EIGEN_MAX_ALIGN_BYTES>0) & !(Options_&DontAlign),
77  Layout = Options_ & RowMajor ? RowMajor : ColMajor,
78  CoordAccess = true,
79  RawAccess = true
80  };
81 
82  static const int Options = Options_;
83  static const int NumIndices = NumIndices_;
85 
86  protected:
88 
89 #ifdef EIGEN_HAS_SFINAE
90  template<typename CustomIndices>
91  struct isOfNormalIndex{
92  static const bool is_array = internal::is_base_of<array<Index, NumIndices>, CustomIndices>::value;
93  static const bool is_int = NumTraits<CustomIndices>::IsInteger;
94  static const bool value = is_array | is_int;
95  };
96 #endif
97 
98  public:
99  // Metadata
106 
107  // This makes EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
108  // work, because that uses base().coeffRef() - and we don't yet
109  // implement a similar class hierarchy
110  inline Self& base() { return *this; }
111  inline const Self& base() const { return *this; }
112 
113 #if EIGEN_HAS_VARIADIC_TEMPLATES
114  template<typename... IndexTypes>
115  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeff(Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
116  {
117  // The number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
118  EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
119  return coeff(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
120  }
121 #endif
122 
123  // normal indices
125  {
128  }
129 
130  // custom indices
131 #ifdef EIGEN_HAS_SFINAE
132  template<typename CustomIndices,
134  >
135  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& coeff(CustomIndices& indices) const
136  {
137  return coeff(internal::customIndices2Array<Index,NumIndices>(indices));
138  }
139 #endif
140 
142  {
143  EIGEN_STATIC_ASSERT(NumIndices == 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
144  return m_storage.data()[0];
145  }
146 
148  {
149  eigen_internal_assert(index >= 0 && index < size());
150  return m_storage.data()[index];
151  }
152 
153 #if EIGEN_HAS_VARIADIC_TEMPLATES
154  template<typename... IndexTypes>
155  inline Scalar& coeffRef(Index firstIndex, Index secondIndex, IndexTypes... otherIndices)
156  {
157  // The number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
158  EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
159  return coeffRef(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
160  }
161 #endif
162 
163  // normal indices
165  {
168  }
169 
170  // custom indices
171 #ifdef EIGEN_HAS_SFINAE
172  template<typename CustomIndices,
174  >
176  {
177  return coeffRef(internal::customIndices2Array<Index,NumIndices>(indices));
178  }
179 #endif
180 
182  {
183  EIGEN_STATIC_ASSERT(NumIndices == 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
184  return m_storage.data()[0];
185  }
186 
188  {
189  eigen_internal_assert(index >= 0 && index < size());
190  return m_storage.data()[index];
191  }
192 
193 #if EIGEN_HAS_VARIADIC_TEMPLATES
194  template<typename... IndexTypes>
195  inline const Scalar& operator()(Index firstIndex, Index secondIndex, IndexTypes... otherIndices) const
196  {
197  // The number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
198  EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
199  return this->operator()(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
200  }
201 #else
204  {
205  return coeff(array<Index, 2>(i0, i1));
206  }
209  {
210  return coeff(array<Index, 3>(i0, i1, i2));
211  }
214  {
215  return coeff(array<Index, 4>(i0, i1, i2, i3));
216  }
219  {
220  return coeff(array<Index, 5>(i0, i1, i2, i3, i4));
221  }
222 #endif
223 
224  // custom indices
225 #ifdef EIGEN_HAS_SFINAE
226  template<typename CustomIndices,
228  >
229  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar& operator()(CustomIndices& indices) const
230  {
231  return coeff(internal::customIndices2Array<Index,NumIndices>(indices));
232  }
233 #endif
234 
235  // normal indices
237  {
238  return coeff(indices);
239  }
240 
242  {
243  eigen_internal_assert(index >= 0 && index < size());
244  return coeff(index);
245  }
246 
248  {
249  EIGEN_STATIC_ASSERT(NumIndices == 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
250  return coeff();
251  }
252 
254  {
255  // The bracket operator is only for vectors, use the parenthesis operator instead.
256  EIGEN_STATIC_ASSERT(NumIndices == 1, YOU_MADE_A_PROGRAMMING_MISTAKE);
257  return coeff(index);
258  }
259 
260 #if EIGEN_HAS_VARIADIC_TEMPLATES
261  template<typename... IndexTypes>
262  inline Scalar& operator()(Index firstIndex, Index secondIndex, IndexTypes... otherIndices)
263  {
264  // The number of indices used to access a tensor coefficient must be equal to the rank of the tensor.
265  EIGEN_STATIC_ASSERT(sizeof...(otherIndices) + 2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
266  return operator()(array<Index, NumIndices>{{firstIndex, secondIndex, otherIndices...}});
267  }
268 #else
271  {
272  return coeffRef(array<Index, 2>(i0, i1));
273  }
276  {
277  return coeffRef(array<Index, 3>(i0, i1, i2));
278  }
281  {
282  return coeffRef(array<Index, 4>(i0, i1, i2, i3));
283  }
286  {
287  return coeffRef(array<Index, 5>(i0, i1, i2, i3, i4));
288  }
289 #endif
290 
291  // normal indices
293  {
294  return coeffRef(indices);
295  }
296 
297  // custom indices
298 #ifdef EIGEN_HAS_SFINAE
299  template<typename CustomIndices,
301  >
303  {
304  return coeffRef(internal::customIndices2Array<Index,NumIndices>(indices));
305  }
306 #endif
307 
309  {
310  eigen_assert(index >= 0 && index < size());
311  return coeffRef(index);
312  }
313 
315  {
316  EIGEN_STATIC_ASSERT(NumIndices == 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
317  return coeffRef();
318  }
319 
321  {
322  // The bracket operator is only for vectors, use the parenthesis operator instead
323  EIGEN_STATIC_ASSERT(NumIndices == 1, YOU_MADE_A_PROGRAMMING_MISTAKE)
324  return coeffRef(index);
325  }
326 
329  : m_storage()
330  {
331  }
332 
336  {
337  }
338 
339 #if EIGEN_HAS_VARIADIC_TEMPLATES
340  template<typename... IndexTypes>
341  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index firstDimension, IndexTypes... otherDimensions)
342  : m_storage(firstDimension, otherDimensions...)
343  {
344  // The number of dimensions used to construct a tensor must be equal to the rank of the tensor.
345  EIGEN_STATIC_ASSERT(sizeof...(otherDimensions) + 1 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
346  }
347 #else
349  : m_storage(dim1, array<Index, 1>(dim1))
350  {
351  EIGEN_STATIC_ASSERT(1 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
352  }
354  : m_storage(dim1*dim2, array<Index, 2>(dim1, dim2))
355  {
356  EIGEN_STATIC_ASSERT(2 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
357  }
359  : m_storage(dim1*dim2*dim3, array<Index, 3>(dim1, dim2, dim3))
360  {
361  EIGEN_STATIC_ASSERT(3 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
362  }
364  : m_storage(dim1*dim2*dim3*dim4, array<Index, 4>(dim1, dim2, dim3, dim4))
365  {
366  EIGEN_STATIC_ASSERT(4 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
367  }
369  : m_storage(dim1*dim2*dim3*dim4*dim5, array<Index, 5>(dim1, dim2, dim3, dim4, dim5))
370  {
371  EIGEN_STATIC_ASSERT(5 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
372  }
373 #endif
374 
378  {
380  }
381 
382  template<typename OtherDerived>
385  {
387  Assign assign(*this, other.derived());
390  }
391 
392  template<typename OtherDerived>
395  {
397  Assign assign(*this, other.derived());
400  }
401 
402  #if EIGEN_HAS_RVALUE_REFERENCES
406  {
407  }
410  {
411  m_storage = std::move(other.m_storage);
412  return *this;
413  }
414  #endif
415 
418  {
420  Assign assign(*this, other);
423  return *this;
424  }
425  template<typename OtherDerived>
428  {
430  Assign assign(*this, other);
433  return *this;
434  }
435 
436 #if EIGEN_HAS_VARIADIC_TEMPLATES
437  template<typename... IndexTypes> EIGEN_DEVICE_FUNC
438  void resize(Index firstDimension, IndexTypes... otherDimensions)
439  {
440  // The number of dimensions used to resize a tensor must be equal to the rank of the tensor.
441  EIGEN_STATIC_ASSERT(sizeof...(otherDimensions) + 1 == NumIndices, YOU_MADE_A_PROGRAMMING_MISTAKE)
442  resize(array<Index, NumIndices>{{firstDimension, otherDimensions...}});
443  }
444 #endif
445 
448  {
449  int i;
450  Index size = Index(1);
451  for (i = 0; i < NumIndices; i++) {
453  size *= dimensions[i];
454  }
455  #ifdef EIGEN_INITIALIZE_COEFFS
456  bool size_changed = size != this->size();
457  m_storage.resize(size, dimensions);
459  #else
460  m_storage.resize(size, dimensions);
461  #endif
462  }
463 
464  // Why this overload, DSizes is derived from array ??? //
467  for (int i = 0; i < NumIndices; ++i) {
468  dims[i] = dimensions[i];
469  }
470  resize(dims);
471  }
472 
474  void resize()
475  {
476  EIGEN_STATIC_ASSERT(NumIndices == 0, YOU_MADE_A_PROGRAMMING_MISTAKE);
477  // Nothing to do: rank 0 tensors have fixed size
478  }
479 
480 #ifdef EIGEN_HAS_INDEX_LIST
481  template <typename FirstType, typename... OtherTypes>
483  void resize(const Eigen::IndexList<FirstType, OtherTypes...>& dimensions) {
485  for (int i = 0; i < NumIndices; ++i) {
486  dims[i] = static_cast<Index>(dimensions[i]);
487  }
488  resize(dims);
489  }
490 #endif
491 
493 #ifdef EIGEN_HAS_SFINAE
494  template<typename CustomDimension,
496  >
498  {
499  resize(internal::customIndices2Array<Index,NumIndices>(dimensions));
500  }
501 #endif
502 
503 #ifndef EIGEN_EMULATE_CXX11_META_H
504  template <typename std::ptrdiff_t... Indices>
508  for (int i = 0; i < NumIndices; ++i) {
509  dims[i] = static_cast<Index>(dimensions[i]);
510  }
511  resize(dims);
512  }
513 #else
514  template <std::size_t V1, std::size_t V2, std::size_t V3, std::size_t V4, std::size_t V5>
518  for (int i = 0; i < NumIndices; ++i) {
519  dims[i] = static_cast<Index>(dimensions[i]);
520  }
521  resize(dims);
522  }
523 #endif
524 
525  protected:
526 
528  {
533  using internal::lesser_op;
534 
535  return
536  // check whether the indices are all >= 0
537  array_apply_and_reduce<logical_and_op, greater_equal_zero_op>(indices) &&
538  // check whether the indices fit in the dimensions
539  array_zip_and_reduce<logical_and_op, lesser_op>(indices, m_storage.dimensions());
540  }
541 
543  {
544  if (Options&RowMajor) {
546  } else {
548  }
549  }
550 };
551 
552 } // end namespace Eigen
553 
554 #endif // EIGEN_CXX11_TENSOR_TENSOR_H
Eigen::Tensor::data
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar * data() const
Definition: Tensor.h:105
Eigen::Tensor::dimension
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index dimension(std::size_t n) const
Definition: Tensor.h:101
Eigen::Tensor
The tensor class.
Definition: Tensor.h:63
Eigen::Tensor::resize
EIGEN_DEVICE_FUNC void resize(const Sizes< Indices... > &dimensions)
Definition: Tensor.h:506
EIGEN_DEVICE_FUNC
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:976
Eigen::Tensor::Scalar
Scalar_ Scalar
Definition: Tensor.h:71
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()() const
Definition: Tensor.h:247
Eigen
Namespace containing all symbols from the Eigen library.
Definition: jet.h:637
Eigen::Tensor::StorageKind
internal::traits< Self >::StorageKind StorageKind
Definition: Tensor.h:69
Eigen::Tensor::operator[]
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator[](Index index) const
Definition: Tensor.h:253
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2)
Definition: Tensor.h:353
Eigen::internal::array_zip_and_reduce
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
Eigen::array
Definition: EmulateArray.h:21
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(const array< Index, NumIndices > &indices)
Definition: Tensor.h:292
Eigen::Tensor::CoeffReturnType
Base::CoeffReturnType CoeffReturnType
Definition: Tensor.h:73
Eigen::Tensor::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff(const array< Index, NumIndices > &indices) const
Definition: Tensor.h:124
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::TensorStorage::dimensions
static EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE FixedDimensions & dimensions()
Definition: TensorStorage.h:59
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor()
Definition: Tensor.h:328
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2) const
Definition: Tensor.h:208
Eigen::TensorStorage< Scalar, Dimensions, Options >
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3, Index i4) const
Definition: Tensor.h:218
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2)
Definition: Tensor.h:275
Eigen::Tensor::resize
EIGEN_DEVICE_FUNC void resize(const DSizes< Index, NumIndices > &dimensions)
Definition: Tensor.h:465
Eigen::RowMajor
@ RowMajor
Definition: Constants.h:321
Eigen::TensorBase< Tensor< _Scalar, NumIndices_, Options_, IndexType_ > >::CoeffReturnType
Scalar CoeffReturnType
Definition: TensorBase.h:979
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1)
Definition: Tensor.h:348
Eigen::Tensor::Nested
Eigen::internal::nested< Self >::type Nested
Definition: Tensor.h:68
Eigen::Tensor::Self
Tensor< Scalar_, NumIndices_, Options_, IndexType_ > Self
Definition: Tensor.h:66
Eigen::Tensor::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff() const
Definition: Tensor.h:141
Eigen::Tensor::IsAligned
@ IsAligned
Definition: Tensor.h:76
Eigen::internal::array_apply_and_reduce
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
Eigen::DontAlign
@ DontAlign
Definition: Constants.h:325
eigen_internal_assert
#define eigen_internal_assert(x)
Definition: Macros.h:1043
Eigen::DSizes
Definition: TensorDimensions.h:263
Eigen::Sizes
Definition: TensorDimensions.h:93
test_eigen_tensor.indices
indices
Definition: test_eigen_tensor.py:33
Eigen::DefaultDevice
Definition: TensorDeviceDefault.h:17
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3) const
Definition: Tensor.h:213
n
int n
Definition: BiCGSTAB_simple.cpp:1
Eigen::Tensor::operator[]
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator[](Index index)
Definition: Tensor.h:320
Eigen::DSizes::IndexOfRowMajor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfRowMajor(const array< DenseIndex, NumDims > &indices) const
Definition: TensorDimensions.h:381
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const Self &other)
Definition: Tensor.h:334
Eigen::internal::check_rows_cols_for_overflow::run
static EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE void run(Index, Index)
Definition: PlainObjectBase.h:32
Eigen::internal::true_type
Definition: Meta.h:96
Eigen::Tensor::rank
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index rank() const
Definition: Tensor.h:100
Eigen::Tensor::operator=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & operator=(const OtherDerived &other)
Definition: Tensor.h:427
Eigen::Tensor::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef()
Definition: Tensor.h:181
Eigen::Tensor::RealScalar
NumTraits< Scalar >::Real RealScalar
Definition: Tensor.h:72
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index index)
Definition: Tensor.h:308
Eigen::Tensor::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(const array< Index, NumIndices > &indices)
Definition: Tensor.h:164
Eigen::Tensor::CoordAccess
@ CoordAccess
Definition: Tensor.h:78
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const TensorBase< OtherDerived, ReadOnlyAccessors > &other)
Definition: Tensor.h:384
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3)
Definition: Tensor.h:358
Eigen::TensorStorage::size
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex size() const
Definition: TensorStorage.h:66
Eigen::Tensor::resize
EIGEN_DEVICE_FUNC void resize(const array< Index, NumIndices > &dimensions)
Definition: Tensor.h:447
Eigen::Tensor::dimensions
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Dimensions & dimensions() const
Definition: Tensor.h:102
Eigen::Tensor::NumIndices
static const int NumIndices
Definition: Tensor.h:83
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4)
Definition: Tensor.h:363
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::TensorStorage::data
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T * data()
Definition: TensorStorage.h:54
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const TensorBase< OtherDerived, WriteAccessors > &other)
Definition: Tensor.h:394
Eigen::internal::lesser_op
Definition: CXX11Meta.h:306
EIGEN_MAX_ALIGN_BYTES
#define EIGEN_MAX_ALIGN_BYTES
Definition: ConfigureVectorization.h:175
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1)
Definition: Tensor.h:270
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3)
Definition: Tensor.h:280
EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
#define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED
Definition: PlainObjectBase.h:22
EIGEN_SFINAE_ENABLE_IF
#define EIGEN_SFINAE_ENABLE_IF(__condition__)
Definition: TensorMacros.h:43
Eigen::TensorBase
The tensor base class.
Definition: TensorBase.h:973
size_t
std::size_t size_t
Definition: wrap/pybind11/include/pybind11/detail/common.h:490
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(const array< Index, NumIndices > &dimensions)
Definition: Tensor.h:376
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1) const
Definition: Tensor.h:203
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()(Index i0, Index i1, Index i2, Index i3, Index i4)
Definition: Tensor.h:285
Eigen::internal::array_prod
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
Definition: TensorDimensions.h:140
Eigen::Tensor::base
const Self & base() const
Definition: Tensor.h:111
Eigen::Tensor::m_storage
TensorStorage< Scalar, Dimensions, Options > m_storage
Definition: Tensor.h:87
Eigen::Tensor::coeffRef
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & coeffRef(Index index)
Definition: Tensor.h:187
i0
double i0(double x)
Definition: i0.c:149
Eigen::Tensor::Tensor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor(Index dim1, Index dim2, Index dim3, Index dim4, Index dim5)
Definition: Tensor.h:368
Eigen::Tensor::base
Self & base()
Definition: Tensor.h:110
Eigen::Tensor::resize
EIGEN_DEVICE_FUNC void resize()
Definition: Tensor.h:474
Eigen::Tensor::Layout
@ Layout
Definition: Tensor.h:77
move
detail::enable_if_t<!detail::move_never< T >::value, T > move(object &&obj)
Definition: cast.h:1243
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar & operator()()
Definition: Tensor.h:314
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(const array< Index, NumIndices > &indices) const
Definition: Tensor.h:236
Eigen::Tensor::Options
static const int Options
Definition: Tensor.h:82
Eigen::internal::traits
Definition: ForwardDeclarations.h:17
i1
double i1(double x)
Definition: i1.c:150
EIGEN_STATIC_ASSERT
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition: StaticAssert.h:127
std
Definition: BFloat16.h:88
Eigen::DSizes::IndexOfColMajor
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DenseIndex IndexOfColMajor(const array< DenseIndex, NumDims > &indices) const
Definition: TensorDimensions.h:378
Eigen::Tensor::data
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Scalar * data()
Definition: Tensor.h:104
Eigen::Tensor::operator()
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & operator()(Index index) const
Definition: Tensor.h:241
Eigen::Tensor::operator=
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Tensor & operator=(const Tensor &other)
Definition: Tensor.h:417
Eigen::Tensor::Dimensions
DSizes< Index, NumIndices_ > Dimensions
Definition: Tensor.h:84
Eigen::TensorEvaluator
A cost model used to limit the number of threads used for evaluating tensor expression.
Definition: TensorEvaluator.h:28
Eigen::Tensor::checkIndexRange
bool checkIndexRange(const array< Index, NumIndices > &indices) const
Definition: Tensor.h:527
Eigen::Tensor::size
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index size() const
Definition: Tensor.h:103
internal
Definition: BandTriangularSolver.h:13
Eigen::Tensor::linearizedIndex
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Index linearizedIndex(const array< Index, NumIndices > &indices) const
Definition: Tensor.h:542
Eigen::Tensor::RawAccess
@ RawAccess
Definition: Tensor.h:79
Eigen::ColMajor
@ ColMajor
Definition: Constants.h:319
Indices
std::vector< size_t > Indices
Definition: testPartialPriorFactor.cpp:37
Eigen::internal::greater_equal_zero_op
Definition: CXX11Meta.h:315
Eigen::internal::logical_and_op
Definition: CXX11Meta.h:301
Eigen::Tensor::coeff
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE Scalar & coeff(Index index) const
Definition: Tensor.h:147
Eigen::Tensor::Index
internal::traits< Self >::Index Index
Definition: Tensor.h:70
Eigen::TensorAssignOp
Definition: TensorAssign.h:61
Eigen::NumTraits
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:232
test_callbacks.value
value
Definition: test_callbacks.py:160
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
pybind_wrapper_test_script.other
other
Definition: pybind_wrapper_test_script.py:42
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
Eigen::Tensor::Base
TensorBase< Tensor< Scalar_, NumIndices_, Options_, IndexType_ > > Base
Definition: Tensor.h:67
Eigen::internal::TensorExecutor::run
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void run(const Expression &expr, const Device &device=Device())
Definition: TensorExecutor.h:96


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:05:25