Eigen  3.4.90 (git rev 9589cc4e7fd8e4538bedef80dd36c7738977a8be)
 
Loading...
Searching...
No Matches
Eigen::ArrayBase< Derived > Class Template Reference

#include <Eigen/src/Core/ArrayBase.h>

Detailed Description

template<typename Derived>
class Eigen::ArrayBase< Derived >

Base class for all 1D and 2D array, and related expressions.

An array is similar to a dense vector or matrix. While matrices are mathematical objects with well defined linear algebra operators, an array is just a collection of scalar values arranged in a one or two dimensional fashion. As the main consequence, all operations applied to an array are performed coefficient wise. Furthermore, arrays support scalar math functions of the c++ standard library (e.g., std::sin(x)), and convenient constructors allowing to easily write generic code working for both scalar values and arrays.

This class is the base that is inherited by all array expression types.

Template Parameters
Derivedis the derived type, e.g., an array or an expression type.

This class can be extended with the help of the plugin mechanism described on the page Extending MatrixBase (and other classes) by defining the preprocessor symbol EIGEN_ARRAYBASE_PLUGIN.

See also
class MatrixBase, The class hierarchy
+ Inheritance diagram for Eigen::ArrayBase< Derived >:

Public Member Functions

const AbsReturnType abs () const
 
const Abs2ReturnType abs2 () const
 
