27 #ifndef ANTIOCH_EIGEN_UTILS_DECL_H
28 #define ANTIOCH_EIGEN_UTILS_DECL_H
30 #ifdef ANTIOCH_METAPROGRAMMING_H
31 # error eigen_utils_decl.h must be included before metaprogramming.h
34 #include "antioch_config.h"
37 #include <type_traits>
39 #ifdef ANTIOCH_HAVE_EIGEN
47 template<
typename Derived,
typename ThenDerived,
typename ElseDerived>
58 static const bool value =
false;
71 template <
typename,
int,
int,
int,
int,
int>
class _Matrix,
72 typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols
75 <_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >
89 template <
typename,
int,
int,
int,
int,
int>
class _Matrix,
90 typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols
93 ANTIOCH_AUTO(_Matrix<_Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols>)
94 max(
const _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & a,
95 const _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & b)
96 ANTIOCH_RETURNEXPR(_Matrix<_Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols>,
97 a.array().max(b.array()));
100 template <
typename,
int,
int,
int,
int,
int>
class _Matrix,
101 typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols
104 ANTIOCH_AUTO(_Matrix<_Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols>)
105 min(
const _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & a,
106 const _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> & b)
107 ANTIOCH_RETURNEXPR(_Matrix<_Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols>,
108 a.array().min(b.array()));
115 template <
typename T>
117 typename
std::enable_if<is_eigen<T>::value>
::type
124 template <
typename,
int,
int,
int,
int,
int>
class _Matrix,
125 typename _Scalar,
int _Rows,
int _Cols,
int _Options,
int _MaxRows,
int _MaxCols,
128 struct rebind<_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>, NewScalar>
130 typedef _Matrix<NewScalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
type;
133 template <
typename T>
136 template <typename T>
137 struct
return_auto<T, typename Antioch::enable_if_c<is_eigen<T>::value,void>::type>;
139 template <typename T>
140 struct
size_type<T, typename Antioch::enable_if_c<is_eigen<T>::value,void>::type>;
144 template <typename, int, int, int, int, int> class _Matrix,
145 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols
147 struct
value_type<_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >;
150 template <typename, int, int, int, int, int> class _Matrix,
151 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols
153 struct
raw_value_type<_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> >;
155 template <typename T>
158 typename value_type<T>::type
162 template <typename T>
165 typename value_type<T>::type
170 template <typename, int, int, int, int, int> class _Matrix,
171 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols
174 _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
175 zero_clone(const _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& ex);
178 template <typename, int, int, int, int, int> class _Matrix,
179 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols,
184 zero_clone(_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& output,
185 const _Matrix<Scalar2, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& ex);
188 template <typename, int, int, int, int, int> class _Matrix,
189 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols,
193 _Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
195 _MaxRows, _MaxCols>& ex,
196 const Scalar& value);
199 template <typename, int, int, int, int, int> class _Matrix,
200 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols,
205 constant_fill(_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows,
207 const Scalar& value);
211 template <typename, int, int, int, int, int> class _Matrix,
212 typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols
216 set_zero(_Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& a);
228 template <typename Condition, typename T1, typename T2>
231 is_eigen<T1>::value &&
233 typename state_type<T1>::type
236 const Condition& condition,
241 template <typename VectorT,
242 template <typename, int, int, int, int, int> class _Matrix,
243 typename _UIntT, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols
247 is_eigen<typename value_type<VectorT>::type>::value,
248 typename value_type<VectorT>::type
250 eval_index(const VectorT& vec, const _Matrix<_UIntT, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& index);
252 template <typename T>
256 template <typename T>
262 #endif //ANTIOCH_EIGEN_UTILS_DECL_H
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
#define ANTIOCH_RETURNEXPR(Type, Expr)
bool conjunction_root(const T &vec, eigen_library_tag)
_Matrix< NewScalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > type
bool disjunction_root(const T &vec, eigen_library_tag)
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)
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > constant_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex, const Scalar &value)
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)
void set_zero(_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a)
void constant_fill(_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &output, const Scalar &value)
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 >
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
#define ANTIOCH_AUTO(Type)