Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
VectorwiseOp< ExpressionType, Direction > Class Template Reference

Pseudo expression providing partial reduction operations. More...

#include <VectorwiseOp.h>

List of all members.

Classes

struct  ExtendedType
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 ExpressionType::PlainObject CrossReturnType
typedef internal::conditional
< internal::must_nest_by_value
< ExpressionType >::ret,
ExpressionType, ExpressionType & >
::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 ExpressionType::Index Index
typedef ExpressionType::RealScalar RealScalar
typedef Replicate
< ExpressionType, Direction==Vertical?Dynamic:1,
Direction==Horizontal?Dynamic:1 > 
ReplicateReturnType
typedef ExpressionType::Scalar Scalar

Public Member Functions

const ExpressionType & _expression () const
const ReturnType
< internal::member_all >::Type 
all () const
const ReturnType
< internal::member_any >::Type 
any () const
const ReturnType
< internal::member_blueNorm,
RealScalar >::Type 
blueNorm () const
const PartialReduxExpr
< ExpressionType,
internal::member_count< Index >
, Direction > 
count () const
template<typename OtherDerived >
const CrossReturnType cross (const MatrixBase< OtherDerived > &other) const
const HNormalizedReturnType hnormalized () const
const ReturnType
< internal::member_hypotNorm,
RealScalar >::Type 
hypotNorm () const
const ReturnType
< internal::member_maxCoeff >
::Type 
maxCoeff () const
const ReturnType
< internal::member_mean >
::Type 
mean () const
const ReturnType
< internal::member_minCoeff >
::Type 
minCoeff () const
const ReturnType
< internal::member_norm,
RealScalar >::Type 
norm () const
template<typename OtherDerived >
EIGEN_STRONG_INLINE
CwiseBinaryOp
< internal::scalar_sum_op
< Scalar >, const
ExpressionTypeNestedCleaned,
const typename ExtendedType
< OtherDerived >::Type > 
operator+ (const DenseBase< OtherDerived > &other) const
template<typename OtherDerived >
ExpressionType & operator+= (const DenseBase< OtherDerived > &other)
template<typename OtherDerived >
CwiseBinaryOp
< internal::scalar_difference_op
< Scalar >, const
ExpressionTypeNestedCleaned,
const typename ExtendedType
< OtherDerived >::Type > 
operator- (const DenseBase< OtherDerived > &other) const
template<typename OtherDerived >
ExpressionType & operator-= (const DenseBase< OtherDerived > &other)
template<typename OtherDerived >
ExpressionType & operator= (const DenseBase< OtherDerived > &other)
const ReturnType
< internal::member_prod >
::Type 
prod () const
template<typename BinaryOp >
const ReduxReturnType
< BinaryOp >::Type 
redux (const BinaryOp &func=BinaryOp()) const
const ReplicateReturnType replicate (Index factor) const
template<int Factor>
const Replicate
< ExpressionType,(IsVertical?Factor:1),(IsHorizontal?Factor:1)> 
replicate (Index factor=Factor) const
const Reverse< ExpressionType,
Direction > 
reverse () const
const ReturnType
< internal::member_squaredNorm,
RealScalar >::Type 
squaredNorm () const
const ReturnType
< internal::member_stableNorm,
RealScalar >::Type 
stableNorm () const
const ReturnType
< internal::member_sum >::Type 
sum () const
 VectorwiseOp (ExpressionType &matrix)

Protected Types

typedef internal::conditional
< Direction==Vertical,
typename
ExpressionType::ColXpr,
typename
ExpressionType::RowXpr >::type 
SubVector

Protected Member Functions

template<typename OtherDerived >
ExtendedType< OtherDerived >::Type extendedTo (const DenseBase< OtherDerived > &other) const
SubVector subVector (Index i)
Index subVectors () const

Protected Attributes

ExpressionTypeNested m_matrix

Detailed Description

template<typename ExpressionType, int Direction>
class VectorwiseOp< ExpressionType, Direction >

Pseudo expression providing partial reduction operations.

Parameters:
ExpressionTypethe type of the object on which to do partial reductions
Directionindicates the direction of the redux (Vertical or Horizontal)

This class represents a pseudo expression with 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 used.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the sum of each column:" << endl << m.colwise().sum() << endl;
cout << "Here is the maximum absolute value of each column:"
     << endl << m.cwiseAbs().colwise().maxCoeff() << endl;

