27 #ifndef ANTIOCH_METAPHYSICL_UTILS_H
28 #define ANTIOCH_METAPHYSICL_UTILS_H
30 #ifdef ANTIOCH_METAPROGRAMMING_H
31 # ifndef ANTIOCH_METAPHYSICL_UTILS_DECL_H
32 # error metaphysicl_utils_decl.h must be included before metaprogramming.h
36 #include "antioch_config.h"
40 #ifdef ANTIOCH_HAVE_METAPHYSICL
47 #include "metaphysicl/numberarray.h"
50 namespace MetaPhysicL {
51 template <std::
size_t size,
typename T>
class NumberArray;
65 is_metaphysicl<T>::value,
66 typename value_type<T>::type>::type
72 const std::size_t size = in.size();
73 for (std::size_t i = 1; i < size; ++i)
74 maxval =
max(maxval, in[i]);
82 is_metaphysicl<T>::value,
83 typename value_type<T>::type>::type
89 const std::size_t size = in.size();
90 for (std::size_t i = 1; i < size; ++i)
91 minval =
min(minval, in[i]);
99 static const bool value =
true;
102 template <
typename T>
105 static const bool value =
true;
108 template <
typename T>
114 template <
typename T>
117 typedef typename T::value_type
type;
120 template <
typename T>
126 template <
typename T
bool,
typename Ttrue,
typename Tfalse>
134 const Ttrue& if_true,
135 const Tfalse& if_false)
141 for (std::size_t i=0; i != condition.size(); ++i)
142 returnval[i] = condition[i] ? if_true[i] : if_false[i];
147 template <
typename VectorT,
typename UIntType>
150 is_metaphysicl<typename Antioch::value_type<VectorT>::type >::value &&
151 is_metaphysicl<UIntType>::value,
159 i < indexes.size(); i++)
160 returnval[i] = vec[indexes[i]][i];
167 #endif // ANTIOCH_METAPHYSICL_UTILS_H
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
#define antioch_assert_equal_to(expr1, expr2)
raw_value_type< typename value_type< T >::type >::type type
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type min(const T &in)
enable_if_c< is_eigen< typename value_type< VectorT >::type >::value, typename value_type< VectorT >::type >::type eval_index(const VectorT &vec, const _Matrix< _UIntT, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &index)
max(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
enable_if_c< is_eigen< T1 >::value &&is_eigen< T2 >::value, typename state_type< T1 >::type >::type if_else(const Condition &condition, const T1 &if_true, const T2 &if_false)
The parameters are reduced parameters.
typename _Scalar int _Rows int _Cols int _Options int _MaxRows int _MaxCols inline min(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >