CXX11Meta.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) 2013 Christian Seiler <christian@iwakd.de>
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_CXX11META_H
11 #define EIGEN_CXX11META_H
12 
13 #include <vector>
14 #include "EmulateArray.h"
15 
16 #include "CXX11Workarounds.h"
17 
18 namespace Eigen {
19 
20 namespace internal {
21 
28 template<typename... tt>
29 struct type_list { constexpr static int count = sizeof...(tt); };
30 
31 template<typename t, typename... tt>
32 struct type_list<t, tt...> { constexpr static int count = sizeof...(tt) + 1; typedef t first_type; };
33 
34 template<typename T, T... nn>
35 struct numeric_list { constexpr static std::size_t count = sizeof...(nn); };
36 
37 template<typename T, T n, T... nn>
38 struct numeric_list<T, n, nn...> { static const std::size_t count = sizeof...(nn) + 1; const static T first_value = n; };
39 
40 #ifndef EIGEN_PARSED_BY_DOXYGEN
41 /* numeric list constructors
42  *
43  * equivalencies:
44  * constructor result
45  * typename gen_numeric_list<int, 5>::type numeric_list<int, 0,1,2,3,4>
46  * typename gen_numeric_list_reversed<int, 5>::type numeric_list<int, 4,3,2,1,0>
47  * typename gen_numeric_list_swapped_pair<int, 5,1,2>::type numeric_list<int, 0,2,1,3,4>
48  * typename gen_numeric_list_repeated<int, 0, 5>::type numeric_list<int, 0,0,0,0,0>
49  */
50 
51 template<typename T, std::size_t n, T start = 0, T... ii> struct gen_numeric_list : gen_numeric_list<T, n-1, start, start + n-1, ii...> {};
52 template<typename T, T start, T... ii> struct gen_numeric_list<T, 0, start, ii...> { typedef numeric_list<T, ii...> type; };
53 
54 template<typename T, std::size_t n, T start = 0, T... ii> struct gen_numeric_list_reversed : gen_numeric_list_reversed<T, n-1, start, ii..., start + n-1> {};
55 template<typename T, T start, T... ii> struct gen_numeric_list_reversed<T, 0, start, ii...> { typedef numeric_list<T, ii...> type; };
56 
57 template<typename T, std::size_t n, T a, T b, T start = 0, T... ii> struct gen_numeric_list_swapped_pair : gen_numeric_list_swapped_pair<T, n-1, a, b, start, (start + n-1) == a ? b : ((start + n-1) == b ? a : (start + n-1)), ii...> {};
58 template<typename T, T a, T b, T start, T... ii> struct gen_numeric_list_swapped_pair<T, 0, a, b, start, ii...> { typedef numeric_list<T, ii...> type; };
59 
60 template<typename T, std::size_t n, T V, T... nn> struct gen_numeric_list_repeated : gen_numeric_list_repeated<T, n-1, V, V, nn...> {};
61 template<typename T, T V, T... nn> struct gen_numeric_list_repeated<T, 0, V, nn...> { typedef numeric_list<T, nn...> type; };
62 
63 /* list manipulation: concatenate */
64 
65 template<class a, class b> struct concat;
66 
67 template<typename... as, typename... bs> struct concat<type_list<as...>, type_list<bs...>> { typedef type_list<as..., bs...> type; };
68 template<typename T, T... as, T... bs> struct concat<numeric_list<T, as...>, numeric_list<T, bs...> > { typedef numeric_list<T, as..., bs...> type; };
69 
70 template<typename... p> struct mconcat;
71 template<typename a> struct mconcat<a> { typedef a type; };
72 template<typename a, typename b> struct mconcat<a, b> : concat<a, b> {};
73 template<typename a, typename b, typename... cs> struct mconcat<a, b, cs...> : concat<a, typename mconcat<b, cs...>::type> {};
74 
75 /* list manipulation: extract slices */
76 
77 template<int n, typename x> struct take;
78 template<int n, typename a, typename... as> struct take<n, type_list<a, as...>> : concat<type_list<a>, typename take<n-1, type_list<as...>>::type> {};
79 template<int n> struct take<n, type_list<>> { typedef type_list<> type; };
80 template<typename a, typename... as> struct take<0, type_list<a, as...>> { typedef type_list<> type; };
81 template<> struct take<0, type_list<>> { typedef type_list<> type; };
82 
83 template<typename T, int n, T a, T... as> struct take<n, numeric_list<T, a, as...>> : concat<numeric_list<T, a>, typename take<n-1, numeric_list<T, as...>>::type> {};
84 template<typename T, int n> struct take<n, numeric_list<T>> { typedef numeric_list<T> type; };
85 template<typename T, T a, T... as> struct take<0, numeric_list<T, a, as...>> { typedef numeric_list<T> type; };
86 template<typename T> struct take<0, numeric_list<T>> { typedef numeric_list<T> type; };
87 
88 template<typename T, int n, T... ii> struct h_skip_helper_numeric;
89 template<typename T, int n, T i, T... ii> struct h_skip_helper_numeric<T, n, i, ii...> : h_skip_helper_numeric<T, n-1, ii...> {};
90 template<typename T, T i, T... ii> struct h_skip_helper_numeric<T, 0, i, ii...> { typedef numeric_list<T, i, ii...> type; };
91 template<typename T, int n> struct h_skip_helper_numeric<T, n> { typedef numeric_list<T> type; };
92 template<typename T> struct h_skip_helper_numeric<T, 0> { typedef numeric_list<T> type; };
93 
94 template<int n, typename... tt> struct h_skip_helper_type;
95 template<int n, typename t, typename... tt> struct h_skip_helper_type<n, t, tt...> : h_skip_helper_type<n-1, tt...> {};
96 template<typename t, typename... tt> struct h_skip_helper_type<0, t, tt...> { typedef type_list<t, tt...> type; };
97 template<int n> struct h_skip_helper_type<n> { typedef type_list<> type; };
98 template<> struct h_skip_helper_type<0> { typedef type_list<> type; };
99 #endif //not EIGEN_PARSED_BY_DOXYGEN
100 
101 template<int n>
102 struct h_skip {
103  template<typename T, T... ii>
105  template<typename... tt>
107 };
108 
109 template<int n, typename a> struct skip { typedef decltype(h_skip<n>::helper(a())) type; };
110 
111 template<int start, int count, typename a> struct slice : take<count, typename skip<start, a>::type> {};
112 
113 /* list manipulation: retrieve single element from list */
114 
115 template<int n, typename x> struct get;
116 
117 template<int n, typename a, typename... as> struct get<n, type_list<a, as...>> : get<n-1, type_list<as...>> {};
118 template<typename a, typename... as> struct get<0, type_list<a, as...>> { typedef a type; };
119 
120 template<typename T, int n, T a, T... as> struct get<n, numeric_list<T, a, as...>> : get<n-1, numeric_list<T, as...>> {};
121 template<typename T, T a, T... as> struct get<0, numeric_list<T, a, as...>> { constexpr static T value = a; };
122 
123 template<std::size_t n, typename T, T a, T... as> constexpr T array_get(const numeric_list<T, a, as...>&) {
125 }
126 
127 /* always get type, regardless of dummy; good for parameter pack expansion */
128 
129 template<typename T, T dummy, typename t> struct id_numeric { typedef t type; };
130 template<typename dummy, typename t> struct id_type { typedef t type; };
131 
132 /* equality checking, flagged version */
133 
134 template<typename a, typename b> struct is_same_gf : is_same<a, b> { constexpr static int global_flags = 0; };
135 
136 /* apply_op to list */
137 
138 template<
139  bool from_left, // false
140  template<typename, typename> class op,
141  typename additional_param,
142  typename... values
143 >
145 template<
146  template<typename, typename> class op,
147  typename additional_param,
148  typename... values
149 >
150 struct h_apply_op_helper<true, op, additional_param, values...> { typedef type_list<typename op<additional_param, values>::type...> type; };
151 
152 template<
153  bool from_left,
154  template<typename, typename> class op,
155  typename additional_param
156 >
158 {
159  template<typename... values>
160  constexpr static typename h_apply_op_helper<from_left, op, additional_param, values...>::type helper(type_list<values...>)
162 };
163 
164 template<
165  template<typename, typename> class op,
166  typename additional_param,
167  typename a
168 >
170 
171 template<
172  template<typename, typename> class op,
173  typename additional_param,
174  typename a
175 >
177 
178 /* see if an element is in a list */
179 
180 template<
181  template<typename, typename> class test,
182  typename check_against,
183  typename h_list,
184  bool last_check_positive = false
185 >
187 
188 template<
189  template<typename, typename> class test,
190  typename check_against,
191  typename h_list
192 >
193 struct contained_in_list<test, check_against, h_list, true>
194 {
195  constexpr static bool value = true;
196 };
197 
198 template<
199  template<typename, typename> class test,
200  typename check_against,
201  typename a,
202  typename... as
203 >
204 struct contained_in_list<test, check_against, type_list<a, as...>, false> : contained_in_list<test, check_against, type_list<as...>, test<check_against, a>::value> {};
205 
206 template<
207  template<typename, typename> class test,
208  typename check_against
210 >
211 struct contained_in_list<test, check_against, type_list<EIGEN_TPL_PP_SPEC_HACK_USE(empty)>, false> { constexpr static bool value = false; };
212 
213 /* see if an element is in a list and check for global flags */
214 
215 template<
216  template<typename, typename> class test,
217  typename check_against,
218  typename h_list,
219  int default_flags = 0,
220  bool last_check_positive = false,
221  int last_check_flags = default_flags
222 >
224 
225 template<
226  template<typename, typename> class test,
227  typename check_against,
228  typename h_list,
229  int default_flags,
230  int last_check_flags
231 >
232 struct contained_in_list_gf<test, check_against, h_list, default_flags, true, last_check_flags>
233 {
234  constexpr static bool value = true;
235  constexpr static int global_flags = last_check_flags;
236 };
237 
238 template<
239  template<typename, typename> class test,
240  typename check_against,
241  typename a,
242  typename... as,
243  int default_flags,
244  int last_check_flags
245 >
246 struct contained_in_list_gf<test, check_against, type_list<a, as...>, default_flags, false, last_check_flags> : contained_in_list_gf<test, check_against, type_list<as...>, default_flags, test<check_against, a>::value, test<check_against, a>::global_flags> {};
247 
248 template<
249  template<typename, typename> class test,
250  typename check_against
252  int default_flags,
253  int last_check_flags
254 >
255 struct contained_in_list_gf<test, check_against, type_list<EIGEN_TPL_PP_SPEC_HACK_USE(empty)>, default_flags, false, last_check_flags> { constexpr static bool value = false; constexpr static int global_flags = default_flags; };
256 
257 /* generic reductions */
258 
259 template<
260  typename Reducer,
261  typename... Ts
262 > struct reduce;
263 
264 template<
265  typename Reducer
266 > struct reduce<Reducer>
267 {
268  EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE int run() { return Reducer::Identity; }
269 };
270 
271 template<
272  typename Reducer,
273  typename A
274 > struct reduce<Reducer, A>
275 {
276  EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE A run(A a) { return a; }
277 };
278 
279 template<
280  typename Reducer,
281  typename A,
282  typename... Ts
283 > struct reduce<Reducer, A, Ts...>
284 {
285  EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce<Reducer, Ts...>::run(ts...))) {
287  }
288 };
289 
290 /* generic binary operations */
291 
292 struct sum_op {
293  template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a + b) { return a + b; }
294  static constexpr int Identity = 0;
295 };
296 struct product_op {
297  template<typename A, typename B> EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a * b) { return a * b; }
298  static constexpr int Identity = 1;
299 };
300 
301 struct logical_and_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a && b) { return a && b; } };
302 struct logical_or_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a || b) { return a || b; } };
303 
304 struct equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a == b) { return a == b; } };
305 struct not_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a != b) { return a != b; } };
306 struct lesser_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a < b) { return a < b; } };
307 struct lesser_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a <= b) { return a <= b; } };
308 struct greater_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a > b) { return a > b; } };
309 struct greater_equal_op { template<typename A, typename B> constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a >= b) { return a >= b; } };
310 
311 /* generic unary operations */
312 
313 struct not_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(!a) { return !a; } };
314 struct negation_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(-a) { return -a; } };
315 struct greater_equal_zero_op { template<typename A> constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(a >= 0) { return a >= 0; } };
316 
317 
318 /* reductions for lists */
319 
320 // using auto -> return value spec makes ICC 13.0 and 13.1 crash here, so we have to hack it
321 // together in front... (13.0 doesn't work with array_prod/array_reduce/... anyway, but 13.1
322 // does...
323 template<typename... Ts>
325 {
326  return reduce<product_op, Ts...>::run(ts...);
327 }
328 
329 template<typename... Ts>
330 constexpr EIGEN_STRONG_INLINE decltype(reduce<sum_op, Ts...>::run((*((Ts*)0))...)) arg_sum(Ts... ts)
331 {
332  return reduce<sum_op, Ts...>::run(ts...);
333 }
334 
335 /* reverse arrays */
336 
337 template<typename Array, int... n>
339 {
340  return {{array_get<sizeof...(n) - n - 1>(arr)...}};
341 }
342 
343 template<typename T, std::size_t N>
345 {
347 }
348 
349 
350 /* generic array reductions */
351 
352 // can't reuse standard reduce() interface above because Intel's Compiler
353 // *really* doesn't like it, so we just reimplement the stuff
354 // (start from N - 1 and work down to 0 because specialization for
355 // n == N - 1 also doesn't work in Intel's compiler, so it goes into
356 // an infinite loop)
357 template<typename Reducer, typename T, std::size_t N, std::size_t n = N - 1>
359  EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE auto run(array<T, N> arr, T identity) -> decltype(Reducer::run(h_array_reduce<Reducer, T, N, n - 1>::run(arr, identity), array_get<n>(arr)))
360  {
361  return Reducer::run(h_array_reduce<Reducer, T, N, n - 1>::run(arr, identity), array_get<n>(arr));
362  }
363 };
364 
365 template<typename Reducer, typename T, std::size_t N>
366 struct h_array_reduce<Reducer, T, N, 0>
367 {
369  {
370  return array_get<0>(arr);
371  }
372 };
373 
374 template<typename Reducer, typename T>
375 struct h_array_reduce<Reducer, T, 0>
376 {
377  EIGEN_DEVICE_FUNC constexpr static EIGEN_STRONG_INLINE T run(const array<T, 0>&, T identity)
378  {
379  return identity;
380  }
381 };
382 
383 template<typename Reducer, typename T, std::size_t N>
385 {
386  return h_array_reduce<Reducer, T, N>::run(arr, identity);
387 }
388 
389 /* standard array reductions */
390 
391 template<typename T, std::size_t N>
392 EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_sum(const array<T, N>& arr) -> decltype(array_reduce<sum_op, T, N>(arr, static_cast<T>(0)))
393 {
394  return array_reduce<sum_op, T, N>(arr, static_cast<T>(0));
395 }
396 
397 template<typename T, std::size_t N>
398 EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_prod(const array<T, N>& arr) -> decltype(array_reduce<product_op, T, N>(arr, static_cast<T>(1)))
399 {
400  return array_reduce<product_op, T, N>(arr, static_cast<T>(1));
401 }
402 
403 template<typename t>
405  eigen_assert(a.size() > 0);
406  t prod = 1;
407  for (size_t i = 0; i < a.size(); ++i) { prod *= a[i]; }
408  return prod;
409 }
410 
411 /* zip an array */
412 
413 template<typename Op, typename A, typename B, std::size_t N, int... n>
415 {
416  return array<decltype(Op::run(A(), B())),N>{{ Op::run(array_get<n>(a), array_get<n>(b))... }};
417 }
418 
419 template<typename Op, typename A, typename B, std::size_t N>
421 {
422  return h_array_zip<Op>(a, b, typename gen_numeric_list<int, N>::type());
423 }
424 
425 /* zip an array and reduce the result */
426 
427 template<typename Reducer, typename Op, typename A, typename B, std::size_t N, int... n>
428 constexpr EIGEN_STRONG_INLINE auto h_array_zip_and_reduce(array<A, N> a, array<B, N> b, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A(), B()))>::type...>::run(Op::run(array_get<n>(a), array_get<n>(b))...))
429 {
430  return reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A(), B()))>::type...>::run(Op::run(array_get<n>(a), array_get<n>(b))...);
431 }
432 
433 template<typename Reducer, typename Op, typename A, typename B, std::size_t N>
434 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()))
435 {
436  return h_array_zip_and_reduce<Reducer, Op, A, B, N>(a, b, typename gen_numeric_list<int, N>::type());
437 }
438 
439 /* apply stuff to an array */
440 
441 template<typename Op, typename A, std::size_t N, int... n>
443 {
444  return array<decltype(Op::run(A())),N>{{ Op::run(array_get<n>(a))... }};
445 }
446 
447 template<typename Op, typename A, std::size_t N>
449 {
450  return h_array_apply<Op>(a, typename gen_numeric_list<int, N>::type());
451 }
452 
453 /* apply stuff to an array and reduce */
454 
455 template<typename Reducer, typename Op, typename A, std::size_t N, int... n>
456 constexpr EIGEN_STRONG_INLINE auto h_array_apply_and_reduce(array<A, N> arr, numeric_list<int, n...>) -> decltype(reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A()))>::type...>::run(Op::run(array_get<n>(arr))...))
457 {
458  return reduce<Reducer, typename id_numeric<int,n,decltype(Op::run(A()))>::type...>::run(Op::run(array_get<n>(arr))...);
459 }
460 
461 template<typename Reducer, typename Op, typename A, std::size_t N>
462 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()))
463 {
464  return h_array_apply_and_reduce<Reducer, Op, A, N>(a, typename gen_numeric_list<int, N>::type());
465 }
466 
467 /* repeat a value n times (and make an array out of it
468  * usage:
469  * array<int, 16> = repeat<16>(42);
470  */
471 
472 template<int n>
473 struct h_repeat
474 {
475  template<typename t, int... ii>
477  {
478  return {{ typename id_numeric<int, ii, t>::type(v)... }};
479  }
480 };
481 
482 template<int n, typename t>
484 
485 /* instantiate a class by a C-style array */
486 template<class InstType, typename ArrType, std::size_t N, bool Reverse, typename... Ps>
488 
489 template<class InstType, typename ArrType, std::size_t N, typename... Ps>
490 struct h_instantiate_by_c_array<InstType, ArrType, N, false, Ps...>
491 {
492  static InstType run(ArrType* arr, Ps... args)
493  {
495  }
496 };
497 
498 template<class InstType, typename ArrType, std::size_t N, typename... Ps>
499 struct h_instantiate_by_c_array<InstType, ArrType, N, true, Ps...>
500 {
501  static InstType run(ArrType* arr, Ps... args)
502  {
504  }
505 };
506 
507 template<class InstType, typename ArrType, typename... Ps>
508 struct h_instantiate_by_c_array<InstType, ArrType, 0, false, Ps...>
509 {
510  static InstType run(ArrType* arr, Ps... args)
511  {
512  (void)arr;
513  return InstType(args...);
514  }
515 };
516 
517 template<class InstType, typename ArrType, typename... Ps>
518 struct h_instantiate_by_c_array<InstType, ArrType, 0, true, Ps...>
519 {
520  static InstType run(ArrType* arr, Ps... args)
521  {
522  (void)arr;
523  return InstType(args...);
524  }
525 };
526 
527 template<class InstType, typename ArrType, std::size_t N, bool Reverse = false>
528 InstType instantiate_by_c_array(ArrType* arr)
529 {
531 }
532 
533 } // end namespace internal
534 
535 } // end namespace Eigen
536 
537 #endif // EIGEN_CXX11META_H
Eigen::internal::array_reverse
constexpr EIGEN_STRONG_INLINE array< T, N > array_reverse(array< T, N > arr)
Definition: CXX11Meta.h:344
Eigen::internal::h_array_reduce< Reducer, T, 0 >::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T run(const array< T, 0 > &, T identity)
Definition: CXX11Meta.h:377
Eigen::internal::concat
Definition: CXX11Meta.h:65
gtsam.examples.DogLegOptimizerExample.int
int
Definition: DogLegOptimizerExample.py:111
Eigen::internal::h_instantiate_by_c_array
Definition: CXX11Meta.h:487
Eigen::internal::arg_prod
constexpr EIGEN_DEVICE_FUNCdecltype(reduce< product_op, Ts... >::run((*((Ts *) 0))...)) EIGEN_STRONG_INLIN arg_prod)(Ts... ts)
Definition: CXX11Meta.h:324
Eigen::internal::h_skip_helper_numeric
Definition: CXX11Meta.h:88
Eigen::internal::array_sum
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto array_sum(const array< T, N > &arr) -> decltype(array_reduce< sum_op, T, N >(arr, static_cast< T >(0)))
Definition: CXX11Meta.h:392
Eigen::internal::h_instantiate_by_c_array< InstType, ArrType, 0, true, Ps... >::run
static InstType run(ArrType *arr, Ps... args)
Definition: CXX11Meta.h:520
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::internal::h_array_reduce< Reducer, T, N, 0 >::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE T run(const array< T, N > &arr, T)
Definition: CXX11Meta.h:368
Eigen::internal::contained_in_list
Definition: CXX11Meta.h:186
Eigen::internal::take< 0, numeric_list< T, a, as... > >::type
numeric_list< T > type
Definition: CXX11Meta.h:85
gtsam.examples.DogLegOptimizerExample.type
type
Definition: DogLegOptimizerExample.py:111
Eigen::internal::instantiate_by_c_array
InstType instantiate_by_c_array(ArrType *arr)
Definition: CXX11Meta.h:528
Eigen::internal::id_numeric
Definition: CXX11Meta.h:129
Eigen::internal::slice
Definition: CXX11Meta.h:111
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::internal::arg_sum
constexpr decltype(reduce< sum_op, Ts... >::run((*((Ts *) 0))...)) EIGEN_STRONG_INLIN arg_sum)(Ts... ts)
Definition: CXX11Meta.h:330
Eigen::array
Definition: EmulateArray.h:21
Eigen::internal::h_skip
Definition: CXX11Meta.h:102
Eigen::internal::h_array_reverse
constexpr EIGEN_STRONG_INLINE Array h_array_reverse(Array arr, numeric_list< int, n... >)
Definition: CXX11Meta.h:338
b
Scalar * b
Definition: benchVecAdd.cpp:17
eigen_assert
#define eigen_assert(x)
Definition: Macros.h:1037
Eigen::internal::take< 0, numeric_list< T > >::type
numeric_list< T > type
Definition: CXX11Meta.h:86
Eigen::internal::id_type::type
t type
Definition: CXX11Meta.h:130
Eigen::internal::concat< numeric_list< T, as... >, numeric_list< T, bs... > >::type
numeric_list< T, as..., bs... > type
Definition: CXX11Meta.h:68
EIGEN_TPL_PP_SPEC_HACK_DEFC
#define EIGEN_TPL_PP_SPEC_HACK_DEFC(mt, n)
Definition: CXX11Workarounds.h:75
Eigen::internal::equal_op
Definition: CXX11Meta.h:304
B
Definition: test_numpy_dtypes.cpp:299
Eigen::internal::take< 0, type_list<> >::type
type_list type
Definition: CXX11Meta.h:81
Eigen::internal::h_apply_op_helper
Definition: CXX11Meta.h:144
Eigen::Array
General-purpose arrays with easy API for coefficient-wise operations.
Definition: Array.h:45
type
Definition: pytypes.h:1525
Eigen::internal::reduce< Reducer >::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE int run()
Definition: CXX11Meta.h:268
Eigen::internal::lesser_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a< b)
Definition: CXX11Meta.h:306
T
Eigen::Triplet< double > T
Definition: Tutorial_sparse_example.cpp:6
Eigen::internal::type_list::count
constexpr static int count
Definition: CXX11Meta.h:29
different_sigmas::values
HybridValues values
Definition: testHybridBayesNet.cpp:245
Eigen::internal::array_reduce
constexpr EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto array_reduce(const array< T, N > &arr, T identity) -> decltype(h_array_reduce< Reducer, T, N >::run(arr, identity))
Definition: CXX11Meta.h:384
Eigen::internal::greater_equal_zero_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(a >=0)
Definition: CXX11Meta.h:315
Eigen::internal::h_skip_helper_type< 0, t, tt... >::type
type_list< t, tt... > type
Definition: CXX11Meta.h:96
Eigen::internal::mconcat
Definition: CXX11Meta.h:70
Eigen::internal::h_skip_helper_type< n >::type
type_list type
Definition: CXX11Meta.h:97
Eigen::internal::take< n, numeric_list< T > >::type
numeric_list< T > type
Definition: CXX11Meta.h:84
Eigen::internal::logical_or_op
Definition: CXX11Meta.h:302
Eigen::internal::gen_numeric_list_swapped_pair
Definition: CXX11Meta.h:57
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
EmulateArray.h
Eigen::internal::h_instantiate_by_c_array< InstType, ArrType, N, false, Ps... >::run
static InstType run(ArrType *arr, Ps... args)
Definition: CXX11Meta.h:492
Eigen::internal::h_skip_helper_numeric< T, 0, i, ii... >::type
numeric_list< T, i, ii... > type
Definition: CXX11Meta.h:90
Eigen::internal::array_get
const Index array_get(DimensionList< Index, Rank > &)
Definition: TensorDimensionList.h:39
Eigen::internal::not_equal_op
Definition: CXX11Meta.h:305
Eigen::internal::not_op
Definition: CXX11Meta.h:313
test
Definition: test.py:1
n
int n
Definition: BiCGSTAB_simple.cpp:1
Eigen::internal::type_list< t, tt... >::first_type
t first_type
Definition: CXX11Meta.h:32
Eigen::internal::greater_equal_op
Definition: CXX11Meta.h:309
Eigen::internal::reduce< Reducer, A >::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE A run(A a)
Definition: CXX11Meta.h:276
Eigen::internal::h_skip_helper_numeric< T, 0 >::type
numeric_list< T > type
Definition: CXX11Meta.h:92
Eigen::internal::negation_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(-a)
Definition: CXX11Meta.h:314
Eigen::internal::gen_numeric_list_repeated< T, 0, V, nn... >::type
numeric_list< T, nn... > type
Definition: CXX11Meta.h:61
Eigen::internal::h_array_zip
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A(), B())), N > h_array_zip(array< A, N > a, array< B, N > b, numeric_list< int, n... >)
Definition: CXX11Meta.h:414
Eigen::internal::h_array_zip_and_reduce
constexpr EIGEN_STRONG_INLINE auto h_array_zip_and_reduce(array< A, N > a, array< B, N > b, numeric_list< int, n... >) -> decltype(reduce< Reducer, typename id_numeric< int, n, decltype(Op::run(A(), B()))>::type... >::run(Op::run(array_get< n >(a), array_get< n >(b))...))
Definition: CXX11Meta.h:428
Eigen::internal::lesser_equal_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a<=b)
Definition: CXX11Meta.h:307
A
Definition: test_numpy_dtypes.cpp:298
Eigen::internal::gen_numeric_list_reversed< T, 0, start, ii... >::type
numeric_list< T, ii... > type
Definition: CXX11Meta.h:55
Eigen::internal::apply_op_from_right
Definition: CXX11Meta.h:176
Eigen::internal::sum_op::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a+b)
Definition: CXX11Meta.h:293
Eigen::internal::get
Definition: CXX11Meta.h:115
Eigen::internal::reduce
Definition: CXX11Meta.h:262
test
void test(OptionalJacobian< 2, 3 > H={})
Definition: testOptionalJacobian.cpp:63
Eigen::internal::h_array_apply
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A())), N > h_array_apply(array< A, N > a, numeric_list< int, n... >)
Definition: CXX11Meta.h:442
Eigen::internal::gen_numeric_list_repeated
Definition: CXX11Meta.h:60
EIGEN_STRONG_INLINE
#define EIGEN_STRONG_INLINE
Definition: Macros.h:917
Eigen::Reverse
Expression of the reverse of a vector or matrix.
Definition: Reverse.h:63
Eigen::internal::h_skip_helper_type
Definition: CXX11Meta.h:94
Eigen::internal::repeat
constexpr array< t, n > repeat(t v)
Definition: CXX11Meta.h:483
Eigen::internal::lesser_op
Definition: CXX11Meta.h:306
Eigen::internal::id_numeric::type
t type
Definition: CXX11Meta.h:129
Eigen::internal::take
Definition: CXX11Meta.h:77
Eigen::internal::gen_numeric_list
Definition: CXX11Meta.h:51
gtsam.examples.DogLegOptimizerExample.run
def run(args)
Definition: DogLegOptimizerExample.py:21
Eigen::Triplet
A small structure to hold a non zero as a triplet (i,j,value).
Definition: SparseUtil.h:162
Eigen::internal::h_instantiate_by_c_array< InstType, ArrType, 0, false, Ps... >::run
static InstType run(ArrType *arr, Ps... args)
Definition: CXX11Meta.h:510
Eigen::internal::array_apply
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A())), N > array_apply(array< A, N > a)
Definition: CXX11Meta.h:448
Eigen::internal::concat< type_list< as... >, type_list< bs... > >::type
type_list< as..., bs... > type
Definition: CXX11Meta.h:67
Eigen::internal::gen_numeric_list_reversed
Definition: CXX11Meta.h:54
Eigen::internal::greater_equal_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a >=b)
Definition: CXX11Meta.h:309
Eigen::internal::array_zip
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A(), B())), N > array_zip(array< A, N > a, array< B, N > b)
Definition: CXX11Meta.h:420
Eigen::internal::reduce< Reducer, A, Ts... >::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce< Reducer, Ts... >::run(ts...)))
Definition: CXX11Meta.h:285
size_t
std::size_t size_t
Definition: wrap/pybind11/include/pybind11/detail/common.h:490
Eigen::internal::type_list
Definition: CXX11Meta.h:29
Eigen::internal::logical_or_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a||b)
Definition: CXX11Meta.h:302
Eigen::internal::array_prod
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
Definition: TensorDimensions.h:140
Eigen::internal::h_skip_helper_type< 0 >::type
type_list type
Definition: CXX11Meta.h:98
Eigen::internal::h_apply_op::helper
constexpr static h_apply_op_helper< from_left, op, additional_param, values... >::type helper(type_list< values... >)
Definition: CXX11Meta.h:160
Eigen::internal::h_apply_op
Definition: CXX11Meta.h:157
Eigen::internal::h_instantiate_by_c_array< InstType, ArrType, N, true, Ps... >::run
static InstType run(ArrType *arr, Ps... args)
Definition: CXX11Meta.h:501
Eigen::internal::h_skip_helper_numeric< T, n >::type
numeric_list< T > type
Definition: CXX11Meta.h:91
Eigen::internal::numeric_list
Definition: CXX11Meta.h:35
Eigen::internal::take< n, type_list<> >::type
type_list type
Definition: CXX11Meta.h:79
Eigen::internal::sum_op
Definition: CXX11Meta.h:292
a
ArrayXXi a
Definition: Array_initializer_list_23_cxx11.cpp:1
Eigen::internal::h_apply_op_helper::type
type_list< typename op< values, additional_param >::type... > type
Definition: CXX11Meta.h:144
arr
py::array arr
Definition: test_numpy_array.cpp:77
Eigen::internal::gen_numeric_list_swapped_pair< T, 0, a, b, start, ii... >::type
numeric_list< T, ii... > type
Definition: CXX11Meta.h:58
empty
Definition: test_copy_move.cpp:19
Eigen::internal::h_skip::helper
constexpr static EIGEN_STRONG_INLINE h_skip_helper_numeric< T, n, ii... >::type helper(numeric_list< T, ii... >)
Definition: CXX11Meta.h:104
Eigen::internal::h_array_reduce::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto run(array< T, N > arr, T identity) -> decltype(Reducer::run(h_array_reduce< Reducer, T, N, n - 1 >::run(arr, identity), array_get< n >(arr)))
Definition: CXX11Meta.h:359
Eigen::internal::product_op::Identity
static constexpr int Identity
Definition: CXX11Meta.h:298
Eigen::internal::get< 0, type_list< a, as... > >::type
a type
Definition: CXX11Meta.h:118
Eigen::internal::product_op::run
constexpr static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a *b)
Definition: CXX11Meta.h:297
Eigen::internal::equal_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a==b)
Definition: CXX11Meta.h:304
Eigen::internal::sum_op::Identity
static constexpr int Identity
Definition: CXX11Meta.h:294
Eigen::internal::is_same_gf::global_flags
constexpr static int global_flags
Definition: CXX11Meta.h:134
Eigen::internal::apply_op_from_left::type
decltype(h_apply_op< true, op, additional_param >::helper(a())) typedef type
Definition: CXX11Meta.h:169
Eigen::internal::h_array_apply_and_reduce
constexpr EIGEN_STRONG_INLINE auto h_array_apply_and_reduce(array< A, N > arr, numeric_list< int, n... >) -> decltype(reduce< Reducer, typename id_numeric< int, n, decltype(Op::run(A()))>::type... >::run(Op::run(array_get< n >(arr))...))
Definition: CXX11Meta.h:456
args
Definition: pytypes.h:2210
Eigen::internal::contained_in_list_gf
Definition: CXX11Meta.h:223
Eigen::internal::skip
Definition: CXX11Meta.h:109
p
float * p
Definition: Tutorial_Map_using.cpp:9
Eigen::internal::h_skip::helper
constexpr static EIGEN_STRONG_INLINE h_skip_helper_type< n, tt... >::type helper(type_list< tt... >)
Definition: CXX11Meta.h:106
v
Array< int, Dynamic, 1 > v
Definition: Array_initializer_list_vector_cxx11.cpp:1
Eigen::internal::not_equal_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a !=b)
Definition: CXX11Meta.h:305
Eigen::internal::h_apply_op_helper< true, op, additional_param, values... >::type
type_list< typename op< additional_param, values >::type... > type
Definition: CXX11Meta.h:150
Eigen::internal::mconcat< a >::type
a type
Definition: CXX11Meta.h:71
V
MatrixXcd V
Definition: EigenSolver_EigenSolver_MatrixType.cpp:15
Eigen::internal::is_same
Definition: Meta.h:148
Eigen::internal::numeric_list::count
constexpr static std::size_t count
Definition: CXX11Meta.h:35
EIGEN_TPL_PP_SPEC_HACK_USE
#define EIGEN_TPL_PP_SPEC_HACK_USE(n)
Definition: CXX11Workarounds.h:76
Eigen::internal::logical_and_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a &&b)
Definition: CXX11Meta.h:301
N
#define N
Definition: igam.h:9
internal
Definition: BandTriangularSolver.h:13
Eigen::internal::gen_numeric_list< T, 0, start, ii... >::type
numeric_list< T, ii... > type
Definition: CXX11Meta.h:52
Eigen::internal::h_repeat::run
constexpr static EIGEN_STRONG_INLINE array< t, n > run(t v, numeric_list< int, ii... >)
Definition: CXX11Meta.h:476
Eigen::internal::id_type
Definition: CXX11Meta.h:130
Eigen::internal::take< 0, type_list< a, as... > >::type
type_list type
Definition: CXX11Meta.h:80
Eigen::internal::lesser_equal_op
Definition: CXX11Meta.h:307
Eigen::internal::skip::type
decltype(h_skip< n >::helper(a())) typedef type
Definition: CXX11Meta.h:109
align_3::t
Point2 t(10, 10)
Eigen::internal::greater_equal_zero_op
Definition: CXX11Meta.h:315
nn
idx_t * nn
Definition: include/metis.h:207
Eigen::internal::apply_op_from_left
Definition: CXX11Meta.h:169
Eigen::internal::apply_op_from_right::type
decltype(h_apply_op< false, op, additional_param >::helper(a())) typedef type
Definition: CXX11Meta.h:176
Eigen::internal::logical_and_op
Definition: CXX11Meta.h:301
Eigen::internal::h_array_reduce
Definition: CXX11Meta.h:358
Eigen::internal::negation_op
Definition: CXX11Meta.h:314
Eigen::array< T, 0 >
Definition: EmulateArray.h:136
Eigen::internal::not_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a) -> decltype(!a)
Definition: CXX11Meta.h:313
Eigen::internal::h_repeat
Definition: CXX11Meta.h:473
Eigen::prod
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Definition: evaluators.cpp:8
test_callbacks.value
value
Definition: test_callbacks.py:160
i
int i
Definition: BiCGSTAB_step_by_step.cpp:9
CXX11Workarounds.h
Eigen::internal::greater_op
Definition: CXX11Meta.h:308
Eigen::internal::product_op
Definition: CXX11Meta.h:296
Eigen::internal::greater_op::run
constexpr static EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a > b)
Definition: CXX11Meta.h:308
Eigen::internal::is_same_gf
Definition: CXX11Meta.h:134


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:25