Output:

See also:
DenseBase::colwise(), DenseBase::rowwise(), class PartialReduxExpr

Definition at line 178 of file VectorwiseOp.h.


Member Typedef Documentation

template<typename ExpressionType, int Direction>
typedef ExpressionType::PlainObject VectorwiseOp< ExpressionType, Direction >::CrossReturnType

Definition at line 475 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef internal::conditional<internal::must_nest_by_value<ExpressionType>::ret, ExpressionType, ExpressionType&>::type VectorwiseOp< ExpressionType, Direction >::ExpressionTypeNested

Definition at line 186 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef internal::remove_all<ExpressionTypeNested>::type VectorwiseOp< ExpressionType, Direction >::ExpressionTypeNestedCleaned

Definition at line 187 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef Block<const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) : int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) : int(internal::traits<ExpressionType>::ColsAtCompileTime)> VectorwiseOp< ExpressionType, Direction >::HNormalized_Block

Definition at line 489 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef Block<const ExpressionType, Direction==Vertical ? 1 : int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? 1 : int(internal::traits<ExpressionType>::ColsAtCompileTime)> VectorwiseOp< ExpressionType, Direction >::HNormalized_Factors

Definition at line 493 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
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> > VectorwiseOp< ExpressionType, Direction >::HNormalizedReturnType

Definition at line 499 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef ExpressionType::Index VectorwiseOp< ExpressionType, Direction >::Index

Definition at line 184 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef ExpressionType::RealScalar VectorwiseOp< ExpressionType, Direction >::RealScalar

Definition at line 183 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef Replicate<ExpressionType,Direction==Vertical?Dynamic:1,Direction==Horizontal?Dynamic:1> VectorwiseOp< ExpressionType, Direction >::ReplicateReturnType

Definition at line 395 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef ExpressionType::Scalar VectorwiseOp< ExpressionType, Direction >::Scalar

Definition at line 182 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
typedef internal::conditional<Direction==Vertical, typename ExpressionType::ColXpr, typename ExpressionType::RowXpr>::type VectorwiseOp< ExpressionType, Direction >::SubVector [protected]

Definition at line 217 of file VectorwiseOp.h.


Member Enumeration Documentation

template<typename ExpressionType, int Direction>
anonymous enum
Enumerator:
IsVertical 
IsHorizontal 

Definition at line 206 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
anonymous enum
Enumerator:
HNormalized_Size 
HNormalized_SizeMinusOne 

Definition at line 479 of file VectorwiseOp.h.


Constructor & Destructor Documentation

template<typename ExpressionType, int Direction>
VectorwiseOp< ExpressionType, Direction >::VectorwiseOp ( ExpressionType &  matrix) [inline]

Definition at line 249 of file VectorwiseOp.h.


Member Function Documentation

template<typename ExpressionType, int Direction>
const ExpressionType& VectorwiseOp< ExpressionType, Direction >::_expression ( ) const [inline]

Definition at line 252 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_all>::Type VectorwiseOp< ExpressionType, Direction >::all ( void  ) const [inline]
Returns:
a row (or column) vector expression representing whether all coefficients of each respective column (or row) are true.
See also:
DenseBase::all()

Definition at line 354 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_any>::Type VectorwiseOp< ExpressionType, Direction >::any ( void  ) const [inline]
Returns:
a row (or column) vector expression representing whether at least one coefficient of each respective column (or row) is true.
See also:
DenseBase::any()

Definition at line 361 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_blueNorm,RealScalar>::Type VectorwiseOp< ExpressionType, Direction >::blueNorm ( ) const [inline]
Returns:
a row (or column) vector expression of the norm of each column (or row) of the referenced expression, using blue's algorithm.
See also:
DenseBase::blueNorm()

Definition at line 312 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const PartialReduxExpr<ExpressionType, internal::member_count<Index>, Direction> VectorwiseOp< ExpressionType, Direction >::count ( ) const [inline]
Returns:
a row (or column) vector expression representing the number of true coefficients of each respective column (or row).

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl << (m.array() >= 0.5).rowwise().count() << endl;

Output:

See also:
DenseBase::count()

