template<typename ExpressionType, int Direction>
          VectorwiseOp class
        
        Pseudo expression providing broadcasting and partial reduction operations.
| Template parameters | |
|---|---|
| ExpressionType | the type of the object on which to do partial reductions | 
| Direction | indicates whether to operate on columns (Vertical) or rows (Horizontal) | 
Contents
This class represents a pseudo expression with broadcasting and partial reduction features. It is the return type of DenseBase::
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: [A.col(0).foo(), A.col(1).foo(), ..., A.col(A.cols()-1).foo()]
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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the sum of each column: 1.04 0.815 -0.238 Here is the maximum absolute value of each column: 0.68 0.823 0.536
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:
Matrix3i m = Matrix3i::Random(); cout << "Here is the initial matrix m:" << endl << m << endl; int i = -1; for(auto c: m.colwise()) { c *= i; ++i; } cout << "Here is the matrix m after the for-range-loop:" << endl << m << endl; auto cols = m.colwise(); auto it = std::find_if(cols.cbegin(), cols.cend(), [](Matrix3i::ConstColXpr x) { return x.squaredNorm() == 0; }); cout << "The first empty column is: " << distance(cols.cbegin(),it) << endl;
Output:
Here is the initial matrix m: 7 6 -3 -2 9 6 6 -6 -5 Here is the matrix m after the for-range-loop: -7 0 -3 2 0 6 -6 0 -5 The first empty column is: 1
For a partial reduction on an empty input, some rules apply. For the sake of clarity, let's consider a vertical reduction:
- If the number of columns is zero, then a 1x0 row-major vector expression is returned.
- Otherwise, if the number of rows is zero, then- a row vector of zeros is returned for sum-like reductions (sum, squaredNorm, norm, etc.)
- a row vector of ones is returned for a product reduction (e.g., MatrixXd(n,0).colwise().prod())
- an assert is triggered for all other reductions (minCoeff,maxCoeff,redux(bin_op))
 
Public types
- enum (anonymous) { isVertical = (Direction==Vertical) ? 1 : 0, isHorizontal = (Direction==Horizontal) ? 1 : 0 }
- enum (anonymous) { HNormalized_Size = Direction==Vertical ? internal::traits<ExpressionType>::RowsAtCompileTime : internal::traits<ExpressionType>::ColsAtCompileTime, HNormalized_SizeMinusOne = HNormalized_Size==Dynamic ? Dynamic : HNormalized_Size-1 }
- using AllReturnType = ReturnType<internal::member_all>::Type
- using AnyReturnType = ReturnType<internal::member_any>::Type
- using BlueNormReturnType = ReturnType<internal::member_blueNorm, RealScalar>::Type
- using ConstReverseReturnType = Reverse<const ExpressionType, Direction>
- using CountReturnType = PartialReduxExpr<ExpressionType, internal::member_count<Index, Scalar>, Direction>
- using CrossReturnType = ExpressionType::PlainObject
- using ExpressionTypeNested = internal::ref_selector<ExpressionType>::non_const_type
- using ExpressionTypeNestedCleaned = internal::remove_all<ExpressionTypeNested>::type
- using HNormalized_Block = Block<const ExpressionType, Direction==Vertical ? int(HNormalized_SizeMinusOne) :int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? int(HNormalized_SizeMinusOne) :int(internal::traits<ExpressionType>::ColsAtCompileTime)>
- using HNormalized_Factors = Block<const ExpressionType, Direction==Vertical ? 1 :int(internal::traits<ExpressionType>::RowsAtCompileTime), Direction==Horizontal ? 1 :int(internal::traits<ExpressionType>::ColsAtCompileTime)>
- 
              using HNormalizedReturnType = 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>> 
- using HomogeneousReturnType = Homogeneous<ExpressionType, Direction>
- using HypotNormReturnType = ReturnType<internal::member_hypotNorm, RealScalar>::Type
- 
              using Index = Eigen::Index deprecated 
