![]() |
Eigen
5.0.1
|
#include <Eigen/src/Core/DenseBase.h>
Base class for all dense matrices, vectors, and arrays.
This class is the base that is inherited by all dense objects (matrix, vector, arrays, and related expression types). The common Eigen API for dense objects is contained in this class.
| Derived | is the derived type, e.g., a matrix type or an expression. |
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_DENSEBASE_PLUGIN.
Inheritance diagram for Eigen::DenseBase< Derived >:Public Types | |
| enum | { RowsAtCompileTime , ColsAtCompileTime , SizeAtCompileTime , MaxRowsAtCompileTime , MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , NumDimensions , Flags , IsRowMajor , InnerSizeAtCompileTime , InnerStrideAtCompileTime , OuterStrideAtCompileTime } |
| typedef random_access_iterator_type | const_iterator |
| using | InnerIterator |
| typedef random_access_iterator_type | iterator |
| using | PlainArray |
| using | PlainMatrix |
| using | PlainObject |
| The plain matrix or array type corresponding to this expression. | |
| using | Scalar |
| using | StorageIndex |
| The type used to store indices. | |
| using | value_type |
Public Member Functions | |
| bool | all () const |
| bool | allFinite () const |
| bool | any () const |
| iterator | begin () |
| const_iterator | begin () const |
| template<int NRows, int NCols> | |
| constexpr FixedBlockXpr< NRows, NCols >::Type | block (Index startRow, Index startCol) |
| template<int NRows, int NCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr< NRows, NCols >::Type | block (Index startRow, Index startCol, Index blockRows, Index blockCols) |
| template<int NRows, int NCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr<...,... >::Type | block (Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols) |
| template<typename NRowsType, typename NColsType> | |
| constexpr 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> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | bottomLeftCorner () |
| template<int CRows, int CCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr<...,... >::Type | bottomLeftCorner (NRowsType cRows, NColsType cCols) |
| template<typename NRowsType, typename NColsType> | |
| constexpr ConstFixedBlockXpr<...,... >::Type | bottomLeftCorner (NRowsType cRows, NColsType cCols) const |
| This is the const version of bottomLeftCorner(NRowsType, NColsType). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | bottomRightCorner () |
| template<int CRows, int CCols> | |
| constexpr const ConstFixedBlockXpr< CRows, CCols >::Type | bottomRightCorner () const |
| This is the const version of bottomRightCorner<int, int>(). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | bottomRightCorner (Index cRows, Index cCols) |
| template<int CRows, int CCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr<...,... >::Type | bottomRightCorner (NRowsType cRows, NColsType cCols) |
| template<typename NRowsType, typename NColsType> | |
| constexpr const ConstFixedBlockXpr<...,... >::Type | bottomRightCorner (NRowsType cRows, NColsType cCols) const |
| This is the const version of bottomRightCorner(NRowsType, NColsType). | |
| template<int N> | |
| constexpr NRowsBlockXpr< N >::Type | bottomRows (Index n=N) |
| template<int N> | |
| constexpr ConstNRowsBlockXpr< N >::Type | bottomRows (Index n=N) const |
| This is the const version of bottomRows<int>(). | |
| template<typename NRowsType> | |
| constexpr NRowsBlockXpr<... >::Type | bottomRows (NRowsType n) |
| template<typename NRowsType> | |
| constexpr const ConstNRowsBlockXpr<... >::Type | bottomRows (NRowsType n) const |
| This is the const version of bottomRows(NRowsType). | |
| template<typename NewType> | |
| constexpr CastXpr< NewType >::Type | cast () const |
| const_iterator | cbegin () const |
| const_iterator | cend () const |
| constexpr ColXpr | col (Index i) |
| constexpr ConstColXpr | col (Index i) const |
| This is the const version of col(). | |
| ColwiseReturnType | colwise () |
| ConstColwiseReturnType | colwise () const |
| constexpr ConjugateReturnType | conjugate () const |
| template<bool Cond> | |
| constexpr 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> | |
| constexpr FixedSegmentReturnType< N >::Type | head (Index n=N) |
| template<int N> | |
| constexpr ConstFixedSegmentReturnType< N >::Type | head (Index n=N) const |
| This is the const version of head<int>(). | |
| template<typename NType> | |
| constexpr FixedSegmentReturnType<... >::Type | head (NType n) |
| template<typename NType> | |
| constexpr const ConstFixedSegmentReturnType<... >::Type | head (NType n) const |
| This is the const version of head(NType). | |
| constexpr NonConstImagReturnType | imag () |
| constexpr const ImagReturnType | imag () const |
| constexpr Index | innerSize () const |
| constexpr InnerVectorReturnType | innerVector (Index outer) |
| constexpr const ConstInnerVectorReturnType | innerVector (Index outer) const |
| constexpr InnerVectorsReturnType | innerVectors (Index outerStart, Index outerSize) |
| constexpr const ConstInnerVectorsReturnType | innerVectors (Index outerStart, Index outerSize) const |
| template<typename OtherDerived> | |
| constexpr 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> | |
| constexpr bool | isMuchSmallerThan (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const |
| template<typename Derived> | |
| constexpr 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 constexpr Derived & | lazyAssign (const DenseBase< OtherDerived > &other) |
| template<int N> | |
| constexpr NColsBlockXpr< N >::Type | leftCols (Index n=N) |
| template<int N> | |
| constexpr ConstNColsBlockXpr< N >::Type | leftCols (Index n=N) const |
| This is the const version of leftCols<int>(). | |
| template<typename NColsType> | |
| constexpr NColsBlockXpr<... >::Type | leftCols (NColsType n) |
| template<typename NColsType> | |
| constexpr const ConstNColsBlockXpr<... >::Type | leftCols (NColsType n) const |
| This is the const version of leftCols(NColsType). | |
| template<int NaNPropagation = PropagateFast> | |
| internal::traits< Derived >::Scalar | maxCoeff () const |
| template<int NaNPropagation = PropagateFast, typename IndexType> | |
| internal::traits< Derived >::Scalar | maxCoeff (IndexType *index) const |
| template<int NaNPropagation = PropagateFast, typename IndexType> | |
| internal::traits< Derived >::Scalar | maxCoeff (IndexType *row, IndexType *col) const |
| Scalar | mean () const |
| template<int N> | |
| constexpr NColsBlockXpr< N >::Type | middleCols (Index startCol, Index n=N) |
| template<int N> | |
| constexpr ConstNColsBlockXpr< N >::Type | middleCols (Index startCol, Index n=N) const |
| This is the const version of middleCols<int>(). | |
| template<typename NColsType> | |
| constexpr NColsBlockXpr<... >::Type | middleCols (Index startCol, NColsType numCols) |
| template<typename NColsType> | |
| constexpr const ConstNColsBlockXpr<... >::Type | middleCols (Index startCol, NColsType numCols) const |
| This is the const version of middleCols(Index,NColsType). | |
| template<int N> | |
| constexpr NRowsBlockXpr< N >::Type | middleRows (Index startRow, Index n=N) |
| template<int N> | |
| constexpr ConstNRowsBlockXpr< N >::Type | middleRows (Index startRow, Index n=N) const |
| This is the const version of middleRows<int>(). | |
| template<typename NRowsType> | |
| constexpr NRowsBlockXpr<... >::Type | middleRows (Index startRow, NRowsType n) |
| template<typename NRowsType> | |
| constexpr const ConstNRowsBlockXpr<... >::Type | middleRows (Index startRow, NRowsType n) const |
| This is the const version of middleRows(Index,NRowsType). | |
| template<int NaNPropagation = PropagateFast> | |
| internal::traits< Derived >::Scalar | minCoeff () const |
| template<int NaNPropagation = PropagateFast, typename IndexType> | |
| internal::traits< Derived >::Scalar | minCoeff (IndexType *index) const |
| template<int NaNPropagation = PropagateFast, typename IndexType> | |
| internal::traits< Derived >::Scalar | minCoeff (IndexType *row, IndexType *col) const |
| constexpr 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) |
| constexpr const NegativeReturnType | operator- () const |
| template<typename OtherDerived> | |
| CommaInitializer< Derived > | operator<< (const DenseBase< OtherDerived > &other) |
| CommaInitializer< Derived > | operator<< (const Scalar &s) |
| constexpr Derived & | operator= (const DenseBase &other) |
| template<typename OtherDerived> | |
| constexpr Derived & | operator= (const DenseBase< OtherDerived > &other) |
| template<typename OtherDerived> | |
| constexpr Derived & | operator= (const EigenBase< OtherDerived > &other) |
| Copies the generic expression other into *this. | |
| constexpr Index | outerSize () const |
| Scalar | prod () const |
| constexpr NonConstRealReturnType | real () |
| constexpr RealReturnType | real () const |
| RealViewReturnType | realView () |
| ConstRealViewReturnType | realView () const |
| This is the const version of realView(). | |
| 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, Dynamic > | replicate (Index rowFactor, Index colFactor) const |
| template<typename NRowsType, typename NColsType> | |
| const Replicate< Derived, internal::get_fixed_value< NRowsType >::value, internal::get_fixed_value< NColsType >::value > | replicate (NRowsType nRows, NColsType nCols) const |
| template<int Order = ColMajor> | |
| constexpr Reshaped< Derived,... > | reshaped () |
| template<int Order = ColMajor> | |
| constexpr const Reshaped< const Derived,... > | reshaped () const |
| This is the const version of reshaped(). | |
| template<int Order = ColMajor, typename NRowsType, typename NColsType> | |
| constexpr Reshaped< Derived,... > | reshaped (NRowsType nRows, NColsType nCols) |
| template<int Order = ColMajor, typename NRowsType, typename NColsType> | |
| constexpr 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> | |
| constexpr NColsBlockXpr< N >::Type | rightCols (Index n=N) |
| template<int N> | |
| constexpr ConstNColsBlockXpr< N >::Type | rightCols (Index n=N) const |
| This is the const version of rightCols<int>(). | |
| template<typename NColsType> | |
| constexpr NColsBlockXpr<... >::Type | rightCols (NColsType n) |
| template<typename NColsType> | |
| constexpr const ConstNColsBlockXpr<... >::Type | rightCols (NColsType n) const |
| This is the const version of rightCols(NColsType). | |
| constexpr RowXpr | row (Index i) |
| constexpr ConstRowXpr | row (Index i) const |
| This is the const version of row(). | |
| RowwiseReturnType | rowwise () |
| ConstRowwiseReturnType | rowwise () const |
| template<int N> | |
| constexpr FixedSegmentReturnType< N >::Type | segment (Index start, Index n=N) |
| template<int N> | |
| constexpr ConstFixedSegmentReturnType< N >::Type | segment (Index start, Index n=N) const |
| This is the const version of segment<int>(Index). | |
| template<typename NType> | |
| constexpr FixedSegmentReturnType<... >::Type | segment (Index start, NType n) |
| template<typename NType> | |
| constexpr const ConstFixedSegmentReturnType<... >::Type | segment (Index start, NType n) const |
| This is the const version of segment(Index,NType). | |
| template<typename ThenDerived, typename ElseDerived> | |
| constexpr 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> | |
| constexpr 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> | |
| constexpr 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> | |
| constexpr std::conditional_t< Direction==Vertical, ColXpr, RowXpr > | subVector (Index i) |
| template<DirectionType Direction> | |
| constexpr std::conditional_t< Direction==Vertical, ConstColXpr, ConstRowXpr > | subVector (Index i) const |
| template<DirectionType Direction> | |
| 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> | |
| constexpr FixedSegmentReturnType< N >::Type | tail (Index n=N) |
| template<int N> | |
| constexpr ConstFixedSegmentReturnType< N >::Type | tail (Index n=N) const |
| This is the const version of tail<int>(). | |
| template<typename NType> | |
| constexpr FixedSegmentReturnType<... >::Type | tail (NType n) |
| template<typename NType> | |
| constexpr const ConstFixedSegmentReturnType<... >::Type | tail (NType n) const |
| This is the const version of tail(NType). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | topLeftCorner () |
| template<int CRows, int CCols> | |
| constexpr const ConstFixedBlockXpr< CRows, CCols >::Type | topLeftCorner () const |
| This is the const version of topLeftCorner<int, int>(). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | topLeftCorner (Index cRows, Index cCols) |
| template<int CRows, int CCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr<...,... >::Type | topLeftCorner (NRowsType cRows, NColsType cCols) |
| template<typename NRowsType, typename NColsType> | |
| constexpr const ConstFixedBlockXpr<...,... >::Type | topLeftCorner (NRowsType cRows, NColsType cCols) const |
| This is the const version of topLeftCorner(Index, Index). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | topRightCorner () |
| template<int CRows, int CCols> | |
| constexpr const ConstFixedBlockXpr< CRows, CCols >::Type | topRightCorner () const |
| This is the const version of topRightCorner<int, int>(). | |
| template<int CRows, int CCols> | |
| constexpr FixedBlockXpr< CRows, CCols >::Type | topRightCorner (Index cRows, Index cCols) |
| template<int CRows, int CCols> | |
| constexpr 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> | |
| constexpr FixedBlockXpr<...,... >::Type | topRightCorner (NRowsType cRows, NColsType cCols) |
| template<typename NRowsType, typename NColsType> | |
| constexpr const ConstFixedBlockXpr<...,... >::Type | topRightCorner (NRowsType cRows, NColsType cCols) const |
| This is the const version of topRightCorner(NRowsType, NColsType). | |
| template<int N> | |
| constexpr NRowsBlockXpr< N >::Type | topRows (Index n=N) |
| template<int N> | |
| constexpr ConstNRowsBlockXpr< N >::Type | topRows (Index n=N) const |
| This is the const version of topRows<int>(). | |
| template<typename NRowsType> | |
| constexpr NRowsBlockXpr<... >::Type | topRows (NRowsType n) |
| template<typename NRowsType> | |
| constexpr 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> | |
| constexpr const CwiseUnaryOp< CustomUnaryOp, const Derived > | unaryExpr (const CustomUnaryOp &func=CustomUnaryOp()) const |
| Apply a unary operator coefficient-wise. | |
| template<typename CustomViewOp> | |
| constexpr CwiseUnaryView< CustomViewOp, Derived > | unaryViewExpr (const CustomViewOp &func=CustomViewOp()) |
| template<typename CustomViewOp> | |
| constexpr 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 > | |
| constexpr Index | colStride () const noexcept |
| constexpr Index | innerStride () const noexcept |
| constexpr Index | outerStride () const noexcept |
| constexpr Index | rowStride () const noexcept |
Static Public Member Functions | |
| 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 const RandomAccessLinSpacedReturnType | LinSpaced (Sequential_t, const Scalar &low, const Scalar &high) |
| static const RandomAccessLinSpacedReturnType | LinSpaced (Sequential_t, Index size, const Scalar &low, const Scalar &high) |
| template<typename CustomNullaryOp> | |
| static const CwiseNullaryOp< CustomNullaryOp, PlainObject > | NullaryExpr (const CustomNullaryOp &func) |
| template<typename CustomNullaryOp> | |
| static const CwiseNullaryOp< CustomNullaryOp, PlainObject > | NullaryExpr (Index rows, Index cols, const CustomNullaryOp &func) |
| template<typename CustomNullaryOp> | |
| static const CwiseNullaryOp< CustomNullaryOp, PlainObject > | NullaryExpr (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 | |
| constexpr | DenseBase ()=default |
Related Symbols | |
(Note that these are not member symbols.) | |
| template<typename Derived> | |
| std::ostream & | operator<< (std::ostream &s, const DenseBase< Derived > &m) |
| typedef random_access_iterator_type Eigen::DenseBase< Derived >::const_iterator |
This is the const version of iterator (aka read-only)
| using Eigen::DenseBase< Derived >::InnerIterator |
Inner iterator type to iterate over the coefficients of a row or column.
| typedef random_access_iterator_type Eigen::DenseBase< Derived >::iterator |
STL-like RandomAccessIterator iterator type as returned by the begin() and end() methods.
| using Eigen::DenseBase< Derived >::PlainArray |
The plain array type corresponding to this expression.
| using Eigen::DenseBase< Derived >::PlainMatrix |
The plain matrix type corresponding to this expression.
| using Eigen::DenseBase< Derived >::PlainObject |
The plain matrix or array type corresponding to this expression.
This is not necessarily exactly the return type of eval(). In the case of plain matrices, the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either PlainObject or const PlainObject&.
| using Eigen::DenseBase< Derived >::Scalar |
The numeric type of the expression's coefficients, e.g. float, double, int or std::complex<float>, etc.
| using Eigen::DenseBase< Derived >::StorageIndex |
The type used to store indices.
This typedef is relevant for types that store multiple indices such as PermutationMatrix or Transpositions, otherwise it defaults to Eigen::Index
| using Eigen::DenseBase< Derived >::value_type |
The numeric type of the expression's coefficients, e.g. float, double, int or std::complex<float>, etc.
It is an alias for the Scalar type
| anonymous enum |
| Enumerator | |
|---|---|
| RowsAtCompileTime | The number of rows at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.
|
| ColsAtCompileTime | The number of columns at compile-time. This is just a copy of the value provided by the Derived type. If a value is not known at compile-time, it is set to the Dynamic constant.
|
| SizeAtCompileTime | This is equal to the number of coefficients, i.e. the number of rows times the number of columns, or to Dynamic if this is not known at compile-time.
|
| MaxRowsAtCompileTime | This value is equal to the maximum possible number of rows that this expression might have. If this expression might have an arbitrarily high number of rows, this value is set to Dynamic. This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation. |
| MaxColsAtCompileTime | This value is equal to the maximum possible number of columns that this expression might have. If this expression might have an arbitrarily high number of columns, this value is set to Dynamic. This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation. |
| MaxSizeAtCompileTime | This value is equal to the maximum possible number of coefficients that this expression might have. If this expression might have an arbitrarily high number of coefficients, this value is set to Dynamic. This value is useful to know when evaluating an expression, in order to determine whether it is possible to avoid doing a dynamic memory allocation. |
| IsVectorAtCompileTime | This is set to true if either the number of rows or the number of columns is known at compile-time to be equal to 1. Indeed, in that case, we are dealing with a column-vector (if there is only one column) or with a row-vector (if there is only one row). |
| NumDimensions | This value is equal to Tensor::NumDimensions, i.e. 0 for scalars, 1 for vectors, and 2 for matrices. |
| Flags | This stores expression Flags flags which may or may not be inherited by new expressions constructed from this one. See the list of flags. |
| IsRowMajor | True if this expression has row-major storage order. |
|
constexprprotecteddefault |
Default constructor. Do nothing.
|
inline |
Example:
Output:
Is ( 0.68 -0.211 0.566) inside the box: 0 Is (0.597 0.823 0.605) inside the box: 1
|
inline |
*this contains only finite numbers, i.e., no NaN and no +/-INF values.
|
inline |
|
inline |
|
inline |
const version of begin()
|
inlineconstexpr |
*this.The template parameters NRows and NCols are the number of rows and columns in the block.
| startRow | the first row in the block |
| startCol | the first column in the block |
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.block<2,2>(1,1): -1122281286 -1843394476 -1364114958 35005211 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 0 0 278722862 1957747793 0 0 2145174067 -1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this.| NRows | number of rows in block as specified at compile-time |
| NCols | number of columns in block as specified at compile-time |
| startRow | the first row in the block |
| startCol | the first column in the block |
| blockRows | number of rows in block as specified at run-time |
| blockCols | number of columns in block as specified at run-time |
This function is mainly useful for blocks where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, blockRows should equal NRows unless NRows is Dynamic, and the same for the number of columns.
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is the block: -1122281286 -1843394476 278722862 -1364114958 35005211 2145174067 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 0 0 0 1957747793 0 0 0 -1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this with either dynamic or fixed sizes.| startRow | the first row in the block |
| startCol | the first column in the block |
| blockRows | number of rows in the block, specified at either run-time or compile-time |
| blockCols | number of columns in the block, specified at either run-time or compile-time |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example using runtime (aka dynamic) sizes:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.block(1, 1, 2, 2): -1122281286 -1843394476 -1364114958 35005211 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 0 0 278722862 1957747793 0 0 2145174067 -1427598262 -102585885 -1852781081 -1045969719
New in Eigen 3.4.:
The number of rows blockRows and columns blockCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. In the later case, n plays the role of a runtime fallback value in case N equals Eigen::Dynamic. Here is an example with a fixed number of rows NRows and dynamic number of columns cols:
This function thus fully covers the features offered by the following overloads block<NRows,NCols>(Index, Index), and block<NRows,NCols>(Index, Index, Index, Index) that are thus obsolete. Indeed, this generic version avoids redundancy, it preserves the argument order, and prevents the need to rely on the template keyword in templated code.
but with less redundancy and more consistency as it does not modify the argument order and seamlessly enable hybrid fixed/dynamic sizes.
|
inlineconstexpr |
*this.The template parameters CRows and CCols are the number of rows and columns in the corner.
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.bottomLeftCorner<2,2>():
1957747793 -1364114958
-1427598262 -102585885
Now the matrix m is:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
0 0 35005211 2145174067
0 0 -1852781081 -1045969719
|
inline |
*this.| CRows | number of rows in corner as specified at compile-time |
| CCols | number of columns in corner as specified at compile-time |
| cRows | number of rows in corner as specified at run-time |
| cCols | number of columns in corner as specified at run-time |
This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.bottomLeftCorner<2,Dynamic>(2,2):
1957747793 -1364114958
-1427598262 -102585885
Now the matrix m is:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
0 0 35005211 2145174067
0 0 -1852781081 -1045969719
|
inlineconstexpr |
*this with either dynamic or fixed sizes.| cRows | the number of rows in the corner |
| cCols | the number of columns in the corner |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.bottomLeftCorner(2, 2):
1957747793 -1364114958
-1427598262 -102585885
Now the matrix m is:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
0 0 35005211 2145174067
0 0 -1852781081 -1045969719
The number of rows blockRows and columns blockCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.The template parameters CRows and CCols are the number of rows and columns in the corner.
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.bottomRightCorner<2,2>(): 35005211 2145174067 -1852781081 -1045969719 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 0 0 -1427598262 -102585885 0 0
|
inlineconstexpr |
*this.| CRows | number of rows in corner as specified at compile-time |
| CCols | number of columns in corner as specified at compile-time |
| cRows | number of rows in corner as specified at run-time |
| cCols | number of columns in corner as specified at run-time |
This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.bottomRightCorner<2,Dynamic>(2,2): 35005211 2145174067 -1852781081 -1045969719 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 0 0 -1427598262 -102585885 0 0
|
inlineconstexpr |
*this with either dynamic or fixed sizes.| cRows | the number of rows in the corner |
| cCols | the number of columns in the corner |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.bottomRightCorner(2, 2): 35005211 2145174067 -1852781081 -1045969719 Now the matrix m is: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 0 0 -1427598262 -102585885 0 0
The number of rows blockRows and columns blockCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.| N | the number of rows in the block as specified at compile-time |
| n | the number of rows in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.bottomRows<2>():
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Now the array a is:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
0 0 0 0
0 0 0 0
|
inlineconstexpr |
*this.| n | the number of rows in the block |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.bottomRows(2):
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Now the array a is:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
0 0 0 0
0 0 0 0
The number of rows n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this with the Scalar type casted to NewScalar.The template parameter NewScalar is the type we are casting the scalars to.
|
inline |
returns a read-only const_iterator to the first element of the 1D vector or array This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
|
inline |
returns a read-only const_iterator to the element following the last element of the 1D vector or array This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
|
inlineconstexpr |
|
inline |
|
inline |
Example:
Output:
Here is the matrix m: -0.211 0.536 0.0268 0.597 0.108 0.832 -0.605 0.258 0.435 Here is the sum of each column: -0.219 0.902 1.29 Here is the maximum absolute value of each column: 0.605 0.536 0.832
|
inlineconstexpr |
*this.
|
inlineconstexpr |
*this if Cond==true, returns derived() otherwise.
|
inlinestatic |
This variant is only for fixed-size DenseBase types. For dynamic-size types, you need to use the variants taking size arguments.
|
inlinestatic |
The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this DenseBase type.
This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Constant(const Scalar&) should be used instead.
|
inlinestatic |
The parameter size is the size of the returned vector. Must be compatible with this DenseBase type.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Constant(const Scalar&) should be used instead.
| Index Eigen::DenseBase< Derived >::count | ( | ) | const |
|
inline |
|
inline |
const version of end()
|
inline |
Notice that in the case of a plain matrix or vector (not an expression) this function just returns a const reference, in order to avoid a useless copy.
|
inline |
Alias for setConstant(): sets all coefficients in this expression to val.
|
inline |
|
inline |
See class IOFormat for some examples.
|
inlineconstexpr |
*this.This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| N | the number of coefficients in the segment as specified at compile-time |
| n | the number of coefficients in the segment as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the vector v:
1804289383 -465790871 1957747793 -1427598262
Here is v.head(2):
1804289383 -465790871
Now the vector v is:
0 0 1957747793 -1427598262
|
inlineconstexpr |
*this with either dynamic or fixed sizes.This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| n | the number of coefficients in the segment |
| NType | the type of the value handling the number of coefficients in the segment, typically Index. |
Example:
Output:
Here is the vector v:
1804289383 -465790871 1957747793 -1427598262
Here is v.head(2):
1804289383 -465790871
Now the vector v is:
0 0 1957747793 -1427598262
The number of coefficients n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this. For real-valued objects the imaginary part is identically zero and not writable; this then returns the same read-only zero expression as the const overload.
|
inlineconstexpr |
*this.
|
inlineconstexpr |
|
inlineconstexpr |
*this if *this is col-major (resp. row-major).
|
inlineconstexpr |
*this if *this is col-major (resp. row-major). Read-only.
|
inlineconstexpr |
*this starting at outerStart if *this is col-major (resp. row-major).
|
inlineconstexpr |
*this starting at outerStart if *this is col-major (resp. row-major). Read-only.
|
constexpr |
true if *this is approximately equal to other, within the precision determined by prec.\[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \]
For matrices, the comparison is done using the Hilbert-Schmidt norm (aka Frobenius norm L2 norm).prec is a relative tolerance chosen by the caller, not a bound on floating-point rounding error. The default, NumTraits<Scalar>::dummy_precision(), does not account for the operation, dimensions, or conditioning of the problem. Choose an explicit tolerance when checking numerical accuracy. A norm comparison also does not bound the relative error of each coefficient.
*this is approximately equal to the zero matrix or vector. Indeed, isApprox(zero) returns false unless *this itself is exactly the zero matrix or vector. If you want to test whether *this is small relative to a reference norm, use isMuchSmallerThan() instead.
|
inline |
| bool Eigen::DenseBase< Derived >::isConstant | ( | const Scalar & | val, |
| const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() ) const |
This is just an alias for isApproxToConstant().
|
constexpr |
true if the norm of *this is much smaller than the norm of other, within the precision determined by prec.\[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \]
For matrices, the comparison is done using the Hilbert-Schmidt norm.
|
constexpr |
true if the norm of *this is much smaller than other, within the precision determined by prec.\[ \Vert v \Vert \leqslant p\,\vert x\vert. \]
For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, the value of the reference scalar other should come from the Hilbert-Schmidt norm of a reference matrix of same dimensions.
| bool Eigen::DenseBase< Derived >::isOnes | ( | const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() | ) | const |
Example:
Output:
Here's the matrix m: 1 1 1 1 1 1 1 1 1 m.isOnes() returns: 0 m.isOnes(1e-3) returns: 1
|
inline |
Example:
Output:
Here's the matrix m:
0 0 0.0001
0 0 0
0 0 0
m.isZero() returns: 0
m.isZero(1e-3) returns: 1
|
constexpr |
|
inlineconstexpr |
*this.| N | the number of columns in the block as specified at compile-time |
| n | the number of columns in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.leftCols<2>():
1804289383 -1550966999
-465790871 -1122281286
1957747793 -1364114958
-1427598262 -102585885
Now the array a is:
0 0 -782303108 336465782
0 0 -1843394476 278722862
0 0 35005211 2145174067
0 0 -1852781081 -1045969719
|
inlineconstexpr |
*this.| n | the number of columns in the block |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.leftCols(2):
1804289383 -1550966999
-465790871 -1122281286
1957747793 -1364114958
-1427598262 -102585885
Now the array a is:
0 0 -782303108 336465782
0 0 -1843394476 278722862
0 0 35005211 2145174067
0 0 -1852781081 -1045969719
The number of columns n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlinestatic |
Sets a linearly spaced vector.
The function generates 'size' equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
Example:
Output:
7 8 9 10 0 0.25 0.5 0.75 1
For integer scalar types, an even spacing is possible if and only if the length of the range, i.e., high-low is a scalar multiple of size-1, or if size is a scalar multiple of the number of values high-low+1 (meaning each value can be repeated the same number of times). If one of these two conditions is not satisfied, then high is lowered to the largest value satisfying one of this constraint. Here are some examples:
Example:
Output:
Even spacing inputs: 1 1 2 2 3 3 4 4 1 2 3 4 5 6 7 8 1 3 5 7 9 11 13 15 Uneven spacing inputs: 1 1 2 2 3 3 4 4 1 2 3 4 5 6 7 8 1 3 5 7 9 11 13 15
|
inlinestatic |
Sets a linearly spaced vector.
The function generates 'size' equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
Example:
Output:
7 8 9 10 0 0.25 0.5 0.75 1
For integer scalar types, an even spacing is possible if and only if the length of the range, i.e., high-low is a scalar multiple of size-1, or if size is a scalar multiple of the number of values high-low+1 (meaning each value can be repeated the same number of times). If one of these two conditions is not satisfied, then high is lowered to the largest value satisfying one of this constraint. Here are some examples:
Example:
Output:
Even spacing inputs: 1 1 2 2 3 3 4 4 1 2 3 4 5 6 7 8 1 3 5 7 9 11 13 15 Uneven spacing inputs: 1 1 2 2 3 3 4 4 1 2 3 4 5 6 7 8 1 3 5 7 9 11 13 15
|
inlinestatic |
|
inlinestatic |
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
Example:
Output:
7 8 9 10 0 0.25 0.5 0.75 1
|
inline |
*this. In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is maximum of elements that are not NaN | internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff | ( | IndexType * | indexPtr | ) | const |
If there are multiple coefficients with the same extreme value, the location of the first instance is returned.
In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is maximum of elements that are not NaN
| internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff | ( | IndexType * | rowId, |
| IndexType * | colId ) const |
If there are multiple coefficients with the same extreme value, the location of the first instance is returned.
In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is maximum of elements that are not NaN
|
inline |
|
inlineconstexpr |
*this.| N | the number of columns in the block as specified at compile-time |
| startCol | the index of the first column in the block |
| n | the number of columns in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
A = 1804289383 -1122281286 35005211 -1045969719 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450 -1550966999 -1843394476 2145174067 -1519308637 -1997685333 A(:,1..3) = -1122281286 35005211 -1045969719 -1364114958 -1852781081 1315634022 -102585885 336465782 -778350579 -782303108 278722862 -1087522255 -1843394476 2145174067 -1519308637
|
inlineconstexpr |
*this.| startCol | the index of the first column in the block |
| numCols | the number of columns in the block |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
A = 1804289383 -1122281286 35005211 -1045969719 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450 -1550966999 -1843394476 2145174067 -1519308637 -1997685333 A(1..3,:) = -1122281286 35005211 -1045969719 -1364114958 -1852781081 1315634022 -102585885 336465782 -778350579 -782303108 278722862 -1087522255 -1843394476 2145174067 -1519308637
The number of columns n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.| N | the number of rows in the block as specified at compile-time |
| startRow | the index of the first row in the block |
| n | the number of rows in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
A = 1804289383 -1122281286 35005211 -1045969719 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450 -1550966999 -1843394476 2145174067 -1519308637 -1997685333 A(1..3,:) = -465790871 -1364114958 -1852781081 1315634022 -1287999227 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450
|
inlineconstexpr |
*this.| startRow | the index of the first row in the block |
| n | the number of rows in the block |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
Example:
Output:
A = 1804289383 -1122281286 35005211 -1045969719 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450 -1550966999 -1843394476 2145174067 -1519308637 -1997685333 A(2..3,:) = 1957747793 -102585885 336465782 -778350579 608413784 -1427598262 -782303108 278722862 -1087522255 -412908450
The number of rows n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inline |
*this. In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is minimum of elements that are not NaN | internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff | ( | IndexType * | indexPtr | ) | const |
If there are multiple coefficients with the same extreme value, the location of the first instance is returned.
In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is minimum of elements that are not NaN
| internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff | ( | IndexType * | rowId, |
| IndexType * | colId ) const |
If there are multiple coefficients with the same extreme value, the location of the first instance is returned.
In case *this contains NaN, NaNPropagation determines the behavior: NaNPropagation == PropagateFast : undefined NaNPropagation == PropagateNaN : result is NaN NaNPropagation == PropagateNumbers : result is minimum of elements that are not NaN
|
inlineconstexpr |
|
inlinestatic |
This variant is only for fixed-size DenseBase types. For dynamic-size types, you need to use the variants taking size arguments.
The template parameter CustomNullaryOp is the type of the functor.
|
inlinestatic |
The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.
This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so NullaryExpr(const CustomNullaryOp&) should be used instead.
The template parameter CustomNullaryOp is the type of the functor.
|
inlinestatic |
The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so NullaryExpr(const CustomNullaryOp&) should be used instead.
The template parameter CustomNullaryOp is the type of the functor.
Here is an example with std random generators:
Output:
2 3 1 4 3 4 4 3 2 3
|
inlinestatic |
This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.
Example:
Output:
1 1 1 1 6 6 6 6
|
inlinestatic |
The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.
This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Ones() should be used instead.
Example:
Output:
1 1 1 1 1 1
|
inlinestatic |
The parameter newSize is the size of the returned vector. Must be compatible with this MatrixBase type.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Ones() should be used instead.
Example:
Output:
6 6 6 6 1 1
| IndexedView_or_VectorBlock Eigen::DenseBase< Derived >::operator() | ( | const Indices & | indices | ) |
This is an overload of operator()(const RowIndices&, const ColIndices&) for 1D vectors or arrays
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| IndexedView_or_Block Eigen::DenseBase< Derived >::operator() | ( | const RowIndices & | rowIndices, |
| const ColIndices & | colIndices ) |
Each parameter must either be:
int[N]<integral type> stands for any integer type compatible with Eigen::Index (i.e. std::ptrdiff_t).The last statement implies compatibility with std::vector, std::valarray, std::array, many of the Range-v3's ranges, etc.
If the submatrix can be represented using a starting position (i,j) and positive sizes (rows,columns), then this method will return a Block object after extraction of the relevant information from the passed arguments. This is the case when all arguments are either:
Otherwise a more general IndexedView<Derived,RowIndices',ColIndices'> object will be returned, after conversion of the inputs to more suitable types RowIndices' and ColIndices'.
For 1D vectors and arrays, it is better to use the operator()(const Indices&) overload, which behaves the same way but takes a single parameter.
See also this question and its answer for an example of how to duplicate coefficients.
|
inlineconstexpr |
*this bool coefficients. Cast to a signed integer type first.
|
inline |
|
inline |
Convenient operator to set the coefficients of a matrix.
The coefficients must be provided in a row major order and exactly match the size of the matrix. Otherwise an assertion is raised.
Example:
Output:
1 2 3 4 5 6 7 8 9 10 11 0 12 13 0 0 0 1 14 15 16 14 5 6 15 8 9
|
inlineconstexpr |
Special case of the template operator=, in order to prevent the compiler from generating a default operator= (issue hit with g++ 4.1)
|
inlineconstexpr |
Copies other into *this.
|
constexpr |
Copies the generic expression other into *this.
The expression must provide a (templated) evalTo(Derived& dst) const function which does the actual job. In practice, this allows any user to write its own special matrix without having to modify MatrixBase
|
inlineconstexpr |
|
inline |
Example:
Output:
Here is the matrix m: -0.211 0.536 0.0268 0.597 0.108 0.832 -0.605 0.258 0.435 Here is the product of all the coefficients: 1.1e-05
|
inlinestatic |
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.
Example:
Output:
40311868 -1793716316 665553156 -1025905432
This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary matrix whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.
|
inlinestatic |
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.
This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Random() should be used instead.
Example:
Output:
1804289383 1957747793 -1550966999 -465790871 -1427598262 -1122281286
This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary matrix whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.
See DenseBase::NullaryExpr(Index, const CustomNullaryOp&) for an example using std random generators.
|
inlinestatic |
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Random() should be used instead.
Example:
Output:
1804289383 -465790871
This expression has the "evaluate before nesting" flag so that it will be evaluated into a temporary vector whenever it is nested in a larger expression. This prevents unexpected behavior with expressions involving random matrices.
|
inlineconstexpr |
*this.
|
inlineconstexpr |
*this.| DenseBase< Derived >::RealViewReturnType Eigen::DenseBase< Derived >::realView | ( | ) |
*this as a real expression, twice as large along the inner dimension, holding the components interleaved in storage order. For a real *this it is the identity and returns *this itself, so everything below concerns a complex *this.real() and imag() build a view that is not packet accessible, so a reduction over either runs coefficient by coefficient. This view instead keeps whichever of linear access, packet access and writability *this itself provides, so where *this supplies them an operation that treats the components alike should prefer it:
covers both components in a single vectorized pass. Operations that must distinguish the components, or that need only one of them, still require real()/imag().
Writing through the returned expression additionally requires the scalar type to be std::complex, whose storage the standard fixes as its two components interleaved.
|
inline |
The template parameter BinaryOp is the type of the functor func which must be an associative operator. Coefficients are combined in traversal order, though possibly re-associated into groups. If Eigen::internal::functor_is_commutative<BinaryOp> is specialized to derive from std::true_type, the implementation may also reorder operands, which enables a faster reduction; Eigen's own sum, product, min and max functors opt in.
| const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate | ( | ) | const |
*this Example:
Output:
Here is the matrix m: 1804289383 1957747793 -1550966999 -465790871 -1427598262 -1122281286 m.replicate<3,2>() = ... 1804289383 1957747793 -1550966999 1804289383 1957747793 -1550966999 -465790871 -1427598262 -1122281286 -465790871 -1427598262 -1122281286 1804289383 1957747793 -1550966999 1804289383 1957747793 -1550966999 -465790871 -1427598262 -1122281286 -465790871 -1427598262 -1122281286 1804289383 1957747793 -1550966999 1804289383 1957747793 -1550966999 -465790871 -1427598262 -1122281286 -465790871 -1427598262 -1122281286
|
inline |
*this Example:
Output:
Here is the vector v: 1804289383 -465790871 1957747793 v.replicate(2,5) = ... 1804289383 1804289383 1804289383 1804289383 1804289383 -465790871 -465790871 -465790871 -465790871 -465790871 1957747793 1957747793 1957747793 1957747793 1957747793 1804289383 1804289383 1804289383 1804289383 1804289383 -465790871 -465790871 -465790871 -465790871 -465790871 1957747793 1957747793 1957747793 1957747793 1957747793
|
inline |
*this The replication factors can be passed at run time as integers, or at compile time as Eigen::fix<N> or Eigen::fix<N>(n). In the latter case, n is the runtime value used when N equals Eigen::Dynamic, and must equal N otherwise. For example, with a fixed row factor NRows and a runtime column factor cols:
|
inlineconstexpr |
*this with columns (or rows) stacked to a linear column vector| Order | specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor), or follows the natural order of the nested expression (AutoOrder). The default is ColMajor. |
This overload is essentially a shortcut for A.reshaped<Order>(AutoSize,fix<1>).
Order==ColMajor (the default), then it returns a column-vector from the stacked columns of *this.Order==RowMajor, then it returns a column-vector from the stacked rows of *this.Order==AutoOrder, then it returns a column-vector with elements stacked following the storage order of *this. This mode is the recommended one when the particular ordering of the element is not relevant.Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.reshaped().transpose(): 1804289383 -465790871 1957747793 -1427598262 -1550966999 -1122281286 -1364114958 -102585885 -782303108 -1843394476 35005211 -1852781081 336465782 278722862 2145174067 -1045969719 Here is m.reshaped<RowMajor>().transpose(): 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719
If you want more control, you can still fall back to reshaped(NRowsType,NColsType).
|
inlineconstexpr |
*this with reshaped sizes.| nRows | the number of rows in the reshaped expression, specified at either run-time or compile-time, or AutoSize |
| nCols | the number of columns in the reshaped expression, specified at either run-time or compile-time, or AutoSize |
| Order | specifies whether the coefficients should be processed in column-major-order (ColMajor), in row-major-order (RowMajor), or follows the natural order of the nested expression (AutoOrder). The default is ColMajor. |
| NRowsType | the type of the value handling the number of rows, typically Index. |
| NColsType | the type of the value handling the number of columns, typically Index. |
Dynamic size example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.reshaped(2, 8): 1804289383 1957747793 -1550966999 -1364114958 -782303108 35005211 336465782 2145174067 -465790871 -1427598262 -1122281286 -102585885 -1843394476 -1852781081 278722862 -1045969719
The number of rows nRows and columns nCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. In the latter case, n plays the role of a runtime fallback value in case N equals Eigen::Dynamic. Here is an example with a fixed number of rows and columns:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.reshaped(fix<2>,fix<8>): 1804289383 1957747793 -1550966999 -1364114958 -782303108 35005211 336465782 2145174067 -465790871 -1427598262 -1122281286 -102585885 -1843394476 -1852781081 278722862 -1045969719
Finally, one of the sizes parameter can be automatically deduced from the other one by passing AutoSize as in the following example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.reshaped(2, AutoSize): 1804289383 1957747793 -1550966999 -1364114958 -782303108 35005211 336465782 2145174067 -465790871 -1427598262 -1122281286 -102585885 -1843394476 -1852781081 278722862 -1045969719 Here is m.reshaped<RowMajor>(AutoSize, fix<8>): 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719
AutoSize does preserve compile-time sizes when possible, i.e., when the sizes of the input are known at compile time and that the other size is passed at compile-time using Eigen::fix<N> as above.
|
inline |
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does nothing else.
|
inline |
Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does nothing else.
|
inline |
Example:
Output:
Here is the matrix m: 1804289383 -1427598262 -1364114958 -1843394476 -465790871 -1550966999 -102585885 35005211 1957747793 -1122281286 -782303108 -1852781081 Here is the reverse of m: -1852781081 -782303108 -1122281286 1957747793 35005211 -102585885 -1550966999 -465790871 -1843394476 -1364114958 -1427598262 1804289383 Here is the coefficient (1,0) in the reverse of m: 35005211 Let us overwrite this coefficient with the value 4. Now the matrix m is: 1804289383 -1427598262 -1364114958 -1843394476 -465790871 -1550966999 -102585885 4 1957747793 -1122281286 -782303108 -1852781081
|
inline |
This is the const version of reverse().
|
inline |
This is the "in place" version of reverse: it reverses *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:
|
inlineconstexpr |
*this.| N | the number of columns in the block as specified at compile-time |
| n | the number of columns in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the array a: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is a.rightCols<2>(): -782303108 336465782 -1843394476 278722862 35005211 2145174067 -1852781081 -1045969719 Now the array a is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 1957747793 -1364114958 0 0 -1427598262 -102585885 0 0
|
inlineconstexpr |
*this.| n | the number of columns in the block |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
Here is the array a: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is a.rightCols(2): -782303108 336465782 -1843394476 278722862 35005211 2145174067 -1852781081 -1045969719 Now the array a is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 1957747793 -1364114958 0 0 -1427598262 -102585885 0 0
The number of columns n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
|
inline |
|
inline |
Example:
Output:
Here is the matrix m: -0.211 0.536 0.0268 0.597 0.108 0.832 -0.605 0.258 0.435 Here is the sum of each row: 0.352 1.54 0.0874 Here is the maximum absolute value of each row: 0.536 0.832 0.605
|
inlineconstexpr |
*this This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| N | the number of coefficients in the segment as specified at compile-time |
| start | the index of the first element in the segment |
| n | the number of coefficients in the segment as specified at compile-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the vector v: 1804289383 -465790871 1957747793 -1427598262 Here is v.segment<2>(1): -465790871 1957747793 Now the vector v is: 1804289383 -465790871 0 0
|
inlineconstexpr |
*this with either dynamic or fixed sizes.This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| start | the first coefficient in the segment |
| n | the number of coefficients in the segment |
| NType | the type of the value handling the number of coefficients in the segment, typically Index. |
Example:
Output:
Here is the vector v: 1804289383 -465790871 1957747793 -1427598262 Here is v.segment(1, 2): -465790871 1957747793 Now the vector v is: 1804289383 0 0 -1427598262
The number of coefficients n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this(i,j) != Scalar(0), and elseMatrix(i,j) otherwise.Example:
Output:
1 2 3 4 -5 -6 -7 -8 -9
|
inlineconstexpr |
Version of DenseBase::select(const DenseBase&, const DenseBase&) with the else expression being a scalar value.
|
inlineconstexpr |
Version of DenseBase::select(const DenseBase&, const DenseBase&) with the then expression being a scalar value.
|
inline |
Sets all coefficients in this expression to value val.
|
inline |
Sets a linearly spaced vector.
The function fills *this with equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
For integer scalar types, do not miss the explanations on the definition of even spacing .
|
inline |
Sets a linearly spaced vector.
The function generates 'size' equally spaced values in the closed interval [low,high]. When size is set to 1, a vector of length 1 containing 'high' is returned.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
Example:
Output:
0.5 0.75 1 1.25 1.5
For integer scalar types, do not miss the explanations on the definition of even spacing .
|
inline |
Sets all coefficients in this expression to one.
Example:
Output:
1804289383 -1550966999 -782303108 336465782
1 1 1 1
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
|
inline |
Sets all coefficients in this expression to random values.
Numbers are uniformly spread through their whole definition range for integer types, and in the [-1:1] range for floating point scalar types.
Example:
Output:
0 1804289383 0 0
0 -465790871 0 0
0 1957747793 0 0
0 -1427598262 0 0
|
inline |
Sets all coefficients in this expression to zero.
Example:
Output:
1804289383 -1550966999 -782303108 336465782
0 0 0 0
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
Direction
|
inlineconstexpr |
This is the const version of subVector(Index)
|
inlineconstexpr |
Direction
|
inline |
|
inline |
swaps *this with the expression other.
|
inline |
swaps *this with the matrix or array other.
|
inlineconstexpr |
*this.This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| N | the number of coefficients in the segment as specified at compile-time |
| n | the number of coefficients in the segment as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the vector v: 1804289383 -465790871 1957747793 -1427598262 Here is v.tail(2): 1957747793 -1427598262 Now the vector v is: 1804289383 -465790871 0 0
|
inlineconstexpr |
*this with either dynamic or fixed sizes.This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
| n | the number of coefficients in the segment |
| NType | the type of the value handling the number of coefficients in the segment, typically Index. |
Example:
Output:
Here is the vector v: 1804289383 -465790871 1957747793 -1427598262 Here is v.tail(2): 1957747793 -1427598262 Now the vector v is: 1804289383 -465790871 0 0
The number of coefficients n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.The template parameters CRows and CCols are the number of rows and columns in the corner.
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.topLeftCorner<2,2>():
1804289383 -1550966999
-465790871 -1122281286
Now the matrix m is:
0 0 -782303108 336465782
0 0 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this.| CRows | number of rows in corner as specified at compile-time |
| CCols | number of columns in corner as specified at compile-time |
| cRows | number of rows in corner as specified at run-time |
| cCols | number of columns in corner as specified at run-time |
This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.topLeftCorner<2,Dynamic>(2,2):
1804289383 -1550966999
-465790871 -1122281286
Now the matrix m is:
0 0 -782303108 336465782
0 0 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this with either dynamic or fixed sizes.| cRows | the number of rows in the corner |
| cCols | the number of columns in the corner |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example:
Output:
Here is the matrix m:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is m.topLeftCorner(2, 2):
1804289383 -1550966999
-465790871 -1122281286
Now the matrix m is:
0 0 -782303108 336465782
0 0 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
The number of rows blockRows and columns blockCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.| CRows | the number of rows in the corner |
| CCols | the number of columns in the corner |
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.topRightCorner<2,2>(): -782303108 336465782 -1843394476 278722862 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this.| CRows | number of rows in corner as specified at compile-time |
| CCols | number of columns in corner as specified at compile-time |
| cRows | number of rows in corner as specified at run-time |
| cCols | number of columns in corner as specified at run-time |
This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.
Example:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.topRightCorner<2,Dynamic>(2,2): -782303108 336465782 -1843394476 278722862 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this with either dynamic or fixed sizes.| cRows | the number of rows in the corner |
| cCols | the number of columns in the corner |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
| NColsType | the type of the value handling the number of columns in the block, typically Index. |
Example with dynamic sizes:
Output:
Here is the matrix m: 1804289383 -1550966999 -782303108 336465782 -465790871 -1122281286 -1843394476 278722862 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719 Here is m.topRightCorner(2, 2): -782303108 336465782 -1843394476 278722862 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 1957747793 -1364114958 35005211 2145174067 -1427598262 -102585885 -1852781081 -1045969719
The number of rows blockRows and columns blockCols can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inlineconstexpr |
*this.| N | the number of rows in the block as specified at compile-time |
| n | the number of rows in the block as specified at run-time |
The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.topRows<2>():
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
Now the array a is:
0 0 0 0
0 0 0 0
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
|
inlineconstexpr |
*this.| n | the number of rows in the block |
| NRowsType | the type of the value handling the number of rows in the block, typically Index. |
Example:
Output:
Here is the array a:
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
Here is a.topRows(2):
1804289383 -1550966999 -782303108 336465782
-465790871 -1122281286 -1843394476 278722862
Now the array a is:
0 0 0 0
0 0 0 0
1957747793 -1364114958 35005211 2145174067
-1427598262 -102585885 -1852781081 -1045969719
The number of rows n can also be specified at compile-time by passing Eigen::fix<N>, or Eigen::fix<N>(n) as arguments. See block() for the details.
|
inline |
Example:
Output:
Here is the matrix m: 1804289383 1957747793 -465790871 -1427598262 Here is the transpose of m: 1804289383 -465790871 1957747793 -1427598262 Here is the coefficient (1,0) in the transpose of m: 1957747793 Let us overwrite this coefficient with the value 0. Now the matrix m is: 1804289383 0 -465790871 -1427598262
|
inline |
This is the const version of transpose().
Make sure you read the warning for transpose() !
|
inline |
This is the "in place" version of transpose(): it replaces *this by its own transpose. Thus, doing
has the same effect on m as doing
and is faster and also safer because in the latter line of code, forgetting the eval() results in a bug caused by aliasing.
Notice however that this method is only useful if you want to replace a matrix by its own transpose. If you just need the transpose of a matrix, use transpose().
*this must be a resizable matrix. This excludes (non-square) fixed-size matrices, block-expressions and maps.
|
inlineconstexpr |
Apply a unary operator coefficient-wise.
| [in] | func | Functor implementing the unary operator |
| CustomUnaryOp | Type of func |
A lambda can be used to adapt a normal function to the functor interface expected by this method.
Example:
Output:
-0.211 0.108 0.435 -0.198
0.597 0.258 0.214 -0.782
-0.605 0.0268 -0.514 -0.563
0.536 0.832 0.608 0.678
becomes:
0 0.108 0.435 0
0.597 0.258 0.214 0
0 0.0268 0 0
0.536 0.832 0.608 0.678
Genuine functors allow for more possibilities, for instance it may contain a state.
Example:
Output:
-0.211 0.108 0.435 -0.198 0.597 0.258 0.214 -0.782 -0.605 0.0268 -0.514 -0.563 0.536 0.832 0.608 0.678 becomes: -0.211 0.108 0.435 -0.198 0.5 0.258 0.214 -0.5 -0.5 0.0268 -0.5 -0.5 0.5 0.5 0.5 0.5
|
inlineconstexpr |
The template parameter CustomUnaryOp is the type of the functor of the custom unary operator.
|
inlineconstexpr |
The template parameter CustomUnaryOp is the type of the functor of the custom unary operator.
Example:
Output:
-0.211 0.108 0.435 -0.198 0.597 0.258 0.214 -0.782 -0.605 0.0268 -0.514 -0.563 0.536 0.832 0.608 0.678 becomes: -0.211 0.108 0.435 -0.198 0.5 0.258 0.214 -0.5 -0.5 0.0268 -0.5 -0.5 0.5 0.5 0.5 0.5
|
inline |
| void Eigen::DenseBase< Derived >::visit | ( | Visitor & | visitor | ) | const |
Applies the visitor visitor to the whole coefficients of the matrix or vector.
The template parameter Visitor is the type of the visitor and provides the following interface:
|
inlinestatic |
This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.
Example:
Output:
0 0 0 0 0 0 0 0
|
inlinestatic |
The parameters rows and cols are the number of rows and of columns of the returned matrix. Must be compatible with this MatrixBase type.
This variant is meant to be used for dynamic-size matrix types. For fixed-size types, it is redundant to pass rows and cols as arguments, so Zero() should be used instead.
Example:
Output:
0 0 0 0 0 0
|
inlinestatic |
The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.
This is only for vectors (either row-vectors or column-vectors), i.e. matrices which are known at compile-time to have either one row or one column.
This variant is meant to be used for dynamic-size vector types. For fixed-size types, it is redundant to pass size as argument, so Zero() should be used instead.
Example:
Output:
0 0 0 0 0 0
|
Outputs the matrix, to the given stream.
If you wish to print the matrix with a format different than the default, use DenseBase::format().
It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters.