10 #ifndef EIGEN_VISITOR_H 11 #define EIGEN_VISITOR_H 17 template<
typename Visitor,
typename Derived,
int UnrollCount>
21 col = (UnrollCount-1) / Derived::RowsAtCompileTime,
22 row = (UnrollCount-1) % Derived::RowsAtCompileTime
26 static inline void run(
const Derived &
mat, Visitor& visitor)
33 template<
typename Visitor,
typename Derived>
37 static inline void run(
const Derived &
mat, Visitor& visitor)
39 return visitor.init(mat.coeff(0, 0), 0, 0);
44 template<
typename Visitor,
typename Derived>
47 static inline void run(
const Derived &, Visitor& )
51 template<
typename Visitor,
typename Derived>
55 static inline void run(
const Derived&
mat, Visitor& visitor)
57 visitor.init(mat.coeff(0,0), 0, 0);
58 for(
Index i = 1;
i < mat.rows(); ++
i)
59 visitor(mat.coeff(
i, 0),
i, 0);
60 for(
Index j = 1;
j < mat.cols(); ++
j)
61 for(
Index i = 0;
i < mat.rows(); ++
i)
62 visitor(mat.coeff(
i,
j),
i,
j);
67 template<
typename XprType>
78 RowsAtCompileTime = XprType::RowsAtCompileTime,
87 {
return m_evaluator.coeff(row, col); }
114 template<
typename Derived>
115 template<
typename Visitor>
123 ThisEvaluator thisEval(derived());
126 unroll = SizeAtCompileTime !=
Dynamic 137 template <
typename Derived>
160 template <
typename Derived,
int NaNPropagation>
167 if(value < this->
res)
176 template <
typename Derived>
192 template <
typename Derived>
208 template<
typename Scalar,
int NaNPropagation>
220 template <
typename Derived,
int NaNPropagation>
227 if(value > this->
res)
236 template <
typename Derived>
252 template <
typename Derived>
268 template<
typename Scalar,
int NaNPropagation>
288 template<
typename Derived>
289 template<
int NaNPropagation,
typename IndexType>
297 this->visit(minVisitor);
298 *rowId = minVisitor.
row;
299 if (colId) *colId = minVisitor.
col;
300 return minVisitor.
res;
313 template<
typename Derived>
314 template<
int NaNPropagation,
typename IndexType>
323 this->visit(minVisitor);
324 *index = IndexType((RowsAtCompileTime==1) ? minVisitor.
col : minVisitor.
row);
325 return minVisitor.
res;
339 template<
typename Derived>
340 template<
int NaNPropagation,
typename IndexType>
348 this->visit(maxVisitor);
349 *rowPtr = maxVisitor.
row;
350 if (colPtr) *colPtr = maxVisitor.
col;
351 return maxVisitor.
res;
364 template<
typename Derived>
365 template<
int NaNPropagation,
typename IndexType>
374 this->visit(maxVisitor);
375 *index = (RowsAtCompileTime==1) ? maxVisitor.
col : maxVisitor.
row;
376 return maxVisitor.
res;
381 #endif // EIGEN_VISITOR_H EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
static EIGEN_DEVICE_FUNC void run(const Derived &, Visitor &)
EIGEN_DEVICE_FUNC void visit(Visitor &func) const
EIGEN_DEVICE_FUNC coeff_visitor()
Namespace containing all symbols from the Eigen library.
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
static EIGEN_DEVICE_FUNC void run(const Derived &mat, Visitor &visitor)
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
Generic expression where a coefficient-wise binary operator is applied to two expressions.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff() const
XprType::CoeffReturnType CoeffReturnType
static EIGEN_DEVICE_FUNC void run(const Derived &mat, Visitor &visitor)
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff() const
internal::evaluator< XprType > m_evaluator
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
static EIGEN_DEVICE_FUNC void run(const Derived &mat, Visitor &visitor)
EIGEN_CONSTEXPR Index size(const T &x)
#define EIGEN_DEVICE_FUNC
EIGEN_DEVICE_FUNC void init(const Scalar &value, Index i, Index j)
EIGEN_DEVICE_FUNC visitor_evaluator(const XprType &xpr)
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE bool() isnan(const Eigen::bfloat16 &h)
EIGEN_DEVICE_FUNC CoeffReturnType coeff(Index row, Index col) const
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
internal::enable_if< internal::valid_indexed_view_overload< RowIndices, ColIndices >::value &&internal::traits< typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::ReturnAsIndexedView, typename EIGEN_INDEXED_VIEW_METHOD_TYPE< RowIndices, ColIndices >::type >::type operator()(const RowIndices &rowIndices, const ColIndices &colIndices) EIGEN_INDEXED_VIEW_METHOD_CONST
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
#define EIGEN_UNROLLING_LIMIT