- using MaxCoeffReturnType = ReturnType<internal::member_maxCoeff>::Type
- using MinCoeffReturnType = ReturnType<internal::member_minCoeff>::Type
- using NormReturnType = CwiseUnaryOp<internal::scalar_sqrt_op<RealScalar>, const SquaredNormReturnType>
- using ProdReturnType = ReturnType<internal::member_prod>::Type
- using RealScalar = ExpressionType::RealScalar
- using ReplicateReturnType = Replicate<ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)>
- using ReverseReturnType = Reverse<ExpressionType, Direction>
- using Scalar = ExpressionType::Scalar
- using SquaredNormReturnType = PartialReduxExpr<const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const ExpressionTypeNestedCleaned>, internal::member_sum<RealScalar, RealScalar>, Direction>
- using StableNormReturnType = ReturnType<internal::member_stableNorm, RealScalar>::Type
- using SumReturnType = ReturnType<internal::member_sum>::Type
Constructors, destructors, conversion operators
- VectorwiseOp(ExpressionType& matrix) explicit
Public functions
- auto _expression() const -> const ExpressionType&
- auto all() const -> const AllReturnType
- auto any() const -> const AnyReturnType
- auto begin() const -> iterator
- auto blueNorm() const -> const BlueNormReturnType
- 
              auto cbegin() const -> const_iterator 
- 
              auto cend() const -> const_iterator 
- auto count() const -> const CountReturnType
- 
              template<typename OtherDerived>auto cross(const MatrixBase<OtherDerived>& other) const -> const CrossReturnType
- auto EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(SumReturnType, Scalar, quotient) MeanReturnType -> typedef
- auto end() const -> iterator
- auto hnormalized() const -> const HNormalizedReturnType
- column or row-wise homogeneous normalization
- auto homogeneous() const -> HomogeneousReturnType
- auto hypotNorm() const -> const HypotNormReturnType
- 
              template<int p>auto lpNorm() const -> const LpNormReturnType<p>::Type
- auto maxCoeff() const -> const MaxCoeffReturnType
- auto mean() const -> const MeanReturnType
- auto minCoeff() const -> const MinCoeffReturnType
- auto norm() const -> const NormReturnType
- void normalize()
- auto normalized() const -> CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType<NormReturnType>::Type>
- 
              template<typename OtherDerived>auto operator*(const DenseBase<OtherDerived>& other) const -> CwiseBinaryOp<internal::scalar_product_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
- 
              template<typename OtherDerived>auto operator*=(const DenseBase<OtherDerived>& other) -> ExpressionType&
- 
              template<typename OtherDerived>auto operator+(const DenseBase<OtherDerived>& other) const -> CwiseBinaryOp<internal::scalar_sum_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
- 
              template<typename OtherDerived>auto operator+=(const DenseBase<OtherDerived>& other) -> ExpressionType&
- 
              template<typename OtherDerived>auto operator-(const DenseBase<OtherDerived>& other) const -> CwiseBinaryOp<internal::scalar_difference_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
- 
              template<typename OtherDerived>auto operator-=(const DenseBase<OtherDerived>& other) -> ExpressionType&
- 
              template<typename OtherDerived>auto operator/(const DenseBase<OtherDerived>& other) const -> CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type>
- 
              template<typename OtherDerived>auto operator/=(const DenseBase<OtherDerived>& other) -> ExpressionType&
- 
              template<typename OtherDerived>auto operator=(const DenseBase<OtherDerived>& other) -> ExpressionType&
- auto prod() const -> const ProdReturnType
- 
              template<typename BinaryOp>auto redux(const BinaryOp& func = BinaryOp()) const -> const ReduxReturnType<BinaryOp>::Type
- auto replicate(Index factor) const -> const ReplicateReturnType
- 
              template<int Factor>auto replicate(Index factor = Factor) const -> const Replicate<ExpressionType, isVertical*Factor+isHorizontal, isHorizontal*Factor+isVertical>
- auto reverse() const -> const ConstReverseReturnType
- auto reverse() -> ReverseReturnType
- void reverseInPlace()
- auto squaredNorm() const -> const SquaredNormReturnType
- auto stableNorm() const -> const StableNormReturnType
- auto sum() const -> const SumReturnType
Public variables
- random_access_iterator_type const_iterator
- random_access_iterator_type iterator
Protected functions
- 
              template<typename OtherDerived>auto extendedTo(const DenseBase<OtherDerived>& other) const -> ExtendedType<OtherDerived>::Type
- 
              template<typename OtherDerived>auto extendedToOpposite(const DenseBase<OtherDerived>& other) const -> OppositeExtendedType<OtherDerived>::Type
- auto redux_length() const -> Index
Protected variables
- ExpressionTypeNested m_matrix
Enum documentation
              
                template<typename ExpressionType, int Direction>
              
              enum Eigen::
            | Enumerators | |
