Add missing EIGEN_DEVICE_FUNC

This commit is contained in:
Nicolas Mellado 2015-07-15 10:14:52 +02:00
parent dbb3e2cf8a
commit 592ee2a4b4
2 changed files with 57 additions and 10 deletions

View File

@ -65,13 +65,16 @@ class PartialReduxExpr : public internal::dense_xpr_base< PartialReduxExpr<Matri
typedef typename internal::traits<PartialReduxExpr>::MatrixTypeNested MatrixTypeNested; typedef typename internal::traits<PartialReduxExpr>::MatrixTypeNested MatrixTypeNested;
typedef typename internal::traits<PartialReduxExpr>::_MatrixTypeNested _MatrixTypeNested; typedef typename internal::traits<PartialReduxExpr>::_MatrixTypeNested _MatrixTypeNested;
EIGEN_DEVICE_FUNC
explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp()) explicit PartialReduxExpr(const MatrixType& mat, const MemberOp& func = MemberOp())
: m_matrix(mat), m_functor(func) {} : m_matrix(mat), m_functor(func) {}
EIGEN_DEVICE_FUNC
Index rows() const { return (Direction==Vertical ? 1 : m_matrix.rows()); } Index rows() const { return (Direction==Vertical ? 1 : m_matrix.rows()); }
EIGEN_DEVICE_FUNC
Index cols() const { return (Direction==Horizontal ? 1 : m_matrix.cols()); } Index cols() const { return (Direction==Horizontal ? 1 : m_matrix.cols()); }
EIGEN_STRONG_INLINE const Scalar coeff(Index i, Index j) const EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const Scalar coeff(Index i, Index j) const
{ {
if (Direction==Vertical) if (Direction==Vertical)
return m_functor(m_matrix.col(j)); return m_functor(m_matrix.col(j));
@ -100,7 +103,8 @@ class PartialReduxExpr : public internal::dense_xpr_base< PartialReduxExpr<Matri
template<typename Scalar, int Size> struct Cost \ template<typename Scalar, int Size> struct Cost \
{ enum { value = COST }; }; \ { enum { value = COST }; }; \
template<typename XprType> \ template<typename XprType> \
EIGEN_STRONG_INLINE ResultType operator()(const XprType& mat) const \ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
ResultType operator()(const XprType& mat) const \
{ return mat.MEMBER(); } \ { return mat.MEMBER(); } \
} }
@ -128,9 +132,9 @@ struct member_redux {
>::type result_type; >::type result_type;
template<typename _Scalar, int Size> struct Cost template<typename _Scalar, int Size> struct Cost
{ enum { value = (Size-1) * functor_traits<BinaryOp>::Cost }; }; { enum { value = (Size-1) * functor_traits<BinaryOp>::Cost }; };
explicit member_redux(const BinaryOp func) : m_functor(func) {} EIGEN_DEVICE_FUNC explicit member_redux(const BinaryOp func) : m_functor(func) {}
template<typename Derived> template<typename Derived>
inline result_type operator()(const DenseBase<Derived>& mat) const EIGEN_DEVICE_FUNC inline result_type operator()(const DenseBase<Derived>& mat) const
{ return mat.redux(m_functor); } { return mat.redux(m_functor); }
const BinaryOp m_functor; const BinaryOp m_functor;
}; };
@ -192,6 +196,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
typedef typename internal::conditional<Direction==Vertical, typedef typename internal::conditional<Direction==Vertical,
typename ExpressionType::ColXpr, typename ExpressionType::ColXpr,
typename ExpressionType::RowXpr>::type SubVector; typename ExpressionType::RowXpr>::type SubVector;
EIGEN_DEVICE_FUNC
SubVector subVector(Index i) SubVector subVector(Index i)
{ {
return SubVector(m_matrix.derived(),i); return SubVector(m_matrix.derived(),i);
@ -199,6 +204,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** \internal /** \internal
* \returns the number of subvectors in the direction \c Direction */ * \returns the number of subvectors in the direction \c Direction */
EIGEN_DEVICE_FUNC
Index subVectors() const Index subVectors() const
{ return Direction==Vertical?m_matrix.cols():m_matrix.rows(); } { return Direction==Vertical?m_matrix.cols():m_matrix.rows(); }
@ -211,6 +217,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** \internal /** \internal
* Replicates a vector to match the size of \c *this */ * Replicates a vector to match the size of \c *this */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
typename ExtendedType<OtherDerived>::Type typename ExtendedType<OtherDerived>::Type
extendedTo(const DenseBase<OtherDerived>& other) const extendedTo(const DenseBase<OtherDerived>& other) const
{ {
@ -233,6 +240,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** \internal /** \internal
* Replicates a vector in the opposite direction to match the size of \c *this */ * Replicates a vector in the opposite direction to match the size of \c *this */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
typename OppositeExtendedType<OtherDerived>::Type typename OppositeExtendedType<OtherDerived>::Type
extendedToOpposite(const DenseBase<OtherDerived>& other) const extendedToOpposite(const DenseBase<OtherDerived>& other) const
{ {
@ -248,9 +256,11 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
public: public:
EIGEN_DEVICE_FUNC
explicit inline VectorwiseOp(ExpressionType& matrix) : m_matrix(matrix) {} explicit inline VectorwiseOp(ExpressionType& matrix) : m_matrix(matrix) {}
/** \internal */ /** \internal */
EIGEN_DEVICE_FUNC
inline const ExpressionType& _expression() const { return m_matrix; } inline const ExpressionType& _expression() const { return m_matrix; }
/** \returns a row or column vector expression of \c *this reduxed by \a func /** \returns a row or column vector expression of \c *this reduxed by \a func
@ -262,6 +272,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
*/ */
template<typename BinaryOp> template<typename BinaryOp>
const typename ReduxReturnType<BinaryOp>::Type const typename ReduxReturnType<BinaryOp>::Type
EIGEN_DEVICE_FUNC
redux(const BinaryOp& func = BinaryOp()) const redux(const BinaryOp& func = BinaryOp()) const
{ return typename ReduxReturnType<BinaryOp>::Type(_expression(), internal::member_redux<BinaryOp,Scalar>(func)); } { return typename ReduxReturnType<BinaryOp>::Type(_expression(), internal::member_redux<BinaryOp,Scalar>(func)); }
@ -289,6 +300,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_minCoeff.out * Output: \verbinclude PartialRedux_minCoeff.out
* *
* \sa DenseBase::minCoeff() */ * \sa DenseBase::minCoeff() */
EIGEN_DEVICE_FUNC
const MinCoeffReturnType minCoeff() const const MinCoeffReturnType minCoeff() const
{ return MinCoeffReturnType(_expression()); } { return MinCoeffReturnType(_expression()); }
@ -301,6 +313,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_maxCoeff.out * Output: \verbinclude PartialRedux_maxCoeff.out
* *
* \sa DenseBase::maxCoeff() */ * \sa DenseBase::maxCoeff() */
EIGEN_DEVICE_FUNC
const MaxCoeffReturnType maxCoeff() const const MaxCoeffReturnType maxCoeff() const
{ return MaxCoeffReturnType(_expression()); } { return MaxCoeffReturnType(_expression()); }
@ -312,6 +325,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_squaredNorm.out * Output: \verbinclude PartialRedux_squaredNorm.out
* *
* \sa DenseBase::squaredNorm() */ * \sa DenseBase::squaredNorm() */
EIGEN_DEVICE_FUNC
const SquaredNormReturnType squaredNorm() const const SquaredNormReturnType squaredNorm() const
{ return SquaredNormReturnType(_expression()); } { return SquaredNormReturnType(_expression()); }
@ -323,6 +337,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_norm.out * Output: \verbinclude PartialRedux_norm.out
* *
* \sa DenseBase::norm() */ * \sa DenseBase::norm() */
EIGEN_DEVICE_FUNC
const NormReturnType norm() const const NormReturnType norm() const
{ return NormReturnType(_expression()); } { return NormReturnType(_expression()); }
@ -333,6 +348,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* This is a vector with real entries, even if the original matrix has complex entries. * This is a vector with real entries, even if the original matrix has complex entries.
* *
* \sa DenseBase::blueNorm() */ * \sa DenseBase::blueNorm() */
EIGEN_DEVICE_FUNC
const BlueNormReturnType blueNorm() const const BlueNormReturnType blueNorm() const
{ return BlueNormReturnType(_expression()); } { return BlueNormReturnType(_expression()); }
@ -343,6 +359,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* This is a vector with real entries, even if the original matrix has complex entries. * This is a vector with real entries, even if the original matrix has complex entries.
* *
* \sa DenseBase::stableNorm() */ * \sa DenseBase::stableNorm() */
EIGEN_DEVICE_FUNC
const StableNormReturnType stableNorm() const const StableNormReturnType stableNorm() const
{ return StableNormReturnType(_expression()); } { return StableNormReturnType(_expression()); }
@ -353,6 +370,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* This is a vector with real entries, even if the original matrix has complex entries. * This is a vector with real entries, even if the original matrix has complex entries.
* *
* \sa DenseBase::hypotNorm() */ * \sa DenseBase::hypotNorm() */
EIGEN_DEVICE_FUNC
const HypotNormReturnType hypotNorm() const const HypotNormReturnType hypotNorm() const
{ return HypotNormReturnType(_expression()); } { return HypotNormReturnType(_expression()); }
@ -363,6 +381,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_sum.out * Output: \verbinclude PartialRedux_sum.out
* *
* \sa DenseBase::sum() */ * \sa DenseBase::sum() */
EIGEN_DEVICE_FUNC
const SumReturnType sum() const const SumReturnType sum() const
{ return SumReturnType(_expression()); } { return SumReturnType(_expression()); }
@ -370,6 +389,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* of each column (or row) of the referenced expression. * of each column (or row) of the referenced expression.
* *
* \sa DenseBase::mean() */ * \sa DenseBase::mean() */
EIGEN_DEVICE_FUNC
const MeanReturnType mean() const const MeanReturnType mean() const
{ return MeanReturnType(_expression()); } { return MeanReturnType(_expression()); }
@ -378,6 +398,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* This expression can be assigned to a vector with entries of type \c bool. * This expression can be assigned to a vector with entries of type \c bool.
* *
* \sa DenseBase::all() */ * \sa DenseBase::all() */
EIGEN_DEVICE_FUNC
const AllReturnType all() const const AllReturnType all() const
{ return AllReturnType(_expression()); } { return AllReturnType(_expression()); }
@ -386,6 +407,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* This expression can be assigned to a vector with entries of type \c bool. * This expression can be assigned to a vector with entries of type \c bool.
* *
* \sa DenseBase::any() */ * \sa DenseBase::any() */
EIGEN_DEVICE_FUNC
const AnyReturnType any() const const AnyReturnType any() const
{ return Any(_expression()); } { return Any(_expression()); }
@ -398,6 +420,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_count.out * Output: \verbinclude PartialRedux_count.out
* *
* \sa DenseBase::count() */ * \sa DenseBase::count() */
EIGEN_DEVICE_FUNC
const CountReturnType count() const const CountReturnType count() const
{ return CountReturnType(_expression()); } { return CountReturnType(_expression()); }
@ -408,6 +431,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude PartialRedux_prod.out * Output: \verbinclude PartialRedux_prod.out
* *
* \sa DenseBase::prod() */ * \sa DenseBase::prod() */
EIGEN_DEVICE_FUNC
const ProdReturnType prod() const const ProdReturnType prod() const
{ return ProdReturnType(_expression()); } { return ProdReturnType(_expression()); }
@ -419,10 +443,12 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* Output: \verbinclude Vectorwise_reverse.out * Output: \verbinclude Vectorwise_reverse.out
* *
* \sa DenseBase::reverse() */ * \sa DenseBase::reverse() */
EIGEN_DEVICE_FUNC
const ReverseReturnType reverse() const const ReverseReturnType reverse() const
{ return ReverseReturnType( _expression() ); } { return ReverseReturnType( _expression() ); }
typedef Replicate<ExpressionType,Direction==Vertical?Dynamic:1,Direction==Horizontal?Dynamic:1> ReplicateReturnType; typedef Replicate<ExpressionType,Direction==Vertical?Dynamic:1,Direction==Horizontal?Dynamic:1> ReplicateReturnType;
EIGEN_DEVICE_FUNC
const ReplicateReturnType replicate(Index factor) const; const ReplicateReturnType replicate(Index factor) const;
/** /**
@ -445,6 +471,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Copies the vector \a other to each subvector of \c *this */ /** Copies the vector \a other to each subvector of \c *this */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
ExpressionType& operator=(const DenseBase<OtherDerived>& other) ExpressionType& operator=(const DenseBase<OtherDerived>& other)
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
@ -455,6 +482,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Adds the vector \a other to each subvector of \c *this */ /** Adds the vector \a other to each subvector of \c *this */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
ExpressionType& operator+=(const DenseBase<OtherDerived>& other) ExpressionType& operator+=(const DenseBase<OtherDerived>& other)
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
@ -464,6 +492,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Substracts the vector \a other to each subvector of \c *this */ /** Substracts the vector \a other to each subvector of \c *this */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
ExpressionType& operator-=(const DenseBase<OtherDerived>& other) ExpressionType& operator-=(const DenseBase<OtherDerived>& other)
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
@ -473,6 +502,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Multiples each subvector of \c *this by the vector \a other */ /** Multiples each subvector of \c *this by the vector \a other */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
ExpressionType& operator*=(const DenseBase<OtherDerived>& other) ExpressionType& operator*=(const DenseBase<OtherDerived>& other)
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
@ -484,6 +514,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Divides each subvector of \c *this by the vector \a other */ /** Divides each subvector of \c *this by the vector \a other */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
ExpressionType& operator/=(const DenseBase<OtherDerived>& other) ExpressionType& operator/=(const DenseBase<OtherDerived>& other)
{ {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived)
@ -494,7 +525,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
} }
/** Returns the expression of the sum of the vector \a other to each subvector of \c *this */ /** Returns the expression of the sum of the vector \a other to each subvector of \c *this */
template<typename OtherDerived> EIGEN_STRONG_INLINE template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
CwiseBinaryOp<internal::scalar_sum_op<Scalar>, CwiseBinaryOp<internal::scalar_sum_op<Scalar>,
const ExpressionTypeNestedCleaned, const ExpressionTypeNestedCleaned,
const typename ExtendedType<OtherDerived>::Type> const typename ExtendedType<OtherDerived>::Type>
@ -507,6 +538,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Returns the expression of the difference between each subvector of \c *this and the vector \a other */ /** Returns the expression of the difference between each subvector of \c *this and the vector \a other */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
CwiseBinaryOp<internal::scalar_difference_op<Scalar>, CwiseBinaryOp<internal::scalar_difference_op<Scalar>,
const ExpressionTypeNestedCleaned, const ExpressionTypeNestedCleaned,
const typename ExtendedType<OtherDerived>::Type> const typename ExtendedType<OtherDerived>::Type>
@ -519,7 +551,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Returns the expression where each subvector is the product of the vector \a other /** Returns the expression where each subvector is the product of the vector \a other
* by the corresponding subvector of \c *this */ * by the corresponding subvector of \c *this */
template<typename OtherDerived> EIGEN_STRONG_INLINE template<typename OtherDerived> EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC
CwiseBinaryOp<internal::scalar_product_op<Scalar>, CwiseBinaryOp<internal::scalar_product_op<Scalar>,
const ExpressionTypeNestedCleaned, const ExpressionTypeNestedCleaned,
const typename ExtendedType<OtherDerived>::Type> const typename ExtendedType<OtherDerived>::Type>
@ -534,6 +566,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Returns the expression where each subvector is the quotient of the corresponding /** Returns the expression where each subvector is the quotient of the corresponding
* subvector of \c *this by the vector \a other */ * subvector of \c *this by the vector \a other */
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, CwiseBinaryOp<internal::scalar_quotient_op<Scalar>,
const ExpressionTypeNestedCleaned, const ExpressionTypeNestedCleaned,
const typename ExtendedType<OtherDerived>::Type> const typename ExtendedType<OtherDerived>::Type>
@ -549,6 +582,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* The referenced matrix is \b not modified. * The referenced matrix is \b not modified.
* \sa MatrixBase::normalized(), normalize() * \sa MatrixBase::normalized(), normalize()
*/ */
EIGEN_DEVICE_FUNC
CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, CwiseBinaryOp<internal::scalar_quotient_op<Scalar>,
const ExpressionTypeNestedCleaned, const ExpressionTypeNestedCleaned,
const typename OppositeExtendedType<typename ReturnType<internal::member_norm,RealScalar>::Type>::Type> const typename OppositeExtendedType<typename ReturnType<internal::member_norm,RealScalar>::Type>::Type>
@ -558,11 +592,11 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
/** Normalize in-place each row or columns of the referenced matrix. /** Normalize in-place each row or columns of the referenced matrix.
* \sa MatrixBase::normalize(), normalized() * \sa MatrixBase::normalize(), normalized()
*/ */
void normalize() { EIGEN_DEVICE_FUNC void normalize() {
m_matrix = this->normalized(); m_matrix = this->normalized();
} }
inline void reverseInPlace(); EIGEN_DEVICE_FUNC inline void reverseInPlace();
/////////// Geometry module /////////// /////////// Geometry module ///////////
@ -571,6 +605,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
typedef typename ExpressionType::PlainObject CrossReturnType; typedef typename ExpressionType::PlainObject CrossReturnType;
template<typename OtherDerived> template<typename OtherDerived>
EIGEN_DEVICE_FUNC
const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const; const CrossReturnType cross(const MatrixBase<OtherDerived>& other) const;
enum { enum {
@ -609,6 +644,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
* \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting * \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
*/ */
template<typename Derived> template<typename Derived>
EIGEN_DEVICE_FUNC
inline const typename DenseBase<Derived>::ConstColwiseReturnType inline const typename DenseBase<Derived>::ConstColwiseReturnType
DenseBase<Derived>::colwise() const DenseBase<Derived>::colwise() const
{ {
@ -620,6 +656,7 @@ DenseBase<Derived>::colwise() const
* \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting * \sa rowwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
*/ */
template<typename Derived> template<typename Derived>
EIGEN_DEVICE_FUNC
inline typename DenseBase<Derived>::ColwiseReturnType inline typename DenseBase<Derived>::ColwiseReturnType
DenseBase<Derived>::colwise() DenseBase<Derived>::colwise()
{ {
@ -634,6 +671,7 @@ DenseBase<Derived>::colwise()
* \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
*/ */
template<typename Derived> template<typename Derived>
EIGEN_DEVICE_FUNC
inline const typename DenseBase<Derived>::ConstRowwiseReturnType inline const typename DenseBase<Derived>::ConstRowwiseReturnType
DenseBase<Derived>::rowwise() const DenseBase<Derived>::rowwise() const
{ {
@ -645,6 +683,7 @@ DenseBase<Derived>::rowwise() const
* \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting * \sa colwise(), class VectorwiseOp, \ref TutorialReductionsVisitorsBroadcasting
*/ */
template<typename Derived> template<typename Derived>
EIGEN_DEVICE_FUNC
inline typename DenseBase<Derived>::RowwiseReturnType inline typename DenseBase<Derived>::RowwiseReturnType
DenseBase<Derived>::rowwise() DenseBase<Derived>::rowwise()
{ {

View File

@ -99,6 +99,7 @@ protected:
*/ */
template<typename Derived> template<typename Derived>
template<typename Visitor> template<typename Visitor>
EIGEN_DEVICE_FUNC
void DenseBase<Derived>::visit(Visitor& visitor) const void DenseBase<Derived>::visit(Visitor& visitor) const
{ {
typedef typename internal::visitor_evaluator<Derived> ThisEvaluator; typedef typename internal::visitor_evaluator<Derived> ThisEvaluator;
@ -125,6 +126,7 @@ struct coeff_visitor
typedef typename Derived::Scalar Scalar; typedef typename Derived::Scalar Scalar;
Index row, col; Index row, col;
Scalar res; Scalar res;
EIGEN_DEVICE_FUNC
inline void init(const Scalar& value, Index i, Index j) inline void init(const Scalar& value, Index i, Index j)
{ {
res = value; res = value;
@ -142,6 +144,7 @@ template <typename Derived>
struct min_coeff_visitor : coeff_visitor<Derived> struct min_coeff_visitor : coeff_visitor<Derived>
{ {
typedef typename Derived::Scalar Scalar; typedef typename Derived::Scalar Scalar;
EIGEN_DEVICE_FUNC
void operator() (const Scalar& value, Index i, Index j) void operator() (const Scalar& value, Index i, Index j)
{ {
if(value < this->res) if(value < this->res)
@ -168,7 +171,8 @@ struct functor_traits<min_coeff_visitor<Scalar> > {
template <typename Derived> template <typename Derived>
struct max_coeff_visitor : coeff_visitor<Derived> struct max_coeff_visitor : coeff_visitor<Derived>
{ {
typedef typename Derived::Scalar Scalar; typedef typename Derived::Scalar Scalar;
EIGEN_DEVICE_FUNC
void operator() (const Scalar& value, Index i, Index j) void operator() (const Scalar& value, Index i, Index j)
{ {
if(value > this->res) if(value > this->res)
@ -196,6 +200,7 @@ struct functor_traits<max_coeff_visitor<Scalar> > {
*/ */
template<typename Derived> template<typename Derived>
template<typename IndexType> template<typename IndexType>
EIGEN_DEVICE_FUNC
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::minCoeff(IndexType* rowId, IndexType* colId) const DenseBase<Derived>::minCoeff(IndexType* rowId, IndexType* colId) const
{ {
@ -213,6 +218,7 @@ DenseBase<Derived>::minCoeff(IndexType* rowId, IndexType* colId) const
*/ */
template<typename Derived> template<typename Derived>
template<typename IndexType> template<typename IndexType>
EIGEN_DEVICE_FUNC
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::minCoeff(IndexType* index) const DenseBase<Derived>::minCoeff(IndexType* index) const
{ {
@ -230,6 +236,7 @@ DenseBase<Derived>::minCoeff(IndexType* index) const
*/ */
template<typename Derived> template<typename Derived>
template<typename IndexType> template<typename IndexType>
EIGEN_DEVICE_FUNC
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::maxCoeff(IndexType* rowPtr, IndexType* colPtr) const DenseBase<Derived>::maxCoeff(IndexType* rowPtr, IndexType* colPtr) const
{ {
@ -247,6 +254,7 @@ DenseBase<Derived>::maxCoeff(IndexType* rowPtr, IndexType* colPtr) const
*/ */
template<typename Derived> template<typename Derived>
template<typename IndexType> template<typename IndexType>
EIGEN_DEVICE_FUNC
typename internal::traits<Derived>::Scalar typename internal::traits<Derived>::Scalar
DenseBase<Derived>::maxCoeff(IndexType* index) const DenseBase<Derived>::maxCoeff(IndexType* index) const
{ {