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
84 #define EIGEN_MEMBER_FUNCTOR(MEMBER,COST) \
85 template <typename ResultType> \
86 struct member_##MEMBER { \
87 EIGEN_EMPTY_STRUCT_CTOR(member_##MEMBER) \
88 typedef ResultType result_type; \
89 template<typename Scalar, int Size> struct Cost \
90 { enum { value = COST }; }; \
91 template<typename XprType> \
92 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE \
93 ResultType operator()(const XprType& mat) const \
94 { return mat.MEMBER(); } \
113 template <
int p,
typename ResultType>
116 template<
typename Scalar,
int Size>
struct Cost
119 template<
typename XprType>
121 {
return mat.template lpNorm<p>(); }
124 template <
typename BinaryOp,
typename Scalar>
129 template<
typename _Scalar,
int Size>
struct Cost
132 template<
typename Derived>
156 template<
typename ExpressionType,
int Direction>
class VectorwiseOp
166 template<
template<
typename _Scalar>
class Functor,
209 isVertical ? 1 : ExpressionType::RowsAtCompileTime,
215 template<
typename OtherDerived>
221 YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
223 YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
238 template<
typename OtherDerived>
244 YOU_PASSED_A_ROW_VECTOR_BUT_A_COLUMN_VECTOR_WAS_EXPECTED)
246 YOU_PASSED_A_COLUMN_VECTOR_BUT_A_ROW_VECTOR_WAS_EXPECTED)
268 template<
typename BinaryOp>
271 redux(
const BinaryOp& func = BinaryOp())
const
496 template<
typename OtherDerived>
507 template<
typename OtherDerived>
517 template<
typename OtherDerived>
527 template<
typename OtherDerived>
535 return const_cast<ExpressionType&
>(
m_matrix);
539 template<
typename OtherDerived>
547 return const_cast<ExpressionType&
>(
m_matrix);
563 template<
typename OtherDerived>
592 template<
typename OtherDerived>
632 template<
typename OtherDerived>
641 typedef Block<
const ExpressionType,
643 :
int(
internal::traits<ExpressionType>::RowsAtCompileTime),
645 :
int(
internal::traits<ExpressionType>::ColsAtCompileTime)>
647 typedef Block<
const ExpressionType,
672 template<
typename Derived>
676 return ColwiseReturnType(derived());
686 template<
typename Derived>
690 return RowwiseReturnType(derived());
695 #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_DEVICE_FUNC result_type operator()(const DenseBase< Derived > &mat) const
EIGEN_DEVICE_FUNC member_lpnorm()
EIGEN_DEVICE_FUNC PartialReduxExpr(const MatrixType &mat, const MemberOp &func=MemberOp())
Block< Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > RowXpr
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
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.
ReturnType< internal::member_minCoeff >::Type MinCoeffReturnType
NumTraits< Scalar >::Real RealScalar
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
PartialReduxExpr< ExpressionType, internal::member_lpnorm< p, RealScalar >, Direction > Type
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType< typename ReturnType< internal::member_norm, RealScalar >::Type >::Type > normalized() const
const EIGEN_DEVICE_FUNC MeanReturnType mean() const
Pseudo expression providing partial reduction operations.
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)
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Reverse< ExpressionType, Direction > ReverseReturnType
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise() const
#define EIGEN_STATIC_ASSERT_ARRAYXPR(Derived)
Reverse< const ExpressionType, Direction > ConstReverseReturnType
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
EIGEN_MEMBER_FUNCTOR(squaredNorm, Size *NumTraits< Scalar >::MulCost+(Size-1) *NumTraits< Scalar >::AddCost)
internal::dense_xpr_base< PartialReduxExpr >::type Base
internal::ref_selector< ExpressionType >::non_const_type ExpressionTypeNested
const EIGEN_DEVICE_FUNC MaxCoeffReturnType maxCoeff() const
ReturnType< internal::member_squaredNorm, RealScalar >::Type SquaredNormReturnType
MatrixType::Scalar InputScalar
result_of< BinaryOp(const Scalar &, const Scalar &) >::type result_type
traits< MatrixType >::StorageKind StorageKind
Expression of one (or a set of) homogeneous vector(s)
EIGEN_DEVICE_FUNC void reverseInPlace()
EIGEN_DEVICE_FUNC void normalize()
ReturnType< internal::member_stableNorm, RealScalar >::Type StableNormReturnType
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
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise() const
ReturnType< internal::member_norm, RealScalar >::Type NormReturnType
Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> ReplicateReturnType
EIGEN_DEVICE_FUNC Index rows() const
PartialReduxExpr< ExpressionType, Functor< Scalar_ >, Direction > Type
EIGEN_DEVICE_FUNC ResultType operator()(const XprType &mat) const
const EIGEN_DEVICE_FUNC HNormalizedReturnType hnormalized() const
column or row-wise homogeneous normalization
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.
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 Index cols() const
EIGEN_DEVICE_FUNC ExpressionType & operator*=(const DenseBase< OtherDerived > &other)
const EIGEN_DEVICE_FUNC AnyReturnType any() const
Homogeneous< ExpressionType, Direction > HomogeneousReturnType
ReturnType< internal::member_mean >::Type MeanReturnType
EIGEN_DEVICE_FUNC SubVector subVector(Index i)
internal::conditional< isVertical, typename ExpressionType::ColXpr, typename ExpressionType::RowXpr >::type SubVector
EIGEN_DEVICE_FUNC CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const ExpressionTypeNestedCleaned, const typename ExtendedType< OtherDerived >::Type > operator/(const DenseBase< OtherDerived > &other) const
const EIGEN_DEVICE_FUNC BlueNormReturnType blueNorm() const
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ColXpr
const EIGEN_DEVICE_FUNC ProdReturnType prod() const
const EIGEN_DEVICE_FUNC AllReturnType all() const
EIGEN_DEVICE_FUNC member_redux(const BinaryOp func)
EIGEN_DEVICE_FUNC ExpressionType & operator-=(const DenseBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC Index subVectors() 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
MatrixType::Nested m_matrix
ExpressionTypeNested m_matrix
@ HNormalized_SizeMinusOne
const EIGEN_DEVICE_FUNC SumReturnType sum() const
EIGEN_DEVICE_FUNC VectorwiseOp(ExpressionType &matrix)
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)
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.
const EIGEN_DEVICE_FUNC StableNormReturnType stableNorm() const
PartialReduxExpr< ExpressionType, internal::member_count< Index >, Direction > CountReturnType
const EIGEN_DEVICE_FUNC ConstReverseReturnType reverse() const
ReturnType< internal::member_hypotNorm, RealScalar >::Type HypotNormReturnType
ReturnType< internal::member_sum >::Type SumReturnType
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 EIGEN_DEVICE_FUNC ReplicateReturnType replicate(Index factor) 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
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:07:15