|---|---|
| isVertical | |
| isHorizontal | 
              
                template<typename ExpressionType, int Direction>
              
              enum Eigen::
            | Enumerators | |
|---|---|
| HNormalized_Size | |
| HNormalized_SizeMinusOne | 
Typedef documentation
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_all>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_any>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_blueNorm, RealScalar>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef Reverse<const ExpressionType, Direction> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef PartialReduxExpr<ExpressionType, internal::member_count<Index, Scalar>, Direction> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ExpressionType::PlainObject Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef internal::ref_selector<ExpressionType>::non_const_type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef internal::remove_all<ExpressionTypeNested>::type Eigen::
          
              
                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)> Eigen::
          
              
                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)> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef CwiseBinaryOp<internal::scalar_quotient_op<typename internal::traits<ExpressionType>::Scalar>, const HNormalized_
          
              
                template<typename ExpressionType, int Direction>
              
              typedef Homogeneous<ExpressionType, Direction> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_hypotNorm, RealScalar>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_maxCoeff>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_minCoeff>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef CwiseUnaryOp<internal::scalar_sqrt_op<RealScalar>, const SquaredNormReturnType> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_prod>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ExpressionType::RealScalar Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef Replicate<ExpressionType,(isVertical?Dynamic:1),(isHorizontal?Dynamic:1)> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef Reverse<ExpressionType, Direction> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ExpressionType::Scalar Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef PartialReduxExpr<const CwiseUnaryOp<internal::scalar_abs2_op<Scalar>, const ExpressionTypeNestedCleaned>, internal::member_sum<RealScalar, RealScalar>, Direction> Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_stableNorm, RealScalar>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              typedef ReturnType<internal::member_sum>::Type Eigen::
          Function documentation
              
                template<typename ExpressionType, int Direction>
              
               Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              const ExpressionType& Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              const AllReturnType Eigen::
            | Returns | a row (or column) vector expression representing whether all coefficients of each respective column (or row) are true. This expression can be assigned to a vector with entries of typebool. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              const AnyReturnType Eigen::
            | Returns | a row (or column) vector expression representing whether at least one coefficient of each respective column (or row) is true. This expression can be assigned to a vector with entries of typebool. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              const BlueNormReturnType Eigen::
            | Returns | a row (or column) vector expression of the norm of each column (or row) of the referenced expression, using Blue's algorithm. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              const_
const version of begin()
              
                template<typename ExpressionType, int Direction>
              
              const_
const version of end()
              
                template<typename ExpressionType, int Direction>
              
              const CountReturnType Eigen::
            | Returns | a row (or column) vector expression representing the number of truecoefficients 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 isstd::ptrdiff_t. | 
|---|
Example:
Matrix3d m = Matrix3d::Random(); cout << "Here is the matrix m:" << endl << m << endl; Matrix<ptrdiff_t, 3, 1> res = (m.array() >= 0.5).rowwise().count(); cout << "Here is the count of elements larger or equal than 0.5 of each row:" << endl; cout << res << endl;
Output:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the count of elements larger or equal than 0.5 of each row: 2 2 1
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              const CrossReturnType Eigen::
            | Returns | a matrix expression of the cross product of each column or row of the referenced expression with the other vector. | 
|---|
This is defined in the Geometry module. #include <Eigen/Geometry>
The referenced matrix must have one dimension equal to 3. The result matrix has the same dimensions than the referenced one.
              
                template<typename ExpressionType, int Direction>
              
              typedef Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              const HNormalizedReturnType Eigen::
            column or row-wise homogeneous normalization
