10 #ifndef EIGEN_CXX11META_H 11 #define EIGEN_CXX11META_H 28 template<
typename... tt>
31 template<
typename t,
typename... tt>
34 template<
typename T,
T...
nn>
37 template<
typename T,
T n,
T...
nn>
40 #ifndef EIGEN_PARSED_BY_DOXYGEN 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; };
65 template<
class a,
class b>
struct concat;
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> {};
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> {};
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> {};
99 #endif //not EIGEN_PARSED_BY_DOXYGEN 103 template<
typename T,
T... ii>
105 template<
typename... tt>
111 template<
int start,
int count,
typename a>
struct slice :
take<count, typename skip<start, a>::type> {};
115 template<
int n,
typename x>
struct get;
117 template<
int n,
typename a,
typename... as>
struct get<n,
type_list<a, as...>> :
get<n-1, type_list<as...>> {};
130 template<
typename dummy,
typename t>
struct id_type {
typedef t
type; };
134 template<
typename a,
typename b>
struct is_same_gf :
is_same<a, b> { constexpr
static int global_flags = 0; };
140 template<
typename,
typename>
class op,
141 typename additional_param,
146 template<
typename,
typename>
class op,
147 typename additional_param,
154 template<
typename,
typename>
class op,
155 typename additional_param
159 template<
typename...
values>
165 template<
typename,
typename>
class op,
166 typename additional_param,
172 template<
typename,
typename>
class op,
173 typename additional_param,
181 template<
typename,
typename>
class test,
182 typename check_against,
184 bool last_check_positive =
false 189 template<
typename,
typename>
class test,
190 typename check_against,
199 template<
typename,
typename>
class test,
200 typename check_against,
207 template<
typename,
typename>
class test,
208 typename check_against
216 template<
typename,
typename>
class test,
217 typename check_against,
219 int default_flags = 0,
220 bool last_check_positive =
false,
221 int last_check_flags = default_flags
226 template<
typename,
typename>
class test,
227 typename check_against,
235 constexpr
static int global_flags = last_check_flags;
239 template<
typename,
typename>
class test,
240 typename check_against,
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> {};
249 template<
typename,
typename>
class test,
250 typename check_against
294 static constexpr
int Identity = 0;
298 static constexpr
int Identity = 1;
323 template<
typename... Ts>
329 template<
typename... Ts>
337 template<
typename Array,
int... n>
340 return {{
array_get<
sizeof...(n) - n - 1>(arr)...}};
343 template<
typename T, std::
size_t N>
365 template<
typename Reducer,
typename T, std::
size_t N>
370 return array_get<0>(
arr);
374 template<
typename Reducer,
typename T>
383 template<
typename Reducer,
typename T, std::
size_t N>
391 template<
typename T, std::
size_t N>
394 return array_reduce<sum_op, T, N>(
arr,
static_cast<T
>(0));
397 template<
typename T, std::
size_t N>
400 return array_reduce<product_op, T, N>(
arr,
static_cast<T
>(1));
407 for (
size_t i = 0; i < a.size(); ++
i) { prod *= a[
i]; }
413 template<
typename Op,
typename A,
typename B,
std::size_t N,
int... n>
419 template<
typename Op,
typename A,
typename B, std::
size_t N>
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))...))
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()))
441 template<
typename Op,
typename A,
std::size_t N,
int... n>
447 template<
typename Op,
typename A, std::
size_t N>
455 template<
typename Reducer,
typename Op,
typename A,
std::size_t N,
int... n>
461 template<
typename Reducer,
typename Op,
typename A, std::
size_t N>
475 template<
typename t,
int... ii>
482 template<
int n,
typename t>
489 template<
class InstType,
typename ArrType,
std::size_t N,
typename... Ps>
498 template<
class InstType,
typename ArrType,
std::size_t N,
typename... Ps>
507 template<
class InstType,
typename ArrType,
typename... Ps>
513 return InstType(
args...);
517 template<
class InstType,
typename ArrType,
typename... Ps>
523 return InstType(
args...);
527 template<
class InstType,
typename ArrType, std::
size_t N,
bool Reverse = false>
537 #endif // EIGEN_CXX11META_H numeric_list< T, ii... > type
constexpr EIGEN_STRONG_INLINE array< T, N > array_reverse(array< T, N > arr)
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a *b)
decltype(h_apply_op< false, op, additional_param >::helper(a())) typedef type
numeric_list< T, ii... > type
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A())), N > array_apply(array< A, N > a)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE std::ptrdiff_t array_prod(const Sizes< Indices... > &)
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a !=b)
#define EIGEN_STRONG_INLINE
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)))
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a+b)
numeric_list< T, nn... > type
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()))
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE T run(const array< T, 0 > &, T identity)
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a >=b)
decltype(h_skip< n >::helper(a())) typedef type
numeric_list< T, as..., bs... > type
type_list< typename op< additional_param, values >::type... > type
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE T run(const array< T, N > &arr, T)
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a &&b)
Namespace containing all symbols from the Eigen library.
numeric_list< T, ii... > type
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a||b)
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A())), N > h_array_apply(array< A, N > a, numeric_list< int, n... >)
type_list< as..., bs... > type
type_list< t, tt... > type
constexpr EIGEN_STRONG_INLINE Array h_array_reverse(Array arr, numeric_list< int, n... >)
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()))
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE A run(A a)
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))...))
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a< b)
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE auto array_reduce(const array< T, N > &arr, T identity) -> decltype(h_array_reduce< Reducer, T, N >::run(arr, identity))
type_list< typename op< values, additional_param >::type... > type
static constexpr EIGEN_STRONG_INLINE array< t, n > run(t v, numeric_list< int, ii... >)
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a<=b)
Array< int, Dynamic, 1 > v
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))...))
Eigen::Triplet< double > T
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a > b)
constexpr EIGEN_STRONG_INLINE array< decltype(Op::run(A(), B())), N > array_zip(array< A, N > a, array< B, N > b)
static constexpr EIGEN_STRONG_INLINE auto run(A a) -> decltype(a >=0)
EIGEN_DEVICE_FUNC static constexpr 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)))
static InstType run(ArrType *arr, Ps... args)
#define EIGEN_TPL_PP_SPEC_HACK_DEFC(mt, n)
static constexpr EIGEN_STRONG_INLINE auto run(A a) -> decltype(-a)
#define EIGEN_DEVICE_FUNC
static InstType run(ArrType *arr, Ps... args)
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE int run()
static InstType run(ArrType *arr, Ps... args)
static constexpr int count
void test(OptionalJacobian< 2, 3 > H={})
static InstType run(ArrType *arr, Ps... args)
static constexpr h_apply_op_helper< from_left, op, additional_param, values... >::type helper(type_list< values... >)
General-purpose arrays with easy API for coefficient-wise operations.
#define EIGEN_TPL_PP_SPEC_HACK_USE(n)
static constexpr EIGEN_STRONG_INLINE h_skip_helper_type< n, tt... >::type helper(type_list< tt... >)
const Index array_get(DimensionList< Index, Rank > &)
constexprdecltype(reduce< sum_op, Ts... >::run((*((Ts *) 0))...)) EIGEN_STRONG_INLIN arg_sum)(Ts... ts)
static constexpr EIGEN_STRONG_INLINE auto run(A a, B b) -> decltype(a==b)
decltype(h_apply_op< true, op, additional_param >::helper(a())) typedef type
InstType instantiate_by_c_array(ArrType *arr)
Expression of the reverse of a vector or matrix.
static constexpr EIGEN_STRONG_INLINE h_skip_helper_numeric< T, n, ii... >::type helper(numeric_list< T, ii... >)
numeric_list< T, i, ii... > type
EIGEN_DEVICE_FUNC constexprdecltype(reduce< product_op, Ts... >::run((*((Ts *) 0))...)) EIGEN_STRONG_INLIN arg_prod)(Ts... ts)
EIGEN_DEVICE_FUNC static constexpr EIGEN_STRONG_INLINE auto run(A a, Ts... ts) -> decltype(Reducer::run(a, reduce< Reducer, Ts... >::run(ts...)))
static constexpr EIGEN_STRONG_INLINE auto run(A a) -> decltype(!a)
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... >)
constexpr array< t, n > repeat(t v)
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)