![]() |
Eigen
3.4.90 (git rev 9589cc4e7fd8e4538bedef80dd36c7738977a8be)
|
#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
.
Public Types | |
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 >::MaxColsAtCompileTime > | PlainArray |
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 >::MaxColsAtCompileTime > | PlainMatrix |
typedef std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > | PlainObject |
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 |
Public Member Functions | |
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, Dynamic > | replicate (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 |
![]() | |
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 |
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 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, 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)
typedef Eigen::InnerIterator<Derived> 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.
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>::MaxColsAtCompileTime> Eigen::DenseBase< Derived >::PlainArray |
The plain array type corresponding to this expression.
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>::MaxColsAtCompileTime> Eigen::DenseBase< Derived >::PlainMatrix |
The plain matrix type corresponding to this expression.
typedef std::conditional_t<internal::is_same<typename internal::traits<Derived>::XprKind, MatrixXpr>::value, PlainMatrix, PlainArray> 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&.
typedef internal::traits<Derived>::Scalar Eigen::DenseBase< Derived >::Scalar |
The numeric type of the expression' coefficients, e.g. float, double, int or std::complex<float>, etc.
typedef internal::traits<Derived>::StorageIndex 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
typedef Scalar Eigen::DenseBase< Derived >::value_type |
The numeric type of the expression' 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.824 0.924 -0.0532) inside the box: 0 Is (0.199 0.237 0.146) 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()
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.block<2,2>(1,1): -1122281286 304089172 -1364114958 35005211 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 0 0 -1868760786 -189735855 0 0 -2309581 719885386 2044897763 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is the block: -1122281286 304089172 -1868760786 -1364114958 35005211 -2309581 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 0 0 0 -189735855 0 0 0 719885386 2044897763 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.block(1, 1, 2, 2): -1122281286 304089172 -1364114958 35005211 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 0 0 -1868760786 -189735855 0 0 -2309581 719885386 2044897763 -1852781081 1101513929
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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomLeftCorner<2,2>(): -189735855 -1364114958 719885386 2044897763 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 0 0 35005211 -2309581 0 0 -1852781081 1101513929
|
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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomLeftCorner<2,Dynamic>(2,2): -189735855 -1364114958 719885386 2044897763 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 0 0 35005211 -2309581 0 0 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomLeftCorner(2, 2): -189735855 -1364114958 719885386 2044897763 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 0 0 35005211 -2309581 0 0 -1852781081 1101513929
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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomRightCorner<2,2>(): 35005211 -2309581 -1852781081 1101513929 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 0 0 719885386 2044897763 0 0
|
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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomRightCorner<2,Dynamic>(2,2): 35005211 -2309581 -1852781081 1101513929 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 0 0 719885386 2044897763 0 0
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.bottomRightCorner(2, 2): 35005211 -2309581 -1852781081 1101513929 Now the matrix m is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 0 0 719885386 2044897763 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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.bottomRows<2>(): -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Now the array a is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 0 0 0 0 0 0 0 0
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.bottomRows(2): -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Now the array a is: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 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.
|
inline |
*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.
|
inline |
|
inline |
|
inline |
Example:
Output:
Here is the matrix m: 0.696 0.334 0.445 0.205 -0.47 -0.633 -0.415 0.928 0.0241 Here is the sum of each column: 0.487 0.792 -0.163 Here is the maximum absolute value of each column: 0.696 0.928 0.633
|
inline |
*this
.
|
inline |
*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.
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 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 Zero() 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 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 Zero() should be used instead.
The template parameter CustomNullaryOp is the type of the functor.
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.
|
inline |
*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 -189735855 719885386 Here is v.head(2): 1804289383 -465790871 Now the vector v is: 0 0 -189735855 719885386
|
inline |
*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 -189735855 719885386 Here is v.head(2): 1804289383 -465790871 Now the vector v is: 0 0 -189735855 719885386
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.
|
inline |
*this
.
|
inline |
*this
.
|
inline |
|
inline |
*this
if *this
is col-major (resp. row-major).
|
inline |
*this
if *this
is col-major (resp. row-major). Read-only.
|
inline |
*this
if *this
is col-major (resp. row-major).
|
inline |
*this
if *this
is col-major (resp. row-major). Read-only. bool Eigen::DenseBase< Derived >::isApprox | ( | const DenseBase< OtherDerived > & | other, |
const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() ) const |
true
if *this
is approximately equal to other, within the precision determined by prec.
*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 zero, use internal::isMuchSmallerThan(const
RealScalar&, RealScalar) instead.bool Eigen::DenseBase< Derived >::isApproxToConstant | ( | const Scalar & | val, |
const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() ) const |
bool Eigen::DenseBase< Derived >::isConstant | ( | const Scalar & | val, |
const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() ) const |
This is just an alias for isApproxToConstant().
bool Eigen::DenseBase< Derived >::isMuchSmallerThan | ( | const DenseBase< OtherDerived > & | other, |
const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() ) const |
true
if the norm of *this
is much smaller than the norm of other, within the precision determined by prec.
bool Eigen::DenseBase< Derived >::isMuchSmallerThan | ( | const typename NumTraits< Scalar >::Real & | other, |
const RealScalar & | prec ) const |
true
if the norm of *this
is much smaller than other, within the precision determined by prec.
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
bool Eigen::DenseBase< Derived >::isZero | ( | const RealScalar & | prec = NumTraits<Scalar>::dummy_precision() | ) | const |
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
EIGEN_DEPRECATED Derived & Eigen::DenseBase< Derived >::lazyAssign | ( | const DenseBase< OtherDerived > & | other | ) |
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.leftCols<2>(): 1804289383 -1550966999 -465790871 -1122281286 -189735855 -1364114958 719885386 2044897763 Now the array a is: 0 0 1365180540 336465782 0 0 304089172 -1868760786 0 0 35005211 -2309581 0 0 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.leftCols(2): 1804289383 -1550966999 -465790871 -1122281286 -189735855 -1364114958 719885386 2044897763 Now the array a is: 0 0 1365180540 336465782 0 0 304089172 -1868760786 0 0 35005211 -2309581 0 0 -1852781081 1101513929
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 time). If one of these two considions 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 time). If one of these two considions 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 * | index | ) | const |
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 |
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 |
|
inline |
*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 1101513929 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198 -1550966999 304089172 -2309581 628175011 149798315 A(:,1..3) = -1122281286 35005211 1101513929 -1364114958 -1852781081 1315634022 2044897763 336465782 -778350579 1365180540 -1868760786 1059961393 304089172 -2309581 628175011
|
inline |
*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 1101513929 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198 -1550966999 304089172 -2309581 628175011 149798315 A(1..3,:) = -1122281286 35005211 1101513929 -1364114958 -1852781081 1315634022 2044897763 336465782 -778350579 1365180540 -1868760786 1059961393 304089172 -2309581 628175011
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.
|
inline |
*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 1101513929 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198 -1550966999 304089172 -2309581 628175011 149798315 A(1..3,:) = -465790871 -1364114958 -1852781081 1315634022 -1287999227 -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198
|
inline |
*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 1101513929 -1016307419 -465790871 -1364114958 -1852781081 1315634022 -1287999227 -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198 -1550966999 304089172 -2309581 628175011 149798315 A(2..3,:) = -189735855 2044897763 336465782 -778350579 -1539069864 719885386 1365180540 -1868760786 1059961393 1734575198
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 * | index | ) | const |
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 >::minCoeff | ( | IndexType * | rowId, |
IndexType * | colId ) const |
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 |
|
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 Zero() 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 Zero() should be used instead.
The template parameter CustomNullaryOp is the type of the functor.
Here is an example with C++11 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 returns 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, you better use the operator()(const Indices&) overload, which behave the same way but taking a single parameter.
See also this question and its answer for an example of how to duplicate coefficients.
|
inline |
*this
|
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
|
inline |
Special case of the template operator=, in order to prevent the compiler from generating a default operator= (issue hit with g++ 4.1)
|
inline |
Copies other into *this.
Derived & Eigen::DenseBase< Derived >::operator= | ( | const EigenBase< OtherDerived > & | other | ) |
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
|
inline |
|
inline |
Example:
Output:
Here is the matrix m: 0.696 0.334 0.445 0.205 -0.47 -0.633 -0.415 0.928 0.0241 Here is the product of all the coefficients: -5.85e-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 -189735855 -1550966999 -465790871 719885386 -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 C++11 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.
|
inline |
*this
.
|
inline |
*this
.
|
inline |
The template parameter BinaryOp is the type of the functor func which must be an associative operator. Both current C++98 and C++11 functor styles are handled.
const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate | ( | ) | const |
*this
Example:
Output:
Here is the matrix m: 1804289383 -189735855 -1550966999 -465790871 719885386 -1122281286 m.replicate<3,2>() = ... 1804289383 -189735855 -1550966999 1804289383 -189735855 -1550966999 -465790871 719885386 -1122281286 -465790871 719885386 -1122281286 1804289383 -189735855 -1550966999 1804289383 -189735855 -1550966999 -465790871 719885386 -1122281286 -465790871 719885386 -1122281286 1804289383 -189735855 -1550966999 1804289383 -189735855 -1550966999 -465790871 719885386 -1122281286 -465790871 719885386 -1122281286
|
inline |
*this
Example:
Output:
Here is the vector v: 1804289383 -465790871 -189735855 v.replicate(2,5) = ... 1804289383 1804289383 1804289383 1804289383 1804289383 -465790871 -465790871 -465790871 -465790871 -465790871 -189735855 -189735855 -189735855 -189735855 -189735855 1804289383 1804289383 1804289383 1804289383 1804289383 -465790871 -465790871 -465790871 -465790871 -465790871 -189735855 -189735855 -189735855 -189735855 -189735855
|
inline |
*this
with columns (or rows) stacked to a linear column vectorOrder | 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 overloads 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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.reshaped().transpose(): 1804289383 -465790871 -189735855 719885386 -1550966999 -1122281286 -1364114958 2044897763 1365180540 304089172 35005211 -1852781081 336465782 -1868760786 -2309581 1101513929 Here is m.reshaped<RowMajor>().transpose(): 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
If you want more control, you can still fall back to reshaped(NRowsType,NColsType).
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.reshaped(2, 8): 1804289383 -189735855 -1550966999 -1364114958 1365180540 35005211 336465782 -2309581 -465790871 719885386 -1122281286 2044897763 304089172 -1852781081 -1868760786 1101513929
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 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 and columns:
Output:
Here is the matrix m: 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.reshaped(fix<2>,fix<8>): 1804289383 -189735855 -1550966999 -1364114958 1365180540 35005211 336465782 -2309581 -465790871 719885386 -1122281286 2044897763 304089172 -1852781081 -1868760786 1101513929
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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.reshaped(2, AutoSize): 1804289383 -189735855 -1550966999 -1364114958 1365180540 35005211 336465782 -2309581 -465790871 719885386 -1122281286 2044897763 304089172 -1852781081 -1868760786 1101513929 Here is m.reshaped<RowMajor>(AutoSize, fix<8>): 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
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 719885386 -1364114958 304089172 -465790871 -1550966999 2044897763 35005211 -189735855 -1122281286 1365180540 -1852781081 Here is the reverse of m: -1852781081 1365180540 -1122281286 -189735855 35005211 2044897763 -1550966999 -465790871 304089172 -1364114958 719885386 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 719885386 -1364114958 304089172 -465790871 -1550966999 2044897763 4 -189735855 -1122281286 1365180540 -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:
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.rightCols<2>(): 1365180540 336465782 304089172 -1868760786 35005211 -2309581 -1852781081 1101513929 Now the array a is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 -189735855 -1364114958 0 0 719885386 2044897763 0 0
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.rightCols(2): 1365180540 336465782 304089172 -1868760786 35005211 -2309581 -1852781081 1101513929 Now the array a is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 -189735855 -1364114958 0 0 719885386 2044897763 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.
|
inline |
|
inline |
|
inline |
Example:
Output:
Here is the matrix m: 0.696 0.334 0.445 0.205 -0.47 -0.633 -0.415 0.928 0.0241 Here is the sum of each row: 1.48 -0.897 0.537 Here is the maximum absolute value of each row: 0.696 0.633 0.928
|
inline |
*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 -189735855 719885386 Here is v.segment<2>(1): -465790871 -189735855 Now the vector v is: 1804289383 -465790871 0 0
|
inline |
*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 -189735855 719885386 Here is v.segment(1, 2): -465790871 -189735855 Now the vector v is: 1804289383 0 0 719885386
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.
|
inline |
*this
(i,j) != Scalar(0), and elseMatrix(i,j) otherwise.Example:
Output:
1 2 3 4 -5 -6 -7 -8 -9
|
inline |
Version of DenseBase::select(const DenseBase&, const DenseBase&) with the else expression being a scalar value.
|
inline |
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 1365180540 336465782 1 1 1 1 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
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 -189735855 0 0 0 719885386 0 0
|
inline |
Sets all coefficients in this expression to zero.
Example:
Output:
1804289383 -1550966999 1365180540 336465782 0 0 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
inline |
Direction
|
inline |
This is the const version of subVector(Index)
|
inline |
Direction
|
inline |
|
inline |
swaps *this with the expression other.
|
inline |
swaps *this with the matrix or array other.
|
inline |
*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 -189735855 719885386 Here is v.tail(2): -189735855 719885386 Now the vector v is: 1804289383 -465790871 0 0
|
inline |
*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 -189735855 719885386 Here is v.tail(2): -189735855 719885386 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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topLeftCorner<2,2>(): 1804289383 -1550966999 -465790871 -1122281286 Now the matrix m is: 0 0 1365180540 336465782 0 0 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topLeftCorner<2,Dynamic>(2,2): 1804289383 -1550966999 -465790871 -1122281286 Now the matrix m is: 0 0 1365180540 336465782 0 0 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topLeftCorner(2, 2): 1804289383 -1550966999 -465790871 -1122281286 Now the matrix m is: 0 0 1365180540 336465782 0 0 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topRightCorner<2,2>(): 1365180540 336465782 304089172 -1868760786 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topRightCorner<2,Dynamic>(2,2): 1365180540 336465782 304089172 -1868760786 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is m.topRightCorner(2, 2): 1365180540 336465782 304089172 -1868760786 Now the matrix m is: 1804289383 -1550966999 0 0 -465790871 -1122281286 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
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.
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.topRows<2>(): 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 Now the array a is: 0 0 0 0 0 0 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
|
inline |
*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 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929 Here is a.topRows(2): 1804289383 -1550966999 1365180540 336465782 -465790871 -1122281286 304089172 -1868760786 Now the array a is: 0 0 0 0 0 0 0 0 -189735855 -1364114958 35005211 -2309581 719885386 2044897763 -1852781081 1101513929
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 -189735855 -465790871 719885386 Here is the transpose of m: 1804289383 -465790871 -189735855 719885386 Here is the coefficient (1,0) in the transpose of m: -189735855 Let us overwrite this coefficient with the value 0. Now the matrix m is: 1804289383 0 -465790871 719885386
|
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.
|
inline |
Apply a unary operator coefficient-wise.
[in] | func | Functor implementing the unary operator |
CustomUnaryOp | Type of func |
The function ptr_fun()
from the C++ standard library can be used to make functors out of normal functions.
Example:
Output:
0.696 -0.47 0.0241 0.134 0.205 0.928 0.0723 -0.16 -0.415 0.445 0.432 -0.00986 0.334 -0.633 -0.046 -0.498 becomes: 0.696 0 0.0241 0.134 0.205 0.928 0.0723 0 0 0.445 0.432 0 0.334 0 0 0
Genuine functors allow for more possibilities, for instance it may contain a state.
Example:
Output:
0.696 -0.47 0.0241 0.134 0.205 0.928 0.0723 -0.16 -0.415 0.445 0.432 -0.00986 0.334 -0.633 -0.046 -0.498 becomes: 0.5 -0.47 0.0241 0.134 0.205 0.5 0.0723 -0.16 -0.415 0.445 0.432 -0.00986 0.334 -0.5 -0.046 -0.498
|
inline |
The template parameter CustomUnaryOp is the type of the functor of the custom unary operator.
|
inline |
The template parameter CustomUnaryOp is the type of the functor of the custom unary operator.
Example:
Output:
0.696 -0.47 0.0241 0.134 0.205 0.928 0.0723 -0.16 -0.415 0.445 0.432 -0.00986 0.334 -0.633 -0.046 -0.498 becomes: 0.5 -0.47 0.0241 0.134 0.205 0.5 0.0723 -0.16 -0.415 0.445 0.432 -0.00986 0.334 -0.5 -0.046 -0.498
|
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.