| Returns | an expression of the first N-1 coefficients of each column (or row) of *thisdivided by the last coefficient of each column (or row). | 
|---|
This is defined in the Geometry module. #include <Eigen/Geometry>
This can be used to convert homogeneous coordinates to affine coordinates.
It is conceptually equivalent to calling MatrixBase::*this.
Example:
Matrix4Xd M = Matrix4Xd::Random(4,5); Projective3d P(Matrix4d::Random()); cout << "The matrix M is:" << endl << M << endl << endl; cout << "M.colwise().hnormalized():" << endl << M.colwise().hnormalized() << endl << endl; cout << "P*M:" << endl << P*M << endl << endl; cout << "(P*M).colwise().hnormalized():" << endl << (P*M).colwise().hnormalized() << endl << endl;
Output:
The matrix M is: 0.68 0.823 -0.444 -0.27 0.271 -0.211 -0.605 0.108 0.0268 0.435 0.566 -0.33 -0.0452 0.904 -0.717 0.597 0.536 0.258 0.832 0.214 M.colwise().hnormalized(): 1.14 1.53 -1.72 -0.325 1.27 -0.354 -1.13 0.419 0.0322 2.03 0.949 -0.614 -0.175 1.09 -3.35 P*M: 0.186 -0.589 0.369 1.33 -1.23 -0.871 -0.337 0.127 -0.715 0.091 -0.158 -0.0104 0.312 0.429 -0.478 0.992 0.777 -0.373 0.468 -0.651 (P*M).colwise().hnormalized(): 0.188 -0.759 -0.989 2.85 1.89 -0.877 -0.433 -0.342 -1.53 -0.14 -0.16 -0.0134 -0.837 0.915 0.735
              
                template<typename ExpressionType, int Direction>
              
              HomogeneousReturnType Eigen::
            | Returns | an expression where the value 1 is symbolically appended as the final coefficient to each column (or row) of the matrix. | 
|---|
This is defined in the Geometry module. #include <Eigen/Geometry>
This can be used to convert affine coordinates to homogeneous coordinates.
Example:
Matrix3Xd M = Matrix3Xd::Random(3,5); Projective3d P(Matrix4d::Random()); cout << "The matrix M is:" << endl << M << endl << endl; cout << "M.colwise().homogeneous():" << endl << M.colwise().homogeneous() << endl << endl; cout << "P * M.colwise().homogeneous():" << endl << P * M.colwise().homogeneous() << endl << endl; cout << "P * M.colwise().homogeneous().hnormalized(): " << endl << (P * M.colwise().homogeneous()).colwise().hnormalized() << endl << endl;
Output:
The matrix M is:
   0.68   0.597   -0.33   0.108   -0.27
 -0.211   0.823   0.536 -0.0452  0.0268
  0.566  -0.605  -0.444   0.258   0.904
M.colwise().homogeneous():
   0.68   0.597   -0.33   0.108   -0.27
 -0.211   0.823   0.536 -0.0452  0.0268
  0.566  -0.605  -0.444   0.258   0.904
      1       1       1       1       1
P * M.colwise().homogeneous():
0.0832 -0.477  -1.21 -0.545 -0.452
 0.998  0.779  0.695  0.894  0.277
-0.271 -0.608 -0.895 -0.544 -0.874
-0.728 -0.551  0.202  -0.21 -0.469
P * M.colwise().homogeneous().hnormalized(): 
-0.114  0.866     -6    2.6  0.962
 -1.37  -1.41   3.44  -4.27 -0.591
 0.373    1.1  -4.43    2.6   1.86
          
              
                template<typename ExpressionType, int Direction>
              
              const HypotNormReturnType Eigen::
            | 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. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
              
                template<typename ExpressionType, int Direction>
                template<int p>
              
              const LpNormReturnType<p>::Type Eigen::
            | Returns | a row (or column) vector expression of the norm of each column (or row) of the referenced expression. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the norm of each column: 0.91 1.18 0.771
              
                template<typename ExpressionType, int Direction>
              
              const MaxCoeffReturnType Eigen::
            | 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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the maximum of each column: 0.68 0.823 0.536
              
                template<typename ExpressionType, int Direction>
              
              const MeanReturnType Eigen::
            | Returns | a row (or column) vector expression of the mean of each column (or row) of the referenced expression. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              const MinCoeffReturnType Eigen::
            | 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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the minimum of each column: -0.211 -0.605 -0.444
              
                template<typename ExpressionType, int Direction>
              
              const NormReturnType Eigen::
            | Returns | a row (or column) vector expression of the norm of each column (or row) of the referenced expression. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the norm of each column: 0.91 1.18 0.771
              
                template<typename ExpressionType, int Direction>
              
              void Eigen::
Normalize in-place each row or columns of the referenced matrix.
              
                template<typename ExpressionType, int Direction>
              
              CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeNestedCleaned, const typename OppositeExtendedType<NormReturnType>::Type> Eigen::
            | Returns | an expression where each column (or row) of the referenced matrix are normalized. The referenced matrix is not modified. | 