template<typename OtherDerived>
const CwiseBinaryOp< absolute_difference< Scalar >, const Derived, const OtherDerived > absolute_difference (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseBinaryOp< internal::scalar_absolute_difference_op< Scalar, Scalar >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > absolute_difference (const Scalar &other) const
 
const AcosReturnType acos () const
 
const AcoshReturnType acosh () const
 
const ArgReturnType arg () const
 
const AsinReturnType asin () const
 
const AsinhReturnType asinh () const
 
const AtanReturnType atan () const
 
template<typename OtherDerived>
const CwiseBinaryOp< atan2< Scalar >, const Derived, const OtherDerived > atan2 (const Eigen::ArrayBase< OtherDerived > &other) const
 
const AtanhReturnType atanh () const
 
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp< CustomBinaryOp, const Derived, const OtherDerived > binaryExpr (const Eigen::ArrayBase< OtherDerived > &other, const CustomBinaryOp &func=CustomBinaryOp()) const
 
const CbrtReturnType cbrt () const
 
const CeilReturnType ceil () const
 
const CosReturnType cos () const
 
const CoshReturnType cosh () const
 
const CubeReturnType cube () const
 
const CwiseAbsReturnType cwiseAbs () const
 
const CwiseAbs2ReturnType cwiseAbs2 () const
 
const CwiseArgReturnType cwiseArg () const
 
const CwiseCbrtReturnType cwiseCbrt () const
 
template<typename OtherDerived>
const CwiseBinaryEqualReturnType< OtherDerived > cwiseEqual (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarEqualReturnType cwiseEqual (const Scalar &s) const
 
template<typename OtherDerived>
const CwiseBinaryGreaterReturnType< OtherDerived > cwiseGreater (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarGreaterReturnType cwiseGreater (const Scalar &s) const
 
template<typename OtherDerived>
const CwiseBinaryGreaterOrEqualReturnType< OtherDerived > cwiseGreaterOrEqual (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarGreaterOrEqualReturnType cwiseGreaterOrEqual (const Scalar &s) const
 
const CwiseInverseReturnType cwiseInverse () const
 
template<typename OtherDerived>
const CwiseBinaryLessReturnType< OtherDerived > cwiseLess (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarLessReturnType cwiseLess (const Scalar &s) const
 
template<typename OtherDerived>
const CwiseBinaryLessOrEqualReturnType< OtherDerived > cwiseLessOrEqual (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarLessOrEqualReturnType cwiseLessOrEqual (const Scalar &s) const
 
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMax (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > cwiseMax (const Scalar &other) const
 
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > cwiseMin (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > cwiseMin (const Scalar &other) const
 
template<typename OtherDerived>
const CwiseBinaryNotEqualReturnType< OtherDerived > cwiseNotEqual (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseScalarNotEqualReturnType cwiseNotEqual (const Scalar &s) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > cwiseProduct (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const Derived, const OtherDerived > cwiseQuotient (const Eigen::ArrayBase< OtherDerived > &other) const
 
const CwiseSignReturnType cwiseSign () const
 
const CwiseSqrtReturnType cwiseSqrt () const
 
const CwiseSquareReturnType cwiseSquare () const
 
const DigammaReturnType digamma () const
 
const ErfReturnType erf () const
 
const ErfcReturnType erfc () const
 
const ExpReturnType exp () const
 
const Exp2ReturnType exp2 () const
 
const Expm1ReturnType expm1 () const
 
const FloorReturnType floor () const
 
const InverseReturnType inverse () const
 
const IsFiniteReturnType isFinite () const
 
const IsInfReturnType isInf () const
 
const IsNaNReturnType isNaN () const
 
const LgammaReturnType lgamma () const
 
const LogReturnType log () const
 
const Log10ReturnType log10 () const
 
const Log1pReturnType log1p () const
 
const Log2ReturnType log2 () const
 
const LogisticReturnType logistic () const
 
MatrixWrapper< Derived > matrix ()
 
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > max (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > max (const Scalar &other) const
 
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > min (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > min (const Scalar &other) const
 
const NdtriReturnType ndtri () const
 
const BooleanNotReturnType operator! () const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_and_op< Scalar >, const Derived, const OtherDerived > operator& (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_boolean_and_op< Scalar >, const Derived, const OtherDerived > operator&& (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > operator* (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
Derived & operator*= (const ArrayBase< OtherDerived > &other)
 
template<typename OtherDerived>
const CwiseBinaryOp< sum< Scalar >, const Derived, const OtherDerived > operator+ (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename T>
const CwiseBinaryOp< internal::scalar_sum_op< Scalar, T >, Derived, Constant< T > > operator+ (const T &scalar) const
 
template<typename OtherDerived>
Derived & operator+= (const ArrayBase< OtherDerived > &other)
 
template<typename OtherDerived>
const CwiseBinaryOp< difference< Scalar >, const Derived, const OtherDerived > operator- (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename T>
const CwiseBinaryOp< internal::scalar_difference_op< Scalar, T >, Derived, Constant< T > > operator- (const T &scalar) const
 
template<typename OtherDerived>
Derived & operator-= (const ArrayBase< OtherDerived > &other)
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_quotient_op< Scalar, typename OtherDerived::Scalar >, const Derived, const OtherDerived > operator/ (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
Derived & operator/= (const ArrayBase< OtherDerived > &other)
 
Derived & operator= (const ArrayBase &other)
 
Derived & operator= (const Scalar &value)
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_xor_op< Scalar >, const Derived, const OtherDerived > operator^ (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_or_op< Scalar >, const Derived, const OtherDerived > operator| (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_boolean_or_op< Scalar >, const Derived, const OtherDerived > operator|| (const Eigen::ArrayBase< OtherDerived > &other) const
 
const BitwiseNotReturnType operator~ () const
 
template<typename OtherDerived>
const CwiseBinaryOp< pow< Scalar >, const Derived, const OtherDerived > pow (const Eigen::ArrayBase< OtherDerived > &other) const
 
template<typename ScalarExponent>
const UnaryPowReturnType< ScalarExponent > pow (const ScalarExponent &exponent) const
 
const RintReturnType rint () const
 
const RoundReturnType round () const
 
const RsqrtReturnType rsqrt () const
 
template<int N>
ShiftLeftXpr< N >::Type shiftLeft () const
 
template<int N>
ShiftRightXpr< N >::Type shiftRight () const
 
const SignReturnType sign () const
 
const SinReturnType sin () const
 
const SinhReturnType sinh () const
 
const SqrtReturnType sqrt () const
 
const SquareReturnType square () const
 
const TanReturnType tan () const
 
const TanhReturnType tanh () const
 
const TruncReturnType trunc () const
 
template<typename DerivedQ>
const CwiseBinaryOp< internal::scalar_zeta_op< Scalar >, const Derived, const DerivedQ > zeta (const Eigen::ArrayBase< DerivedQ > &q) const
 
- Public Member Functions inherited from Eigen::DenseBase< Derived >
bool all () const
 
bool allFinite () const
 
bool any () const
 
iterator begin ()
 
const_iterator begin () const
 
template<int NRows, int NCols>
FixedBlockXpr< NRows, NCols >::Type block (Index startRow, Index startCol)
 
template<int NRows, int NCols>
const ConstFixedBlockXpr< NRows, NCols >::Type block (Index startRow, Index startCol) const
 This is the const version of block<>(Index, Index). *‍/.
 
template<int NRows, int NCols>
FixedBlockXpr< NRows, NCols >::Type block (Index startRow, Index startCol, Index blockRows, Index blockCols)
 
template<int NRows, int NCols>
const ConstFixedBlockXpr< NRows, NCols >::Type block (Index startRow, Index startCol, Index blockRows, Index blockCols) const
 This is the const version of block<>(Index, Index, Index, Index).
 
template<typename NRowsType, typename NColsType>
FixedBlockXpr<...,... >::Type block (Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
 
template<typename NRowsType, typename NColsType>
const ConstFixedBlockXpr<...,... >::Type block (Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) const
 This is the const version of block(Index,Index,NRowsType,NColsType)
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type bottomLeftCorner ()
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type bottomLeftCorner () const
 This is the const version of bottomLeftCorner<int, int>().
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type bottomLeftCorner (Index cRows, Index cCols)
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type bottomLeftCorner (Index cRows, Index cCols) const
 This is the const version of bottomLeftCorner<int, int>(Index, Index).
 
template<typename NRowsType, typename NColsType>
FixedBlockXpr<...,... >::Type bottomLeftCorner (NRowsType cRows, NColsType cCols)
 
template<typename NRowsType, typename NColsType>
ConstFixedBlockXpr<...,... >::Type bottomLeftCorner (NRowsType cRows, NColsType cCols) const
 This is the const version of bottomLeftCorner(NRowsType, NColsType).
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type bottomRightCorner ()
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type bottomRightCorner () const
 This is the const version of bottomRightCorner<int, int>().
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type bottomRightCorner (Index cRows, Index cCols)
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type bottomRightCorner (Index cRows, Index cCols) const
 This is the const version of bottomRightCorner<int, int>(Index, Index).
 
template<typename NRowsType, typename NColsType>
FixedBlockXpr<...,... >::Type bottomRightCorner (NRowsType cRows, NColsType cCols)
 
template<typename NRowsType, typename NColsType>
const ConstFixedBlockXpr<...,... >::Type bottomRightCorner (NRowsType cRows, NColsType cCols) const
 This is the const version of bottomRightCorner(NRowsType, NColsType).
 
template<int N>
NRowsBlockXpr< N >::Type bottomRows (Index n=N)
 
template<int N>
ConstNRowsBlockXpr< N >::Type bottomRows (Index n=N) const
 This is the const version of bottomRows<int>().
 
template<typename NRowsType>
NRowsBlockXpr<... >::Type bottomRows (NRowsType n)
 
template<typename NRowsType>
const ConstNRowsBlockXpr<... >::Type bottomRows (NRowsType n) const
 This is the const version of bottomRows(NRowsType).
 
template<typename NewType>
CastXpr< NewType >::Type cast () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
ColXpr col (Index i)
 
ConstColXpr col (Index i) const
 This is the const version of col().
 
ColwiseReturnType colwise ()
 
ConstColwiseReturnType colwise () const
 
ConjugateReturnType conjugate () const
 
template<bool Cond>
std::conditional_t< Cond, ConjugateReturnType, const Derived & > conjugateIf () const
 
Index count () const
 
iterator end ()
 
const_iterator end () const
 
EvalReturnType eval () const
 
void fill (const Scalar &value)
 
template<unsigned int Added, unsigned int Removed>
EIGEN_DEPRECATED const Derived & flagged () const
 
const WithFormat< Derived > format (const IOFormat &fmt) const
 
template<int N>
FixedSegmentReturnType< N >::Type head (Index n=N)
 
template<int N>
ConstFixedSegmentReturnType< N >::Type head (Index n=N) const
 This is the const version of head<int>().
 
template<typename NType>
FixedSegmentReturnType<... >::Type head (NType n)
 
template<typename NType>
const ConstFixedSegmentReturnType<... >::Type head (NType n) const
 This is the const version of head(NType).
 
NonConstImagReturnType imag ()
 
const ImagReturnType imag () const
 
EIGEN_CONSTEXPR Index innerSize () const
 
InnerVectorReturnType innerVector (Index outer)
 
const ConstInnerVectorReturnType innerVector (Index outer) const
 
InnerVectorsReturnType innerVectors (Index outerStart, Index outerSize)
 
const ConstInnerVectorsReturnType innerVectors (Index outerStart, Index outerSize) const
 
template<typename OtherDerived>
bool isApprox (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isApproxToConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived>
bool isMuchSmallerThan (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename Derived>
bool isMuchSmallerThan (const typename NumTraits< Scalar >::Real &other, const RealScalar &prec) const
 
bool isOnes (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isZero (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived>
EIGEN_DEPRECATED Derived & lazyAssign (const DenseBase< OtherDerived > &other)
 
template<int N>
NColsBlockXpr< N >::Type leftCols (Index n=N)
 
template<int N>
ConstNColsBlockXpr< N >::Type leftCols (Index n=N) const
 This is the const version of leftCols<int>().
 
template<typename NColsType>
NColsBlockXpr<... >::Type leftCols (NColsType n)
 
template<typename NColsType>
const ConstNColsBlockXpr<... >::Type leftCols (NColsType n) const
 This is the const version of leftCols(NColsType).
 
template<int NaNPropagation>
internal::traits< Derived >::Scalar maxCoeff () const
 
template<int NaNPropagation, typename IndexType>
internal::traits< Derived >::Scalar maxCoeff (IndexType *index) const
 
template<int NaNPropagation, typename IndexType>
internal::traits< Derived >::Scalar maxCoeff (IndexType *row, IndexType *col) const
 
Scalar mean () const
 
template<int N>
NColsBlockXpr< N >::Type middleCols (Index startCol, Index n=N)
 
template<int N>
ConstNColsBlockXpr< N >::Type middleCols (Index startCol, Index n=N) const
 This is the const version of middleCols<int>().
 
template<typename NColsType>
NColsBlockXpr<... >::Type middleCols (Index startCol, NColsType numCols)
 
template<typename NColsType>
const ConstNColsBlockXpr<... >::Type middleCols (Index startCol, NColsType numCols) const
 This is the const version of middleCols(Index,NColsType).
 
template<int N>
NRowsBlockXpr< N >::Type middleRows (Index startRow, Index n=N)
 
template<int N>
ConstNRowsBlockXpr< N >::Type middleRows (Index startRow, Index n=N) const
 This is the const version of middleRows<int>().
 
template<typename NRowsType>
NRowsBlockXpr<... >::Type middleRows (Index startRow, NRowsType n)
 
template<typename NRowsType>
const ConstNRowsBlockXpr<... >::Type middleRows (Index startRow, NRowsType n) const
 This is the const version of middleRows(Index,NRowsType).
 
template<int NaNPropagation>
internal::traits< Derived >::Scalar minCoeff () const
 
template<int NaNPropagation, typename IndexType>
internal::traits< Derived >::Scalar minCoeff (IndexType *index) const
 
template<int NaNPropagation, typename IndexType>
internal::traits< Derived >::Scalar minCoeff (IndexType *row, IndexType *col) const
 
const NestByValue< Derived > nestByValue () const
 
template<typename Indices>
IndexedView_or_VectorBlock operator() (const Indices &indices)
 
template<typename RowIndices, typename ColIndices>
IndexedView_or_Block operator() (const RowIndices &rowIndices, const ColIndices &colIndices)
 
const NegativeReturnType operator- () const
 
template<typename OtherDerived>
CommaInitializer< Derived > operator<< (const DenseBase< OtherDerived > &other)
 
CommaInitializer< Derived > operator<< (const Scalar &s)
 
Derived & operator= (const DenseBase &other)
 
template<typename OtherDerived>
Derived & operator= (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived>
Derived & operator= (const EigenBase< OtherDerived > &other)
 Copies the generic expression other into *this.
 
EIGEN_CONSTEXPR Index outerSize () const
 
Scalar prod () const
 
NonConstRealReturnType real ()
 
RealReturnType real () const
 
template<typename Func>
internal::traits< Derived >::Scalar redux (const Func &func) const
 
template<int RowFactor, int ColFactor>
const Replicate< Derived, RowFactor, ColFactor > replicate () const
 
const Replicate< Derived, Dynamic, Dynamicreplicate (Index rowFactor, Index colFactor) const
 
template<int Order = ColMajor>
Reshaped< Derived,... > reshaped ()
 
template<int Order = ColMajor>
const Reshaped< const Derived,... > reshaped () const
 This is the const version of reshaped().
 
template<int Order = ColMajor, typename NRowsType, typename NColsType>
Reshaped< Derived,... > reshaped (NRowsType nRows, NColsType nCols)
 
template<int Order = ColMajor, typename NRowsType, typename NColsType>
const Reshaped< const Derived,... > reshaped (NRowsType nRows, NColsType nCols) const
 This is the const version of reshaped(NRowsType,NColsType).
 
void resize (Index newSize)
 
void resize (Index rows, Index cols)
 
ReverseReturnType reverse ()
 
ConstReverseReturnType reverse () const
 
void reverseInPlace ()
 
template<int N>
NColsBlockXpr< N >::Type rightCols (Index n=N)
 
template<int N>
ConstNColsBlockXpr< N >::Type rightCols (Index n=N) const
 This is the const version of rightCols<int>().
 
template<typename NColsType>
NColsBlockXpr<... >::Type rightCols (NColsType n)
 
template<typename NColsType>
const ConstNColsBlockXpr<... >::Type rightCols (NColsType n) const
 This is the const version of rightCols(NColsType).
 
RowXpr row (Index i)
 
ConstRowXpr row (Index i) const
 This is the const version of row(). *‍/.
 
RowwiseReturnType rowwise ()
 
ConstRowwiseReturnType rowwise () const
 
template<int N>
FixedSegmentReturnType< N >::Type segment (Index start, Index n=N)
 
template<int N>
ConstFixedSegmentReturnType< N >::Type segment (Index start, Index n=N) const
 This is the const version of segment<int>(Index).
 
template<typename NType>
FixedSegmentReturnType<... >::Type segment (Index start, NType n)
 
template<typename NType>
const ConstFixedSegmentReturnType<... >::Type segment (Index start, NType n) const
 This is the const version of segment(Index,NType).
 
template<typename ThenDerived, typename ElseDerived>
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ThenDerived >::Scalar, typename DenseBase< ElseDerived >::Scalar, typename DenseBase< Derived >::Scalar >, ThenDerived, ElseDerived, Derived > select (const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
 
template<typename ThenDerived>
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ThenDerived >::Scalar, typename DenseBase< ThenDerived >::Scalar, typename DenseBase< Derived >::Scalar >, ThenDerived, typename DenseBase< ThenDerived >::ConstantReturnType, Derived > select (const DenseBase< ThenDerived > &thenMatrix, const typename DenseBase< ThenDerived >::Scalar &elseScalar) const
 
template<typename ElseDerived>
CwiseTernaryOp< internal::scalar_boolean_select_op< typename DenseBase< ElseDerived >::Scalar, typename DenseBase< ElseDerived >::Scalar, typename DenseBase< Derived >::Scalar >, typename DenseBase< ElseDerived >::ConstantReturnType, ElseDerived, Derived > select (const typename DenseBase< ElseDerived >::Scalar &thenScalar, const DenseBase< ElseDerived > &elseMatrix) const
 
Derived & setConstant (const Scalar &value)
 
Derived & setLinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
Derived & setLinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
Derived & setOnes ()
 
Derived & setRandom ()
 
Derived & setZero ()
 
template<DirectionType Direction>
std::conditional_t< Direction==Vertical, ColXpr, RowXpr > subVector (Index i)
 
template<DirectionType Direction>
std::conditional_t< Direction==Vertical, ConstColXpr, ConstRowXpr > subVector (Index i) const
 
template<DirectionType Direction>
EIGEN_CONSTEXPR Index subVectors () const
 
Scalar sum () const
 
template<typename OtherDerived>
void swap (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived>
void swap (PlainObjectBase< OtherDerived > &other)
 
template<int N>
FixedSegmentReturnType< N >::Type tail (Index n=N)
 
template<int N>
ConstFixedSegmentReturnType< N >::Type tail (Index n=N) const
 This is the const version of tail<int>.
 
template<typename NType>
FixedSegmentReturnType<... >::Type tail (NType n)
 
template<typename NType>
const ConstFixedSegmentReturnType<... >::Type tail (NType n) const
 This is the const version of tail(Index).
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type topLeftCorner ()
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type topLeftCorner () const
 This is the const version of topLeftCorner<int, int>().
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type topLeftCorner (Index cRows, Index cCols)
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type topLeftCorner (Index cRows, Index cCols) const
 This is the const version of topLeftCorner<int, int>(Index, Index).
 
template<typename NRowsType, typename NColsType>
FixedBlockXpr<...,... >::Type topLeftCorner (NRowsType cRows, NColsType cCols)
 
template<typename NRowsType, typename NColsType>
const ConstFixedBlockXpr<...,... >::Type topLeftCorner (NRowsType cRows, NColsType cCols) const
 This is the const version of topLeftCorner(Index, Index).
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type topRightCorner ()
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type topRightCorner () const
 This is the const version of topRightCorner<int, int>().
 
template<int CRows, int CCols>
FixedBlockXpr< CRows, CCols >::Type topRightCorner (Index cRows, Index cCols)
 
template<int CRows, int CCols>
const ConstFixedBlockXpr< CRows, CCols >::Type topRightCorner (Index cRows, Index cCols) const
 This is the const version of topRightCorner<int, int>(Index, Index).
 
template<typename NRowsType, typename NColsType>
FixedBlockXpr<...,... >::Type topRightCorner (NRowsType cRows, NColsType cCols)
 
template<typename NRowsType, typename NColsType>
const ConstFixedBlockXpr<...,... >::Type topRightCorner (NRowsType cRows, NColsType cCols) const
 This is the const version of topRightCorner(NRowsType, NColsType).
 
template<int N>
NRowsBlockXpr< N >::Type topRows (Index n=N)
 
template<int N>
ConstNRowsBlockXpr< N >::Type topRows (Index n=N) const
 This is the const version of topRows<int>().
 
template<typename NRowsType>
NRowsBlockXpr<... >::Type topRows (NRowsType n)
 
template<typename NRowsType>
const ConstNRowsBlockXpr<... >::Type topRows (NRowsType n) const
 This is the const version of topRows(NRowsType).
 
TransposeReturnType transpose ()
 
const ConstTransposeReturnType transpose () const
 
void transposeInPlace ()
 
template<typename CustomUnaryOp>
const CwiseUnaryOp< CustomUnaryOp, const Derived > unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const
 Apply a unary operator coefficient-wise.
 
template<typename CustomViewOp>
CwiseUnaryView< CustomViewOp, Derived > unaryViewExpr (const CustomViewOp &func=CustomViewOp())
 
template<typename CustomViewOp>
const CwiseUnaryView< CustomViewOp, const Derived > unaryViewExpr (const CustomViewOp &func=CustomViewOp()) const
 
CoeffReturnType value () const
 
template<typename Visitor>
void visit (Visitor &func) const
 
- Public Member Functions inherited from Eigen::DenseCoeffsBase< Derived, DirectWriteAccessors >
EIGEN_CONSTEXPR Index colStride () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index innerStride () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index outerStride () const EIGEN_NOEXCEPT
 
EIGEN_CONSTEXPR Index rowStride () const EIGEN_NOEXCEPT
 

Related Symbols

(Note that these are not member symbols.)

template<typename LhsDerived, typename RhsDerived>
const std::enable_if_t< std::is_same< typename LhsDerived::Scalar, typename RhsDerived::Scalar >::value, Eigen::CwiseBinaryOp< Eigen::internal::scalar_atan2_op< typename LhsDerived::Scalar, typename RhsDerived::Scalar >, const LhsDerived, const RhsDerived > > atan2 (const Eigen::ArrayBase< LhsDerived > &x, const Eigen::ArrayBase< RhsDerived > &exponents)
 
template<typename Derived, typename ExponentDerived>
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow (const Eigen::ArrayBase< Derived > &x, const Eigen::ArrayBase< ExponentDerived > &exponents)
 
template<typename Derived, typename ScalarExponent>
const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow (const Eigen::ArrayBase< Derived > &x, const ScalarExponent &exponent)
 
template<typename Scalar, typename Derived>
const CwiseBinaryOp< internal::scalar_pow_op< Scalar, Derived::Scalar >, Constant< Scalar >, Derived > pow (const Scalar &x, const Eigen::ArrayBase< Derived > &x)
 

Additional Inherited Members

- Public Types inherited from Eigen::DenseBase< Derived >
enum  {
  RowsAtCompileTime ,
  ColsAtCompileTime ,
  SizeAtCompileTime ,
  MaxRowsAtCompileTime ,
  MaxColsAtCompileTime ,
  MaxSizeAtCompileTime ,
  IsVectorAtCompileTime ,
  NumDimensions ,
  Flags ,
  IsRowMajor ,
  InnerSizeAtCompileTime ,
  InnerStrideAtCompileTime ,
  OuterStrideAtCompileTime
}
 
typedef random_access_iterator_type const_iterator
 
typedef Eigen::InnerIterator< Derived > InnerIterator
 
typedef random_access_iterator_type iterator
 
typedef Array< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainArray
 
typedef Matrix< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainMatrix
 
typedef std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArrayPlainObject
 The plain matrix or array type corresponding to this expression.
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 The type used to store indices.
 
typedef Scalar value_type
 
- Static Public Member Functions inherited from Eigen::DenseBase< Derived >
static const ConstantReturnType Constant (const Scalar &value)
 
static const ConstantReturnType Constant (Index rows, Index cols, const Scalar &value)
 
static const ConstantReturnType Constant (Index size, const Scalar &value)
 
static const RandomAccessLinSpacedReturnType LinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
static const RandomAccessLinSpacedReturnType LinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
static EIGEN_DEPRECATED const RandomAccessLinSpacedReturnType LinSpaced (Sequential_t, const Scalar &low, const Scalar &high)
 
static EIGEN_DEPRECATED const RandomAccessLinSpacedReturnType LinSpaced (Sequential_t, Index size, const Scalar &low, const Scalar &high)
 
template<typename CustomNullaryOp>
static const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (const CustomNullaryOp &func)
 
template<typename CustomNullaryOp>
static const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index rows, Index cols, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp>
static const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index size, const CustomNullaryOp &func)
 
static const ConstantReturnType Ones ()
 
static const ConstantReturnType Ones (Index rows, Index cols)
 
static const ConstantReturnType Ones (Index size)
 
static const RandomReturnType Random ()
 
static const RandomReturnType Random (Index rows, Index cols)
 
static const RandomReturnType Random (Index size)
 
static const ZeroReturnType Zero ()
 
static const ZeroReturnType Zero (Index rows, Index cols)
 
static const ZeroReturnType Zero (Index size)
 
- Protected Member Functions inherited from Eigen::DenseBase< Derived >
constexpr DenseBase ()=default
 

Member Function Documentation

◆ abs()

template<typename Derived>
const AbsReturnType Eigen::ArrayBase< Derived >::abs ( ) const
inline
Returns
an expression of the coefficient-wise absolute value of *this

Example:

Array3d v(1, -2, -3);
cout << v.abs() << endl;

Output:

1
2
3
See also
Math functions, abs2()

◆ abs2()

template<typename Derived>
const Abs2ReturnType Eigen::ArrayBase< Derived >::abs2 ( ) const
inline
Returns
an expression of the coefficient-wise squared absolute value of *this

Example:

Array3d v(1, -2, -3);
cout << v.abs2() << endl;

Output:

1
4
9
See also
Math functions, abs(), square()

◆ absolute_difference() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< absolute_difference< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::absolute_difference ( const Eigen::ArrayBase< OtherDerived > & other) const
Returns
an expression of the coefficient-wise absdiff of *this and other
See also
absolute_difference()

◆ absolute_difference() [2/2]

template<typename Derived>
const CwiseBinaryOp< internal::scalar_absolute_difference_op< Scalar, Scalar >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > Eigen::ArrayBase< Derived >::absolute_difference ( const Scalar & other) const
inline
Returns
an expression of the coefficient-wise absolute_difference of *this and scalar other
See also
absolute_difference()

◆ acos()

template<typename Derived>
const AcosReturnType Eigen::ArrayBase< Derived >::acos ( ) const
inline
Returns
an expression of the coefficient-wise arc cosine of *this.

Example:

Array3d v(0, sqrt(2.) / 2, 1);
cout << v.acos() << endl;
const SqrtReturnType sqrt() const
Definition ArrayBase.h:155

Output:

 1.57
0.785
    0
See also
Math functions, cos(), asin()

◆ acosh()

template<typename Derived>
const AcoshReturnType Eigen::ArrayBase< Derived >::acosh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic cos of *this.
See also
Math functions, atanh(), asinh(), acosh()

◆ arg()

template<typename Derived>
const ArgReturnType Eigen::ArrayBase< Derived >::arg ( ) const
inline
Returns
an expression of the coefficient-wise phase angle of *this

Example:

ArrayXcf v = ArrayXcf::Random(3);
cout << v << endl << endl;
cout << arg(v) << endl;
const ArgReturnType arg() const
Definition ArrayBase.h:62

Output:

  (0.924,-0.824)
(-0.199,-0.0532)
  (0.146,-0.237)

-0.728
 -2.88
 -1.02
See also
abs()

◆ asin()

template<typename Derived>
const AsinReturnType Eigen::ArrayBase< Derived >::asin ( ) const
inline
Returns
an expression of the coefficient-wise arc sine of *this.

Example:

Array3d v(0, sqrt(2.) / 2, 1);
cout << v.asin() << endl;

Output:

    0
0.785
 1.57
See also
Math functions, sin(), acos()

◆ asinh()

template<typename Derived>
const AsinhReturnType Eigen::ArrayBase< Derived >::asinh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic sin of *this.
See also
Math functions, atanh(), asinh(), acosh()

◆ atan()

template<typename Derived>
const AtanReturnType Eigen::ArrayBase< Derived >::atan ( ) const
inline
Returns
an expression of the coefficient-wise arc tan of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
cout << v.atan() << endl;

Output:

    0
0.245
0.464
0.644
0.785
See also
Math functions, tan(), asin(), acos()

◆ atan2()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< atan2< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::atan2 ( const Eigen::ArrayBase< OtherDerived > & other) const
Returns
an expression of the coefficient-wise atan2(*this, y), where y is the given array argument.

This function computes the coefficient-wise atan2.

◆ atanh()

template<typename Derived>
const AtanhReturnType Eigen::ArrayBase< Derived >::atanh ( ) const
inline
Returns
an expression of the coefficient-wise inverse hyperbolic tan of *this.
See also
Math functions, atanh(), asinh(), acosh()

◆ binaryExpr()

template<typename Derived>
template<typename CustomBinaryOp, typename OtherDerived>
const CwiseBinaryOp< CustomBinaryOp, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::binaryExpr ( const Eigen::ArrayBase< OtherDerived > & other,
const CustomBinaryOp & func = CustomBinaryOp() ) const
inline
Returns
an expression of a custom coefficient-wise operator func of *this and other

The template parameter CustomBinaryOp is the type of the functor of the custom operator (see class CwiseBinaryOp for an example)

Here is an example illustrating the use of custom functors:

#include <Eigen/Core>
#include <iostream>
// define a custom template binary functor
template <typename Scalar>
struct MakeComplexOp {
typedef std::complex<Scalar> result_type;
result_type operator()(const Scalar& a, const Scalar& b) const { return result_type(a, b); }
};
int main(int, char**) {
Matrix4d m1 = Matrix4d::Random(), m2 = Matrix4d::Random();
std::cout << m1.binaryExpr(m2, MakeComplexOp<double>()) << std::endl;
return 0;
}
IndexedView_or_Block operator()(const RowIndices &rowIndices, const ColIndices &colIndices)
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:62
Matrix< double, 4, 4 > Matrix4d
4×4 matrix of type double.
Definition Matrix.h:479

Output:

  (0.696,-0.727)   (-0.47,-0.216)  (0.0241,-0.778)   (0.134,0.0072)
    (0.205,0.74)    (0.928,0.852)  (0.0723,-0.758)     (-0.16,0.22)
 (-0.415,-0.757)    (0.445,0.835)   (0.432,-0.711) (-0.00986,0.859)
   (0.334,0.741)  (-0.633,-0.834)  (-0.046,-0.467)  (-0.498,-0.316)
See also
class CwiseBinaryOp, operator+(), operator-(), cwiseProduct()

◆ cbrt()

template<typename Derived>
const CbrtReturnType Eigen::ArrayBase< Derived >::cbrt ( ) const
inline
Returns
an expression of the coefficient-wise cube root of *this.

This function computes the coefficient-wise cube root.

Example:

Array3d v(1, 2, 4);
cout << v.cbrt() << endl;

Output:

   1
1.26
1.59
See also
Math functions, sqrt(), pow(), square()

◆ ceil()

template<typename Derived>
const CeilReturnType Eigen::ArrayBase< Derived >::ceil ( ) const
inline
Returns
an expression of the coefficient-wise ceil of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
cout << v << endl << endl;
cout << ceil(v) << endl;
const CeilReturnType ceil() const
Definition ArrayBase.h:360

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-0
 0
 1
 2
 2
See also
Math functions, floor(), round()

◆ cos()

template<typename Derived>
const CosReturnType Eigen::ArrayBase< Derived >::cos ( ) const
inline
Returns
an expression of the coefficient-wise cosine of *this.

This function computes the coefficient-wise cosine. The function MatrixBase\cos() in the unsupported module MatrixFunctions computes the matrix cosine.

Example:

Array3d v(EIGEN_PI, EIGEN_PI / 2, EIGEN_PI / 3);
cout << v.cos() << endl;

Output:

 -1
 -0
0.5
See also
Math functions, sin(), acos()

◆ cosh()

template<typename Derived>
const CoshReturnType Eigen::ArrayBase< Derived >::cosh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic cos of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
cout << cosh(v) << endl;
const CoshReturnType cosh() const
Definition ArrayBase.h:275

Output:

   1
1.03
1.13
1.29
1.54
See also
Math functions, tanh(), sinh(), cosh()

◆ cube()

template<typename Derived>
const CubeReturnType Eigen::ArrayBase< Derived >::cube ( ) const
inline
Returns
an expression of the coefficient-wise cube of *this.

Example:

Array3d v(2, 3, 4);
cout << v.cube() << endl;

Output:

 8
27
64
See also
Math functions, square(), pow()

◆ cwiseAbs()

template<typename Derived>
const CwiseAbsReturnType Eigen::ArrayBase< Derived >::cwiseAbs ( ) const
inline
Returns
an expression of the coefficient-wise absolute value of *this

Example:

MatrixXd m(2, 3);
m << 2, -4, 6, -5, 1, 0;
cout << m.cwiseAbs() << endl;
Matrix< double, Dynamic, Dynamic > MatrixXd
Dynamic×Dynamic matrix of type double.
Definition Matrix.h:479

Output:

2 4 6
5 1 0
See also
cwiseAbs2()

◆ cwiseAbs2()

template<typename Derived>
const CwiseAbs2ReturnType Eigen::ArrayBase< Derived >::cwiseAbs2 ( ) const
inline
Returns
an expression of the coefficient-wise squared absolute value of *this

Example:

MatrixXd m(2, 3);
m << 2, -4, 6, -5, 1, 0;
cout << m.cwiseAbs2() << endl;

Output:

 4 16 36
25  1  0
See also
cwiseAbs()

◆ cwiseArg()

template<typename Derived>
const CwiseArgReturnType Eigen::ArrayBase< Derived >::cwiseArg ( ) const
inline
Returns
an expression of the coefficient-wise phase angle of *this

Example:

MatrixXcf v = MatrixXcf::Random(2, 3);
cout << v << endl << endl;
cout << v.cwiseArg() << endl;
Matrix< std::complex< float >, Dynamic, Dynamic > MatrixXcf
Dynamic×Dynamic matrix of type std::complex<float>.
Definition Matrix.h:480

Output:

  (0.924,-0.824)   (0.146,-0.237)   (0.633,-0.779)
(-0.199,-0.0532)    (0.334,0.634)   (0.982,-0.573)

-0.728  -1.02 -0.889
 -2.88   1.09 -0.528

◆ cwiseCbrt()

template<typename Derived>
const CwiseCbrtReturnType Eigen::ArrayBase< Derived >::cwiseCbrt ( ) const
inline
Returns
an expression of the coefficient-wise cube root of *this.
See also
cwiseSqrt(), cwiseSquare(), cwisePow()

◆ cwiseEqual() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryEqualReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseEqual ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise == operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

MatrixXi m(2, 2);
m << 1, 0, 1, 1;
cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseEqual(MatrixXi::Identity(2, 2)) << endl;
Index count = m.cwiseEqual(MatrixXi::Identity(2, 2)).count();
cout << "Number of coefficients that are equal: " << count << endl;
Index count() const
Definition Visitor.h:765
Matrix< int, Dynamic, Dynamic > MatrixXi
Dynamic×Dynamic matrix of type int.
Definition Matrix.h:477
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:82

Output:

Comparing m with identity matrix:
1 1
0 1
Number of coefficients that are equal: 3
See also
cwiseNotEqual(), isApprox(), isMuchSmallerThan()

◆ cwiseEqual() [2/2]

template<typename Derived>
const CwiseScalarEqualReturnType Eigen::ArrayBase< Derived >::cwiseEqual ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise == operator of *this and a scalar s
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().
See also
cwiseEqual(const MatrixBase<OtherDerived> &) const

◆ cwiseGreater() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryGreaterReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseGreater ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise > operator of *this and other

◆ cwiseGreater() [2/2]

template<typename Derived>
const CwiseScalarGreaterReturnType Eigen::ArrayBase< Derived >::cwiseGreater ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise > operator of *this and a scalar s

◆ cwiseGreaterOrEqual() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryGreaterOrEqualReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseGreaterOrEqual ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise >= operator of *this and other

◆ cwiseGreaterOrEqual() [2/2]

template<typename Derived>
const CwiseScalarGreaterOrEqualReturnType Eigen::ArrayBase< Derived >::cwiseGreaterOrEqual ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise >= operator of *this and a scalar s

◆ cwiseInverse()

template<typename Derived>
const CwiseInverseReturnType Eigen::ArrayBase< Derived >::cwiseInverse ( ) const
inline
Returns
an expression of the coefficient-wise inverse of *this.

Example:

MatrixXd m(2, 3);
m << 2, 0.5, 1, 3, 0.25, 1;
cout << m.cwiseInverse() << endl;

Output:

  0.5     2     1
0.333     4     1
See also
cwiseProduct()

◆ cwiseLess() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryLessReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseLess ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise < operator of *this and other

◆ cwiseLess() [2/2]

template<typename Derived>
const CwiseScalarLessReturnType Eigen::ArrayBase< Derived >::cwiseLess ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise < operator of *this and a scalar s

◆ cwiseLessOrEqual() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryLessOrEqualReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseLessOrEqual ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise <= operator of *this and other

◆ cwiseLessOrEqual() [2/2]

template<typename Derived>
const CwiseScalarLessOrEqualReturnType Eigen::ArrayBase< Derived >::cwiseLessOrEqual ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise <= operator of *this and a scalar s

◆ cwiseMax() [1/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::cwiseMax ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise max of *this and other

Example:

Vector3d v(2, 3, 4), w(4, 2, 3);
cout << v.cwiseMax(w) << endl;
Matrix< double, 3, 1 > Vector3d
3×1 vector of type double.
Definition Matrix.h:479

Output:

4
3
4
See also
class CwiseBinaryOp, min()

◆ cwiseMax() [2/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > Eigen::ArrayBase< Derived >::cwiseMax ( const Scalar & other) const
inline
Returns
an expression of the coefficient-wise max of *this and scalar other
See also
class CwiseBinaryOp, min()

◆ cwiseMin() [1/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::cwiseMin ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise min of *this and other

Example:

Vector3d v(2, 3, 4), w(4, 2, 3);
cout << v.cwiseMin(w) << endl;

Output:

2
2
3
See also
class CwiseBinaryOp, max()

◆ cwiseMin() [2/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const ConstantReturnType > Eigen::ArrayBase< Derived >::cwiseMin ( const Scalar & other) const
inline
Returns
an expression of the coefficient-wise min of *this and scalar other
See also
class CwiseBinaryOp, min()

◆ cwiseNotEqual() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryNotEqualReturnType< OtherDerived > Eigen::ArrayBase< Derived >::cwiseNotEqual ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise != operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

MatrixXi m(2, 2);
m << 1, 0, 1, 1;
cout << "Comparing m with identity matrix:" << endl;
cout << m.cwiseNotEqual(MatrixXi::Identity(2, 2)) << endl;
Index count = m.cwiseNotEqual(MatrixXi::Identity(2, 2)).count();
cout << "Number of coefficients that are not equal: " << count << endl;

Output:

Comparing m with identity matrix:
0 0
1 0
Number of coefficients that are not equal: 1
See also
cwiseEqual(), isApprox(), isMuchSmallerThan()

◆ cwiseNotEqual() [2/2]

template<typename Derived>
const CwiseScalarNotEqualReturnType Eigen::ArrayBase< Derived >::cwiseNotEqual ( const Scalar & s) const
inline
Returns
an expression of the coefficient-wise == operator of *this and a scalar s
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().
See also
cwiseEqual(const MatrixBase<OtherDerived> &) const

◆ cwiseProduct()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::cwiseProduct ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the Schur product (coefficient wise product) of *this and other

Example:

Matrix3i a = Matrix3i::Random(), b = Matrix3i::Random();
Matrix3i c = a.cwiseProduct(b);
cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
Matrix< int, 3, 3 > Matrix3i
3×3 matrix of type int.
Definition Matrix.h:477

Output:

a:
 1804289383   719885386 -1364114958
 -465790871 -1550966999  2044897763
 -189735855 -1122281286  1365180540
b:
  304089172   336465782  1101513929
   35005211 -1868760786  1315634022
-1852781081    -2309581  -778350579
c:
-1900151348  1274064924  1451757314
 1178627603 -1395361186  1323254130
  982755863  -343432946  1494074956
See also
class CwiseBinaryOp, cwiseAbs2

◆ cwiseQuotient()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_quotient_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::cwiseQuotient ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise quotient of *this and other

Example:

Vector3d v(2, 3, 4), w(4, 2, 3);
cout << v.cwiseQuotient(w) << endl;

Output:

 0.5
 1.5
1.33
See also
class CwiseBinaryOp, cwiseProduct(), cwiseInverse()

◆ cwiseSign()

template<typename Derived>
const CwiseSignReturnType Eigen::ArrayBase< Derived >::cwiseSign ( ) const
inline
Returns
an expression of the coefficient-wise signum of *this.

Example:

MatrixXd m(2, 3);
m << 2, -4, 6, -5, 1, 0;
cout << m.cwiseSign() << endl;

Output:

 1 -1  1
-1  1  0

◆ cwiseSqrt()

template<typename Derived>
const CwiseSqrtReturnType Eigen::ArrayBase< Derived >::cwiseSqrt ( ) const
inline
Returns
an expression of the coefficient-wise square root of *this.

Example:

Vector3d v(1, 2, 4);
cout << v.cwiseSqrt() << endl;

Output:

   1
1.41
   2
See also
cwisePow(), cwiseSquare(), cwiseCbrt()

◆ cwiseSquare()

template<typename Derived>
const CwiseSquareReturnType Eigen::ArrayBase< Derived >::cwiseSquare ( ) const
inline
Returns
an expression of the coefficient-wise square of *this.
See also
cwisePow(), cwiseSqrt(), cwiseCbrt()

◆ digamma()

template<typename Derived>
const DigammaReturnType Eigen::ArrayBase< Derived >::digamma ( ) const
inline
Returns
an expression of the coefficient-wise digamma (psi, derivative of lgamma).

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
Note
This function supports only float and double scalar types. To support other scalar types, the user has to provide implementations of digamma(T) for any scalar type T to be supported.
See also
Math functions, Eigen\digamma(), Eigen::polygamma(), lgamma()

◆ erf()

template<typename Derived>
const ErfReturnType Eigen::ArrayBase< Derived >::erf ( ) const
inline

[c++11]

Returns
an expression of the coefficient-wise Gauss error function of *this.

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of erf(T) for any scalar type T to be supported.
See also
Math functions, erfc()

◆ erfc()

template<typename Derived>
const ErfcReturnType Eigen::ArrayBase< Derived >::erfc ( ) const
inline

[c++11]

Returns
an expression of the coefficient-wise Complementary error function of *this.

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of erfc(T) for any scalar type T to be supported.
See also
Math functions, erf()

◆ exp()

template<typename Derived>
const ExpReturnType Eigen::ArrayBase< Derived >::exp ( ) const
inline
Returns
an expression of the coefficient-wise exponential of *this.

This function computes the coefficient-wise exponential. The function MatrixBase\exp() in the unsupported module MatrixFunctions computes the matrix exponential.

Example:

Array3d v(1, 2, 3);
cout << v.exp() << endl;

Output:

2.72
7.39
20.1
See also
Math functions, exp2(), pow(), log(), sin(), cos()

◆ exp2()

template<typename Derived>
const Exp2ReturnType Eigen::ArrayBase< Derived >::exp2 ( ) const
inline
Returns
an expression of the coefficient-wise exponential of *this.

This function computes the coefficient-wise base2 exponential, i.e. 2^x.

See also
Math functions, exp(), pow(), log(), sin(), cos()

◆ expm1()

template<typename Derived>
const Expm1ReturnType Eigen::ArrayBase< Derived >::expm1 ( ) const
inline
Returns
an expression of the coefficient-wise exponential of *this minus 1.

In exact arithmetic, x.expm1() is equivalent to x.exp() - 1, however, with finite precision, this function is much more accurate when x is close to zero.

See also
Math functions, exp()

◆ floor()

template<typename Derived>
const FloorReturnType Eigen::ArrayBase< Derived >::floor ( ) const
inline
Returns
an expression of the coefficient-wise floor of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
cout << v << endl << endl;
cout << floor(v) << endl;
const FloorReturnType floor() const
Definition ArrayBase.h:351

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-2
-1
 0
 0
 1
 2
See also
Math functions, ceil(), round()

◆ inverse()

template<typename Derived>
const InverseReturnType Eigen::ArrayBase< Derived >::inverse ( ) const
inline
Returns
an expression of the coefficient-wise inverse of *this.

Example:

Array3d v(2, 3, 4);
cout << v.inverse() << endl;

Output:

  0.5
0.333
 0.25
See also
operator/(), operator*()

◆ isFinite()

template<typename Derived>
const IsFiniteReturnType Eigen::ArrayBase< Derived >::isFinite ( ) const
inline
Returns
an expression of the coefficient-wise isfinite of *this.

Example:

Array3d v(1, 2, 3);
v(1) *= 0.0 / 0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isfinite(v) << endl;
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isfinite_op< typename Derived::Scalar >, const Derived > isfinite(const Eigen::ArrayBase< Derived > &x)

Output:

   1
-nan
 inf

1
0
0
See also
isnan(), isinf()

◆ isInf()

template<typename Derived>
const IsInfReturnType Eigen::ArrayBase< Derived >::isInf ( ) const
inline
Returns
an expression of the coefficient-wise isinf of *this.

Example:

Array3d v(1, 2, 3);
v(1) *= 0.0 / 0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isinf(v) << endl;
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isinf_op< typename Derived::Scalar >, const Derived > isinf(const Eigen::ArrayBase< Derived > &x)

Output:

   1
-nan
 inf

0
0
1
See also
isnan(), isfinite()

◆ isNaN()

template<typename Derived>
const IsNaNReturnType Eigen::ArrayBase< Derived >::isNaN ( ) const
inline
Returns
an expression of the coefficient-wise isnan of *this.

Example:

Array3d v(1, 2, 3);
v(1) *= 0.0 / 0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << isnan(v) << endl;
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_isnan_op< typename Derived::Scalar >, const Derived > isnan(const Eigen::ArrayBase< Derived > &x)

Output:

   1
-nan
 inf

0
1
0
See also
isfinite(), isinf()

◆ lgamma()

template<typename Derived>
const LgammaReturnType Eigen::ArrayBase< Derived >::lgamma ( ) const
inline

[c++11]

Returns
an expression of the coefficient-wise ln(|gamma(*this)|).

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>
Note
This function supports only float and double scalar types in c++11 mode. To support other scalar types, or float/double in non c++11 mode, the user has to provide implementations of lgamma(T) for any scalar type T to be supported.
See also
Math functions, digamma()

◆ log()

template<typename Derived>
const LogReturnType Eigen::ArrayBase< Derived >::log ( ) const
inline
Returns
an expression of the coefficient-wise logarithm of *this.

This function computes the coefficient-wise logarithm. The function MatrixBase\log() in the unsupported module MatrixFunctions computes the matrix logarithm.

Example:

Array3d v(1, 2, 3);
cout << v.log() << endl;

Output:

    0
0.693
  1.1
See also
Math functions, log()

◆ log10()

template<typename Derived>
const Log10ReturnType Eigen::ArrayBase< Derived >::log10 ( ) const
inline
Returns
an expression of the coefficient-wise base-10 logarithm of *this.

This function computes the coefficient-wise base-10 logarithm.

Example:

Array4d v(-1, 0, 1, 2);
cout << log10(v) << endl;
const Log10ReturnType log10() const
Definition ArrayBase.h:136

Output:

  nan
 -inf
    0
0.301
See also
Math functions, log()

◆ log1p()

template<typename Derived>
const Log1pReturnType Eigen::ArrayBase< Derived >::log1p ( ) const
inline
Returns
an expression of the coefficient-wise logarithm of 1 plus *this.

In exact arithmetic, x.log() is equivalent to (x+1).log(), however, with finite precision, this function is much more accurate when x is close to zero.

See also
Math functions, log()

◆ log2()

template<typename Derived>
const Log2ReturnType Eigen::ArrayBase< Derived >::log2 ( ) const
inline
Returns
an expression of the coefficient-wise base-2 logarithm of *this.

This function computes the coefficient-wise base-2 logarithm.

◆ logistic()

template<typename Derived>
const LogisticReturnType Eigen::ArrayBase< Derived >::logistic ( ) const
inline
Returns
an expression of the coefficient-wise logistic of *this.

◆ matrix()

template<typename Derived>
MatrixWrapper< Derived > Eigen::ArrayBase< Derived >::matrix ( )
inline
Returns
an Matrix expression of this array
See also
MatrixBase::array()

◆ max() [1/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::max ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise max of *this and other

Example:

Array3d v(2, 3, 4), w(4, 2, 3);
cout << v.max(w) << endl;

Output:

4
3
4
See also
min()

◆ max() [2/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_max_op< Scalar, Scalar, NaNPropagation >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > Eigen::ArrayBase< Derived >::max ( const Scalar & other) const
inline
Returns
an expression of the coefficient-wise max of *this and scalar other
See also
min()

◆ min() [1/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast, typename OtherDerived>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::min ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise min of *this and other

Example:

Array3d v(2, 3, 4), w(4, 2, 3);
cout << v.min(w) << endl;

Output:

2
2
3
See also
max()

◆ min() [2/2]

template<typename Derived>
template<int NaNPropagation = PropagateFast>
const CwiseBinaryOp< internal::scalar_min_op< Scalar, Scalar, NaNPropagation >, const Derived, const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > > Eigen::ArrayBase< Derived >::min ( const Scalar & other) const
inline
Returns
an expression of the coefficient-wise min of *this and scalar other
See also
max()

◆ ndtri()

template<typename Derived>
const NdtriReturnType Eigen::ArrayBase< Derived >::ndtri ( ) const
inline
Returns
an expression of the coefficient-wise inverse of the CDF of the Normal distribution function function of *this.

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>

In other words, considering x = ndtri(y), it returns the argument, x, for which the area under the Gaussian probability density function (integrated from minus infinity to x) is equal to y.

Note
This function supports only float and double scalar types. To support other scalar types, the user has to provide implementations of ndtri(T) for any scalar type T to be supported.
See also
Math functions

◆ operator!()

template<typename Derived>
const BooleanNotReturnType Eigen::ArrayBase< Derived >::operator! ( ) const
inline
Returns
an expression of the coefficient-wise ! operator of *this

Example:

Array3d v(1, 2, 3);
v(1) *= 0.0 / 0.0;
v(2) /= 0.0;
cout << v << endl << endl;
cout << !isfinite(v) << endl;

Output:

   1
-nan
 inf

0
1
1
See also
operator!=()

◆ operator&()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_and_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator& ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the bitwise and operator of *this and other
See also
operator|(), operator^()

◆ operator&&()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_boolean_and_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator&& ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of *this scaled by the scalar factor scalar
Template Parameters
Tis the scalar type of scalar. It must be compatible with the scalar type of the given expression.
Returns
an expression of *this divided by the scalar value scalar
Template Parameters
Tis the scalar type of scalar. It must be compatible with the scalar type of the given expression.
Returns
an expression of the coefficient-wise boolean and operator of *this and other

Example:

Array3d v(-1, 2, 1), w(-3, 2, 3);
cout << ((v < w) && (v < 0)) << endl;

Output:

0
0
0
See also
operator||(), select()

◆ operator*()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator* ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient wise product of *this and other
See also
MatrixBase\cwiseProduct

◆ operator*=()

template<typename Derived>
template<typename OtherDerived>
Derived & Eigen::ArrayBase< Derived >::operator*= ( const ArrayBase< OtherDerived > & other)
inline

replaces *this by *this * other coefficient wise.

Returns
a reference to *this

◆ operator+() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< sum< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator+ ( const Eigen::ArrayBase< OtherDerived > & other) const
Returns
an expression of the sum of *this and other
Note
If you want to add a given scalar to all coefficients, see Cwise::operator+().
See also
class CwiseBinaryOp, operator+=()

◆ operator+() [2/2]

template<typename Derived>
template<typename T>
const CwiseBinaryOp< internal::scalar_sum_op< Scalar, T >, Derived, Constant< T > > Eigen::ArrayBase< Derived >::operator+ ( const T & scalar) const
Returns
an expression of the coefficient-wise < operator of *this and other

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v < w) << endl;

Output:

1
0
0
See also
all(), any(), operator>(), operator<=()
Returns
an expression of the coefficient-wise <= operator of *this and other

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v <= w) << endl;

Output:

1
1
0
See also
all(), any(), operator>=(), operator<()
Returns
an expression of the coefficient-wise > operator of *this and other

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v > w) << endl;

Output:

0
0
1
See also
all(), any(), operator>=(), operator<()
Returns
an expression of the coefficient-wise >= operator of *this and other

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v >= w) << endl;

Output:

0
1
1
See also
all(), any(), operator>(), operator<=()
Returns
an expression of the coefficient-wise == operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v == w) << endl;

Output:

0
1
0
See also
all(), any(), isApprox(), isMuchSmallerThan()
Returns
an expression of the coefficient-wise != operator of *this and other
Warning
this performs an exact comparison, which is generally a bad idea with floating-point types. In order to check for equality between two vectors or matrices with floating-point coefficients, it is generally a far better idea to use a fuzzy comparison as provided by isApprox() and isMuchSmallerThan().

Example:

Array3d v(1, 2, 3), w(3, 2, 1);
cout << (v != w) << endl;

Output:

1
0
1
See also
all(), any(), isApprox(), isMuchSmallerThan()
Returns
an expression of *this with each coeff incremented by the constant scalar
Template Parameters
Tis the scalar type of scalar. It must be compatible with the scalar type of the given expression.

Example:

Array3d v(1, 2, 3);
cout << v + 5 << endl;

Output:

6
7
8
See also
operator+=(), operator-()

◆ operator+=()

template<typename Derived>
template<typename OtherDerived>
Derived & Eigen::ArrayBase< Derived >::operator+= ( const ArrayBase< OtherDerived > & other)
inline

replaces *this by *this + other.

Returns
a reference to *this

◆ operator-() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< difference< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator- ( const Eigen::ArrayBase< OtherDerived > & other) const
Returns
an expression of the difference of *this and other
Note
If you want to subtract a given scalar from all coefficients, see Cwise::operator-().
See also
class CwiseBinaryOp, operator-=()

◆ operator-() [2/2]

template<typename Derived>
template<typename T>
const CwiseBinaryOp< internal::scalar_difference_op< Scalar, T >, Derived, Constant< T > > Eigen::ArrayBase< Derived >::operator- ( const T & scalar) const
Returns
an expression of *this with each coeff decremented by the constant scalar
Template Parameters
Tis the scalar type of scalar. It must be compatible with the scalar type of the given expression.

Example:

Array3d v(1, 2, 3);
cout << v - 5 << endl;

Output:

-4
-3
-2
See also
operator+=(), operator-()

◆ operator-=()

template<typename Derived>
template<typename OtherDerived>
Derived & Eigen::ArrayBase< Derived >::operator-= ( const ArrayBase< OtherDerived > & other)
inline

replaces *this by *this - other.

Returns
a reference to *this

◆ operator/()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_quotient_op< Scalar, typename OtherDerived::Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator/ ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient wise quotient of *this and other
See also
MatrixBase\cwiseQuotient

◆ operator/=()

template<typename Derived>
template<typename OtherDerived>
Derived & Eigen::ArrayBase< Derived >::operator/= ( const ArrayBase< OtherDerived > & other)
inline

replaces *this by *this / other coefficient wise.

Returns
a reference to *this

◆ operator=() [1/2]

template<typename Derived>
Derived & Eigen::ArrayBase< Derived >::operator= ( const ArrayBase< Derived > & other)
inline

Special case of the template operator=, in order to prevent the compiler from generating a default operator= (issue hit with g++ 4.1)

◆ operator=() [2/2]

template<typename Derived>
Derived & Eigen::ArrayBase< Derived >::operator= ( const Scalar & value)
inline

Set all the entries to value.

See also
DenseBase::setConstant(), DenseBase::fill()

◆ operator^()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_xor_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator^ ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the bitwise xor operator of *this and other
See also
operator&(), operator|()

◆ operator|()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_bitwise_or_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator| ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the bitwise boolean or operator of *this and other
See also
operator&(), operator^()

◆ operator||()

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< internal::scalar_boolean_or_op< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::operator|| ( const Eigen::ArrayBase< OtherDerived > & other) const
inline
Returns
an expression of the coefficient-wise boolean or operator of *this and other

Example:

Array3d v(-1, 2, 1), w(-3, 2, 3);
cout << ((v < w) || (v < 0)) << endl;

Output:

1
0
1
See also
operator&&(), select()

◆ operator~()

template<typename Derived>
const BitwiseNotReturnType Eigen::ArrayBase< Derived >::operator~ ( ) const
inline
Returns
an expression of the bitwise ~ operator of *this

◆ pow() [1/2]

template<typename Derived>
template<typename OtherDerived>
const CwiseBinaryOp< pow< Scalar >, const Derived, const OtherDerived > Eigen::ArrayBase< Derived >::pow ( const Eigen::ArrayBase< OtherDerived > & other) const
Returns
an expression of the coefficient-wise power of *this to the given array of exponents.

This function computes the coefficient-wise power.

Example:

Array<double, 1, 3> x(8, 25, 3), e(1. / 3., 0.5, 2.);
cout << "[" << x << "]^[" << e << "] = " << x.pow(e) << endl; // using ArrayBase::pow
cout << "[" << x << "]^[" << e << "] = " << pow(x, e) << endl; // using Eigen::pow
const UnaryPowReturnType< ScalarExponent > pow(const ScalarExponent &exponent) const
Definition ArrayBase.h:542
General-purpose arrays with easy API for coefficient-wise operations.
Definition ForwardDeclarations.h:399

Output:

[ 8 25  3]^[0.333   0.5     2] = 2 5 9
[ 8 25  3]^[0.333   0.5     2] = 2 5 9

◆ pow() [2/2]

template<typename Derived>
template<typename ScalarExponent>
const UnaryPowReturnType< ScalarExponent > Eigen::ArrayBase< Derived >::pow ( const ScalarExponent & exponent) const
inline
Returns
an expression of the coefficients of *this raised to the constant power exponent
Template Parameters
ScalarExponentis the scalar type of exponent. It must be compatible with the scalar type of the given expression.
Parameters
exponentthe scalar exponent value.

This function computes the coefficient-wise power. The function MatrixBase\pow() in the unsupported module MatrixFunctions computes the matrix power.

Example:

Array3d v(8, 27, 64);
cout << v.pow(0.333333) << endl;

Output:

2
3
4
See also
ArrayBase::pow(ArrayBase), square(), cube(), exp(), log()

◆ rint()

template<typename Derived>
const RintReturnType Eigen::ArrayBase< Derived >::rint ( ) const
inline
Returns
an expression of the coefficient-wise rint of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
cout << v << endl << endl;
cout << rint(v) << endl;
const RintReturnType rint() const
Definition ArrayBase.h:333

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-1
 0
 1
 1
 2
See also
Math functions, ceil(), floor()

◆ round()

template<typename Derived>
const RoundReturnType Eigen::ArrayBase< Derived >::round ( ) const
inline
Returns
an expression of the coefficient-wise round of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
cout << v << endl << endl;
cout << round(v) << endl;
const RoundReturnType round() const
Definition ArrayBase.h:342

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-1
 0
 1
 1
 2
See also
Math functions, ceil(), floor()

◆ rsqrt()

template<typename Derived>
const RsqrtReturnType Eigen::ArrayBase< Derived >::rsqrt ( ) const
inline
Returns
an expression of the coefficient-wise inverse square root of *this.

This function computes the coefficient-wise inverse square root.

Example:

Array3d v(1, 2, 4);
cout << v.sqrt() << endl;

Output:

   1
1.41
   2
See also
pow(), square()

◆ shiftLeft()

template<typename Derived>
template<int N>
ShiftLeftXpr< N >::Type Eigen::ArrayBase< Derived >::shiftLeft ( ) const
inline
Returns
an expression of *this with the Scalar type logically shifted left by N bit positions.

The template parameter N specifies the number of bit positions to shift.

See also
shiftRight()

◆ shiftRight()

template<typename Derived>
template<int N>
ShiftRightXpr< N >::Type Eigen::ArrayBase< Derived >::shiftRight ( ) const
inline
Returns
an expression of *this with the Scalar type arithmetically shifted right by N bit positions.

The template parameter N specifies the number of bit positions to shift.

See also
shiftLeft()

◆ sign()

template<typename Derived>
const SignReturnType Eigen::ArrayBase< Derived >::sign ( ) const
inline
Returns
an expression of the coefficient-wise signum of *this.

This function computes the coefficient-wise signum.

Example:

Array3d v(-3, 5, 0);
cout << v.sign() << endl;

Output:

-1
 1
 0
See also
pow(), square()

◆ sin()

template<typename Derived>
const SinReturnType Eigen::ArrayBase< Derived >::sin ( ) const
inline
Returns
an expression of the coefficient-wise sine of *this.

This function computes the coefficient-wise sine. The function MatrixBase\sin() in the unsupported module MatrixFunctions computes the matrix sine.

Example:

Array3d v(EIGEN_PI, EIGEN_PI / 2, EIGEN_PI / 3);
cout << v.sin() << endl;

Output:

   -0
    1
0.866
See also
Math functions, cos(), asin()

◆ sinh()

template<typename Derived>
const SinhReturnType Eigen::ArrayBase< Derived >::sinh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic sin of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
cout << sinh(v) << endl;
const SinhReturnType sinh() const
Definition ArrayBase.h:266

Output:

    0
0.253
0.521
0.822
 1.18
See also
Math functions, sin(), tanh(), cosh()

◆ sqrt()

template<typename Derived>
const SqrtReturnType Eigen::ArrayBase< Derived >::sqrt ( ) const
inline
Returns
an expression of the coefficient-wise square root of *this.

This function computes the coefficient-wise square root. The function MatrixBase\sqrt() in the unsupported module MatrixFunctions computes the matrix square root.

Example:

Array3d v(1, 2, 4);
cout << v.sqrt() << endl;

Output:

   1
1.41
   2
See also
Math functions, pow(), square(), cbrt()

◆ square()

template<typename Derived>
const SquareReturnType Eigen::ArrayBase< Derived >::square ( ) const
inline
Returns
an expression of the coefficient-wise square of *this.

Example:

Array3d v(2, 3, 4);
cout << v.square() << endl;

Output:

 4
 9
16
See also
Math functions, abs2(), cube(), pow()

◆ tan()

template<typename Derived>
const TanReturnType Eigen::ArrayBase< Derived >::tan ( ) const
inline
Returns
an expression of the coefficient-wise tan of *this.

Example:

Array3d v(EIGEN_PI, EIGEN_PI / 2, EIGEN_PI / 3);
cout << v.tan() << endl;

Output:

-1.22e-16
 1.63e+16
     1.73
See also
Math functions, cos(), sin()

◆ tanh()

template<typename Derived>
const TanhReturnType Eigen::ArrayBase< Derived >::tanh ( ) const
inline
Returns
an expression of the coefficient-wise hyperbolic tan of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(5, 0, 1);
cout << tanh(v) << endl;
const TanhReturnType tanh() const
Definition ArrayBase.h:257

Output:

    0
0.245
0.462
0.635
0.762
See also
Math functions, tan(), sinh(), cosh()

◆ trunc()

template<typename Derived>
const TruncReturnType Eigen::ArrayBase< Derived >::trunc ( ) const
inline
Returns
an expression of the coefficient-wise truncation of *this.

Example:

ArrayXd v = ArrayXd::LinSpaced(7, -2, 2);
cout << v << endl << endl;
cout << trunc(v) << endl;
const TruncReturnType trunc() const
Definition ArrayBase.h:369

Output:

    -2
 -1.33
-0.667
     0
 0.667
  1.33
     2

-2
-1
-0
 0
 0
 1
 2
See also
Math functions, floor(), round()

◆ zeta()

template<typename Derived>
template<typename DerivedQ>
const CwiseBinaryOp< internal::scalar_zeta_op< Scalar >, const Derived, const DerivedQ > Eigen::ArrayBase< Derived >::zeta ( const Eigen::ArrayBase< DerivedQ > & q) const
inline
Returns
an expression of the coefficient-wise zeta function.

This is defined in the unsupported SpecialFunctions module.

#include <Eigen/SpecialFunctions>

It returns the Riemann zeta function of two arguments *this and q:

Parameters
qis the shift, it must be > 0
Note
*this is the exponent, it must be > 1.
This function supports only float and double scalar types. To support other scalar types, the user has to provide implementations of zeta(T,T) for any scalar type T to be supported.

This method is an alias for zeta(*this,q);

See also
Eigen::zeta()

Friends And Related Symbol Documentation

◆ atan2()

template<typename LhsDerived, typename RhsDerived>
const std::enable_if_t< std::is_same< typename LhsDerived::Scalar, typename RhsDerived::Scalar >::value, Eigen::CwiseBinaryOp< Eigen::internal::scalar_atan2_op< typename LhsDerived::Scalar, typename RhsDerived::Scalar >, const LhsDerived, const RhsDerived > > atan2 ( const Eigen::ArrayBase< LhsDerived > & x,
const Eigen::ArrayBase< RhsDerived > & exponents )
related
Returns
an expression of the coefficient-wise atan2(x, y). x and y must be of the same type.

This function computes the coefficient-wise atan2().

See also
ArrayBase::atan2()

◆ pow() [1/3]

template<typename Derived, typename ExponentDerived>
const Eigen::CwiseBinaryOp< Eigen::internal::scalar_pow_op< typename Derived::Scalar, typename ExponentDerived::Scalar >, const Derived, const ExponentDerived > pow ( const Eigen::ArrayBase< Derived > & x,
const Eigen::ArrayBase< ExponentDerived > & exponents )
related
Returns
an expression of the coefficient-wise power of x to the given array of exponents.

This function computes the coefficient-wise power.

Example:

Array<double, 1, 3> x(8, 25, 3), e(1. / 3., 0.5, 2.);
cout << "[" << x << "]^[" << e << "] = " << x.pow(e) << endl; // using ArrayBase::pow
cout << "[" << x << "]^[" << e << "] = " << pow(x, e) << endl; // using Eigen::pow

Output:

[ 8 25  3]^[0.333   0.5     2] = 2 5 9
[ 8 25  3]^[0.333   0.5     2] = 2 5 9
See also
ArrayBase::pow()

◆ pow() [2/3]

template<typename Derived, typename ScalarExponent>
const GlobalUnaryPowReturnType< Derived, ScalarExponent > pow ( const Eigen::ArrayBase< Derived > & x,
const ScalarExponent & exponent )
related
Returns
an expression of the coefficient-wise power of x to the given constant exponent.
Template Parameters
ScalarExponentis the scalar type of exponent. It must be compatible with the scalar type of the given expression (Derived::Scalar).
See also
ArrayBase::pow()

◆ pow() [3/3]

template<typename Scalar, typename Derived>
const CwiseBinaryOp< internal::scalar_pow_op< Scalar, Derived::Scalar >, Constant< Scalar >, Derived > pow ( const Scalar & x,
const Eigen::ArrayBase< Derived > & x )
related
Returns
an expression of the coefficient-wise power of the scalar x to the given array of exponents.

This function computes the coefficient-wise power between a scalar and an array of exponents.

Template Parameters
Scalaris the scalar type of x. It must be compatible with the scalar type of the given array expression (Derived::Scalar).

Example:

Array<double, 1, 3> e(2, -3, 1. / 3.);
cout << "10^[" << e << "] = " << pow(10, e) << endl;

Output:

10^[    2    -3 0.333] =   100 0.001  2.15
See also
ArrayBase::pow()

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