TensorIndexList.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_INDEX_LIST_H
11 #define EIGEN_CXX11_TENSOR_TENSOR_INDEX_LIST_H
12 
13 // IWYU pragma: private
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
38 template <Index n>
39 struct type2index {
40  static constexpr Index value = n;
41  EIGEN_DEVICE_FUNC constexpr operator Index() const { return n; }
43 };
44 
45 // This can be used with IndexPairList to get compile-time constant pairs,
46 // such as IndexPairList<type2indexpair<1,2>, type2indexpair<3,4>>().
47 template <Index f, Index s>
49  static constexpr Index first = f;
50  static constexpr Index second = s;
51 
52  constexpr EIGEN_DEVICE_FUNC operator IndexPair<Index>() const { return IndexPair<Index>(f, s); }
53 
55  eigen_assert(val.first == f);
56  eigen_assert(val.second == s);
57  }
58 };
59 
60 template <Index n>
62  typedef Index Real;
63  enum { IsComplex = 0, RequireInitialization = false, ReadCost = 1, AddCost = 1, MulCost = 1 };
64 
69 };
70 
71 namespace internal {
72 template <typename T>
74  val = internal::convert_index<T>(new_val);
75 }
76 template <Index n>
78  val.set(new_val);
79 }
80 
81 template <typename T>
83  val = new_val;
84 }
85 template <Index f, Index s>
87  val.set(new_val);
88 }
89 
90 template <typename T>
92  static constexpr bool value = false;
93 };
94 
95 template <Index idx>
97  static constexpr bool value = true;
98 };
99 template <Index idx>
101  static constexpr bool value = true;
102 };
103 template <Index idx>
105  static constexpr bool value = true;
106 };
107 template <Index idx>
109  static constexpr bool value = true;
110 };
111 
112 template <Index f, Index s>
114  static constexpr bool value = true;
115 };
116 template <Index f, Index s>
118  static constexpr bool value = true;
119 };
120 template <Index f, Index s>
122  static constexpr bool value = true;
123 };
124 template <Index f, Index s>
126  static constexpr bool value = true;
127 };
128 
129 template <typename... T>
130 struct IndexTuple;
131 
132 template <typename T, typename... O>
133 struct IndexTuple<T, O...> {
134  EIGEN_DEVICE_FUNC constexpr IndexTuple() : head(), others() {}
135  EIGEN_DEVICE_FUNC constexpr IndexTuple(const T& v, const O... o) : head(v), others(o...) {}
136 
137  static constexpr int count = 1 + sizeof...(O);
140  typedef T Head;
141  typedef IndexTuple<O...> Other;
142 };
143 
144 template <typename T>
145 struct IndexTuple<T> {
146  EIGEN_DEVICE_FUNC constexpr IndexTuple() : head() {}
147  EIGEN_DEVICE_FUNC constexpr IndexTuple(const T& v) : head(v) {}
148 
149  constexpr static int count = 1;
151  typedef T Head;
152 };
153 
154 template <int N, typename... T>
156 
157 template <int N, typename T, typename... O>
158 struct IndexTupleExtractor<N, T, O...> {
159  typedef typename IndexTupleExtractor<N - 1, O...>::ValType ValType;
160 
163  }
164 
165  EIGEN_DEVICE_FUNC static constexpr const ValType& get_val(const IndexTuple<T, O...>& val) {
167  }
168  template <typename V>
171  }
172 };
173 
174 template <typename T, typename... O>
175 struct IndexTupleExtractor<0, T, O...> {
176  typedef T ValType;
177 
178  EIGEN_DEVICE_FUNC static constexpr ValType& get_val(IndexTuple<T, O...>& val) { return val.head; }
179  EIGEN_DEVICE_FUNC static constexpr const ValType& get_val(const IndexTuple<T, O...>& val) { return val.head; }
180  template <typename V>
182  val.head = new_val;
183  }
184 };
185 
186 template <int N, typename T, typename... O>
189 }
190 template <int N, typename T, typename... O>
191 EIGEN_DEVICE_FUNC constexpr const typename IndexTupleExtractor<N, T, O...>::ValType& array_get(
192  const IndexTuple<T, O...>& tuple) {
194 }
195 template <typename T, typename... O>
196 struct array_size<IndexTuple<T, O...>> {
197  static constexpr size_t value = IndexTuple<T, O...>::count;
198 };
199 template <typename T, typename... O>
200 struct array_size<const IndexTuple<T, O...>> {
201  static constexpr size_t value = IndexTuple<T, O...>::count;
202 };
203 
204 template <Index Idx, typename ValueT>
205 struct tuple_coeff {
206  template <typename... T>
207  EIGEN_DEVICE_FUNC static constexpr ValueT get(const Index i, const IndexTuple<T...>& t) {
208  // return array_get<Idx>(t) * (i == Idx) + tuple_coeff<Idx-1>::get(i, t) * (i != Idx);
209  return (i == Idx ? array_get<Idx>(t) : tuple_coeff<Idx - 1, ValueT>::get(i, t));
210  }
211  template <typename... T>
212  EIGEN_DEVICE_FUNC static void set(const Index i, IndexTuple<T...>& t, const ValueT& value) {
213  if (i == Idx) {
214  update_value(array_get<Idx>(t), value);
215  } else {
217  }
218  }
219 
220  template <typename... T>
221  EIGEN_DEVICE_FUNC static constexpr bool value_known_statically(const Index i, const IndexTuple<T...>& t) {
224  }
225 
226  template <typename... T>
228  return is_compile_time_constant<typename IndexTupleExtractor<Idx, T...>::ValType>::value &&
230  }
231 
232  template <typename... T>
234  return is_compile_time_constant<typename IndexTupleExtractor<Idx, T...>::ValType>::value &&
235  is_compile_time_constant<typename IndexTupleExtractor<Idx, T...>::ValType>::value &&
236  array_get<Idx>(t) > array_get<Idx - 1>(t) &&
238  }
239 };
240 
241 template <typename ValueT>
242 struct tuple_coeff<0, ValueT> {
243  template <typename... T>
244  EIGEN_DEVICE_FUNC static constexpr ValueT get(const Index /*i*/, const IndexTuple<T...>& t) {
245  // eigen_assert (i == 0); // gcc fails to compile assertions in constexpr
246  return array_get<0>(t) /* * (i == 0)*/;
247  }
248  template <typename... T>
249  EIGEN_DEVICE_FUNC static void set(const Index i, IndexTuple<T...>& t, const ValueT value) {
250  eigen_assert(i == 0);
251  update_value(array_get<0>(t), value);
252  }
253  template <typename... T>
254  EIGEN_DEVICE_FUNC static constexpr bool value_known_statically(const Index i, const IndexTuple<T...>&) {
255  return is_compile_time_constant<typename IndexTupleExtractor<0, T...>::ValType>::value && (i == 0);
256  }
257 
258  template <typename... T>
260  return is_compile_time_constant<typename IndexTupleExtractor<0, T...>::ValType>::value;
261  }
262 
263  template <typename... T>
265  return true;
266  }
267 };
268 } // namespace internal
269 
270 template <typename FirstType, typename... OtherTypes>
271 struct IndexList : internal::IndexTuple<FirstType, OtherTypes...> {
273  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
274  Index>::get(i, *this);
275  }
277  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
278  Index>::get(i, *this);
279  }
281  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
282  Index>::set(i, *this, value);
283  }
284 
285  EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC constexpr std::size_t size() const { return 1 + sizeof...(OtherTypes); };
286 
288  : internal::IndexTuple<FirstType, OtherTypes...>(other) {}
289  EIGEN_DEVICE_FUNC constexpr IndexList(FirstType& first, OtherTypes... other)
290  : internal::IndexTuple<FirstType, OtherTypes...>(first, other...) {}
291  EIGEN_DEVICE_FUNC constexpr IndexList() : internal::IndexTuple<FirstType, OtherTypes...>() {}
292 
293  EIGEN_DEVICE_FUNC constexpr bool value_known_statically(const Index i) const {
294  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
296  }
298  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
299  Index>::values_up_to_known_statically(*this);
300  }
301 
303  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
304  Index>::values_up_to_statically_known_to_increase(*this);
305  }
306 };
307 
308 template <typename FirstType, typename... OtherTypes>
309 std::ostream& operator<<(std::ostream& os, const IndexList<FirstType, OtherTypes...>& dims) {
310  os << "[";
311  for (size_t i = 0; i < 1 + sizeof...(OtherTypes); ++i) {
312  if (i > 0) os << ", ";
313  os << dims[i];
314  }
315  os << "]";
316  return os;
317 }
318 
319 template <typename FirstType, typename... OtherTypes>
320 constexpr IndexList<FirstType, OtherTypes...> make_index_list(FirstType val1, OtherTypes... other_vals) {
321  return IndexList<FirstType, OtherTypes...>(val1, other_vals...);
322 }
323 
324 template <typename FirstType, typename... OtherTypes>
325 struct IndexPairList : internal::IndexTuple<FirstType, OtherTypes...> {
327  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
328  IndexPair<Index>>::get(i, *this);
329  }
331  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
332  IndexPair<Index>>::set(i, *this, value);
333  }
334 
336  : internal::IndexTuple<FirstType, OtherTypes...>(other) {}
337  EIGEN_DEVICE_FUNC constexpr IndexPairList() : internal::IndexTuple<FirstType, OtherTypes...>() {}
338 
339  EIGEN_DEVICE_FUNC constexpr bool value_known_statically(const Index i) const {
340  return internal::tuple_coeff<internal::array_size<internal::IndexTuple<FirstType, OtherTypes...>>::value - 1,
342  }
343 };
344 
345 namespace internal {
346 
347 template <typename FirstType, typename... OtherTypes>
349  Index result = 1;
351  for (size_t i = 0; i < array_size<IndexList<FirstType, OtherTypes...>>::value; ++i) {
352  result *= sizes[i];
353  }
354  return result;
355 }
356 
357 template <typename FirstType, typename... OtherTypes>
358 struct array_size<IndexList<FirstType, OtherTypes...>> {
359  static const size_t value = array_size<IndexTuple<FirstType, OtherTypes...>>::value;
360 };
361 template <typename FirstType, typename... OtherTypes>
362 struct array_size<const IndexList<FirstType, OtherTypes...>> {
363  static const size_t value = array_size<IndexTuple<FirstType, OtherTypes...>>::value;
364 };
365 
366 template <typename FirstType, typename... OtherTypes>
367 struct array_size<IndexPairList<FirstType, OtherTypes...>> {
368  static const size_t value = 1 + sizeof...(OtherTypes);
369 };
370 template <typename FirstType, typename... OtherTypes>
371 struct array_size<const IndexPairList<FirstType, OtherTypes...>> {
372  static const size_t value = 1 + sizeof...(OtherTypes);
373 };
374 
375 template <Index N, typename FirstType, typename... OtherTypes>
378 }
379 template <Index N, typename FirstType, typename... OtherTypes>
382 }
383 
384 template <typename T>
386  EIGEN_DEVICE_FUNC static constexpr bool run(const Index) { return false; }
387 };
388 
389 template <typename FirstType, typename... OtherTypes>
390 struct index_known_statically_impl<IndexList<FirstType, OtherTypes...>> {
391  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i) {
392  return IndexList<FirstType, OtherTypes...>().value_known_statically(i);
393  }
394 };
395 
396 template <typename FirstType, typename... OtherTypes>
397 struct index_known_statically_impl<const IndexList<FirstType, OtherTypes...>> {
398  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i) {
399  return IndexList<FirstType, OtherTypes...>().value_known_statically(i);
400  }
401 };
402 
403 template <typename T>
405  static constexpr bool run() { return false; }
406 };
407 
408 template <typename FirstType, typename... OtherTypes>
409 struct all_indices_known_statically_impl<IndexList<FirstType, OtherTypes...>> {
410  EIGEN_DEVICE_FUNC static constexpr bool run() {
411  return IndexList<FirstType, OtherTypes...>().all_values_known_statically();
412  }
413 };
414 
415 template <typename FirstType, typename... OtherTypes>
416 struct all_indices_known_statically_impl<const IndexList<FirstType, OtherTypes...>> {
417  EIGEN_DEVICE_FUNC static constexpr bool run() {
418  return IndexList<FirstType, OtherTypes...>().all_values_known_statically();
419  }
420 };
421 
422 template <typename T>
424  EIGEN_DEVICE_FUNC static constexpr bool run() { return false; }
425 };
426 
427 template <typename FirstType, typename... OtherTypes>
428 struct indices_statically_known_to_increase_impl<IndexList<FirstType, OtherTypes...>> {
429  EIGEN_DEVICE_FUNC static constexpr bool run() {
430  return Eigen::IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
431  }
432 };
433 
434 template <typename FirstType, typename... OtherTypes>
435 struct indices_statically_known_to_increase_impl<const IndexList<FirstType, OtherTypes...>> {
436  EIGEN_DEVICE_FUNC static constexpr bool run() {
437  return Eigen::IndexList<FirstType, OtherTypes...>().values_statically_known_to_increase();
438  }
439 };
440 
441 template <typename Tx>
443  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
444 };
445 
446 template <typename FirstType, typename... OtherTypes>
447 struct index_statically_eq_impl<IndexList<FirstType, OtherTypes...>> {
448  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
449  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
450  (IndexList<FirstType, OtherTypes...>().get(i) == value);
451  }
452 };
453 
454 template <typename FirstType, typename... OtherTypes>
455 struct index_statically_eq_impl<const IndexList<FirstType, OtherTypes...>> {
456  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
457  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
458  (IndexList<FirstType, OtherTypes...>().get(i) == value);
459  }
460 };
461 
462 template <typename T>
464  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
465 };
466 
467 template <typename FirstType, typename... OtherTypes>
468 struct index_statically_ne_impl<IndexList<FirstType, OtherTypes...>> {
469  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
470  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
471  (IndexList<FirstType, OtherTypes...>().get(i) != value);
472  }
473 };
474 
475 template <typename FirstType, typename... OtherTypes>
476 struct index_statically_ne_impl<const IndexList<FirstType, OtherTypes...>> {
477  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
478  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
479  (IndexList<FirstType, OtherTypes...>().get(i) != value);
480  }
481 };
482 
483 template <typename T>
485  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
486 };
487 
488 template <typename FirstType, typename... OtherTypes>
489 struct index_statically_gt_impl<IndexList<FirstType, OtherTypes...>> {
490  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
491  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
492  (IndexList<FirstType, OtherTypes...>().get(i) > value);
493  }
494 };
495 
496 template <typename FirstType, typename... OtherTypes>
497 struct index_statically_gt_impl<const IndexList<FirstType, OtherTypes...>> {
498  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
499  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
500  (IndexList<FirstType, OtherTypes...>().get(i) > value);
501  }
502 };
503 
504 template <typename T>
506  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
507 };
508 
509 template <typename FirstType, typename... OtherTypes>
510 struct index_statically_lt_impl<IndexList<FirstType, OtherTypes...>> {
511  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
512  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
513  (IndexList<FirstType, OtherTypes...>().get(i) < value);
514  }
515 };
516 
517 template <typename FirstType, typename... OtherTypes>
518 struct index_statically_lt_impl<const IndexList<FirstType, OtherTypes...>> {
519  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
520  return IndexList<FirstType, OtherTypes...>().value_known_statically(i) &&
521  (IndexList<FirstType, OtherTypes...>().get(i) < value);
522  }
523 };
524 
525 template <typename Tx>
527  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
528 };
529 
530 template <typename FirstType, typename... OtherTypes>
531 struct index_pair_first_statically_eq_impl<IndexPairList<FirstType, OtherTypes...>> {
532  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
533  return IndexPairList<FirstType, OtherTypes...>().value_known_statically(i) &&
534  (IndexPairList<FirstType, OtherTypes...>().operator[](i).first == value);
535  }
536 };
537 
538 template <typename FirstType, typename... OtherTypes>
539 struct index_pair_first_statically_eq_impl<const IndexPairList<FirstType, OtherTypes...>> {
540  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
541  return IndexPairList<FirstType, OtherTypes...>().value_known_statically(i) &&
542  (IndexPairList<FirstType, OtherTypes...>().operator[](i).first == value);
543  }
544 };
545 
546 template <typename Tx>
548  EIGEN_DEVICE_FUNC static constexpr bool run(Index, Index) { return false; }
549 };
550 
551 template <typename FirstType, typename... OtherTypes>
552 struct index_pair_second_statically_eq_impl<IndexPairList<FirstType, OtherTypes...>> {
553  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
554  return IndexPairList<FirstType, OtherTypes...>().value_known_statically(i) &&
555  (IndexPairList<FirstType, OtherTypes...>().operator[](i).second == value);
556  }
557 };
558 
559 template <typename FirstType, typename... OtherTypes>
560 struct index_pair_second_statically_eq_impl<const IndexPairList<FirstType, OtherTypes...>> {
561  EIGEN_DEVICE_FUNC static constexpr bool run(const Index i, const Index value) {
562  return IndexPairList<FirstType, OtherTypes...>().value_known_statically(i) &&
563  (IndexPairList<FirstType, OtherTypes...>().operator[](i).second == value);
564  }
565 };
566 
567 } // end namespace internal
568 } // end namespace Eigen
569 
570 namespace Eigen {
571 namespace internal {
572 template <typename T>
575 }
576 
577 template <typename T>
580 }
581 
582 template <typename T>
585 }
586 
587 template <typename T>
590 }
591 
592 template <typename T>
595 }
596 
597 template <typename T>
600 }
601 
602 template <typename T>
605 }
606 
607 template <typename T>
610 }
611 
612 template <typename T>
615 }
616 
617 } // end namespace internal
618 } // end namespace Eigen
619 
620 #endif // EIGEN_CXX11_TENSOR_TENSOR_INDEX_LIST_H
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
MatrixXcd V
Definition: EigenSolver_EigenSolver_MatrixType.cpp:15
Eigen::Triplet< double > T
Definition: EigenUnitTest.cpp:11
#define EIGEN_UNROLL_LOOP
Definition: Macros.h:1298
#define EIGEN_CONSTEXPR
Definition: Macros.h:758
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
@ N
Definition: constructor.cpp:22
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
std::vector< Array2i > sizes
Definition: dense_solvers.cpp:12
RealScalar s
Definition: level1_cplx_impl.h:130
const Scalar * a
Definition: level2_cplx_impl.h:32
TupleImpl< sizeof...(Types), Types... > tuple
Definition: Tuple.h:267
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_eq(Index i, Index value)
Definition: TensorIndexList.h:588
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_second_statically_eq(Index i, Index value)
Definition: TensorIndexList.h:613
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool indices_statically_known_to_increase()
Definition: TensorIndexList.h:583
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto array_prod(const array< T, N > &arr) -> decltype(array_reduce< product_op, T, N >(arr, static_cast< T >(1)))
Definition: MoreMeta.h:497
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_ne(Index i, Index value)
Definition: TensorIndexList.h:593
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_pair_first_statically_eq(Index i, Index value)
Definition: TensorIndexList.h:608
constexpr T & array_get(std::array< T, N > &a)
Definition: EmulateArray.h:251
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_lt(Index i, Index value)
Definition: TensorIndexList.h:603
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_known_statically(Index i)
Definition: TensorIndexList.h:573
EIGEN_DEVICE_FUNC void update_value(T &val, Index new_val)
Definition: TensorIndexList.h:73
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool index_statically_gt(Index i, Index value)
Definition: TensorIndexList.h:598
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR bool all_indices_known_statically()
Definition: TensorIndexList.h:578
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
std::ostream & operator<<(std::ostream &s, const DiagonalBase< Derived > &m)
Definition: IO.h:227
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
constexpr IndexList< FirstType, OtherTypes... > make_index_list(FirstType val1, OtherTypes... other_vals)
Definition: TensorIndexList.h:320
val
Definition: calibrate.py:119
Definition: Eigen_Colamd.h:49
t
Definition: plotPSD.py:36
Container::iterator get(Container &c, Position position)
Definition: stdlist_overload.cpp:29
@ RequireInitialization
Definition: NumTraits.h:177
@ ReadCost
Definition: NumTraits.h:178
@ AddCost
Definition: NumTraits.h:179
@ IsComplex
Definition: NumTraits.h:176
@ MulCost
Definition: NumTraits.h:180
Definition: TensorIndexList.h:271
constexpr EIGEN_DEVICE_FUNC IndexList(const internal::IndexTuple< FirstType, OtherTypes... > &other)
Definition: TensorIndexList.h:287
constexpr EIGEN_DEVICE_FUNC IndexList(FirstType &first, OtherTypes... other)
Definition: TensorIndexList.h:289
constexpr EIGEN_DEVICE_FUNC bool all_values_known_statically() const
Definition: TensorIndexList.h:297
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC Index operator[](const Index i) const
Definition: TensorIndexList.h:272
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC Index get(const Index i) const
Definition: TensorIndexList.h:276
constexpr EIGEN_DEVICE_FUNC bool values_statically_known_to_increase() const
Definition: TensorIndexList.h:302
constexpr EIGEN_DEVICE_FUNC IndexList()
Definition: TensorIndexList.h:291
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC void set(const Index i, const Index value)
Definition: TensorIndexList.h:280
constexpr EIGEN_DEVICE_FUNC bool value_known_statically(const Index i) const
Definition: TensorIndexList.h:293
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC std::size_t size() const
Definition: TensorIndexList.h:285
Definition: TensorIndexList.h:325
EIGEN_STRONG_INLINE constexpr EIGEN_DEVICE_FUNC IndexPair< Index > operator[](const Index i) const
Definition: TensorIndexList.h:326
constexpr EIGEN_DEVICE_FUNC IndexPairList(const internal::IndexTuple< FirstType, OtherTypes... > &other)
Definition: TensorIndexList.h:335
constexpr EIGEN_DEVICE_FUNC IndexPairList()
Definition: TensorIndexList.h:337
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC void set(const Index i, const IndexPair< Index > value)
Definition: TensorIndexList.h:330
constexpr EIGEN_DEVICE_FUNC bool value_known_statically(const Index i) const
Definition: TensorIndexList.h:339
Definition: TensorMeta.h:238
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real highest()
Definition: TensorIndexList.h:67
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real epsilon()
Definition: TensorIndexList.h:65
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real dummy_precision()
Definition: TensorIndexList.h:66
static EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real lowest()
Definition: TensorIndexList.h:68
Index Real
Definition: TensorIndexList.h:62
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
static constexpr EIGEN_DEVICE_FUNC const ValType & get_val(const IndexTuple< T, O... > &val)
Definition: TensorIndexList.h:179
T ValType
Definition: TensorIndexList.h:176
static constexpr EIGEN_DEVICE_FUNC ValType & get_val(IndexTuple< T, O... > &val)
Definition: TensorIndexList.h:178
static EIGEN_DEVICE_FUNC void set_val(IndexTuple< T, O... > &val, V &new_val)
Definition: TensorIndexList.h:181
static constexpr EIGEN_DEVICE_FUNC const ValType & get_val(const IndexTuple< T, O... > &val)
Definition: TensorIndexList.h:165
static constexpr EIGEN_DEVICE_FUNC ValType & get_val(IndexTuple< T, O... > &val)
Definition: TensorIndexList.h:161
IndexTupleExtractor< N - 1, O... >::ValType ValType
Definition: TensorIndexList.h:159
static EIGEN_DEVICE_FUNC void set_val(IndexTuple< T, O... > &val, V &new_val)
Definition: TensorIndexList.h:169
Definition: TensorIndexList.h:155
Definition: TensorIndexList.h:133
IndexTuple< O... > Other
Definition: TensorIndexList.h:141
IndexTuple< O... > others
Definition: TensorIndexList.h:139
constexpr EIGEN_DEVICE_FUNC IndexTuple()
Definition: TensorIndexList.h:134
T Head
Definition: TensorIndexList.h:140
T head
Definition: TensorIndexList.h:138
constexpr EIGEN_DEVICE_FUNC IndexTuple(const T &v, const O... o)
Definition: TensorIndexList.h:135
T Head
Definition: TensorIndexList.h:151
constexpr EIGEN_DEVICE_FUNC IndexTuple()
Definition: TensorIndexList.h:146
constexpr EIGEN_DEVICE_FUNC IndexTuple(const T &v)
Definition: TensorIndexList.h:147
T head
Definition: TensorIndexList.h:150
Definition: TensorIndexList.h:130
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorIndexList.h:410
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorIndexList.h:417
static constexpr bool run()
Definition: TensorIndexList.h:405
Definition: Meta.h:305
static constexpr Index value
Definition: Meta.h:306
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i)
Definition: TensorIndexList.h:391
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i)
Definition: TensorIndexList.h:398
Definition: TensorIndexList.h:385
static constexpr EIGEN_DEVICE_FUNC bool run(const Index)
Definition: TensorIndexList.h:386
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:532
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:540
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:527
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:553
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:561
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:548
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:448
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:456
Definition: TensorIndexList.h:442
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:443
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:490
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:498
Definition: TensorIndexList.h:484
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:485
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:511
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:519
Definition: TensorIndexList.h:505
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:506
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:469
static constexpr EIGEN_DEVICE_FUNC bool run(const Index i, const Index value)
Definition: TensorIndexList.h:477
Definition: TensorIndexList.h:463
static constexpr EIGEN_DEVICE_FUNC bool run(Index, Index)
Definition: TensorIndexList.h:464
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorIndexList.h:429
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorIndexList.h:436
static constexpr EIGEN_DEVICE_FUNC bool run()
Definition: TensorIndexList.h:424
Definition: TensorIndexList.h:91
static constexpr bool value
Definition: TensorIndexList.h:92
static constexpr EIGEN_DEVICE_FUNC bool values_up_to_statically_known_to_increase(const IndexTuple< T... > &)
Definition: TensorIndexList.h:264
static constexpr EIGEN_DEVICE_FUNC bool values_up_to_known_statically(const IndexTuple< T... > &)
Definition: TensorIndexList.h:259
static constexpr EIGEN_DEVICE_FUNC ValueT get(const Index, const IndexTuple< T... > &t)
Definition: TensorIndexList.h:244
static constexpr EIGEN_DEVICE_FUNC bool value_known_statically(const Index i, const IndexTuple< T... > &)
Definition: TensorIndexList.h:254
static EIGEN_DEVICE_FUNC void set(const Index i, IndexTuple< T... > &t, const ValueT value)
Definition: TensorIndexList.h:249
Definition: TensorIndexList.h:205
static EIGEN_DEVICE_FUNC void set(const Index i, IndexTuple< T... > &t, const ValueT &value)
Definition: TensorIndexList.h:212
static constexpr EIGEN_DEVICE_FUNC bool values_up_to_statically_known_to_increase(const IndexTuple< T... > &t)
Definition: TensorIndexList.h:233
static constexpr EIGEN_DEVICE_FUNC bool values_up_to_known_statically(const IndexTuple< T... > &t)
Definition: TensorIndexList.h:227
static constexpr EIGEN_DEVICE_FUNC bool value_known_statically(const Index i, const IndexTuple< T... > &t)
Definition: TensorIndexList.h:221
static constexpr EIGEN_DEVICE_FUNC ValueT get(const Index i, const IndexTuple< T... > &t)
Definition: TensorIndexList.h:207
Definition: TensorIndexList.h:39
static constexpr Index value
Definition: TensorIndexList.h:40
EIGEN_DEVICE_FUNC void set(Index val)
Definition: TensorIndexList.h:42
Definition: TensorIndexList.h:48
static constexpr Index first
Definition: TensorIndexList.h:49
EIGEN_DEVICE_FUNC void set(const IndexPair< Index > &val)
Definition: TensorIndexList.h:54
static constexpr Index second
Definition: TensorIndexList.h:50