Definition at line 371 of file VectorwiseOp.h.

template<typename ExpressionType , int Direction>
template<typename OtherDerived >
const VectorwiseOp< ExpressionType, Direction >::CrossReturnType VectorwiseOp< ExpressionType, Direction >::cross ( const MatrixBase< OtherDerived > &  other) const
Returns:
a matrix expression of the cross product of each column or row of the referenced expression with the other vector.

The referenced matrix must have one dimension equal to 3. The result matrix has the same dimensions than the referenced one.

See also:
MatrixBase::cross()

Definition at line 114 of file OrthoMethods.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
ExtendedType<OtherDerived>::Type VectorwiseOp< ExpressionType, Direction >::extendedTo ( const DenseBase< OtherDerived > &  other) const [inline, protected]

Definition at line 238 of file VectorwiseOp.h.

template<typename ExpressionType , int Direction>
const VectorwiseOp< ExpressionType, Direction >::HNormalizedReturnType VectorwiseOp< ExpressionType, Direction >::hnormalized ( ) const [inline]
Returns:
an expression of the homogeneous normalized vector of *this

Example:

Output:

See also:
MatrixBase::hnormalized()

Definition at line 189 of file Homogeneous.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_hypotNorm,RealScalar>::Type VectorwiseOp< ExpressionType, Direction >::hypotNorm ( ) const [inline]
Returns:
a row (or column) vector expression of the norm of each column (or row) of the referenced expression, avoiding underflow and overflow using a concatenation of hypot() calls.
See also:
DenseBase::hypotNorm()

Definition at line 330 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_maxCoeff>::Type VectorwiseOp< ExpressionType, Direction >::maxCoeff ( ) const [inline]
Returns:
a row (or column) vector expression of the largest coefficient of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the maximum of each column:" << endl << m.colwise().maxCoeff() << endl;

Output:

See also:
DenseBase::maxCoeff()

Definition at line 283 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_mean>::Type VectorwiseOp< ExpressionType, Direction >::mean ( ) const [inline]
Returns:
a row (or column) vector expression of the mean of each column (or row) of the referenced expression.
See also:
DenseBase::mean()

Definition at line 347 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_minCoeff>::Type VectorwiseOp< ExpressionType, Direction >::minCoeff ( ) const [inline]
Returns:
a row (or column) vector expression of the smallest coefficient of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the minimum of each column:" << endl << m.colwise().minCoeff() << endl;

Output:

See also:
DenseBase::minCoeff()

Definition at line 273 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_norm,RealScalar>::Type VectorwiseOp< ExpressionType, Direction >::norm ( ) const [inline]
Returns:
a row (or column) vector expression of the norm of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the norm of each column:" << endl << m.colwise().norm() << endl;

Output:

See also:
DenseBase::norm()

Definition at line 303 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
EIGEN_STRONG_INLINE CwiseBinaryOp<internal::scalar_sum_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> VectorwiseOp< ExpressionType, Direction >::operator+ ( const DenseBase< OtherDerived > &  other) const [inline]

Returns the expression of the sum of the vector other to each subvector of *this

Definition at line 452 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
ExpressionType& VectorwiseOp< ExpressionType, Direction >::operator+= ( const DenseBase< OtherDerived > &  other) [inline]

Adds the vector other to each subvector of *this

Definition at line 429 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
CwiseBinaryOp<internal::scalar_difference_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> VectorwiseOp< ExpressionType, Direction >::operator- ( const DenseBase< OtherDerived > &  other) const [inline]

Returns the expression of the difference between each subvector of *this and the vector other

Definition at line 463 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
ExpressionType& VectorwiseOp< ExpressionType, Direction >::operator-= ( const DenseBase< OtherDerived > &  other) [inline]

Substracts the vector other to each subvector of *this

Definition at line 439 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename OtherDerived >
ExpressionType& VectorwiseOp< ExpressionType, Direction >::operator= ( const DenseBase< OtherDerived > &  other) [inline]

Copies the vector other to each subvector of *this

Definition at line 418 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_prod>::Type VectorwiseOp< ExpressionType, Direction >::prod ( ) const [inline]
Returns:
a row (or column) vector expression of the product of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the product of each row:" << endl << m.rowwise().prod() << endl;

Output:

See also:
DenseBase::prod()