|---|
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              CwiseBinaryOp<internal::scalar_product_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> Eigen::
Returns the expression where each subvector is the product of the vector other by the corresponding subvector of *this
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              ExpressionType& Eigen::
Multiples each subvector of *this by the vector other
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              CwiseBinaryOp<internal::scalar_sum_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> Eigen::
Returns the expression of the sum of the vector other to each subvector of *this
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              ExpressionType& Eigen::
Adds the vector other to each subvector of *this
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              CwiseBinaryOp<internal::scalar_difference_op<Scalar, typename OtherDerived::Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> Eigen::
Returns the expression of the difference between each subvector of *this and the vector other
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              ExpressionType& Eigen::
Substracts the vector other to each subvector of *this
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              CwiseBinaryOp<internal::scalar_quotient_op<Scalar>, const ExpressionTypeNestedCleaned, const typename ExtendedType<OtherDerived>::Type> Eigen::
Returns the expression where each subvector is the quotient of the corresponding subvector of *this by the vector other
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              ExpressionType& Eigen::
Divides each subvector of *this by the vector other
              
                template<typename ExpressionType, int Direction>
              
              const ProdReturnType Eigen::
            | 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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the product of each row: -0.134 -0.0933 0.152
              
                template<typename ExpressionType, int Direction>
                template<typename BinaryOp>
              
              const ReduxReturnType<BinaryOp>::Type Eigen::
            | Returns | a row or column vector expression of *thisreduxed 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.
              
                template<typename ExpressionType, int Direction>
              
              const ReplicateReturnType Eigen::
            | 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:
Here is the vector v: 7 -2 6 v.rowwise().replicate(5) = ... 7 7 7 7 7 -2 -2 -2 -2 -2 6 6 6 6 6
              
                template<typename ExpressionType, int Direction>
                template<int Factor>
              
              const Replicate<ExpressionType, isVertical*Factor+isHorizontal, isHorizontal*Factor+isVertical> Eigen::
            | 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:
Here is the matrix m: 7 6 9 -2 6 -6 m.colwise().replicate<3>() = ... 7 6 9 -2 6 -6 7 6 9 -2 6 -6 7 6 9 -2 6 -6
              
                template<typename ExpressionType, int Direction>
              
              const ConstReverseReturnType Eigen::
            | 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:
Here is the matrix m: 7 6 -3 1 -2 9 6 0 6 -6 -5 3 Here is the rowwise reverse of m: 1 -3 6 7 0 6 9 -2 3 -5 -6 6 Here is the colwise reverse of m: 6 -6 -5 3 -2 9 6 0 7 6 -3 1 Here is the coefficient (1,0) in the rowise reverse of m: 0 Let us overwrite this coefficient with the value 4. Now the matrix m is: 7 6 -3 1 -2 9 6 0 6 -6 -5 3
              
                template<typename ExpressionType, int Direction>
              
              ReverseReturnType Eigen::
            | Returns | a writable matrix expression where each column (or row) are reversed. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              void Eigen::
This is the "in place" version of VectorwiseOp::*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:
- less error prone: doing the same operation with .reverse() requires special care: m = m.reverse().eval();
- this API enables reverse operations without the need for a temporary
              
                template<typename ExpressionType, int Direction>
              
              const SquaredNormReturnType Eigen::
            | Returns | a row (or column) vector expression of the squared norm of each column (or row) of the referenced expression. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the square norm of each row: 0.928 1.01 0.884
              
                template<typename ExpressionType, int Direction>
              
              const StableNormReturnType Eigen::
            | Returns | a row (or column) vector expression of the norm of each column (or row) of the referenced expression, avoiding underflow and overflow. This is a vector with real entries, even if the original matrix has complex entries. | 
|---|
              
                template<typename ExpressionType, int Direction>
              
              const SumReturnType Eigen::
            | 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:
Here is the matrix m: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the sum of each row: 0.948 1.15 -0.483
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              ExtendedType<OtherDerived>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
                template<typename OtherDerived>
              
              OppositeExtendedType<OtherDerived>::Type Eigen::
          
              
                template<typename ExpressionType, int Direction>
              
              Index Eigen::
          Variable documentation
              
                template<typename ExpressionType, int Direction>
              
              random_access_iterator_type Eigen::
This is the const version of iterator (aka read-only)
              
                template<typename ExpressionType, int Direction>
              
              random_access_iterator_type Eigen::
STL-like RandomAccessIterator iterator type over the columns or rows as returned by the begin() and end() methods.