Pseudo expression providing broadcasting and partial reduction operations. More...
#include <ForwardDeclarations.h>
Classes | |
struct | ExtendedType |
struct | LpNormReturnType |
struct | OppositeExtendedType |
struct | ReduxReturnType |
struct | ReturnType |
Public Types | |
enum | { isVertical = (Direction==Vertical) ? 1 : 0, isHorizontal = (Direction==Horizontal) ? 1 : 0 } |
enum | { HNormalized_Size, HNormalized_SizeMinusOne = HNormalized_Size==Dynamic ? Dynamic : HNormalized_Size-1 } |
typedef ReturnType< internal::member_all >::Type | AllReturnType |
typedef ReturnType< internal::member_any >::Type | AnyReturnType |
typedef ReturnType< internal::member_blueNorm, RealScalar >::Type | BlueNormReturnType |
typedef internal::subvector_stl_iterator< const ExpressionType, DirectionType(Direction)> | const_iterator |
typedef internal::subvector_stl_reverse_iterator< const ExpressionType, DirectionType(Direction)> | const_reverse_iterator |
typedef Reverse< const ExpressionType, Direction > | ConstReverseReturnType |
typedef PartialReduxExpr< ExpressionType, internal::member_count< Index, Scalar >, Direction > | CountReturnType |
typedef ExpressionType::PlainObject | CrossReturnType |
typedef internal::ref_selector< ExpressionType >::non_const_type | ExpressionTypeNested |
typedef internal::remove_all< ExpressionTypeNested >::type | ExpressionTypeNestedCleaned |
typedef 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 |
typedef Block< const ExpressionType, Direction==Vertical ? 1 :int(internal::traits< ExpressionType >::RowsAtCompileTime), Direction==Horizontal ? 1 :int(internal::traits< ExpressionType >::ColsAtCompileTime)> | HNormalized_Factors |
typedef 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 |
typedef Homogeneous< ExpressionType, Direction > | HomogeneousReturnType |
typedef ReturnType< internal::member_hypotNorm, RealScalar >::Type | HypotNormReturnType |
typedef Eigen::Index | Index |
typedef internal::subvector_stl_iterator< ExpressionType, DirectionType(Direction)> | iterator |
typedef ReturnType< internal::member_maxCoeff >::Type | MaxCoeffReturnType |
typedef ReturnType< internal::member_minCoeff >::Type | MinCoeffReturnType |
typedef CwiseUnaryOp< internal::scalar_sqrt_op< RealScalar >, const SquaredNormReturnType > | NormReturnType |
typedef ReturnType< internal::member_prod >::Type | ProdReturnType |
typedef ExpressionType::RealScalar | RealScalar |
typedef Replicate< ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> | ReplicateReturnType |
typedef internal::subvector_stl_reverse_iterator< ExpressionType, DirectionType(Direction)> | reverse_iterator |
typedef Reverse< ExpressionType, Direction > | ReverseReturnType |
typedef ExpressionType::Scalar | Scalar |
typedef PartialReduxExpr< const CwiseUnaryOp< internal::scalar_abs2_op< Scalar >, const ExpressionTypeNestedCleaned >, internal::member_sum< RealScalar, RealScalar >, Direction > | SquaredNormReturnType |
typedef ReturnType< internal::member_stableNorm, RealScalar >::Type | StableNormReturnType |
typedef ReturnType< internal::member_sum >::Type | SumReturnType |
Protected Member Functions | |
template<typename OtherDerived > | |
EIGEN_DEVICE_FUNC ExtendedType< OtherDerived >::Type | extendedTo (const DenseBase< OtherDerived > &other) const |
template<typename OtherDerived > | |
EIGEN_DEVICE_FUNC OppositeExtendedType< OtherDerived >::Type | extendedToOpposite (const DenseBase< OtherDerived > &other) const |
Index | redux_length () const |
Protected Attributes | |
ExpressionTypeNested | m_matrix |
Pseudo expression providing broadcasting and partial reduction operations.
ExpressionType | the type of the object on which to do partial reductions |
Direction | indicates whether to operate on columns (Vertical) or rows (Horizontal) |
This class represents a pseudo expression with broadcasting and partial reduction features. It is the return type of DenseBase::colwise() and DenseBase::rowwise() and most of the time this is the only way it is explicitly used.
To understand the logic of rowwise/colwise expression, let's consider a generic case A.colwise().foo()
where foo
is any method of VectorwiseOp
. This expression is equivalent to applying foo()
to each column of A
and then re-assemble the outputs in a matrix expression:
Example:
Output:
The begin() and end() methods are obviously exceptions to the previous rule as they return STL-compatible begin/end iterators to the rows or columns of the nested expression. Typical use cases include for-range-loop and calls to STL algorithms:
Example:
Output:
For a partial reduction on an empty input, some rules apply. For the sake of clarity, let's consider a vertical reduction:
MatrixXd(n,0).colwise().prod()
)Definition at line 264 of file ForwardDeclarations.h.
typedef ReturnType<internal::member_all>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::AllReturnType |
Definition at line 352 of file VectorwiseOp.h.
typedef ReturnType<internal::member_any>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::AnyReturnType |
Definition at line 353 of file VectorwiseOp.h.
typedef ReturnType<internal::member_blueNorm,RealScalar>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::BlueNormReturnType |
Definition at line 347 of file VectorwiseOp.h.
typedef internal::subvector_stl_iterator<const ExpressionType, DirectionType(Direction)> Eigen::VectorwiseOp< ExpressionType, Direction >::const_iterator |
Definition at line 283 of file VectorwiseOp.h.
typedef internal::subvector_stl_reverse_iterator<const ExpressionType, DirectionType(Direction)> Eigen::VectorwiseOp< ExpressionType, Direction >::const_reverse_iterator |
Definition at line 285 of file VectorwiseOp.h.
typedef Reverse<const ExpressionType, Direction> Eigen::VectorwiseOp< ExpressionType, Direction >::ConstReverseReturnType |
Definition at line 356 of file VectorwiseOp.h.
typedef PartialReduxExpr<ExpressionType, internal::member_count<Index,Scalar>, Direction> Eigen::VectorwiseOp< ExpressionType, Direction >::CountReturnType |
Definition at line 354 of file VectorwiseOp.h.
typedef ExpressionType::PlainObject Eigen::VectorwiseOp< ExpressionType, Direction >::CrossReturnType |
Definition at line 712 of file VectorwiseOp.h.
typedef internal::ref_selector<ExpressionType>::non_const_type Eigen::VectorwiseOp< ExpressionType, Direction >::ExpressionTypeNested |
Definition at line 193 of file VectorwiseOp.h.
typedef internal::remove_all<ExpressionTypeNested>::type Eigen::VectorwiseOp< ExpressionType, Direction >::ExpressionTypeNestedCleaned |
Definition at line 194 of file VectorwiseOp.h.
typedef Block<const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) : int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) : int(internal::traits<ExpressionType>::ColsAtCompileTime)> Eigen::VectorwiseOp< ExpressionType, Direction >::HNormalized_Block |
Definition at line 727 of file VectorwiseOp.h.
typedef Block<const ExpressionType, Direction==Vertical ? 1 : int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? 1 : int(internal::traits<ExpressionType>::ColsAtCompileTime)> Eigen::VectorwiseOp< ExpressionType, Direction >::HNormalized_Factors |
Definition at line 731 of file VectorwiseOp.h.
typedef 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> > Eigen::VectorwiseOp< ExpressionType, Direction >::HNormalizedReturnType |
Definition at line 737 of file VectorwiseOp.h.
typedef Homogeneous<ExpressionType,Direction> Eigen::VectorwiseOp< ExpressionType, Direction >::HomogeneousReturnType |
Definition at line 708 of file VectorwiseOp.h.
typedef ReturnType<internal::member_hypotNorm,RealScalar>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::HypotNormReturnType |
Definition at line 349 of file VectorwiseOp.h.
typedef Eigen::Index Eigen::VectorwiseOp< ExpressionType, Direction >::Index |
Definition at line 192 of file VectorwiseOp.h.
typedef internal::subvector_stl_iterator<ExpressionType, DirectionType(Direction)> Eigen::VectorwiseOp< ExpressionType, Direction >::iterator |
Definition at line 282 of file VectorwiseOp.h.
typedef ReturnType<internal::member_maxCoeff>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::MaxCoeffReturnType |
Definition at line 344 of file VectorwiseOp.h.
typedef ReturnType<internal::member_minCoeff>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::MinCoeffReturnType |
Definition at line 343 of file VectorwiseOp.h.
typedef CwiseUnaryOp<internal::scalar_sqrt_op<RealScalar>, const SquaredNormReturnType> Eigen::VectorwiseOp< ExpressionType, Direction >::NormReturnType |
Definition at line 346 of file VectorwiseOp.h.
typedef ReturnType<internal::member_prod>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::ProdReturnType |
Definition at line 355 of file VectorwiseOp.h.
typedef ExpressionType::RealScalar Eigen::VectorwiseOp< ExpressionType, Direction >::RealScalar |
Definition at line 191 of file VectorwiseOp.h.
typedef Replicate<ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> Eigen::VectorwiseOp< ExpressionType, Direction >::ReplicateReturnType |
Definition at line 552 of file VectorwiseOp.h.
typedef internal::subvector_stl_reverse_iterator<ExpressionType, DirectionType(Direction)> Eigen::VectorwiseOp< ExpressionType, Direction >::reverse_iterator |
Definition at line 284 of file VectorwiseOp.h.
typedef Reverse<ExpressionType, Direction> Eigen::VectorwiseOp< ExpressionType, Direction >::ReverseReturnType |
Definition at line 357 of file VectorwiseOp.h.
typedef ExpressionType::Scalar Eigen::VectorwiseOp< ExpressionType, Direction >::Scalar |
Definition at line 190 of file VectorwiseOp.h.
typedef PartialReduxExpr<const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const ExpressionTypeNestedCleaned>,internal::member_sum<RealScalar,RealScalar>,Direction> Eigen::VectorwiseOp< ExpressionType, Direction >::SquaredNormReturnType |
Definition at line 345 of file VectorwiseOp.h.
typedef ReturnType<internal::member_stableNorm,RealScalar>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::StableNormReturnType |
Definition at line 348 of file VectorwiseOp.h.
typedef ReturnType<internal::member_sum>::Type Eigen::VectorwiseOp< ExpressionType, Direction >::SumReturnType |
Definition at line 350 of file VectorwiseOp.h.
anonymous enum |
Enumerator | |
---|---|
isVertical | |
isHorizontal |
Definition at line 213 of file VectorwiseOp.h.
anonymous enum |
Enumerator | |
---|---|
HNormalized_Size | |
HNormalized_SizeMinusOne |
Definition at line 717 of file VectorwiseOp.h.
|
inlineexplicit |
Definition at line 268 of file VectorwiseOp.h.
|
inline |
Definition at line 272 of file VectorwiseOp.h.
|
inline |
true
. This expression can be assigned to a vector with entries of type bool
.Definition at line 496 of file VectorwiseOp.h.
|
inline |
true
. This expression can be assigned to a vector with entries of type bool
.Definition at line 505 of file VectorwiseOp.h.
|
inline |
returns an iterator to the first row (rowwise) or column (colwise) of the nested expression.
Definition at line 291 of file VectorwiseOp.h.
|
inline |
const version of begin()
Definition at line 293 of file VectorwiseOp.h.
|
inline |
Definition at line 446 of file VectorwiseOp.h.
|
inline |
const version of begin()
Definition at line 295 of file VectorwiseOp.h.
|
inline |
const version of end()
Definition at line 313 of file VectorwiseOp.h.
|
inline |
true
coefficients of each respective column (or row). This expression can be assigned to a vector whose entries have the same type as is used to index entries of the original matrix; for dense matrices, this is std::ptrdiff_t
.Example:
Output:
Definition at line 518 of file VectorwiseOp.h.
|
inline |
const version of rbegin()
Definition at line 304 of file VectorwiseOp.h.
|
inline |
const version of rend()
Definition at line 322 of file VectorwiseOp.h.
typedef Eigen::VectorwiseOp< ExpressionType, Direction >::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE | ( | SumReturnType | , |
Scalar | , | ||
quotient | |||
) |
|
inline |
returns an iterator to the row (resp. column) following the last row (resp. column) of the nested expression
Definition at line 309 of file VectorwiseOp.h.
|
inline |
const version of end()
Definition at line 311 of file VectorwiseOp.h.
|
inlineprotected |
Definition at line 231 of file VectorwiseOp.h.
|
inlineprotected |
Definition at line 254 of file VectorwiseOp.h.
|
inline |
Definition at line 468 of file VectorwiseOp.h.
|
inline |
Example:
Output:
Definition at line 435 of file VectorwiseOp.h.
|
inline |
*this
contains NaN.Example:
Output:
Definition at line 395 of file VectorwiseOp.h.
|
inline |
Definition at line 487 of file VectorwiseOp.h.
|
inline |
*this
contains NaN.Example:
Output:
Definition at line 376 of file VectorwiseOp.h.
|
inline |
Example:
Output:
Definition at line 422 of file VectorwiseOp.h.
|
inline |
Normalize in-place each row or columns of the referenced matrix.
Definition at line 700 of file VectorwiseOp.h.
|
inline |
Definition at line 694 of file VectorwiseOp.h.
|
inline |
Returns the expression where each subvector is the product of the vector other by the corresponding subvector of *this
Definition at line 663 of file VectorwiseOp.h.
|
inline |
Multiples each subvector of *this
by the vector other
Definition at line 610 of file VectorwiseOp.h.
|
inline |
Returns the expression of the sum of the vector other to each subvector of *this
Definition at line 636 of file VectorwiseOp.h.
|
inline |
Adds the vector other to each subvector of *this
Definition at line 590 of file VectorwiseOp.h.
|
inline |
Returns the expression of the difference between each subvector of *this
and the vector other
Definition at line 649 of file VectorwiseOp.h.
|
inline |
Substracts the vector other to each subvector of *this
Definition at line 600 of file VectorwiseOp.h.
|
inline |
Returns the expression where each subvector is the quotient of the corresponding subvector of *this
by the vector other
Definition at line 678 of file VectorwiseOp.h.
|
inline |
Divides each subvector of *this
by the vector other
Definition at line 622 of file VectorwiseOp.h.
|
inline |
Copies the vector other to each subvector of *this
Definition at line 579 of file VectorwiseOp.h.
|
inline |
Example:
Output:
Definition at line 529 of file VectorwiseOp.h.
|
inline |
returns a reverse iterator to the last row (rowwise) or column (colwise) of the nested expression.
Definition at line 300 of file VectorwiseOp.h.
|
inline |
const version of rbegin()
Definition at line 302 of file VectorwiseOp.h.
|
inline |
*this
reduxed by func The template parameter BinaryOp is the type of the functor of the custom redux operator. Note that func must be an associative operator.
Definition at line 337 of file VectorwiseOp.h.
|
inlineprotected |
Definition at line 747 of file VectorwiseOp.h.
|
inline |
returns a reverse iterator to the row (resp. column) before the first row (resp. column) of the nested expression
Definition at line 318 of file VectorwiseOp.h.
|
inline |
const version of rend()
Definition at line 320 of file VectorwiseOp.h.
EIGEN_DEVICE_FUNC const VectorwiseOp< ExpressionType, Direction >::ReplicateReturnType Eigen::VectorwiseOp< ExpressionType, Direction >::replicate | ( | Index | factor | ) | const |
*this
Example:
Output:
Definition at line 134 of file Replicate.h.
|
inline |
*this
Example:
Output:
Definition at line 568 of file VectorwiseOp.h.
|
inline |
Example:
Output:
Definition at line 541 of file VectorwiseOp.h.
|
inline |
Definition at line 549 of file VectorwiseOp.h.
|
inline |
This is the "in place" version of VectorwiseOp::reverse: it reverses each column or row of *this
.
In most cases it is probably better to simply use the reversed expression of a matrix. However, when reversing the matrix data itself is really needed, then this "in-place" version is probably the right choice because it provides the following additional benefits:
|
inline |
Example:
Output:
Definition at line 410 of file VectorwiseOp.h.
|
inline |
Definition at line 457 of file VectorwiseOp.h.
|
inline |
Example:
Output:
Definition at line 479 of file VectorwiseOp.h.
|
protected |
Definition at line 751 of file VectorwiseOp.h.