Definition at line 381 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
template<typename BinaryOp >
const ReduxReturnType<BinaryOp>::Type VectorwiseOp< ExpressionType, Direction >::redux ( const BinaryOp &  func = BinaryOp()) const [inline]
Returns:
a row or column vector expression of *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.

See also:
class VectorwiseOp, DenseBase::colwise(), DenseBase::rowwise()

Definition at line 263 of file VectorwiseOp.h.

template<typename ExpressionType , int Direction>
const VectorwiseOp< ExpressionType, Direction >::ReplicateReturnType VectorwiseOp< ExpressionType, Direction >::replicate ( Index  factor) const
Returns:
an expression of the replication of each column (or row) of *this

Example:

Vector3i v = Vector3i::Random();
cout << "Here is the vector v:" << endl << v << endl;
cout << "v.rowwise().replicate(5) = ..." << endl;
cout << v.rowwise().replicate(5) << endl;

Output:

See also:
VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate

Definition at line 173 of file Replicate.h.

template<typename ExpressionType, int Direction>
template<int Factor>
const Replicate<ExpressionType,(IsVertical?Factor:1),(IsHorizontal?Factor:1)> VectorwiseOp< ExpressionType, Direction >::replicate ( Index  factor = Factor) const [inline]
Returns:
an expression of the replication of each column (or row) of *this

Example:

MatrixXi m = MatrixXi::Random(2,3);
cout << "Here is the matrix m:" << endl << m << endl;
cout << "m.colwise().replicate<3>() = ..." << endl;
cout << m.colwise().replicate<3>() << endl;

Output:

See also:
VectorwiseOp::replicate(Index), DenseBase::replicate(), class Replicate

Definition at line 408 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const Reverse<ExpressionType, Direction> VectorwiseOp< ExpressionType, Direction >::reverse ( ) const [inline]
Returns:
a matrix expression where each column (or row) are reversed.

Example:

MatrixXi m = MatrixXi::Random(3,4);
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the rowwise reverse of m:" << endl << m.rowwise().reverse() << endl;
cout << "Here is the colwise reverse of m:" << endl << m.colwise().reverse() << endl;

cout << "Here is the coefficient (1,0) in the rowise reverse of m:" << endl
<< m.rowwise().reverse()(1,0) << endl;
cout << "Let us overwrite this coefficient with the value 4." << endl;
//m.colwise().reverse()(1,0) = 4;
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
DenseBase::reverse()

Definition at line 392 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_squaredNorm,RealScalar>::Type VectorwiseOp< ExpressionType, Direction >::squaredNorm ( ) const [inline]
Returns:
a row (or column) vector expression of the squared norm of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the square norm of each row:" << endl << m.rowwise().squaredNorm() << endl;

Output:

See also:
DenseBase::squaredNorm()

Definition at line 293 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_stableNorm,RealScalar>::Type VectorwiseOp< ExpressionType, Direction >::stableNorm ( ) const [inline]
Returns:
a row (or column) vector expression of the norm of each column (or row) of the referenced expression, avoiding underflow and overflow.
See also:
DenseBase::stableNorm()

Definition at line 321 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
SubVector VectorwiseOp< ExpressionType, Direction >::subVector ( Index  i) [inline, protected]

Definition at line 218 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
Index VectorwiseOp< ExpressionType, Direction >::subVectors ( ) const [inline, protected]

Definition at line 225 of file VectorwiseOp.h.

template<typename ExpressionType, int Direction>
const ReturnType<internal::member_sum>::Type VectorwiseOp< ExpressionType, Direction >::sum ( ) const [inline]
Returns:
a row (or column) vector expression of the sum of each column (or row) of the referenced expression.

Example:

Matrix3d m = Matrix3d::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is the sum of each row:" << endl << m.rowwise().sum() << endl;

Output:

See also:
DenseBase::sum()

Definition at line 340 of file VectorwiseOp.h.


Member Data Documentation

template<typename ExpressionType, int Direction>
ExpressionTypeNested VectorwiseOp< ExpressionType, Direction >::m_matrix [protected]

Definition at line 504 of file VectorwiseOp.h.


The documentation for this class was generated from the following files:


re_vision
Author(s): Dorian Galvez-Lopez
autogenerated on Sun Jan 5 2014 11:34:29