Go to the documentation of this file.
11 #ifndef EIGEN_PARTIAL_REDUX_H
12 #define EIGEN_PARTIAL_REDUX_H
32 template<
typename MatrixType,
typename MemberOp,
int Direction>
33 class PartialReduxExpr;
36 template<
typename MatrixType,
typename MemberOp,
int Direction>
40 typedef typename MemberOp::result_type
Scalar;
45 RowsAtCompileTime = Direction==
Vertical ? 1 : MatrixType::RowsAtCompileTime,
46 ColsAtCompileTime = Direction==
Horizontal ? 1 : MatrixType::ColsAtCompileTime,
47 MaxRowsAtCompileTime = Direction==
Vertical ? 1 : MatrixType::MaxRowsAtCompileTime,
48 MaxColsAtCompileTime = Direction==
Horizontal ? 1 : MatrixType::MaxColsAtCompileTime,
50 TraversalSize = Direction==
Vertical ? MatrixType::RowsAtCompileTime : MatrixType::ColsAtCompileTime
55 template<
typename MatrixType,
typename MemberOp,
int Direction>
56 class PartialReduxExpr :
public internal::dense_xpr_base< PartialReduxExpr<MatrixType, MemberOp, Direction> >
::type,
57 internal::no_assignment_operator
86 #define EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(MEMBER,COST,VECTORIZABLE,BINARYOP) \
87 template <typename ResultType,typename Scalar> \
88 struct member_##MEMBER { \
89 EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER) \
90 typedef ResultType result_type; \
91 typedef BINARYOP<Scalar,Scalar> BinaryOp; \
92 template<int Size> struct Cost { enum { value = COST }; }; \
93 enum { Vectorizable = VECTORIZABLE }; \
94 template<typename XprType> \
95 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
96 ResultType operator()(const XprType& mat) const \
97 { return mat.MEMBER(); } \
98 BinaryOp binaryFunc() const { return BinaryOp(); } \
101 #define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
102 EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(MEMBER,COST,0,partial_redux_dummy_func)
119 template <
int p,
typename ResultType,
typename Scalar>
126 template<
typename XprType>
128 {
return mat.template lpNorm<p>(); }
131 template <
typename BinaryOpT,
typename Scalar>
141 template<
typename Derived>
186 template<
typename ExpressionType,
int Direction>
class VectorwiseOp
196 template<
template<
typename OutScalar,
typename InputScalar>
class Functor,
222 isVertical ? 1 : ExpressionType::RowsAtCompileTime,
228 template<
typename OtherDerived>
234 YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
236 YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
251 template<
typename OtherDerived>
257 YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
259 YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
274 #ifdef EIGEN_PARSED_BY_DOXYGEN
278 random_access_iterator_type
iterator;
334 template<
typename BinaryOp>
487 const MeanReturnType
mean()
const
577 template<
typename OtherDerived>
588 template<
typename OtherDerived>
598 template<
typename OtherDerived>
608 template<
typename OtherDerived>
620 template<
typename OtherDerived>
644 template<
typename OtherDerived>
673 template<
typename OtherDerived>
713 template<
typename OtherDerived>
722 typedef Block<
const ExpressionType,
724 :
int(
internal::traits<ExpressionType>::RowsAtCompileTime),
726 :
int(
internal::traits<ExpressionType>::ColsAtCompileTime)>
728 typedef Block<
const ExpressionType,
742 # ifdef EIGEN_VECTORWISEOP_PLUGIN
743 # include EIGEN_VECTORWISEOP_PLUGIN
761 template<
typename Derived>
765 return ColwiseReturnType(derived());
775 template<
typename Derived>
779 return RowwiseReturnType(derived());
784 #endif // EIGEN_PARTIAL_REDUX_H
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
const EIGEN_DEVICE_FUNC CrossReturnType cross(const MatrixBase< OtherDerived > &other) const
ReturnType< internal::member_prod >::Type ProdReturnType
EIGEN_MEMBER_FUNCTOR(norm,(Size+5) *NumTraits< Scalar >::MulCost+(Size-1) *NumTraits< Scalar >::AddCost)
const BinaryOp & binaryFunc() const
#define EIGEN_DEVICE_FUNC
Namespace containing all symbols from the Eigen library.
PartialReduxExpr< ExpressionType, Functor< ReturnScalar, Scalar >, Direction > Type
@ HNormalized_SizeMinusOne
PartialReduxExpr< ExpressionType, internal::member_lpnorm< p, RealScalar, Scalar >, Direction > Type
EIGEN_DEVICE_FUNC PartialReduxExpr(const MatrixType &mat, const MemberOp &func=MemberOp())
internal::subvector_stl_iterator< ExpressionType, DirectionType(Direction)> iterator
EIGEN_DEVICE_FUNC ExpressionType & operator/=(const DenseBase< OtherDerived > &other)
Expression of a fixed-size or dynamic-size block.
ReturnType< internal::member_blueNorm, RealScalar >::Type BlueNormReturnType
EIGEN_DEVICE_FUNC result_type operator()(const DenseBase< Derived > &mat) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR Index subVectors() const
const EIGEN_DEVICE_FUNC MemberOp & functor() const
#define EIGEN_STATIC_ASSERT_SAME_XPR_KIND(Derived1, Derived2)
const Replicate< ExpressionType, isVertical *Factor+isHorizontal, isHorizontal *Factor+isVertical > EIGEN_DEVICE_FUNC replicate(Index factor=Factor) const
Generic expression where a coefficient-wise binary operator is applied to two expressions.
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
ReturnType< internal::member_minCoeff >::Type MinCoeffReturnType
const EIGEN_DEVICE_FUNC SquaredNormReturnType squaredNorm() const
EIGEN_DEVICE_FUNC ExpressionType & operator+=(const DenseBase< OtherDerived > &other)
const unsigned int RowMajorBit
EIGEN_DEVICE_FUNC MatrixType::Nested nestedExpression() const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_product_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > EIGEN_DEVICE_FUNC operator*(const DenseBase< OtherDerived > &other) const
traits< MatrixType >::XprKind XprKind
const EIGEN_DEVICE_FUNC CountReturnType count() const
reverse_iterator rbegin()
const EIGEN_DEVICE_FUNC MeanReturnType mean() const
Pseudo expression providing broadcasting and partial reduction operations.
EIGEN_DEVICE_FUNC member_lpnorm()
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_difference_op< Scalar, typename OtherDerived::Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator-(const DenseBase< OtherDerived > &other) const
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_sum_op< Scalar, typename OtherDerived::Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator+(const DenseBase< OtherDerived > &other) const
#define EIGEN_DENSE_PUBLIC_INTERFACE(Derived)
EIGEN_DONT_INLINE T::Scalar hypotNorm(T &v)
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Reverse< ExpressionType, Direction > ReverseReturnType
#define EIGEN_STATIC_ASSERT_ARRAYXPR(Derived)
Reverse< const ExpressionType, Direction > ConstReverseReturnType
internal::dense_xpr_base< PartialReduxExpr >::type Base
internal::ref_selector< ExpressionType >::non_const_type ExpressionTypeNested
EIGEN_DEVICE_FUNC void reverseInPlace()
const EIGEN_DEVICE_FUNC MaxCoeffReturnType maxCoeff() const
MatrixType::Scalar InputScalar
traits< MatrixType >::StorageKind StorageKind
const_iterator begin() const
DecisionTreeFactor factor(D &C &B &A, "0.0 0.0 0.0 0.60658897 0.61241912 0.61241969 0.61247685 0.61247742 0.0 " "0.0 0.0 0.99995287 1.0 1.0 1.0 1.0")
Expression of one (or a set of) homogeneous vector(s)
const_reverse_iterator crend() const
internal::subvector_stl_reverse_iterator< const ExpressionType, DirectionType(Direction)> const_reverse_iterator
EIGEN_DEVICE_FUNC void normalize()
PartialReduxExpr< ExpressionType, internal::member_count< Index, Scalar >, Direction > CountReturnType
ReturnType< internal::member_stableNorm, RealScalar >::Type StableNormReturnType
PartialReduxExpr< const CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const ExpressionTypeNestedCleaned >, internal::member_sum< RealScalar, RealScalar >, Direction > SquaredNormReturnType
EIGEN_MAKE_PARTIAL_REDUX_FUNCTOR(sum,(Size-1) *NumTraits< Scalar >::AddCost, 1, internal::scalar_sum_op)
Block< const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Block
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
ReturnType< internal::member_any >::Type AnyReturnType
const_iterator cbegin() const
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
const_reverse_iterator crbegin() const
const EIGEN_DEVICE_FUNC HNormalizedReturnType hnormalized() const
column or row-wise homogeneous normalization
static const Eigen::internal::all_t all
const_iterator cend() const
const EIGEN_DEVICE_FUNC HypotNormReturnType hypotNorm() const
const EIGEN_DEVICE_FUNC MinCoeffReturnType minCoeff() const
ReturnType< internal::member_all >::Type AllReturnType
#define EIGEN_STRONG_INLINE
Expression of the reverse of a vector or matrix.
Expression of the multiple replication of a matrix or vector.
EIGEN_DONT_INLINE T::Scalar stableNorm(T &v)
ExpressionType::Scalar Scalar
EIGEN_DEVICE_FUNC ExpressionType & operator=(const DenseBase< OtherDerived > &other)
const EIGEN_DEVICE_FUNC ExpressionType & _expression() const
Block< const ExpressionType, Direction==Vertical ? 1 :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? 1 :int(internal::traits< ExpressionType >::ColsAtCompileTime)> HNormalized_Factors
EIGEN_DEVICE_FUNC ExpressionType & operator*=(const DenseBase< OtherDerived > &other)
const EIGEN_DEVICE_FUNC AnyReturnType any() const
Homogeneous< ExpressionType, Direction > HomogeneousReturnType
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator/(const DenseBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
const EIGEN_DEVICE_FUNC BlueNormReturnType blueNorm() const
const EIGEN_DEVICE_FUNC ProdReturnType prod() const
NumTraits< Scalar >::Real RealScalar
Index redux_length() const
const EIGEN_DEVICE_FUNC AllReturnType all() const
EIGEN_DEVICE_FUNC ExpressionType & operator-=(const DenseBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC ResultType operator()(const XprType &mat) const
Replicate< OtherDerived, isVertical ? 1 :ExpressionType::RowsAtCompileTime, isHorizontal ? 1 :ExpressionType::ColsAtCompileTime > Type
Base class for all dense matrices, vectors, and arrays.
EIGEN_DEVICE_FUNC OppositeExtendedType< OtherDerived >::Type extendedToOpposite(const DenseBase< OtherDerived > &other) const
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
const EIGEN_DEVICE_FUNC ReduxReturnType< BinaryOp >::Type redux(const BinaryOp &func=BinaryOp()) const
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(SumReturnType, Scalar, quotient) MeanReturnType
const_reverse_iterator rbegin() const
Generic expression where a coefficient-wise unary operator is applied to an expression.
MatrixType::Nested m_matrix
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
ExpressionTypeNested m_matrix
EIGEN_DEVICE_FUNC member_redux(const BinaryOp func)
internal::subvector_stl_reverse_iterator< ExpressionType, DirectionType(Direction)> reverse_iterator
const EIGEN_DEVICE_FUNC ReplicateReturnType replicate(Index factor) const
const_reverse_iterator rend() const
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
const EIGEN_DEVICE_FUNC SumReturnType sum() const
EIGEN_DEVICE_FUNC VectorwiseOp(ExpressionType &matrix)
EIGEN_DONT_INLINE T::Scalar blueNorm(T &v)
CwiseBinaryOp< internal::scalar_quotient_op< typename internal::traits< ExpressionType >::Scalar >, const HNormalized_Block, const Replicate< HNormalized_Factors, Direction==Vertical ? HNormalized_SizeMinusOne :1, Direction==Horizontal ? HNormalized_SizeMinusOne :1 > > HNormalizedReturnType
internal::remove_all< ExpressionTypeNested >::type ExpressionTypeNestedCleaned
ExpressionType::RealScalar RealScalar
const EIGEN_DEVICE_FUNC NormReturnType norm() const
PartialReduxExpr< ExpressionType, internal::member_redux< BinaryOp, Scalar >, Direction > Type
Base class for all dense matrices, vectors, and expressions.
#define EIGEN_IMPLIES(a, b)
CwiseUnaryOp< internal::scalar_sqrt_op< RealScalar >, const SquaredNormReturnType > NormReturnType
ExpressionType::PlainObject CrossReturnType
const EIGEN_DEVICE_FUNC LpNormReturnType< p >::Type lpNorm() const
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Generic expression of a partially reduxed matrix.
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType< NormReturnType >::Type > normalized() const
const EIGEN_DEVICE_FUNC StableNormReturnType stableNorm() const
internal::subvector_stl_iterator< const ExpressionType, DirectionType(Direction)> const_iterator
result_of< BinaryOp(const Scalar &, const Scalar &) >::type result_type
const EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
ReturnType< internal::member_hypotNorm, RealScalar >::Type HypotNormReturnType
ReturnType< internal::member_sum >::Type SumReturnType
const Product< Lhs, Rhs > prod(const Lhs &lhs, const Rhs &rhs)
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
MemberOp::result_type Scalar
EIGEN_DEVICE_FUNC ExtendedType< OtherDerived >::Type extendedTo(const DenseBase< OtherDerived > &other) const
ReturnType< internal::member_maxCoeff >::Type MaxCoeffReturnType
const_iterator end() const
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Replicate< OtherDerived, isHorizontal ? 1 :ExpressionType::RowsAtCompileTime, isVertical ? 1 :ExpressionType::ColsAtCompileTime > Type
gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:18:24