mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
doc: Explain type of result for VectorwiseOp member functions.
Prompted by a question on the forum.
This commit is contained in:
parent
2f0faf117e
commit
616f9cc593
@ -301,6 +301,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression of the squared norm
|
/** \returns a row (or column) vector expression of the squared norm
|
||||||
* of each column (or row) of the referenced expression.
|
* 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: \include PartialRedux_squaredNorm.cpp
|
* Example: \include PartialRedux_squaredNorm.cpp
|
||||||
* Output: \verbinclude PartialRedux_squaredNorm.out
|
* Output: \verbinclude PartialRedux_squaredNorm.out
|
||||||
@ -311,6 +312,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression of the norm
|
/** \returns a row (or column) vector expression of the norm
|
||||||
* of each column (or row) of the referenced expression.
|
* 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: \include PartialRedux_norm.cpp
|
* Example: \include PartialRedux_norm.cpp
|
||||||
* Output: \verbinclude PartialRedux_norm.out
|
* Output: \verbinclude PartialRedux_norm.out
|
||||||
@ -322,7 +324,8 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression of the norm
|
/** \returns a row (or column) vector expression of the norm
|
||||||
* of each column (or row) of the referenced expression, using
|
* of each column (or row) of the referenced expression, using
|
||||||
* blue's algorithm.
|
* Blue's algorithm.
|
||||||
|
* This is a vector with real entries, even if the original matrix has complex entries.
|
||||||
*
|
*
|
||||||
* \sa DenseBase::blueNorm() */
|
* \sa DenseBase::blueNorm() */
|
||||||
const typename ReturnType<internal::member_blueNorm,RealScalar>::Type blueNorm() const
|
const typename ReturnType<internal::member_blueNorm,RealScalar>::Type blueNorm() const
|
||||||
@ -332,6 +335,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
/** \returns a row (or column) vector expression of the norm
|
/** \returns a row (or column) vector expression of the norm
|
||||||
* of each column (or row) of the referenced expression, avoiding
|
* of each column (or row) of the referenced expression, avoiding
|
||||||
* underflow and overflow.
|
* underflow and overflow.
|
||||||
|
* This is a vector with real entries, even if the original matrix has complex entries.
|
||||||
*
|
*
|
||||||
* \sa DenseBase::stableNorm() */
|
* \sa DenseBase::stableNorm() */
|
||||||
const typename ReturnType<internal::member_stableNorm,RealScalar>::Type stableNorm() const
|
const typename ReturnType<internal::member_stableNorm,RealScalar>::Type stableNorm() const
|
||||||
@ -341,6 +345,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
/** \returns a row (or column) vector expression of the norm
|
/** \returns a row (or column) vector expression of the norm
|
||||||
* of each column (or row) of the referenced expression, avoiding
|
* of each column (or row) of the referenced expression, avoiding
|
||||||
* underflow and overflow using a concatenation of hypot() calls.
|
* underflow and overflow using a concatenation of hypot() calls.
|
||||||
|
* This is a vector with real entries, even if the original matrix has complex entries.
|
||||||
*
|
*
|
||||||
* \sa DenseBase::hypotNorm() */
|
* \sa DenseBase::hypotNorm() */
|
||||||
const typename ReturnType<internal::member_hypotNorm,RealScalar>::Type hypotNorm() const
|
const typename ReturnType<internal::member_hypotNorm,RealScalar>::Type hypotNorm() const
|
||||||
@ -365,6 +370,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression representing
|
/** \returns a row (or column) vector expression representing
|
||||||
* whether \b all coefficients of each respective column (or row) are \c true.
|
* whether \b all coefficients of each respective column (or row) are \c true.
|
||||||
|
* This expression can be assigned to a vector with entries of type \c bool.
|
||||||
*
|
*
|
||||||
* \sa DenseBase::all() */
|
* \sa DenseBase::all() */
|
||||||
const typename ReturnType<internal::member_all>::Type all() const
|
const typename ReturnType<internal::member_all>::Type all() const
|
||||||
@ -372,6 +378,7 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression representing
|
/** \returns a row (or column) vector expression representing
|
||||||
* whether \b at \b least one coefficient of each respective column (or row) is \c true.
|
* whether \b at \b least one coefficient of each respective column (or row) is \c true.
|
||||||
|
* This expression can be assigned to a vector with entries of type \c bool.
|
||||||
*
|
*
|
||||||
* \sa DenseBase::any() */
|
* \sa DenseBase::any() */
|
||||||
const typename ReturnType<internal::member_any>::Type any() const
|
const typename ReturnType<internal::member_any>::Type any() const
|
||||||
@ -379,6 +386,8 @@ template<typename ExpressionType, int Direction> class VectorwiseOp
|
|||||||
|
|
||||||
/** \returns a row (or column) vector expression representing
|
/** \returns a row (or column) vector expression representing
|
||||||
* the number of \c true coefficients of each respective column (or row).
|
* the number of \c 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 \c std::ptrdiff_t .
|
||||||
*
|
*
|
||||||
* Example: \include PartialRedux_count.cpp
|
* Example: \include PartialRedux_count.cpp
|
||||||
* Output: \verbinclude PartialRedux_count.out
|
* Output: \verbinclude PartialRedux_count.out
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
Matrix3d m = Matrix3d::Random();
|
Matrix3d m = Matrix3d::Random();
|
||||||
cout << "Here is the matrix m:" << endl << m << endl;
|
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;
|
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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user