10#ifndef EIGEN_ALLANDANY_H
11#define EIGEN_ALLANDANY_H
17template<
typename Derived,
int UnrollCount,
int Rows>
21 col = (UnrollCount-1) / Rows,
22 row = (UnrollCount-1) % Rows
25 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived &mat)
27 return all_unroller<Derived, UnrollCount-1, Rows>::run(mat) && mat.coeff(row, col);
31template<
typename Derived,
int Rows>
32struct all_unroller<Derived, 0, Rows>
34 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived &) {
return true; }
37template<
typename Derived,
int Rows>
38struct all_unroller<Derived,
Dynamic, Rows>
40 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived &) {
return false; }
43template<
typename Derived,
int UnrollCount,
int Rows>
47 col = (UnrollCount-1) / Rows,
48 row = (UnrollCount-1) % Rows
51 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived &mat)
53 return any_unroller<Derived, UnrollCount-1, Rows>::run(mat) || mat.coeff(row, col);
57template<
typename Derived,
int Rows>
58struct any_unroller<Derived, 0, Rows>
60 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived & ) {
return false; }
63template<
typename Derived,
int Rows>
64struct any_unroller<Derived,
Dynamic, Rows>
66 EIGEN_DEVICE_FUNC
static inline bool run(
const Derived &) {
return false; }
78template<
typename Derived>
81 typedef internal::evaluator<Derived> Evaluator;
84 &&
SizeAtCompileTime * (int(Evaluator::CoeffReadCost) + int(NumTraits<Scalar>::AddCost)) <= EIGEN_UNROLLING_LIMIT
88 return internal::all_unroller<Evaluator, unroll ? int(
SizeAtCompileTime) :
Dynamic, internal::traits<Derived>::RowsAtCompileTime>::run(evaluator);
93 if (!evaluator.coeff(i, j))
return false;
102template<
typename Derived>
105 typedef internal::evaluator<Derived> Evaluator;
108 &&
SizeAtCompileTime * (int(Evaluator::CoeffReadCost) + int(NumTraits<Scalar>::AddCost)) <= EIGEN_UNROLLING_LIMIT
110 Evaluator evaluator(
derived());
112 return internal::any_unroller<Evaluator, unroll ? int(
SizeAtCompileTime) :
Dynamic, internal::traits<Derived>::RowsAtCompileTime>::run(evaluator);
117 if (evaluator.coeff(i, j))
return true;
126template<
typename Derived>
136template<
typename Derived>
139#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
140 return derived().array().isNaN().any();
150template<
typename Derived>
153#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
154 return derived().array().isFinite().all();
Index count() const
Definition BooleanRedux.h:127
bool hasNaN() const
Definition BooleanRedux.h:137
bool any() const
Definition BooleanRedux.h:103
CastXpr< NewType >::Type cast() const
Definition DenseBase.h:63
@ SizeAtCompileTime
Definition DenseBase.h:113
bool all() const
Definition BooleanRedux.h:79
bool allFinite() const
Definition BooleanRedux.h:151
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition EigenBase.h:63
Derived & derived()
Definition EigenBase.h:46
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition EigenBase.h:60
Namespace containing all symbols from the Eigen library.
Definition Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:74
const int Dynamic
Definition Constants.h:22