Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::MatrixBase< Derived > Class Template Reference

Base class for all dense matrices, vectors, and expressions. More...

#include <src/eigen/Eigen/src/Core/MatrixBase.h>

+ Inheritance diagram for Eigen::MatrixBase< Derived >:
+ Collaboration diagram for Eigen::MatrixBase< Derived >:

Classes

struct  ConstDiagonalIndexReturnType
 
struct  ConstSelfAdjointViewReturnType
 
struct  ConstTriangularViewReturnType
 
struct  cross_product_return_type
 
struct  DiagonalIndexReturnType
 
struct  SelfAdjointViewReturnType
 
struct  TriangularViewReturnType
 

Public Types

enum  { HomogeneousReturnTypeDirection }
 
enum  { SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1 }
 
typedef MatrixBase StorageBaseType
 
typedef internal::traits< Derived >::StorageKind StorageKind
 
typedef internal::traits< Derived >::StorageIndex StorageIndex
 
typedef internal::traits< Derived >::Scalar Scalar
 
typedef internal::packet_traits< Scalar >::type PacketScalar
 
typedef NumTraits< Scalar >::Real RealScalar
 
typedef DenseBase< Derived > Base
 
typedef Base::CoeffReturnType CoeffReturnType
 
typedef Base::ConstTransposeReturnType ConstTransposeReturnType
 
typedef Base::RowXpr RowXpr
 
typedef Base::ColXpr ColXpr
 
typedef Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
 
typedef Base::PlainObject PlainObject
 
typedef CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObjectConstantReturnType
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
 
typedef Matrix< std::complex< RealScalar >, internal::traits< Derived >::ColsAtCompileTime, 1, ColMajorEigenvaluesReturnType
 
typedef CwiseNullaryOp< internal::scalar_identity_op< Scalar >, PlainObjectIdentityReturnType
 
typedef Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTimeBasisReturnType
 
typedef Diagonal< Derived > DiagonalReturnType
 
typedef internal::add_const< Diagonal< constDerived > >::type ConstDiagonalReturnType
 
typedef Diagonal< Derived, DynamicIndexDiagonalDynamicIndexReturnType
 
typedef internal::add_const< Diagonal< constDerived, DynamicIndex > >::type ConstDiagonalDynamicIndexReturnType
 
typedef Homogeneous< Derived, HomogeneousReturnTypeDirectionHomogeneousReturnType
 
typedef Block< const Derived, internal::traits< Derived >::ColsAtCompileTime==1 ? SizeMinusOne :1, internal::traits< Derived >::ColsAtCompileTime==1 ? 1 :SizeMinusOneConstStartMinusOne
 
typedef internal::stem_function< Scalar >::type StemFunction
 
enum  {
  RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime , ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime , SizeAtCompileTime , MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime ,
  MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime , MaxSizeAtCompileTime , IsVectorAtCompileTime , Flags = internal::traits<Derived>::Flags ,
  IsRowMajor = int(Flags) & RowMajorBit , InnerSizeAtCompileTime , InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret , OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
}
 
enum  { IsPlainObjectBase = 0 }
 
typedef Eigen::InnerIterator< Derived > InnerIterator
 
typedef Scalar value_type
 
typedef Matrix< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainMatrix
 
typedef Array< typename internal::traits< Derived >::Scalar, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime, AutoAlign|(internal::traits< Derived >::Flags &RowMajorBit ? RowMajor :ColMajor), internal::traits< Derived >::MaxRowsAtCompileTime, internal::traits< Derived >::MaxColsAtCompileTimePlainArray
 
typedef CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObjectSequentialLinSpacedReturnType
 
typedef CwiseNullaryOp< internal::linspaced_op< Scalar, PacketScalar >, PlainObjectRandomAccessLinSpacedReturnType
 
typedef Transpose< Derived > TransposeReturnType
 
typedef internal::add_const_on_value_type< typenameinternal::eval< Derived >::type >::type EvalReturnType
 
typedef VectorwiseOp< Derived, HorizontalRowwiseReturnType
 
typedef const VectorwiseOp< const Derived, HorizontalConstRowwiseReturnType
 
typedef VectorwiseOp< Derived, VerticalColwiseReturnType
 
typedef const VectorwiseOp< const Derived, VerticalConstColwiseReturnType
 
typedef CwiseNullaryOp< internal::scalar_random_op< Scalar >, PlainObjectRandomReturnType
 
typedef Reverse< Derived, BothDirectionsReverseReturnType
 
typedef const Reverse< const Derived, BothDirectionsConstReverseReturnType
 

Public Member Functions

EIGEN_DEVICE_FUNC Index diagonalSize () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator= (const MatrixBase &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator= (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator+= (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator-= (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived, LazyProductlazyProduct (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
Derived & operator*= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
void applyOnTheLeft (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
void applyOnTheRight (const EigenBase< OtherDerived > &other)
 
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC const Product< Derived, DiagonalDerived, LazyProductoperator* (const DiagonalBase< DiagonalDerived > &diagonal) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC RealScalar squaredNorm () const
 
EIGEN_DEVICE_FUNC RealScalar norm () const
 
RealScalar stableNorm () const
 
RealScalar blueNorm () const
 
RealScalar hypotNorm () const
 
EIGEN_DEVICE_FUNC const PlainObject normalized () const
 
EIGEN_DEVICE_FUNC const PlainObject stableNormalized () const
 
EIGEN_DEVICE_FUNC void normalize ()
 
EIGEN_DEVICE_FUNC void stableNormalize ()
 
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint () const
 
EIGEN_DEVICE_FUNC void adjointInPlace ()
 
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal ()
 
EIGEN_DEVICE_FUNC ConstDiagonalReturnType diagonal () const
 
template<int Index>
EIGEN_DEVICE_FUNC DiagonalIndexReturnType< Index >::Type diagonal ()
 
template<int Index>
EIGEN_DEVICE_FUNC ConstDiagonalIndexReturnType< Index >::Type diagonal () const
 
EIGEN_DEVICE_FUNC DiagonalDynamicIndexReturnType diagonal (Index index)
 
EIGEN_DEVICE_FUNC ConstDiagonalDynamicIndexReturnType diagonal (Index index) const
 
template<unsigned int Mode>
EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type triangularView ()
 
template<unsigned int Mode>
EIGEN_DEVICE_FUNC ConstTriangularViewReturnType< Mode >::Type triangularView () const
 
template<unsigned int UpLo>
EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
template<unsigned int UpLo>
EIGEN_DEVICE_FUNC ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
const SparseView< Derived > sparseView (const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal () const
 
const PermutationWrapper< const Derived > asPermutation () const
 
EIGEN_DEVICE_FUNC Derived & setIdentity ()
 
EIGEN_DEVICE_FUNC Derived & setIdentity (Index rows, Index cols)
 Resizes to the given size, and writes the identity expression (not necessarily square) into *this.
 
bool isIdentity (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isDiagonal (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isUpperTriangular (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isLowerTriangular (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
bool isOrthogonal (const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool isUnitary (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool operator== (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool operator!= (const MatrixBase< OtherDerived > &other) const
 
NoAlias< Derived, Eigen::MatrixBasenoalias ()
 
const Derived & forceAlignedAccess () const
 
Derived & forceAlignedAccess ()
 
template<bool Enable>
const Derived & forceAlignedAccessIf () const
 
template<bool Enable>
Derived & forceAlignedAccessIf ()
 
EIGEN_DEVICE_FUNC Scalar trace () const
 
template<int p>
EIGEN_DEVICE_FUNC RealScalar lpNorm () const
 
EIGEN_DEVICE_FUNC MatrixBase< Derived > & matrix ()
 
EIGEN_DEVICE_FUNC const MatrixBase< Derived > & matrix () const
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > array ()
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > array () const
 
const FullPivLU< PlainObjectfullPivLu () const
 
const PartialPivLU< PlainObjectpartialPivLu () const
 
const PartialPivLU< PlainObjectlu () const
 
const Inverse< Derived > inverse () const
 
template<typename ResultType >
void computeInverseAndDetWithCheck (ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
 
template<typename ResultType >
void computeInverseWithCheck (ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
 
Scalar determinant () const
 
const LLT< PlainObjectllt () const
 
const LDLT< PlainObjectldlt () const
 
const HouseholderQR< PlainObjecthouseholderQr () const
 
const ColPivHouseholderQR< PlainObjectcolPivHouseholderQr () const
 
const FullPivHouseholderQR< PlainObjectfullPivHouseholderQr () const
 
const CompleteOrthogonalDecomposition< PlainObjectcompleteOrthogonalDecomposition () const
 
EigenvaluesReturnType eigenvalues () const
 Computes the eigenvalues of a matrix.
 
RealScalar operatorNorm () const
 Computes the L2 operator norm.
 
JacobiSVD< PlainObjectjacobiSvd (unsigned int computationOptions=0) const
 
BDCSVD< PlainObjectbdcSvd (unsigned int computationOptions=0) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type cross (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC PlainObject cross3 (const MatrixBase< OtherDerived > &other) const
 
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal (void) const
 
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > eulerAngles (Index a0, Index a1, Index a2) const
 
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous () const
 
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE (ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType
 
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized () const
 homogeneous normalization
 
void makeHouseholderInPlace (Scalar &tau, RealScalar &beta)
 
template<typename EssentialPart >
void makeHouseholder (EssentialPart &essential, Scalar &tau, RealScalar &beta) const
 
template<typename EssentialPart >
void applyHouseholderOnTheLeft (const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
 
template<typename EssentialPart >
void applyHouseholderOnTheRight (const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
 
template<typename OtherScalar >
void applyOnTheLeft (Index p, Index q, const JacobiRotation< OtherScalar > &j)
 
template<typename OtherScalar >
void applyOnTheRight (Index p, Index q, const JacobiRotation< OtherScalar > &j)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Derived >::Type cwiseProduct (const SparseMatrixBase< OtherDerived > &other) const
 
const MatrixFunctionReturnValue< Derived > matrixFunction (StemFunction f) const
 Helper function for the unsupported MatrixFunctions module.
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator= (const ReturnByValue< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator-= (const MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & operator+= (const MatrixBase< OtherDerived > &other)
 
template<typename DiagonalDerived >
const Product< Derived, DiagonalDerived, LazyProductoperator* (const DiagonalBase< DiagonalDerived > &a_diagonal) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot (const MatrixBase< OtherDerived > &other) const
 
template<int p>
NumTraits< typenameinternal::traits< Derived >::Scalar >::Real lpNorm () const
 
template<bool Enable>
internal::add_const_on_value_type< typenameinternal::conditional< Enable, ForceAlignedAccess< Derived >, Derived & >::type >::type forceAlignedAccessIf () const
 
template<bool Enable>
internal::conditional< Enable, ForceAlignedAccess< Derived >, Derived & >::type forceAlignedAccessIf ()
 
template<typename OtherDerived >
const Product< Derived, OtherDerived > operator* (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
const Product< Derived, OtherDerived, LazyProductlazyProduct (const MatrixBase< OtherDerived > &other) const
 
template<unsigned int UpLo>
MatrixBase< Derived >::template ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView () const
 
template<unsigned int UpLo>
MatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type selfadjointView ()
 
template<unsigned int Mode>
MatrixBase< Derived >::template TriangularViewReturnType< Mode >::Type triangularView ()
 
template<unsigned int Mode>
MatrixBase< Derived >::template ConstTriangularViewReturnType< Mode >::Type triangularView () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC MatrixBase< Derived >::template cross_product_return_type< OtherDerived >::type cross (const MatrixBase< OtherDerived > &other) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & lazyAssign (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & lazyAssign (const DenseBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & operator+= (const EigenBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & operator-= (const EigenBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator*= (const Scalar &other)
 
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator/= (const Scalar &other)
 
EIGEN_DEVICE_FUNC Index nonZeros () const
 
EIGEN_DEVICE_FUNC Index outerSize () const
 
EIGEN_DEVICE_FUNC Index innerSize () const
 
EIGEN_DEVICE_FUNC void resize (Index newSize)
 
EIGEN_DEVICE_FUNC void resize (Index rows, Index cols)
 
EIGEN_DEVICE_FUNC CommaInitializer< Derived > operator<< (const Scalar &s)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer< Derived > operator<< (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
CommaInitializer< Derived > operator<< (const DenseBase< OtherDerived > &other)
 
template<unsigned int Added, unsigned int Removed>
EIGEN_DEPRECATED const Derived & flagged () const
 
EIGEN_DEVICE_FUNC TransposeReturnType transpose ()
 
EIGEN_DEVICE_FUNC ConstTransposeReturnType transpose () const
 
EIGEN_DEVICE_FUNC void transposeInPlace ()
 
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (Index rows, Index cols, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (Index size, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObjectNullaryExpr (const CustomNullaryOp &func)
 
EIGEN_DEVICE_FUNC void fill (const Scalar &value)
 
EIGEN_DEVICE_FUNC Derived & setConstant (const Scalar &value)
 
EIGEN_DEVICE_FUNC Derived & setLinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
EIGEN_DEVICE_FUNC Derived & setLinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
EIGEN_DEVICE_FUNC Derived & setZero ()
 
EIGEN_DEVICE_FUNC Derived & setOnes ()
 
EIGEN_DEVICE_FUNC Derived & setRandom ()
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool isApprox (const DenseBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
bool isApprox (const DenseBase< OtherDerived > &other, const RealScalar &prec) const
 
EIGEN_DEVICE_FUNC bool isMuchSmallerThan (const RealScalar &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC 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
 
template<typename OtherDerived >
bool isMuchSmallerThan (const DenseBase< OtherDerived > &other, const RealScalar &prec) const
 
EIGEN_DEVICE_FUNC bool isApproxToConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isConstant (const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isZero (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
EIGEN_DEVICE_FUNC bool isOnes (const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
 
bool hasNaN () const
 
bool allFinite () const
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void swap (const DenseBase< OtherDerived > &other)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void swap (PlainObjectBase< OtherDerived > &other)
 
EIGEN_DEVICE_FUNC const NestByValue< Derived > nestByValue () const
 
EIGEN_DEVICE_FUNC Scalar sum () const
 
EIGEN_DEVICE_FUNC Scalar mean () const
 
EIGEN_DEVICE_FUNC Scalar prod () const
 
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff () const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff (IndexType *row, IndexType *col) const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar minCoeff (IndexType *index) const
 
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff () const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff (IndexType *row, IndexType *col) const
 
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar maxCoeff (IndexType *index) const
 
template<typename BinaryOp >
EIGEN_DEVICE_FUNC Scalar redux (const BinaryOp &func) const
 
template<typename Func >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar redux (const Func &func) const
 
template<typename Visitor >
EIGEN_DEVICE_FUNC void visit (Visitor &func) const
 
const WithFormat< Derived > format (const IOFormat &fmt) const
 
EIGEN_DEVICE_FUNC CoeffReturnType value () const
 
EIGEN_DEVICE_FUNC bool all () const
 
EIGEN_DEVICE_FUNC bool any () const
 
EIGEN_DEVICE_FUNC Index count () const
 
EIGEN_DEVICE_FUNC ConstRowwiseReturnType rowwise () const
 
EIGEN_DEVICE_FUNC RowwiseReturnType rowwise ()
 
EIGEN_DEVICE_FUNC ConstColwiseReturnType colwise () const
 
EIGEN_DEVICE_FUNC ColwiseReturnType colwise ()
 
template<typename ThenDerived , typename ElseDerived >
const Select< Derived, ThenDerived, ElseDerived > select (const DenseBase< ThenDerived > &thenMatrix, const DenseBase< ElseDerived > &elseMatrix) const
 
template<typename ThenDerived >
const Select< Derived, ThenDerived, typename ThenDerived::ConstantReturnType > select (const DenseBase< ThenDerived > &thenMatrix, const typename ThenDerived::Scalar &elseScalar) const
 
template<typename ElseDerived >
const Select< Derived, typename ElseDerived::ConstantReturnType, ElseDerived > select (const typename ElseDerived::Scalar &thenScalar, const DenseBase< ElseDerived > &elseMatrix) const
 
template<int RowFactor, int ColFactor>
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > replicate () const
 
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamicreplicate (Index rowFactor, Index colFactor) const
 
template<int RowFactor, int ColFactor>
const Replicate< Derived, RowFactor, ColFactor > replicate () const
 
EIGEN_DEVICE_FUNC ReverseReturnType reverse ()
 
EIGEN_DEVICE_FUNC ConstReverseReturnType reverse () const
 
EIGEN_DEVICE_FUNC void reverseInPlace ()
 
template<typename Dest >
EIGEN_DEVICE_FUNC void evalTo (Dest &) const
 

Static Public Member Functions

static EIGEN_DEVICE_FUNC const IdentityReturnType Identity ()
 
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const BasisReturnType Unit (Index size, Index i)
 
static EIGEN_DEVICE_FUNC const BasisReturnType Unit (Index i)
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ ()
 
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW ()
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (Index rows, Index cols, const Scalar &value)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (Index size, const Scalar &value)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant (const Scalar &value)
 
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced (Sequential_t, Index size, const Scalar &low, const Scalar &high)
 
static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced (Index size, const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
static EIGEN_DEVICE_FUNC const SequentialLinSpacedReturnType LinSpaced (Sequential_t, const Scalar &low, const Scalar &high)
 
static EIGEN_DEVICE_FUNC const RandomAccessLinSpacedReturnType LinSpaced (const Scalar &low, const Scalar &high)
 Sets a linearly spaced vector.
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index rows, Index cols, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (Index size, const CustomNullaryOp &func)
 
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObjectNullaryExpr (const CustomNullaryOp &func)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero (Index size)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Zero ()
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones (Index rows, Index cols)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones (Index size)
 
static EIGEN_DEVICE_FUNC const ConstantReturnType Ones ()
 
static const RandomReturnType Random (Index rows, Index cols)
 
static const RandomReturnType Random (Index size)
 
static const RandomReturnType Random ()
 

Protected Member Functions

EIGEN_DEVICE_FUNC MatrixBase ()
 
template<typename OtherDerived >
Derived & operator+= (const ArrayBase< OtherDerived > &)
 
template<typename OtherDerived >
Derived & operator-= (const ArrayBase< OtherDerived > &)
 

Private Member Functions

EIGEN_DEVICE_FUNC MatrixBase (int)
 
EIGEN_DEVICE_FUNC MatrixBase (int, int)
 
template<typename OtherDerived >
EIGEN_DEVICE_FUNC MatrixBase (const MatrixBase< OtherDerived > &)
 

Related Symbols

(Note that these are not member symbols.)

template<typename Derived >
std::ostream & operator<< (std::ostream &s, const DenseBase< Derived > &m)
 

Detailed Description

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

Base class for all dense matrices, vectors, and expressions.

This class is the base that is inherited by all matrix, vector, and related expression types. Most of the Eigen API is contained in this class, and its base classes. Other important classes for the Eigen API are Matrix, and VectorwiseOp.

Note that some methods are defined in other modules such as the LU_Module LU module for all functions related to matrix inversions.

Template Parameters
Derivedis the derived type, e.g. a matrix type, or an expression, etc.

When writing a function taking Eigen objects as argument, if you want your function to take as argument any matrix, vector, or expression, just let it take a MatrixBase argument. As an example, here is a function printFirstRow which, given a matrix, vector, or expression x, prints the first row of x.

template<typename Derived>
void printFirstRow(const Eigen::MatrixBase<Derived>& x)
{
cout << x.row(0) << endl;
}
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50

This class can be extended with the help of the plugin mechanism described on the page TopicCustomizing_Plugins by defining the preprocessor symbol EIGEN_MATRIXBASE_PLUGIN.

See also
\blank TopicClassHierarchy

Class Documentation

◆ Eigen::MatrixBase::ConstDiagonalIndexReturnType

struct Eigen::MatrixBase::ConstDiagonalIndexReturnType
template<typename Derived>
template<int Index>
struct Eigen::MatrixBase< Derived >::ConstDiagonalIndexReturnType< Index >
Class Members
typedef const Diagonal< const Derived, Index > Type

◆ Eigen::MatrixBase::ConstSelfAdjointViewReturnType

struct Eigen::MatrixBase::ConstSelfAdjointViewReturnType
template<typename Derived>
template<unsigned int UpLo>
struct Eigen::MatrixBase< Derived >::ConstSelfAdjointViewReturnType< UpLo >
Class Members
typedef const SelfAdjointView< const Derived, UpLo > Type

◆ Eigen::MatrixBase::ConstTriangularViewReturnType

struct Eigen::MatrixBase::ConstTriangularViewReturnType
template<typename Derived>
template<unsigned int Mode>
struct Eigen::MatrixBase< Derived >::ConstTriangularViewReturnType< Mode >
Class Members
typedef const TriangularView< const Derived, Mode > Type

◆ Eigen::MatrixBase::cross_product_return_type

struct Eigen::MatrixBase::cross_product_return_type
template<typename Derived>
template<typename OtherDerived>
struct Eigen::MatrixBase< Derived >::cross_product_return_type< OtherDerived >
Class Members
typedef Scalar, Scalar >::ReturnType Scalar
typedef Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime > type

◆ Eigen::MatrixBase::DiagonalIndexReturnType

struct Eigen::MatrixBase::DiagonalIndexReturnType
template<typename Derived>
template<int Index>
struct Eigen::MatrixBase< Derived >::DiagonalIndexReturnType< Index >
Class Members
typedef Diagonal< Derived, Index > Type

◆ Eigen::MatrixBase::SelfAdjointViewReturnType

struct Eigen::MatrixBase::SelfAdjointViewReturnType
template<typename Derived>
template<unsigned int UpLo>
struct Eigen::MatrixBase< Derived >::SelfAdjointViewReturnType< UpLo >
Class Members
typedef SelfAdjointView< Derived, UpLo > Type

◆ Eigen::MatrixBase::TriangularViewReturnType

struct Eigen::MatrixBase::TriangularViewReturnType
template<typename Derived>
template<unsigned int Mode>
struct Eigen::MatrixBase< Derived >::TriangularViewReturnType< Mode >
Class Members
typedef TriangularView< Derived, Mode > Type

Member Typedef Documentation

◆ AdjointReturnType

◆ Base

template<typename Derived >
typedef DenseBase<Derived> Eigen::MatrixBase< Derived >::Base

◆ BasisReturnType

◆ CoeffReturnType

template<typename Derived >
typedef Base::CoeffReturnType Eigen::MatrixBase< Derived >::CoeffReturnType

◆ ColwiseReturnType

template<typename Derived >
typedef VectorwiseOp<Derived, Vertical> Eigen::DenseBase< Derived >::ColwiseReturnType
inherited

◆ ColXpr

template<typename Derived >
typedef Base::ColXpr Eigen::MatrixBase< Derived >::ColXpr

◆ ConstantReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> Eigen::MatrixBase< Derived >::ConstantReturnType

◆ ConstColwiseReturnType

template<typename Derived >
typedef const VectorwiseOp<const Derived, Vertical> Eigen::DenseBase< Derived >::ConstColwiseReturnType
inherited

◆ ConstDiagonalDynamicIndexReturnType

template<typename Derived >
typedef internal::add_const<Diagonal<constDerived,DynamicIndex>>::type Eigen::MatrixBase< Derived >::ConstDiagonalDynamicIndexReturnType

◆ ConstDiagonalReturnType

template<typename Derived >
typedef internal::add_const<Diagonal<constDerived>>::type Eigen::MatrixBase< Derived >::ConstDiagonalReturnType

◆ ConstReverseReturnType

template<typename Derived >
typedef const Reverse<const Derived, BothDirections> Eigen::DenseBase< Derived >::ConstReverseReturnType
inherited

◆ ConstRowwiseReturnType

template<typename Derived >
typedef const VectorwiseOp<const Derived, Horizontal> Eigen::DenseBase< Derived >::ConstRowwiseReturnType
inherited

◆ ConstStartMinusOne

template<typename Derived >
typedef Block<const Derived, internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1, internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> Eigen::MatrixBase< Derived >::ConstStartMinusOne

◆ ConstTransposeReturnType

template<typename Derived >
typedef Base::ConstTransposeReturnType Eigen::MatrixBase< Derived >::ConstTransposeReturnType

◆ DiagonalDynamicIndexReturnType

template<typename Derived >
typedef Diagonal<Derived,DynamicIndex> Eigen::MatrixBase< Derived >::DiagonalDynamicIndexReturnType

◆ DiagonalReturnType

template<typename Derived >
typedef Diagonal<Derived> Eigen::MatrixBase< Derived >::DiagonalReturnType

◆ EigenvaluesReturnType

template<typename Derived >
typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> Eigen::MatrixBase< Derived >::EigenvaluesReturnType

◆ EvalReturnType

template<typename Derived >
typedef internal::add_const_on_value_type<typenameinternal::eval<Derived>::type>::type Eigen::DenseBase< Derived >::EvalReturnType
inherited

◆ HomogeneousReturnType

template<typename Derived >
typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> Eigen::MatrixBase< Derived >::HomogeneousReturnType

◆ IdentityReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,PlainObject> Eigen::MatrixBase< Derived >::IdentityReturnType

◆ InnerIterator

template<typename Derived >
typedef Eigen::InnerIterator<Derived> Eigen::DenseBase< Derived >::InnerIterator
inherited

Inner iterator type to iterate over the coefficients of a row or column.

See also
class InnerIterator

◆ PacketScalar

template<typename Derived >
typedef internal::packet_traits<Scalar>::type Eigen::MatrixBase< Derived >::PacketScalar

◆ PlainArray

The plain array type corresponding to this expression.

See also
PlainObject

◆ PlainMatrix

The plain matrix type corresponding to this expression.

See also
PlainObject

◆ PlainObject

template<typename Derived >
typedef Base::PlainObject Eigen::MatrixBase< Derived >::PlainObject

◆ RandomAccessLinSpacedReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> Eigen::DenseBase< Derived >::RandomAccessLinSpacedReturnType
inherited

◆ RandomReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::scalar_random_op<Scalar>,PlainObject> Eigen::DenseBase< Derived >::RandomReturnType
inherited

◆ RealScalar

template<typename Derived >
typedef NumTraits<Scalar>::Real Eigen::MatrixBase< Derived >::RealScalar

◆ ReverseReturnType

template<typename Derived >
typedef Reverse<Derived, BothDirections> Eigen::DenseBase< Derived >::ReverseReturnType
inherited

◆ RowwiseReturnType

template<typename Derived >
typedef VectorwiseOp<Derived, Horizontal> Eigen::DenseBase< Derived >::RowwiseReturnType
inherited

◆ RowXpr

template<typename Derived >
typedef Base::RowXpr Eigen::MatrixBase< Derived >::RowXpr

◆ Scalar

template<typename Derived >
typedef internal::traits<Derived>::Scalar Eigen::MatrixBase< Derived >::Scalar

◆ SequentialLinSpacedReturnType

template<typename Derived >
typedef CwiseNullaryOp<internal::linspaced_op<Scalar,PacketScalar>,PlainObject> Eigen::DenseBase< Derived >::SequentialLinSpacedReturnType
inherited

◆ SquareMatrixType

type of the equivalent square matrix

◆ StemFunction

template<typename Derived >
typedef internal::stem_function<Scalar>::type Eigen::MatrixBase< Derived >::StemFunction

◆ StorageBaseType

template<typename Derived >
typedef MatrixBase Eigen::MatrixBase< Derived >::StorageBaseType

◆ StorageIndex

template<typename Derived >
typedef internal::traits<Derived>::StorageIndex Eigen::MatrixBase< Derived >::StorageIndex

◆ StorageKind

template<typename Derived >
typedef internal::traits<Derived>::StorageKind Eigen::MatrixBase< Derived >::StorageKind

◆ TransposeReturnType

template<typename Derived >
typedef Transpose<Derived> Eigen::DenseBase< Derived >::TransposeReturnType
inherited

◆ value_type

template<typename Derived >
typedef Scalar Eigen::DenseBase< Derived >::value_type
inherited

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

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
inherited
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.

See also
MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime
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.

See also
MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime
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.

See also
RowsAtCompileTime, ColsAtCompileTime
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.

See also
RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
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.

See also
ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
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.

See also
SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime
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).

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.

InnerSizeAtCompileTime 
InnerStrideAtCompileTime 
OuterStrideAtCompileTime 
98 {
99
100 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
106 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
113 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
114 internal::traits<Derived>::ColsAtCompileTime>::ret),
119 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
130 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
141 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
142 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
153 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
154 || internal::traits<Derived>::MaxColsAtCompileTime == 1,
160 Flags = internal::traits<Derived>::Flags,
165 IsRowMajor = int(Flags) & RowMajorBit,
169
170 InnerStrideAtCompileTime = internal::inner_stride_at_compile_time<Derived>::ret,
171 OuterStrideAtCompileTime = internal::outer_stride_at_compile_time<Derived>::ret
172 };
@ IsVectorAtCompileTime
Definition DenseBase.h:153
@ SizeAtCompileTime
Definition DenseBase.h:113
@ MaxSizeAtCompileTime
Definition DenseBase.h:141
@ IsRowMajor
Definition DenseBase.h:165
@ OuterStrideAtCompileTime
Definition DenseBase.h:171
@ Flags
Definition DenseBase.h:160
@ ColsAtCompileTime
Definition DenseBase.h:106
@ InnerSizeAtCompileTime
Definition DenseBase.h:167
@ InnerStrideAtCompileTime
Definition DenseBase.h:170
@ MaxColsAtCompileTime
Definition DenseBase.h:130
@ MaxRowsAtCompileTime
Definition DenseBase.h:119
@ RowsAtCompileTime
Definition DenseBase.h:100
const unsigned int RowMajorBit
Definition Constants.h:61
Definition Eigen_Colamd.h:50

◆ anonymous enum

template<typename Derived >
anonymous enum
inherited
Enumerator
IsPlainObjectBase 
176{ IsPlainObjectBase = 0 };
@ IsPlainObjectBase
Definition DenseBase.h:176

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
HomogeneousReturnTypeDirection 
@ HomogeneousReturnTypeDirection
Definition MatrixBase.h:397
@ ColsAtCompileTime
Definition DenseBase.h:106
@ RowsAtCompileTime
Definition DenseBase.h:100
@ Horizontal
Definition Constants.h:268
@ Vertical
Definition Constants.h:265

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
SizeMinusOne 
403 {
405 };
@ SizeMinusOne
Definition MatrixBase.h:404
@ SizeAtCompileTime
Definition DenseBase.h:113
const int Dynamic
Definition Constants.h:21

Constructor & Destructor Documentation

◆ MatrixBase() [1/4]

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::MatrixBase< Derived >::MatrixBase ( )
inlineprotected
467: Base() {}
DenseBase< Derived > Base
Definition MatrixBase.h:60

◆ MatrixBase() [2/4]

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::MatrixBase< Derived >::MatrixBase ( int  )
explicitprivate

◆ MatrixBase() [3/4]

template<typename Derived >
EIGEN_DEVICE_FUNC Eigen::MatrixBase< Derived >::MatrixBase ( int  ,
int   
)
private

◆ MatrixBase() [4/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Eigen::MatrixBase< Derived >::MatrixBase ( const MatrixBase< OtherDerived > &  )
explicitprivate

Member Function Documentation

◆ adjoint()

template<typename Derived >
const MatrixBase< Derived >::AdjointReturnType Eigen::MatrixBase< Derived >::adjoint
inline
Returns
an expression of the adjoint (i.e. conjugate transpose) of *this.

Example:

Output:

Warning
If you want to replace a matrix by its own adjoint, do NOT do this:
m = m.adjoint(); // bug!!! caused by aliasing effect
Instead, use the adjointInPlace() method:
m.adjointInPlace();
which gives Eigen good opportunities for optimization, or alternatively you can also do:
m = m.adjoint().eval();
See also
adjointInPlace(), transpose(), conjugate(), class Transpose, class internal::scalar_conjugate_op
211{
212 return AdjointReturnType(this->transpose());
213}
EIGEN_DEVICE_FUNC TransposeReturnType transpose()
Definition Transpose.h:172
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
Definition MatrixBase.h:112

◆ adjointInPlace()

template<typename Derived >
void Eigen::MatrixBase< Derived >::adjointInPlace
inline

This is the "in place" version of adjoint(): it replaces *this by its own transpose. Thus, doing

m.adjointInPlace();

has the same effect on m as doing

m = m.adjoint().eval();

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 adjoint. If you just need the adjoint of a matrix, use adjoint().

Note
if the matrix is not square, then *this must be a resizable matrix. This excludes (non-square) fixed-size matrices, block-expressions and maps.
See also
transpose(), adjoint(), transposeInPlace()
316{
317 derived() = adjoint().eval();
318}
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition Transpose.h:210

◆ all()

template<typename Derived >
bool Eigen::DenseBase< Derived >::all
inlineinherited
Returns
true if all coefficients are true

Example:

Output:

See also
any(), Cwise::operator<()
82{
83 typedef internal::evaluator<Derived> Evaluator;
84 enum {
85 unroll = SizeAtCompileTime != Dynamic
86 && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
87 };
88 Evaluator evaluator(derived());
89 if(unroll)
90 return internal::all_unroller<Evaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(evaluator);
91 else
92 {
93 for(Index j = 0; j < cols(); ++j)
94 for(Index i = 0; i < rows(); ++i)
95 if (!evaluator.coeff(i, j)) return false;
96 return true;
97 }
98}
#define EIGEN_UNROLLING_LIMIT
Definition Settings.h:24
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33
size_t cols(const T &raster)
Definition MarchingSquares.hpp:60
size_t rows(const T &raster)
Definition MarchingSquares.hpp:55

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ allFinite()

template<typename Derived >
bool Eigen::DenseBase< Derived >::allFinite
inlineinherited
Returns
true if *this contains only finite numbers, i.e., no NaN and no +/-INF values.
See also
hasNaN()
154{
155#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
156 return derived().array().isFinite().all();
157#else
158 return !((derived()-derived()).hasNaN());
159#endif
160}
bool hasNaN() const
Definition BooleanRedux.h:139

◆ any()

template<typename Derived >
bool Eigen::DenseBase< Derived >::any
inlineinherited
Returns
true if at least one coefficient is true
See also
all()
106{
107 typedef internal::evaluator<Derived> Evaluator;
108 enum {
109 unroll = SizeAtCompileTime != Dynamic
110 && SizeAtCompileTime * (Evaluator::CoeffReadCost + NumTraits<Scalar>::AddCost) <= EIGEN_UNROLLING_LIMIT
111 };
112 Evaluator evaluator(derived());
113 if(unroll)
114 return internal::any_unroller<Evaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(evaluator);
115 else
116 {
117 for(Index j = 0; j < cols(); ++j)
118 for(Index i = 0; i < rows(); ++i)
119 if (evaluator.coeff(i, j)) return true;
120 return false;
121 }
122}

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ applyHouseholderOnTheLeft()

template<typename Derived >
template<typename EssentialPart >
void Eigen::MatrixBase< Derived >::applyHouseholderOnTheLeft ( const EssentialPart &  essential,
const Scalar tau,
Scalar workspace 
)

Apply the elementary reflector H given by $ H = I - tau v v^*$ with $ v^T = [1 essential^T] $ from the left to a vector or matrix.

On input:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
workspacea pointer to working space with at least this->cols() * essential.size() entries
See also
MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheRight()
117{
118 if(rows() == 1)
119 {
120 *this *= Scalar(1)-tau;
121 }
122 else if(tau!=Scalar(0))
123 {
124 Map<typename internal::plain_row_type<PlainObject>::type> tmp(workspace,cols());
125 Block<Derived, EssentialPart::SizeAtCompileTime, Derived::ColsAtCompileTime> bottom(derived(), 1, 0, rows()-1, cols());
126 tmp.noalias() = essential.adjoint() * bottom;
127 tmp += this->row(0);
128 this->row(0) -= tau * tmp;
129 bottom.noalias() -= tau * essential * tmp;
130 }
131}
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). *‍/.
Definition BlockMethods.h:859
internal::traits< Derived >::Scalar Scalar
Definition MatrixBase.h:56

References row().

+ Here is the call graph for this function:

◆ applyHouseholderOnTheRight()

template<typename Derived >
template<typename EssentialPart >
void Eigen::MatrixBase< Derived >::applyHouseholderOnTheRight ( const EssentialPart &  essential,
const Scalar tau,
Scalar workspace 
)

Apply the elementary reflector H given by $ H = I - tau v v^*$ with $ v^T = [1 essential^T] $ from the right to a vector or matrix.

On input:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
workspacea pointer to working space with at least this->cols() * essential.size() entries
See also
MatrixBase::makeHouseholder(), MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheLeft()
154{
155 if(cols() == 1)
156 {
157 *this *= Scalar(1)-tau;
158 }
159 else if(tau!=Scalar(0))
160 {
161 Map<typename internal::plain_col_type<PlainObject>::type> tmp(workspace,rows());
162 Block<Derived, Derived::RowsAtCompileTime, EssentialPart::SizeAtCompileTime> right(derived(), 0, 1, rows(), cols()-1);
163 tmp.noalias() = right * essential.conjugate();
164 tmp += this->col(0);
165 this->col(0) -= tau * tmp;
166 right.noalias() -= tau * tmp * essential.transpose();
167 }
168}
EIGEN_DEVICE_FUNC ColXpr col(Index i)
This is the const version of col().
Definition BlockMethods.h:838

References col().

+ Here is the call graph for this function:

◆ applyOnTheLeft() [1/2]

template<typename Derived >
template<typename OtherDerived >
void Eigen::MatrixBase< Derived >::applyOnTheLeft ( const EigenBase< OtherDerived > &  other)
inline

replaces *this by other * *this.

Example:

Output:

 
523{
524 other.derived().applyThisOnTheLeft(derived());
525}

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ applyOnTheLeft() [2/2]

template<typename Derived >
template<typename OtherScalar >
void Eigen::MatrixBase< Derived >::applyOnTheLeft ( Index  p,
Index  q,
const JacobiRotation< OtherScalar > &  j 
)
inline

\jacobi_module Applies the rotation in the plane j to the rows p and q of *this, i.e., it computes B = J * B, with $ B = \left ( \begin{array}{cc} \text{*this.row}(p) \\ \text{*this.row}(q) \end{array} \right ) $.

See also
class JacobiRotation, MatrixBase::applyOnTheRight(), internal::apply_rotation_in_the_plane()
278{
279 RowXpr x(this->row(p));
280 RowXpr y(this->row(q));
282}
Block< Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > RowXpr
Definition BlockMethods.h:17
const Scalar & y
Definition MathFunctions.h:552
void apply_rotation_in_the_plane(DenseBase< VectorX > &xpr_x, DenseBase< VectorY > &xpr_y, const JacobiRotation< OtherScalar > &j)
Definition Jacobi.h:432
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References Eigen::internal::apply_rotation_in_the_plane(), and row().

+ Here is the call graph for this function:

◆ applyOnTheRight() [1/2]

template<typename Derived >
template<typename OtherDerived >
void Eigen::MatrixBase< Derived >::applyOnTheRight ( const EigenBase< OtherDerived > &  other)
inline

replaces *this by *this * other. It is equivalent to MatrixBase::operator*=().

Example:

Output:

 
511{
512 other.derived().applyThisOnTheRight(derived());
513}

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ applyOnTheRight() [2/2]

template<typename Derived >
template<typename OtherScalar >
void Eigen::MatrixBase< Derived >::applyOnTheRight ( Index  p,
Index  q,
const JacobiRotation< OtherScalar > &  j 
)
inline

Applies the rotation in the plane j to the columns p and q of *this, i.e., it computes B = B * J with $ B = \left ( \begin{array}{cc} \text{*this.col}(p) & \text{*this.col}(q) \end{array} \right ) $.

See also
class JacobiRotation, MatrixBase::applyOnTheLeft(), internal::apply_rotation_in_the_plane()
293{
294 ColXpr x(this->col(p));
295 ColXpr y(this->col(q));
296 internal::apply_rotation_in_the_plane(x, y, j.transpose());
297}
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1, !IsRowMajor > ColXpr
Definition BlockMethods.h:14

References Eigen::internal::apply_rotation_in_the_plane(), col(), and Eigen::JacobiRotation< Scalar >::transpose().

+ Here is the call graph for this function:

◆ array() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > Eigen::MatrixBase< Derived >::array ( )
inline
Returns
an Array expression of this matrix
See also
ArrayBase::matrix()
317{ return ArrayWrapper<Derived>(derived()); }

Referenced by igl::barycentric_coordinates(), igl::copyleft::cgal::mesh_boolean(), igl::copyleft::cgal::minkowski_sum(), igl::normalize_row_sums(), igl::pso(), igl::random_search(), and Eigen::internal::lpNorm_selector< Derived, p >::run().

+ Here is the caller graph for this function:

◆ array() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > Eigen::MatrixBase< Derived >::array ( ) const
inline
Returns
a const Array expression of this matrix
See also
ArrayBase::matrix()
320{ return ArrayWrapper<const Derived>(derived()); }

◆ asDiagonal()

template<typename Derived >
const DiagonalWrapper< const Derived > Eigen::MatrixBase< Derived >::asDiagonal
inline
Returns
a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients

\only_for_vectors

Example:

Output:

See also
class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal()
278{
279 return DiagonalWrapper<const Derived>(derived());
280}

Referenced by Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::prescale(), Eigen::Transform< _Scalar, _Dim, _Mode, _Options >::scale(), and Eigen::Scaling().

+ Here is the caller graph for this function:

◆ asPermutation()

template<typename Derived >
const PermutationWrapper< const Derived > Eigen::MatrixBase< Derived >::asPermutation
621{
622 return derived();
623}

◆ bdcSvd()

template<typename Derived >
BDCSVD< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::bdcSvd ( unsigned int  computationOptions = 0) const
inline

\svd_module

Returns
the singular value decomposition of *this computed by Divide & Conquer algorithm
See also
class BDCSVD
1239{
1240 return BDCSVD<PlainObject>(*this, computationOptions);
1241}

◆ blueNorm()

template<typename Derived >
NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::blueNorm
inline
Returns
the l2 norm of *this using the Blue's algorithm. A Portable Fortran Program to Find the Euclidean Norm of a Vector, ACM TOMS, Vol 4, Issue 1, 1978.

For architecture/scalar types without vectorization, this version is much faster than stableNorm(). Otherwise the stableNorm() is faster.

See also
norm(), stableNorm(), hypotNorm()
203{
204 return internal::blueNorm_impl(*this);
205}
NumTraits< typenametraits< Derived >::Scalar >::Real blueNorm_impl(const EigenBase< Derived > &_vec)
Definition StableNorm.h:55

References Eigen::internal::blueNorm_impl().

+ Here is the call graph for this function:

◆ colPivHouseholderQr()

template<typename Derived >
const ColPivHouseholderQR< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::colPivHouseholderQr
inline
Returns
the column-pivoting Householder QR decomposition of *this.
See also
class ColPivHouseholderQR
647{
648 return ColPivHouseholderQR<PlainObject>(eval());
649}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition DenseBase.h:401

◆ colwise() [1/2]

template<typename Derived >
DenseBase< Derived >::ColwiseReturnType Eigen::DenseBase< Derived >::colwise
inlineinherited
Returns
a writable VectorwiseOp wrapper of *this providing additional partial reduction operations
See also
rowwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
675{
676 return ColwiseReturnType(derived());
677}
VectorwiseOp< Derived, Vertical > ColwiseReturnType
Definition DenseBase.h:493

◆ colwise() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstColwiseReturnType Eigen::DenseBase< Derived >::colwise ( ) const
inlineinherited
Returns
a VectorwiseOp wrapper of *this providing additional partial reduction operations

Example:

Output:

See also
rowwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
516 {
517 return ConstColwiseReturnType(derived());
518 }
const VectorwiseOp< const Derived, Vertical > ConstColwiseReturnType
Definition DenseBase.h:494

Referenced by igl::bounding_box(), igl::copyleft::offset_surface(), and Eigen::umeyama().

+ Here is the caller graph for this function:

◆ completeOrthogonalDecomposition()

template<typename Derived >
const CompleteOrthogonalDecomposition< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::completeOrthogonalDecomposition
inline
Returns
the complete orthogonal decomposition of *this.
See also
class CompleteOrthogonalDecomposition
556 {
557 return CompleteOrthogonalDecomposition<PlainObject>(eval());
558}

◆ computeInverseAndDetWithCheck()

template<typename Derived >
template<typename ResultType >
void Eigen::MatrixBase< Derived >::computeInverseAndDetWithCheck ( ResultType &  inverse,
typename ResultType::Scalar &  determinant,
bool &  invertible,
const RealScalar absDeterminantThreshold = NumTraits<Scalar>::dummy_precision() 
) const
inline

\lu_module

Computation of matrix inverse and determinant, with invertibility check.

This is only for fixed-size square matrices of size up to 4x4.

Parameters
inverseReference to the matrix in which to store the inverse.
determinantReference to the variable in which to store the determinant.
invertibleReference to the bool variable in which to store whether the matrix is invertible.
absDeterminantThresholdOptional parameter controlling the invertibility check. The matrix will be declared invertible if the absolute value of its determinant is greater than this threshold.

Example:

Output:

See also
inverse(), computeInverseWithCheck()
368{
369 // i'd love to put some static assertions there, but SFINAE means that they have no effect...
370 eigen_assert(rows() == cols());
371 // for 2x2, it's worth giving a chance to avoid evaluating.
372 // for larger sizes, evaluating has negligible cost and limits code size.
373 typedef typename internal::conditional<
375 typename internal::remove_all<typename internal::nested_eval<Derived, 2>::type>::type,
377 >::type MatrixType;
378 internal::compute_inverse_and_det_with_check<MatrixType, ResultType>::run
379 (derived(), absDeterminantThreshold, inverse, determinant, invertible);
380}
#define eigen_assert(x)
Definition Macros.h:579
const Inverse< Derived > inverse() const
Definition InverseImpl.h:335
Scalar determinant() const
Definition Determinant.h:92
Base::PlainObject PlainObject
Definition MatrixBase.h:103

References eigen_assert, and inverse().

+ Here is the call graph for this function:

◆ computeInverseWithCheck()

template<typename Derived >
template<typename ResultType >
void Eigen::MatrixBase< Derived >::computeInverseWithCheck ( ResultType &  inverse,
bool &  invertible,
const RealScalar absDeterminantThreshold = NumTraits<Scalar>::dummy_precision() 
) const
inline

\lu_module

Computation of matrix inverse, with invertibility check.

This is only for fixed-size square matrices of size up to 4x4.

Parameters
inverseReference to the matrix in which to store the inverse.
invertibleReference to the bool variable in which to store whether the matrix is invertible.
absDeterminantThresholdOptional parameter controlling the invertibility check. The matrix will be declared invertible if the absolute value of its determinant is greater than this threshold.

Example:

Output:

See also
inverse(), computeInverseAndDetWithCheck()
406{
408 // i'd love to put some static assertions there, but SFINAE means that they have no effect...
409 eigen_assert(rows() == cols());
410 computeInverseAndDetWithCheck(inverse,determinant,invertible,absDeterminantThreshold);
411}
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition InverseImpl.h:362

References eigen_assert, and inverse().

+ Here is the call graph for this function:

◆ Constant() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( const Scalar value)
staticinherited
Returns
an expression of a constant matrix of value value

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.

See also
class CwiseNullaryOp
213{
215 return DenseBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op<Scalar>(value));
216}
#define EIGEN_STATIC_ASSERT_FIXED_SIZE(TYPE)
Definition StaticAssert.h:144
EIGEN_DEVICE_FUNC CoeffReturnType value() const
Definition DenseBase.h:480
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > NullaryExpr(Index rows, Index cols, const CustomNullaryOp &func)

References EIGEN_STATIC_ASSERT_FIXED_SIZE, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ Constant() [2/3]

template<typename Derived >
EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( Index  rows,
Index  cols,
const Scalar value 
)
staticinherited
Returns
an expression of a constant matrix of value value

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.

See also
class CwiseNullaryOp
175{
176 return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_constant_op<Scalar>(value));
177}

References Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ Constant() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Constant ( Index  size,
const Scalar value 
)
staticinherited
Returns
an expression of a constant matrix of value value

The parameter size is the size of the returned vector. Must be compatible with this DenseBase type.

\only_for_vectors

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.

See also
class CwiseNullaryOp
197{
198 return DenseBase<Derived>::NullaryExpr(size, internal::scalar_constant_op<Scalar>(value));
199}

References Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ count()

template<typename Derived >
Eigen::Index Eigen::DenseBase< Derived >::count
inlineinherited
Returns
the number of coefficients which evaluate to true
See also
all(), any()
130{
131 return derived().template cast<bool>().template cast<Index>().sum();
132}

◆ cross()

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type Eigen::MatrixBase< Derived >::cross ( const MatrixBase< OtherDerived > &  other) const
inline

◆ cwiseProduct()

template<typename Derived >
template<typename OtherDerived >
EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Derived >::Type Eigen::MatrixBase< Derived >::cwiseProduct ( const SparseMatrixBase< OtherDerived > &  other) const
inline
440 {
441 return other.cwiseProduct(derived());
442 }

References Eigen::SparseMatrixBase< Derived >::cwiseProduct().

+ Here is the call graph for this function:

◆ determinant()

template<typename Derived >
internal::traits< Derived >::Scalar Eigen::MatrixBase< Derived >::determinant
inline

\lu_module

Returns
the determinant of this matrix
93{
94 eigen_assert(rows() == cols());
96 return internal::determinant_impl<typename internal::remove_all<Nested>::type>::run(derived());
97}
conditional< Evaluate, PlainObject, typenameref_selector< T >::type >::type type
Definition XprHelper.h:452

References eigen_assert.

◆ diagonal() [1/6]

template<typename Derived >
MatrixBase< Derived >::template DiagonalIndexReturnType< Index_ >::Type Eigen::MatrixBase< Derived >::diagonal
inline
Returns
an expression of the main diagonal of the matrix *this

*this is not required to be square.

Example:

Output:

See also
class Diagonal
Returns
an expression of the DiagIndex-th sub or super diagonal of the matrix *this

*this is not required to be square.

The template parameter DiagIndex represent a super diagonal if DiagIndex > 0 and a sub diagonal otherwise. DiagIndex == 0 is equivalent to the main diagonal.

Example:

Output:

See also
MatrixBase::diagonal(), class Diagonal
192{
193 return DiagonalReturnType(derived());
194}
Diagonal< Derived > DiagonalReturnType
Definition MatrixBase.h:205

◆ diagonal() [2/6]

template<typename Derived >
template<int Index>
EIGEN_DEVICE_FUNC DiagonalIndexReturnType< Index >::Type Eigen::MatrixBase< Derived >::diagonal ( )

◆ diagonal() [3/6]

template<typename Derived >
MatrixBase< Derived >::template ConstDiagonalIndexReturnType< Index_ >::Type Eigen::MatrixBase< Derived >::diagonal
inline

This is the const version of diagonal().

This is the const version of diagonal<int>().

200{
201 return ConstDiagonalReturnType(derived());
202}
internal::add_const< Diagonal< constDerived > >::type ConstDiagonalReturnType
Definition MatrixBase.h:209

◆ diagonal() [4/6]

template<typename Derived >
template<int Index>
EIGEN_DEVICE_FUNC ConstDiagonalIndexReturnType< Index >::Type Eigen::MatrixBase< Derived >::diagonal ( ) const

◆ diagonal() [5/6]

template<typename Derived >
MatrixBase< Derived >::DiagonalDynamicIndexReturnType Eigen::MatrixBase< Derived >::diagonal ( Index  index)
inline
Returns
an expression of the DiagIndex-th sub or super diagonal of the matrix *this

*this is not required to be square.

The template parameter DiagIndex represent a super diagonal if DiagIndex > 0 and a sub diagonal otherwise. DiagIndex == 0 is equivalent to the main diagonal.

Example:

Output:

See also
MatrixBase::diagonal(), class Diagonal
218{
219 return DiagonalDynamicIndexReturnType(derived(), index);
220}
Diagonal< Derived, DynamicIndex > DiagonalDynamicIndexReturnType
Definition MatrixBase.h:224

◆ diagonal() [6/6]

template<typename Derived >
MatrixBase< Derived >::ConstDiagonalDynamicIndexReturnType Eigen::MatrixBase< Derived >::diagonal ( Index  index) const
inline

This is the const version of diagonal(Index).

226{
227 return ConstDiagonalDynamicIndexReturnType(derived(), index);
228}
internal::add_const< Diagonal< constDerived, DynamicIndex > >::type ConstDiagonalDynamicIndexReturnType
Definition MatrixBase.h:225

◆ diagonalSize()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::MatrixBase< Derived >::diagonalSize ( ) const
inline
Returns
the size of the main diagonal, which is min(rows(),cols()).
See also
rows(), cols(), SizeAtCompileTime.
101{ return (numext::mini)(rows(),cols()); }
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition MathFunctions.h:815

References Eigen::numext::mini().

+ Here is the call graph for this function:

◆ dot() [1/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType Eigen::MatrixBase< Derived >::dot ( const MatrixBase< OtherDerived > &  other) const
73{
76 EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived)
77#if !(defined(EIGEN_NO_STATIC_ASSERT) && defined(EIGEN_NO_DEBUG))
78 typedef internal::scalar_conj_product_op<Scalar,typename OtherDerived::Scalar> func;
79 EIGEN_CHECK_BINARY_COMPATIBILIY(func,Scalar,typename OtherDerived::Scalar);
80#endif
81
82 eigen_assert(size() == other.size());
83
85}
#define EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:164
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition StaticAssert.h:139
#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP, LHS, RHS)
Definition XprHelper.h:815
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE ResScalar run(const MatrixBase< T > &a, const MatrixBase< U > &b)
Definition Dot.h:35

References eigen_assert, EIGEN_CHECK_BINARY_COMPATIBILIY, EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE, EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::internal::dot_nocheck< T, U, NeedToTranspose >::run().

+ Here is the call graph for this function:

◆ dot() [2/2]

template<typename Derived >
template<typename OtherDerived >
Eigen::MatrixBase< Derived >::dot ( const MatrixBase< OtherDerived > &  other) const
Returns
the dot product of *this with other.

\only_for_vectors

Note
If the scalar type is complex numbers, then this function returns the hermitian (sesquilinear) dot product, conjugate-linear in the first variable and linear in the second variable.
See also
squaredNorm(), norm()

◆ EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE()

template<typename Derived >
typedef Eigen::MatrixBase< Derived >::EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE ( ConstStartMinusOne  ,
Scalar  ,
quotient   
)

◆ eigenvalues()

template<typename Derived >
MatrixBase< Derived >::EigenvaluesReturnType Eigen::MatrixBase< Derived >::eigenvalues
inline

Computes the eigenvalues of a matrix.

Returns
Column vector containing the eigenvalues.

\eigenvalues_module This function computes the eigenvalues with the help of the EigenSolver class (for real matrices) or the ComplexEigenSolver class (for complex matrices).

The eigenvalues are repeated according to their algebraic multiplicity, so there are as many eigenvalues as rows in the matrix.

The SelfAdjointView class provides a better algorithm for selfadjoint matrices.

Example:

Output:

See also
EigenSolver::eigenvalues(), ComplexEigenSolver::eigenvalues(), SelfAdjointView::eigenvalues()
68{
69 return internal::eigenvalues_selector<Derived, NumTraits<Scalar>::IsComplex>::run(derived());
70}

◆ eval()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType Eigen::DenseBase< Derived >::eval ( ) const
inline
Returns
the matrix or vector obtained by evaluating this expression.

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.

Warning
Be carefull with eval() and the auto C++ keyword, as detailed in this page .
402 {
403 // Even though MSVC does not honor strong inlining when the return type
404 // is a dynamic matrix, we desperately need strong inlining for fixed
405 // size types on MSVC.
406 return typename internal::eval<Derived>::type(derived());
407 }

Referenced by Eigen::internal::generic_product_impl< Lhs, Homogeneous< RhsArg, Vertical >, TriangularShape, HomogeneousShape, ProductTag >::evalTo(), igl::min_quad_with_fixed_solve(), and igl::ramer_douglas_peucker().

+ Here is the caller graph for this function:

◆ evalTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::evalTo ( Dest &  ) const
inlineinherited
585 {
586 EIGEN_STATIC_ASSERT((internal::is_same<Dest,void>::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS);
587 }
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
Definition StaticAssert.h:124
@ value
Definition Meta.h:63

References EIGEN_STATIC_ASSERT.

◆ fill()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void Eigen::DenseBase< Derived >::fill ( const Scalar val)
inherited

Alias for setConstant(): sets all coefficients in this expression to val.

See also
setConstant(), Constant(), class CwiseNullaryOp
316{
317 setConstant(val);
318}
EIGEN_DEVICE_FUNC Derived & setConstant(const Scalar &value)
Definition CwiseNullaryOp.h:325

◆ flagged()

template<typename Derived >
template<unsigned int Added, unsigned int Removed>
EIGEN_DEPRECATED const Derived & Eigen::DenseBase< Derived >::flagged ( ) const
inlineinherited
313 { return derived(); }

◆ forceAlignedAccess() [1/2]

template<typename Derived >
ForceAlignedAccess< Derived > Eigen::MatrixBase< Derived >::forceAlignedAccess
inline
Returns
an expression of *this with forced aligned access
See also
forceAlignedAccessIf(), class ForceAlignedAccess
304{ return derived(); }

◆ forceAlignedAccess() [2/2]

template<typename Derived >
const ForceAlignedAccess< Derived > Eigen::MatrixBase< Derived >::forceAlignedAccess
inline
Returns
an expression of *this with forced aligned access
See also
forceAlignedAccessIf(),class ForceAlignedAccess
303{ return derived(); }

◆ forceAlignedAccessIf() [1/4]

template<typename Derived >
template<bool Enable>
internal::conditional< Enable, ForceAlignedAccess< Derived >, Derived & >::type Eigen::MatrixBase< Derived >::forceAlignedAccessIf ( )
inline
Returns
an expression of *this with forced aligned access if Enable is true.
See also
forceAlignedAccess(), class ForceAlignedAccess
140{
141 return derived(); // FIXME This should not work but apparently is never used
142}

◆ forceAlignedAccessIf() [2/4]

template<typename Derived >
template<bool Enable>
Derived & Eigen::MatrixBase< Derived >::forceAlignedAccessIf ( )
inline
306{ return derived(); }

◆ forceAlignedAccessIf() [3/4]

template<typename Derived >
template<bool Enable>
internal::add_const_on_value_type< typenameinternal::conditional< Enable, ForceAlignedAccess< Derived >, Derived & >::type >::type Eigen::MatrixBase< Derived >::forceAlignedAccessIf ( ) const
inline
Returns
an expression of *this with forced aligned access if Enable is true.
See also
forceAlignedAccess(), class ForceAlignedAccess
129{
130 return derived(); // FIXME This should not work but apparently is never used
131}

◆ forceAlignedAccessIf() [4/4]

template<typename Derived >
template<bool Enable>
const Derived & Eigen::MatrixBase< Derived >::forceAlignedAccessIf ( ) const
inline
305{ return derived(); }

◆ format()

template<typename Derived >
const WithFormat< Derived > Eigen::DenseBase< Derived >::format ( const IOFormat fmt) const
inlineinherited
Returns
a WithFormat proxy object allowing to print a matrix the with given format fmt.

See class IOFormat for some examples.

See also
class IOFormat, class WithFormat
474 {
475 return WithFormat<Derived>(derived(), fmt);
476 }

Referenced by igl::matlab_format(), and igl::writeOBJ().

+ Here is the caller graph for this function:

◆ fullPivHouseholderQr()

template<typename Derived >
const FullPivHouseholderQR< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::fullPivHouseholderQr
inline
Returns
the full-pivoting Householder QR decomposition of *this.
See also
class FullPivHouseholderQR
670{
671 return FullPivHouseholderQR<PlainObject>(eval());
672}

◆ fullPivLu()

template<typename Derived >
const FullPivLU< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::fullPivLu
inline

\lu_module

Returns
the full-pivoting LU decomposition of *this.
See also
class FullPivLU
885{
886 return FullPivLU<PlainObject>(eval());
887}

◆ hasNaN()

template<typename Derived >
bool Eigen::DenseBase< Derived >::hasNaN
inlineinherited
Returns
true is *this contains at least one Not A Number (NaN).
See also
allFinite()
140{
141#if EIGEN_COMP_MSVC || (defined __FAST_MATH__)
142 return derived().array().isNaN().any();
143#else
144 return !((derived().array()==derived().array()).all());
145#endif
146}
EIGEN_DEVICE_FUNC bool all() const
Definition BooleanRedux.h:81

◆ householderQr()

template<typename Derived >
const HouseholderQR< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::householderQr
inline
Returns
the Householder QR decomposition of *this.
See also
class HouseholderQR
403{
404 return HouseholderQR<PlainObject>(eval());
405}

◆ hypotNorm()

template<typename Derived >
NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::hypotNorm
inline
Returns
the l2 norm of *this avoiding undeflow and overflow. This version use a concatenation of hypot() calls, and it is very slow.
See also
norm(), stableNorm()
215{
216 return this->cwiseAbs().redux(internal::scalar_hypot_op<RealScalar>());
217}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseAbsReturnType cwiseAbs() const
Definition MatrixCwiseUnaryOps.h:32

References cwiseAbs().

+ Here is the call graph for this function:

◆ Identity() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::IdentityReturnType Eigen::MatrixBase< Derived >::Identity
static
Returns
an expression of the identity matrix (not necessarily square).

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variant taking size arguments.

Example:

Output:

See also
Identity(Index,Index), setIdentity(), isIdentity()
701{
703 return MatrixBase<Derived>::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op<Scalar>());
704}

References EIGEN_STATIC_ASSERT_FIXED_SIZE, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ Identity() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::IdentityReturnType Eigen::MatrixBase< Derived >::Identity ( Index  rows,
Index  cols 
)
static
Returns
an expression of the identity matrix (not necessarily square).

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 Identity() should be used instead.

Example:

Output:

See also
Identity(), setIdentity(), isIdentity()
684{
685 return DenseBase<Derived>::NullaryExpr(rows, cols, internal::scalar_identity_op<Scalar>());
686}

References Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ innerSize()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::innerSize ( ) const
inlineinherited
Returns
the inner size.
Note
For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension with respect to the storage order, i.e., the number of rows for a column-major matrix, and the number of columns for a row-major matrix.
231 {
232 return IsVectorAtCompileTime ? this->size()
233 : int(IsRowMajor) ? this->cols() : this->rows();
234 }

References Eigen::DenseBase< Derived >::IsRowMajor, and Eigen::DenseBase< Derived >::IsVectorAtCompileTime.

◆ inverse()

template<typename Derived >
const Inverse< Derived > Eigen::MatrixBase< Derived >::inverse
inline

\lu_module

Returns
the matrix inverse of this matrix.

For small fixed sizes up to 4x4, this method uses cofactors. In the general case, this method uses class PartialPivLU.

Note
This matrix must be invertible, otherwise the result is undefined. If you need an invertibility check, do the following: Example:
Output:
See also
computeInverseAndDetWithCheck()
336{
337 EIGEN_STATIC_ASSERT(!NumTraits<Scalar>::IsInteger,THIS_FUNCTION_IS_NOT_FOR_INTEGER_NUMERIC_TYPES)
338 eigen_assert(rows() == cols());
339 return Inverse<Derived>(derived());
340}

References eigen_assert, and EIGEN_STATIC_ASSERT.

Referenced by Eigen::Hyperplane< _Scalar, _AmbientDim, _Options >::transform().

+ Here is the caller graph for this function:

◆ isApprox() [1/2]

template<typename Derived >
template<typename OtherDerived >
bool Eigen::DenseBase< Derived >::isApprox ( const DenseBase< OtherDerived > &  other,
const RealScalar prec 
) const
inherited
Returns
true if *this is approximately equal to other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. Two vectors $ v $ and $ w $ are considered to be approximately equal within precision $ p $ if

\[ \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).
Because of the multiplicativeness of this comparison, one can't use this function to check whether *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.
See also
internal::isMuchSmallerThan(const RealScalar&, RealScalar) const
107{
108 return internal::isApprox_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
109}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const OtherDerived &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:23

References Eigen::internal::isApprox_selector< Derived, OtherDerived, is_integer >::run().

+ Here is the call graph for this function:

◆ isApprox() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isApprox ( const DenseBase< OtherDerived > &  other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isApproxToConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isApproxToConstant ( const Scalar val,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited
Returns
true if all coefficients in this matrix are approximately equal to val, to within precision prec
291{
292 typename internal::nested_eval<Derived,1>::type self(derived());
293 for(Index j = 0; j < cols(); ++j)
294 for(Index i = 0; i < rows(); ++i)
295 if(!internal::isApprox(self.coeff(i, j), val, prec))
296 return false;
297 return true;
298}
EIGEN_DEVICE_FUNC bool isApprox(const Scalar &x, const Scalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition MathFunctions.h:1361

References Eigen::internal::isApprox().

+ Here is the call graph for this function:

◆ isConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isConstant ( const Scalar val,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
inherited

This is just an alias for isApproxToConstant().

Returns
true if all coefficients in this matrix are approximately equal to value, to within precision prec
306{
307 return isApproxToConstant(val, prec);
308}
EIGEN_DEVICE_FUNC bool isApproxToConstant(const Scalar &value, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:290

◆ isDiagonal()

template<typename Derived >
bool Eigen::MatrixBase< Derived >::isDiagonal ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
Returns
true if *this is approximately equal to a diagonal matrix, within the precision given by prec.

Example:

Output:

See also
asDiagonal()
292{
293 if(cols() != rows()) return false;
294 RealScalar maxAbsOnDiagonal = static_cast<RealScalar>(-1);
295 for(Index j = 0; j < cols(); ++j)
296 {
297 RealScalar absOnDiagonal = numext::abs(coeff(j,j));
298 if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal;
299 }
300 for(Index j = 0; j < cols(); ++j)
301 for(Index i = 0; i < j; ++i)
302 {
303 if(!internal::isMuchSmallerThan(coeff(i, j), maxAbsOnDiagonal, prec)) return false;
304 if(!internal::isMuchSmallerThan(coeff(j, i), maxAbsOnDiagonal, prec)) return false;
305 }
306 return true;
307}
NumTraits< Scalar >::Real RealScalar
Definition MatrixBase.h:58
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition MathFunctions.h:1354
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE internal::enable_if< NumTraits< T >::IsSigned||NumTraits< T >::IsComplex, typenameNumTraits< T >::Real >::type abs(const T &x)
Definition MathFunctions.h:1049

References Eigen::numext::abs(), and Eigen::internal::isMuchSmallerThan().

+ Here is the call graph for this function:

◆ isIdentity()

template<typename Derived >
bool Eigen::MatrixBase< Derived >::isIdentity ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
Returns
true if *this is approximately equal to the identity matrix (not necessarily square), within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity()
718{
719 typename internal::nested_eval<Derived,1>::type self(derived());
720 for(Index j = 0; j < cols(); ++j)
721 {
722 for(Index i = 0; i < rows(); ++i)
723 {
724 if(i == j)
725 {
726 if(!internal::isApprox(self.coeff(i, j), static_cast<Scalar>(1), prec))
727 return false;
728 }
729 else
730 {
731 if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<RealScalar>(1), prec))
732 return false;
733 }
734 }
735 }
736 return true;
737}

References Eigen::internal::isApprox(), and Eigen::internal::isMuchSmallerThan().

+ Here is the call graph for this function:

◆ isLowerTriangular()

template<typename Derived >
bool Eigen::MatrixBase< Derived >::isLowerTriangular ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
Returns
true if *this is approximately equal to a lower triangular matrix, within the precision given by prec.
See also
isUpperTriangular()
674{
675 RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
676 for(Index j = 0; j < cols(); ++j)
677 for(Index i = j; i < rows(); ++i)
678 {
679 RealScalar absValue = numext::abs(coeff(i,j));
680 if(absValue > maxAbsOnLowerPart) maxAbsOnLowerPart = absValue;
681 }
682 RealScalar threshold = maxAbsOnLowerPart * prec;
683 for(Index j = 1; j < cols(); ++j)
684 {
685 Index maxi = numext::mini(j, rows()-1);
686 for(Index i = 0; i < maxi; ++i)
687 if(numext::abs(coeff(i, j)) > threshold) return false;
688 }
689 return true;
690}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T maxi(const T &x, const T &y)
Definition MathFunctions.h:823

References Eigen::numext::abs(), Eigen::TriangularView< _MatrixType, _Mode >::cols(), Eigen::numext::mini(), and Eigen::TriangularView< _MatrixType, _Mode >::rows().

+ Here is the call graph for this function:

◆ isMuchSmallerThan() [1/4]

template<typename Derived >
template<typename OtherDerived >
bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const DenseBase< OtherDerived > &  other,
const RealScalar prec 
) const
inherited
Returns
true if the norm of *this is much smaller than the norm of other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. A vector $ v $ is considered to be much smaller than a vector $ w $ within precision $ p $ if

\[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \]

For matrices, the comparison is done using the Hilbert-Schmidt norm.
See also
isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const
149{
151}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const OtherDerived &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:45

References Eigen::internal::isMuchSmallerThan_object_selector< Derived, OtherDerived, is_integer >::run().

+ Here is the call graph for this function:

◆ isMuchSmallerThan() [2/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const DenseBase< OtherDerived > &  other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isMuchSmallerThan() [3/4]

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const RealScalar other,
const RealScalar prec = NumTraitsScalar >::dummy_precision() 
) const
inherited

◆ isMuchSmallerThan() [4/4]

template<typename Derived >
template<typename Derived >
bool Eigen::DenseBase< Derived >::isMuchSmallerThan ( const typename NumTraits< Scalar >::Real &  other,
const RealScalar prec 
) const
inherited
Returns
true if the norm of *this is much smaller than other, within the precision determined by prec.
Note
The fuzzy compares are done multiplicatively. A vector $ v $ is considered to be much smaller than $ x $ within precision $ p $ if

\[ \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.

See also
isApprox(), isMuchSmallerThan(const DenseBase<OtherDerived>&, RealScalar) const
129{
131}
static EIGEN_DEVICE_FUNC bool run(const Derived &x, const typename Derived::RealScalar &y, const typename Derived::RealScalar &prec)
Definition Fuzzy.h:65

References Eigen::internal::isMuchSmallerThan_scalar_selector< Derived, is_integer >::run().

+ Here is the call graph for this function:

◆ isOnes()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isOnes ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to the matrix where all coefficients are equal to 1, within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Ones()
613{
614 return isApproxToConstant(Scalar(1), prec);
615}
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:66

◆ isOrthogonal()

template<typename Derived >
template<typename OtherDerived >
bool Eigen::MatrixBase< Derived >::isOrthogonal ( const MatrixBase< OtherDerived > &  other,
const RealScalar prec = NumTraits<Scalar>::dummy_precision() 
) const
Returns
true if *this is approximately orthogonal to other, within the precision given by prec.

Example:

Output:

 
284{
285 typename internal::nested_eval<Derived,2>::type nested(derived());
286 typename internal::nested_eval<OtherDerived,2>::type otherNested(other.derived());
287 return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm();
288}

◆ isUnitary()

template<typename Derived >
bool Eigen::MatrixBase< Derived >::isUnitary ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
Returns
true if *this is approximately an unitary matrix, within the precision given by prec. In the case where the Scalar type is real numbers, a unitary matrix is an orthogonal matrix, whence the name.
Note
This can be used to check whether a family of vectors forms an orthonormal basis. Indeed, m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an orthonormal basis.

Example:

Output:

 
303{
304 typename internal::nested_eval<Derived,1>::type self(derived());
305 for(Index i = 0; i < cols(); ++i)
306 {
307 if(!internal::isApprox(self.col(i).squaredNorm(), static_cast<RealScalar>(1), prec))
308 return false;
309 for(Index j = 0; j < i; ++j)
310 if(!internal::isMuchSmallerThan(self.col(i).dot(self.col(j)), static_cast<Scalar>(1), prec))
311 return false;
312 }
313 return true;
314}

References Eigen::internal::isApprox(), and Eigen::internal::isMuchSmallerThan().

+ Here is the call graph for this function:

◆ isUpperTriangular()

template<typename Derived >
bool Eigen::MatrixBase< Derived >::isUpperTriangular ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
Returns
true if *this is approximately equal to an upper triangular matrix, within the precision given by prec.
See also
isLowerTriangular()
649{
650 RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
651 for(Index j = 0; j < cols(); ++j)
652 {
653 Index maxi = numext::mini(j, rows()-1);
654 for(Index i = 0; i <= maxi; ++i)
655 {
656 RealScalar absValue = numext::abs(coeff(i,j));
657 if(absValue > maxAbsOnUpperPart) maxAbsOnUpperPart = absValue;
658 }
659 }
660 RealScalar threshold = maxAbsOnUpperPart * prec;
661 for(Index j = 0; j < cols(); ++j)
662 for(Index i = j+1; i < rows(); ++i)
663 if(numext::abs(coeff(i, j)) > threshold) return false;
664 return true;
665}

References Eigen::numext::abs(), Eigen::TriangularView< _MatrixType, _Mode >::cols(), Eigen::numext::mini(), and Eigen::TriangularView< _MatrixType, _Mode >::rows().

+ Here is the call graph for this function:

◆ isZero()

template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::DenseBase< Derived >::isZero ( const RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
inherited
Returns
true if *this is approximately equal to the zero matrix, within the precision given by prec.

Example:

Output:

See also
class CwiseNullaryOp, Zero()
482{
483 typename internal::nested_eval<Derived,1>::type self(derived());
484 for(Index j = 0; j < cols(); ++j)
485 for(Index i = 0; i < rows(); ++i)
486 if(!internal::isMuchSmallerThan(self.coeff(i, j), static_cast<Scalar>(1), prec))
487 return false;
488 return true;
489}

References Eigen::internal::isMuchSmallerThan().

+ Here is the call graph for this function:

◆ jacobiSvd()

template<typename Derived >
JacobiSVD< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::jacobiSvd ( unsigned int  computationOptions = 0) const
inline

\svd_module

Returns
the singular value decomposition of *this computed by two-sided Jacobi transformations.
See also
class JacobiSVD
798{
799 return JacobiSVD<PlainObject>(*this, computationOptions);
800}

◆ lazyAssign() [1/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::lazyAssign ( const DenseBase< OtherDerived > &  other)
21{
22 enum{
24 };
25
27 EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived)
28 EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY)
29
30 eigen_assert(rows() == other.rows() && cols() == other.cols());
31 internal::call_assignment_no_alias(derived(),other.derived());
32
33 return derived();
34}
#define EIGEN_STATIC_ASSERT_LVALUE(Derived)
Definition StaticAssert.h:199
#define EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:189
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment_no_alias(Dst &dst, const Src &src, const Func &func)
Definition AssignEvaluator.h:819

◆ lazyAssign() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::DenseBase< Derived >::lazyAssign ( const DenseBase< OtherDerived > &  other)

◆ lazyProduct() [1/2]

template<typename Derived >
template<typename OtherDerived >
const Product< Derived, OtherDerived, LazyProduct > Eigen::MatrixBase< Derived >::lazyProduct ( const MatrixBase< OtherDerived > &  other) const
Returns
an expression of the matrix product of *this and other without implicit evaluation.

The returned product will behave like any other expressions: the coefficients of the product will be computed once at a time as requested. This might be useful in some extremely rare cases when only a small and no coherent fraction of the result's coefficients have to be computed.

Warning
This version of the matrix product can be much much slower. So use it only if you know what you are doing and that you measured a true speed improvement.
See also
operator*(const MatrixBase&)
433{
434 enum {
435 ProductIsValid = Derived::ColsAtCompileTime==Dynamic
436 || OtherDerived::RowsAtCompileTime==Dynamic
437 || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime),
438 AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime,
439 SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived)
440 };
441 // note to the lost user:
442 // * for a dot product use: v1.dot(v2)
443 // * for a coeff-wise product use: v1.cwiseProduct(v2)
444 EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
445 INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
446 EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
447 INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
448 EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
449
450 return Product<Derived,OtherDerived,LazyProduct>(derived(), other.derived());
451}
#define EIGEN_PREDICATE_SAME_MATRIX_SIZE(TYPE0, TYPE1)
Definition StaticAssert.h:171

References Eigen::Dynamic, EIGEN_PREDICATE_SAME_MATRIX_SIZE, and EIGEN_STATIC_ASSERT.

◆ lazyProduct() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived, LazyProduct > Eigen::MatrixBase< Derived >::lazyProduct ( const MatrixBase< OtherDerived > &  other) const

◆ ldlt()

template<typename Derived >
const LDLT< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::ldlt
inline

\cholesky_module

Returns
the Cholesky decomposition with full pivoting without square root of *this
See also
SelfAdjointView::ldlt()
667{
668 return LDLT<PlainObject>(derived());
669}

◆ LinSpaced() [1/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( const Scalar low,
const Scalar high 
)
staticinherited

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.

\only_for_vectors

Example:

Output:

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:

See also
setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp Special version for fixed size types which does not require the size parameter.
281{
284 return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar,PacketScalar>(low,high,Derived::SizeAtCompileTime));
285}

References EIGEN_STATIC_ASSERT_FIXED_SIZE, EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ LinSpaced() [2/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Index  size,
const Scalar low,
const Scalar high 
)
staticinherited

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.

\only_for_vectors

Example:

Output:

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:

See also
setLinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
269{
271 return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar,PacketScalar>(low,high,size));
272}

◆ LinSpaced() [3/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Sequential_t  ,
const Scalar low,
const Scalar high 
)
staticinherited
See also
LinSpaced(Scalar,Scalar)
237{
240 return DenseBase<Derived>::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op<Scalar,PacketScalar>(low,high,Derived::SizeAtCompileTime));
241}

References EIGEN_STATIC_ASSERT_FIXED_SIZE, EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ LinSpaced() [4/4]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::RandomAccessLinSpacedReturnType Eigen::DenseBase< Derived >::LinSpaced ( Sequential_t  ,
Index  size,
const Scalar low,
const Scalar high 
)
staticinherited
See also
LinSpaced(Index,Scalar,Scalar), setLinSpaced(Index,const Scalar&,const Scalar&)
225{
227 return DenseBase<Derived>::NullaryExpr(size, internal::linspaced_op<Scalar,PacketScalar>(low,high,size));
228}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY, and Eigen::DenseBase< Derived >::NullaryExpr().

+ Here is the call graph for this function:

◆ llt()

template<typename Derived >
const LLT< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::llt
inline

\cholesky_module

Returns
the LLT decomposition of *this
See also
SelfAdjointView::llt()
525{
526 return LLT<PlainObject>(derived());
527}

◆ lpNorm() [1/2]

template<typename Derived >
template<int p>
NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::lpNorm ( ) const
inline
Returns
the coefficient-wise $ \ell^p $ norm of *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values of the coefficients of *this. If p is the special value Eigen::Infinity, this function returns the $ \ell^\infty $ norm, that is the maximum of the absolute values of the coefficients of *this.

In all cases, if *this is empty, then the value 0 is returned.

Note
For matrices, this function does not compute the operator-norm. That is, if *this is a matrix, then its coefficients are interpreted as a 1D vector. Nonetheless, you can easily compute the 1-norm and $\infty$-norm matrix operator norms using partial reductions .
See also
norm()
268{
270}
static EIGEN_DEVICE_FUNC RealScalar run(const MatrixBase< Derived > &m)
Definition Dot.h:208

References Eigen::internal::lpNorm_selector< Derived, p >::run().

+ Here is the call graph for this function:

◆ lpNorm() [2/2]

template<typename Derived >
template<int p>
EIGEN_DEVICE_FUNC RealScalar Eigen::MatrixBase< Derived >::lpNorm ( ) const

◆ lu()

template<typename Derived >
const PartialPivLU< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::lu
inline

\lu_module

Synonym of partialPivLu().

Returns
the partial-pivoting LU decomposition of *this.
See also
class PartialPivLU
605{
606 return PartialPivLU<PlainObject>(eval());
607}

◆ makeHouseholder()

template<typename Derived >
template<typename EssentialPart >
void Eigen::MatrixBase< Derived >::makeHouseholder ( EssentialPart &  essential,
Scalar tau,
RealScalar beta 
) const

Computes the elementary reflector H such that: $ H *this = [ beta 0 ... 0]^T $ where the transformation H is: $ H = I - tau v v^*$ and the vector v is: $ v^T = [1 essential^T] $

On output:

Parameters
essentialthe essential part of the vector v
tauthe scaling factor of the Householder transformation
betathe result of H * *this
See also
MatrixBase::makeHouseholderInPlace(), MatrixBase::applyHouseholderOnTheLeft(), MatrixBase::applyHouseholderOnTheRight()
69{
70 using std::sqrt;
71 using numext::conj;
72
74 VectorBlock<const Derived, EssentialPart::SizeAtCompileTime> tail(derived(), 1, size()-1);
75
76 RealScalar tailSqNorm = size()==1 ? RealScalar(0) : tail.squaredNorm();
77 Scalar c0 = coeff(0);
78 const RealScalar tol = (std::numeric_limits<RealScalar>::min)();
79
80 if(tailSqNorm <= tol && numext::abs2(numext::imag(c0))<=tol)
81 {
82 tau = RealScalar(0);
83 beta = numext::real(c0);
84 essential.setZero();
85 }
86 else
87 {
88 beta = sqrt(numext::abs2(c0) + tailSqNorm);
89 if (numext::real(c0)>=RealScalar(0))
90 beta = -beta;
91 essential = tail / (c0 - beta);
92 tau = conj((beta - c0) / beta);
93 }
94}
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
Definition ArrayCwiseUnaryOps.h:152
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
Definition BlockMethods.h:949
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition Dot.h:96

References EIGEN_STATIC_ASSERT_VECTOR_ONLY, sqrt(), and tail().

+ Here is the call graph for this function:

◆ makeHouseholderInPlace()

template<typename Derived >
void Eigen::MatrixBase< Derived >::makeHouseholderInPlace ( Scalar tau,
RealScalar beta 
)

Computes the elementary reflector H such that: $ H *this = [ beta 0 ... 0]^T $ where the transformation H is: $ H = I - tau v v^*$ and the vector v is: $ v^T = [1 essential^T] $

The essential part of the vector v is stored in *this.

On output:

Parameters
tauthe scaling factor of the Householder transformation
betathe result of H * *this
See also
MatrixBase::makeHouseholder(), MatrixBase::applyHouseholderOnTheLeft(), MatrixBase::applyHouseholderOnTheRight()
43{
44 VectorBlock<Derived, internal::decrement_size<Base::SizeAtCompileTime>::ret> essentialPart(derived(), 1, size()-1);
45 makeHouseholder(essentialPart, tau, beta);
46}
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition Householder.h:65

◆ matrix() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC MatrixBase< Derived > & Eigen::MatrixBase< Derived >::matrix ( )
inline
312{ return *this; }

◆ matrix() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC const MatrixBase< Derived > & Eigen::MatrixBase< Derived >::matrix ( ) const
inline
313{ return *this; }

◆ matrixFunction()

template<typename Derived >
const MatrixFunctionReturnValue< Derived > Eigen::MatrixBase< Derived >::matrixFunction ( StemFunction  f) const

Helper function for the unsupported MatrixFunctions module.

◆ maxCoeff() [1/3]

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff
inherited
Returns
the maximum of all coefficients of *this.
Warning
the result is undefined if *this contains NaN.
437{
438 return derived().redux(Eigen::internal::scalar_max_op<Scalar,Scalar>());
439}
Definition BinaryFunctors.h:167

Referenced by igl::copyleft::cgal::half_space_box(), igl::isolines(), igl::min_quad_with_fixed_precompute(), igl::octree(), Eigen::internal::lpNorm_selector< Derived, Infinity >::run(), and igl::slice().

+ Here is the caller graph for this function:

◆ maxCoeff() [2/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff ( IndexType *  index) const
inherited
Returns
the maximum of all coefficients of *this and puts in *index its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visitor(), DenseBase::maxCoeff()
263{
265 internal::max_coeff_visitor<Derived> maxVisitor;
266 this->visit(maxVisitor);
267 *index = (RowsAtCompileTime==1) ? maxVisitor.col : maxVisitor.row;
268 return maxVisitor.res;
269}
EIGEN_DEVICE_FUNC void visit(Visitor &func) const
Definition Visitor.h:107

References Eigen::internal::coeff_visitor< Derived >::col, EIGEN_STATIC_ASSERT_VECTOR_ONLY, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ maxCoeff() [3/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::maxCoeff ( IndexType *  rowId,
IndexType *  colId 
) const
inherited
Returns
the maximum of all coefficients of *this and puts in *row and *col its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::visit(), DenseBase::maxCoeff()
245{
246 internal::max_coeff_visitor<Derived> maxVisitor;
247 this->visit(maxVisitor);
248 *rowPtr = maxVisitor.row;
249 if (colPtr) *colPtr = maxVisitor.col;
250 return maxVisitor.res;
251}

References Eigen::internal::coeff_visitor< Derived >::col, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ mean()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::mean
inherited
Returns
the mean of all coefficients of *this
See also
trace(), prod(), sum()
463{
464#ifdef __INTEL_COMPILER
465 #pragma warning push
466 #pragma warning ( disable : 2259 )
467#endif
469#ifdef __INTEL_COMPILER
470 #pragma warning pop
471#endif
472}
EIGEN_DEVICE_FUNC Scalar redux(const BinaryOp &func) const
Definition BinaryFunctors.h:33

◆ minCoeff() [1/3]

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff
inherited
Returns
the minimum of all coefficients of *this.
Warning
the result is undefined if *this contains NaN.
427{
428 return derived().redux(Eigen::internal::scalar_min_op<Scalar,Scalar>());
429}
Definition BinaryFunctors.h:141

Referenced by igl::copyleft::cgal::half_space_box(), igl::isolines(), igl::min_quad_with_fixed_precompute(), igl::octree(), and igl::slice().

+ Here is the caller graph for this function:

◆ minCoeff() [2/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff ( IndexType *  index) const
inherited
Returns
the minimum of all coefficients of *this and puts in *index its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(IndexType*,IndexType*), DenseBase::maxCoeff(IndexType*,IndexType*), DenseBase::visit(), DenseBase::minCoeff()
226{
228 internal::min_coeff_visitor<Derived> minVisitor;
229 this->visit(minVisitor);
230 *index = IndexType((RowsAtCompileTime==1) ? minVisitor.col : minVisitor.row);
231 return minVisitor.res;
232}

References Eigen::internal::coeff_visitor< Derived >::col, EIGEN_STATIC_ASSERT_VECTOR_ONLY, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ minCoeff() [3/3]

template<typename Derived >
template<typename IndexType >
EIGEN_DEVICE_FUNC internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::minCoeff ( IndexType *  rowId,
IndexType *  colId 
) const
inherited
Returns
the minimum of all coefficients of *this and puts in *row and *col its location.
Warning
the result is undefined if *this contains NaN.
See also
DenseBase::minCoeff(Index*), DenseBase::maxCoeff(Index*,Index*), DenseBase::visit(), DenseBase::minCoeff()
208{
209 internal::min_coeff_visitor<Derived> minVisitor;
210 this->visit(minVisitor);
211 *rowId = minVisitor.row;
212 if (colId) *colId = minVisitor.col;
213 return minVisitor.res;
214}

References Eigen::internal::coeff_visitor< Derived >::col, Eigen::internal::coeff_visitor< Derived >::res, and Eigen::internal::coeff_visitor< Derived >::row.

◆ nestByValue()

template<typename Derived >
const NestByValue< Derived > Eigen::DenseBase< Derived >::nestByValue
inlineinherited
Returns
an expression of the temporary version of *this.
104{
105 return NestByValue<Derived>(derived());
106}

◆ noalias()

template<typename Derived >
NoAlias< Derived, MatrixBase > Eigen::MatrixBase< Derived >::noalias
Returns
a pseudo expression of *this with an operator= assuming no aliasing between *this and the source expression.

More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag. Currently, even though several expressions may alias, only product expressions have this flag. Therefore, noalias() is only usefull when the source expression contains a matrix product.

Here are some examples where noalias is usefull:

D.noalias() = A * B;
D.noalias() += A.transpose() * B;
D.noalias() -= 2 * A * B.adjoint();

On the other hand the following example will lead to a wrong result:

A.noalias() = A * B;

because the result matrix A is also an operand of the matrix product. Therefore, there is no alternative than evaluating A * B in a temporary, that is the default behavior when you write:

A = A * B;
See also
class NoAlias
102{
103 return NoAlias<Derived, Eigen::MatrixBase >(derived());
104}

◆ nonZeros()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::nonZeros ( ) const
inlineinherited
Returns
the number of nonzero coefficients which is in practice the number of stored coefficients.
210{ return size(); }

◆ norm()

template<typename Derived >
EIGEN_STRONG_INLINE NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::norm
Returns
, for vectors, the l2 norm of *this, and for matrices the Frobenius norm. In both cases, it consists in the square root of the sum of the square of all the matrix entries. For vectors, this is also equals to the square root of the dot product of *this with itself.
See also
lpNorm(), dot(), squaredNorm()
109{
110 return numext::sqrt(squaredNorm());
111}
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE float sqrt(const float &x)
Definition MathFunctions.h:540

References Eigen::numext::sqrt().

Referenced by Eigen::internal::lpNorm_selector< Derived, 2 >::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalize()

template<typename Derived >
EIGEN_STRONG_INLINE void Eigen::MatrixBase< Derived >::normalize

Normalizes the vector, i.e. divides it by its own norm.

\only_for_vectors

Warning
If the input vector is too small (i.e., this->norm()==0), then *this is left unchanged.
See also
norm(), normalized()
146{
148 // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
149 if(z>RealScalar(0))
150 derived() /= numext::sqrt(z);
151}

References Eigen::numext::sqrt().

+ Here is the call graph for this function:

◆ normalized()

template<typename Derived >
EIGEN_STRONG_INLINE const MatrixBase< Derived >::PlainObject Eigen::MatrixBase< Derived >::normalized
Returns
an expression of the quotient of *this by its own norm.
Warning
If the input vector is too small (i.e., this->norm()==0), then this function returns a copy of the input.

\only_for_vectors

See also
norm(), normalize()
125{
126 typedef typename internal::nested_eval<Derived,2>::type _Nested;
127 _Nested n(derived());
128 RealScalar z = n.squaredNorm();
129 // NOTE: after extensive benchmarking, this conditional does not impact performance, at least on recent x86 CPU
130 if(z>RealScalar(0))
131 return n / numext::sqrt(z);
132 else
133 return n;
134}

References Eigen::numext::sqrt().

+ Here is the call graph for this function:

◆ NullaryExpr() [1/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( const CustomNullaryOp &  func)
inherited
Returns
an expression of a matrix defined by a custom functor func

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.

See also
class CwiseNullaryOp
155{
156 return CwiseNullaryOp<CustomNullaryOp, PlainObject>(RowsAtCompileTime, ColsAtCompileTime, func);
157}

◆ NullaryExpr() [2/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( const CustomNullaryOp &  func)
staticinherited

◆ NullaryExpr() [3/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  rows,
Index  cols,
const CustomNullaryOp &  func 
)
inherited
Returns
an expression of a matrix defined by a custom functor func

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.

See also
class CwiseNullaryOp
110{
111 return CwiseNullaryOp<CustomNullaryOp, PlainObject>(rows, cols, func);
112}

◆ NullaryExpr() [4/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  rows,
Index  cols,
const CustomNullaryOp &  func 
)
staticinherited

◆ NullaryExpr() [5/6]

template<typename Derived >
template<typename CustomNullaryOp >
EIGEN_STRONG_INLINE const CwiseNullaryOp< CustomNullaryOp, typename DenseBase< Derived >::PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  size,
const CustomNullaryOp &  func 
)
inherited
Returns
an expression of a matrix defined by a custom functor func

The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

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:

See also
class CwiseNullaryOp
136{
138 if(RowsAtCompileTime == 1) return CwiseNullaryOp<CustomNullaryOp, PlainObject>(1, size, func);
139 else return CwiseNullaryOp<CustomNullaryOp, PlainObject>(size, 1, func);
140}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ NullaryExpr() [6/6]

template<typename Derived >
template<typename CustomNullaryOp >
static EIGEN_DEVICE_FUNC const CwiseNullaryOp< CustomNullaryOp, PlainObject > Eigen::DenseBase< Derived >::NullaryExpr ( Index  size,
const CustomNullaryOp &  func 
)
staticinherited

◆ Ones() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones
staticinherited
Returns
an expression of a fixed-size matrix or vector where all coefficients equal one.

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.

Example:

Output:

See also
Ones(Index), Ones(Index,Index), isOnes(), class Ones
598{
599 return Constant(Scalar(1));
600}
static EIGEN_DEVICE_FUNC const ConstantReturnType Constant(Index rows, Index cols, const Scalar &value)
Definition CwiseNullaryOp.h:174

◆ Ones() [2/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones ( Index  rows,
Index  cols 
)
staticinherited
Returns
an expression of a matrix where all coefficients equal one.

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:

See also
Ones(), Ones(Index), isOnes(), class Ones
558{
559 return Constant(rows, cols, Scalar(1));
560}

◆ Ones() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Ones ( Index  newSize)
staticinherited
Returns
an expression of a vector where all coefficients equal one.

The parameter newSize is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

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:

See also
Ones(), Ones(Index,Index), isOnes(), class Ones
581{
582 return Constant(newSize, Scalar(1));
583}

◆ operator!=()

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::MatrixBase< Derived >::operator!= ( const MatrixBase< OtherDerived > &  other) const
inline
Returns
true if at least one pair of coefficients of *this and other are not exactly equal to each other.
Warning
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
See also
isApprox(), operator==
297 { return cwiseNotEqual(other).any(); }
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::not_equal_to< Scalar >, const Derived, const OtherDerived > cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition MatrixCwiseBinaryOps.h:63

References cwiseNotEqual().

+ Here is the call graph for this function:

◆ operator*() [1/4]

template<typename Derived >
template<typename DiagonalDerived >
const Product< Derived, DiagonalDerived, LazyProduct > Eigen::MatrixBase< Derived >::operator* ( const DiagonalBase< DiagonalDerived > &  a_diagonal) const
inline
Returns
the diagonal matrix product of *this by the diagonal matrix diagonal.
22{
23 return Product<Derived, DiagonalDerived, LazyProduct>(derived(),a_diagonal.derived());
24}

References Eigen::DiagonalBase< Derived >::derived().

+ Here is the call graph for this function:

◆ operator*() [2/4]

template<typename Derived >
template<typename DiagonalDerived >
EIGEN_DEVICE_FUNC const Product< Derived, DiagonalDerived, LazyProduct > Eigen::MatrixBase< Derived >::operator* ( const DiagonalBase< DiagonalDerived > &  diagonal) const

◆ operator*() [3/4]

template<typename Derived >
template<typename OtherDerived >
const Product< Derived, OtherDerived > Eigen::MatrixBase< Derived >::operator* ( const MatrixBase< OtherDerived > &  other) const
inline
Returns
the matrix product of *this and other.
Note
If instead of the matrix product you want the coefficient-wise product, see Cwise::operator*().
See also
lazyProduct(), operator*=(const MatrixBase&), Cwise::operator*()
391{
392 // A note regarding the function declaration: In MSVC, this function will sometimes
393 // not be inlined since DenseStorage is an unwindable object for dynamic
394 // matrices and product types are holding a member to store the result.
395 // Thus it does not help tagging this function with EIGEN_STRONG_INLINE.
396 enum {
397 ProductIsValid = Derived::ColsAtCompileTime==Dynamic
398 || OtherDerived::RowsAtCompileTime==Dynamic
399 || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime),
400 AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime,
401 SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived)
402 };
403 // note to the lost user:
404 // * for a dot product use: v1.dot(v2)
405 // * for a coeff-wise product use: v1.cwiseProduct(v2)
406 EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes),
407 INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS)
408 EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors),
409 INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION)
410 EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT)
411#ifdef EIGEN_DEBUG_PRODUCT
412 internal::product_type<Derived,OtherDerived>::debug();
413#endif
414
415 return Product<Derived, OtherDerived>(derived(), other.derived());
416}

References Eigen::Dynamic, EIGEN_PREDICATE_SAME_MATRIX_SIZE, and EIGEN_STATIC_ASSERT.

◆ operator*() [4/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived > Eigen::MatrixBase< Derived >::operator* ( const MatrixBase< OtherDerived > &  other) const

◆ operator*=() [1/2]

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

replaces *this by *this * other.

Returns
a reference to *this

Example:

Output:

 
498{
499 other.derived().applyThisOnTheRight(derived());
500 return derived();
501}

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ operator*=() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::operator*= ( const Scalar other)
19{
20 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::mul_assign_op<Scalar,Scalar>());
21 return derived();
22}
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void call_assignment(Dst &dst, const Src &src)
Definition AssignEvaluator.h:780

◆ operator+=() [1/4]

template<typename Derived >
template<typename OtherDerived >
Derived & Eigen::MatrixBase< Derived >::operator+= ( const ArrayBase< OtherDerived > &  )
inlineprotected
476 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}

References EIGEN_STATIC_ASSERT.

◆ operator+=() [2/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::DenseBase< Derived >::operator+= ( const EigenBase< OtherDerived > &  other)
143{
144 call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
145 return derived();
146}

◆ operator+=() [3/4]

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

replaces *this by *this + other.

Returns
a reference to *this
176{
177 call_assignment(derived(), other.derived(), internal::add_assign_op<Scalar,typename OtherDerived::Scalar>());
178 return derived();
179}

◆ operator+=() [4/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator+= ( const MatrixBase< OtherDerived > &  other)

◆ operator-=() [1/4]

template<typename Derived >
template<typename OtherDerived >
Derived & Eigen::MatrixBase< Derived >::operator-= ( const ArrayBase< OtherDerived > &  )
inlineprotected
479 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}

References EIGEN_STATIC_ASSERT.

◆ operator-=() [2/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::DenseBase< Derived >::operator-= ( const EigenBase< OtherDerived > &  other)
152{
153 call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
154 return derived();
155}

◆ operator-=() [3/4]

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

replaces *this by *this - other.

Returns
a reference to *this
163{
164 call_assignment(derived(), other.derived(), internal::sub_assign_op<Scalar,typename OtherDerived::Scalar>());
165 return derived();
166}

◆ operator-=() [4/4]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator-= ( const MatrixBase< OtherDerived > &  other)

◆ operator/=()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::operator/= ( const Scalar other)
40{
41 internal::call_assignment(this->derived(), PlainObject::Constant(rows(),cols(),other), internal::div_assign_op<Scalar,Scalar>());
42 return derived();
43}

◆ operator<<() [1/3]

template<typename Derived >
template<typename OtherDerived >
CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const DenseBase< OtherDerived > &  other)
inlineinherited
See also
operator<<(const Scalar&)
154{
155 return CommaInitializer<Derived>(*static_cast<Derived *>(this), other);
156}

◆ operator<<() [2/3]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const DenseBase< OtherDerived > &  other)
inherited

◆ operator<<() [3/3]

template<typename Derived >
CommaInitializer< Derived > Eigen::DenseBase< Derived >::operator<< ( const Scalar s)
inlineinherited

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:

Note
According the c++ standard, the argument expressions of this comma initializer are evaluated in arbitrary order.
See also
CommaInitializer::finished(), class CommaInitializer
145{
146 return CommaInitializer<Derived>(*static_cast<Derived*>(this), s);
147}

◆ operator=() [1/6]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator= ( const DenseBase< OtherDerived > &  other)
65{
66 internal::call_assignment(derived(), other.derived());
67 return derived();
68}

References Eigen::internal::call_assignment().

+ Here is the call graph for this function:

◆ operator=() [2/6]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator= ( const EigenBase< OtherDerived > &  other)
74{
75 internal::call_assignment(derived(), other.derived());
76 return derived();
77}

References Eigen::internal::call_assignment(), and Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ operator=() [3/6]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::MatrixBase< Derived >::operator= ( const EigenBase< OtherDerived > &  other)

◆ operator=() [4/6]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator= ( const MatrixBase< Derived > &  other)

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

56{
57 internal::call_assignment(derived(), other.derived());
58 return derived();
59}

References Eigen::internal::call_assignment().

+ Here is the call graph for this function:

◆ operator=() [5/6]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::operator= ( const ReturnByValue< OtherDerived > &  other)
83{
84 other.derived().evalTo(derived());
85 return derived();
86}

References Eigen::ReturnByValue< Derived >::evalTo().

+ Here is the call graph for this function:

◆ operator=() [6/6]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC Derived & Eigen::MatrixBase< Derived >::operator= ( const ReturnByValue< OtherDerived > &  other)

◆ operator==()

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC bool Eigen::MatrixBase< Derived >::operator== ( const MatrixBase< OtherDerived > &  other) const
inline
Returns
true if each coefficients of *this and other are all exactly equal.
Warning
When using floating point scalar values you probably should rather use a fuzzy comparison such as isApprox()
See also
isApprox(), operator!=
289 { return cwiseEqual(other).all(); }
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::equal_to< Scalar >, const Derived, const OtherDerived > cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition MatrixCwiseBinaryOps.h:43

References cwiseEqual().

+ Here is the call graph for this function:

◆ operatorNorm()

template<typename Derived >
MatrixBase< Derived >::RealScalar Eigen::MatrixBase< Derived >::operatorNorm
inline

Computes the L2 operator norm.

Returns
Operator norm of the matrix.

\eigenvalues_module This function computes the L2 operator norm of a matrix, which is also known as the spectral norm. The norm of a matrix $ A $ is defined to be

\[ \|A\|_2 = \max_x \frac{\|Ax\|_2}{\|x\|_2} \]

where the maximum is over all vectors and the norm on the right is the Euclidean vector norm. The norm equals the largest singular value, which is the square root of the largest eigenvalue of the positive semi-definite matrix $ A^*A $.

The current implementation uses the eigenvalues of $ A^*A $, as computed by SelfAdjointView::eigenvalues(), to compute the operator norm of a matrix. The SelfAdjointView class provides a better algorithm for selfadjoint matrices.

Example:

Output:

See also
SelfAdjointView::eigenvalues(), SelfAdjointView::operatorNorm()
121{
122 using std::sqrt;
123 typename Derived::PlainObject m_eval(derived());
124 // FIXME if it is really guaranteed that the eigenvalues are already sorted,
125 // then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough.
126 return sqrt((m_eval*m_eval.adjoint())
127 .eval()
128 .template selfadjointView<Lower>()
129 .eigenvalues()
130 .maxCoeff()
131 );
132}

References sqrt().

+ Here is the call graph for this function:

◆ outerSize()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::DenseBase< Derived >::outerSize ( ) const
inlineinherited
Returns
the outer size.
Note
For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension with respect to the storage order, i.e., the number of columns for a column-major matrix, and the number of rows for a row-major matrix.
219 {
220 return IsVectorAtCompileTime ? 1
221 : int(IsRowMajor) ? this->rows() : this->cols();
222 }

References Eigen::DenseBase< Derived >::IsRowMajor, and Eigen::DenseBase< Derived >::IsVectorAtCompileTime.

◆ partialPivLu()

template<typename Derived >
const PartialPivLU< typename MatrixBase< Derived >::PlainObject > Eigen::MatrixBase< Derived >::partialPivLu
inline

\lu_module

Returns
the partial-pivoting LU decomposition of *this.
See also
class PartialPivLU
590{
591 return PartialPivLU<PlainObject>(eval());
592}

◆ prod()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::prod
inherited
Returns
the product of all coefficients of *this

Example:

Output:

See also
sum(), mean(), trace()
484{
486 return Scalar(1);
487 return derived().redux(Eigen::internal::scalar_product_op<Scalar>());
488}
Definition BinaryFunctors.h:77

References Eigen::Dynamic.

◆ Random() [1/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random
inlinestaticinherited
Returns
a fixed-size random matrix or vector expression

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:

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.

\not_reentrant

See also
DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random(Index)
114{
115 return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op<Scalar>());
116}

◆ Random() [2/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random ( Index  rows,
Index  cols 
)
inlinestaticinherited
Returns
a random matrix expression

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.

\not_reentrant

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:

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.

See also
DenseBase::setRandom(), DenseBase::Random(Index), DenseBase::Random()
57{
58 return NullaryExpr(rows, cols, internal::scalar_random_op<Scalar>());
59}

◆ Random() [3/3]

template<typename Derived >
const DenseBase< Derived >::RandomReturnType Eigen::DenseBase< Derived >::Random ( Index  size)
inlinestaticinherited
Returns
a random vector expression

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.

\only_for_vectors \not_reentrant

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:

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.

See also
DenseBase::setRandom(), DenseBase::Random(Index,Index), DenseBase::Random()
88{
89 return NullaryExpr(size, internal::scalar_random_op<Scalar>());
90}

◆ redux() [1/2]

template<typename Derived >
template<typename BinaryOp >
EIGEN_DEVICE_FUNC Scalar Eigen::DenseBase< Derived >::redux ( const BinaryOp &  func) const
inherited

Referenced by Eigen::internal::member_redux< BinaryOp, Scalar >::operator()().

+ Here is the caller graph for this function:

◆ redux() [2/2]

template<typename Derived >
template<typename Func >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::redux ( const Func &  func) const
inherited
Returns
the result of a full redux operation on the whole matrix or vector using func

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.

See also
DenseBase::sum(), DenseBase::minCoeff(), DenseBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise()
412{
413 eigen_assert(this->rows()>0 && this->cols()>0 && "you are using an empty matrix");
414
415 typedef typename internal::redux_evaluator<Derived> ThisEvaluator;
416 ThisEvaluator thisEval(derived());
417
418 return internal::redux_impl<Func, ThisEvaluator>::run(thisEval, func);
419}

References eigen_assert.

◆ replicate() [1/3]

template<typename Derived >
template<int RowFactor, int ColFactor>
EIGEN_DEVICE_FUNC const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate ( ) const
inherited

Referenced by igl::min_quad_with_fixed_solve().

+ Here is the caller graph for this function:

◆ replicate() [2/3]

template<typename Derived >
template<int RowFactor, int ColFactor>
const Replicate< Derived, RowFactor, ColFactor > Eigen::DenseBase< Derived >::replicate ( ) const
inherited
Returns
an expression of the replication of *this

Example:

Output:

See also
VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate
120{
121 return Replicate<Derived,RowFactor,ColFactor>(derived());
122}

◆ replicate() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC const Replicate< Derived, Dynamic, Dynamic > Eigen::DenseBase< Derived >::replicate ( Index  rowFactor,
Index  colFactor 
) const
inlineinherited
Returns
an expression of the replication of *this

Example:

Output:

See also
VectorwiseOp::replicate(), DenseBase::replicate<int,int>(), class Replicate
555 {
556 return Replicate<Derived, Dynamic, Dynamic>(derived(), rowFactor, colFactor);
557 }

◆ resize() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::resize ( Index  newSize)
inlineinherited

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.

242 {
244 eigen_assert(newSize == this->size()
245 && "DenseBase::resize() does not actually allow to resize.");
246 }
#define EIGEN_ONLY_USED_FOR_DEBUG(x)
Definition Macros.h:591

References eigen_assert, and EIGEN_ONLY_USED_FOR_DEBUG.

Referenced by Eigen::TriangularBase< Derived >::evalToLazy(), igl::find(), and igl::slice_tets().

+ Here is the caller graph for this function:

◆ resize() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::resize ( Index  rows,
Index  cols 
)
inlineinherited

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.

253 {
256 eigen_assert(rows == this->rows() && cols == this->cols()
257 && "DenseBase::resize() does not actually allow to resize.");
258 }

References eigen_assert, and EIGEN_ONLY_USED_FOR_DEBUG.

◆ reverse() [1/2]

template<typename Derived >
DenseBase< Derived >::ReverseReturnType Eigen::DenseBase< Derived >::reverse
inlineinherited
Returns
an expression of the reverse of *this.

Example:

Output:

 
119{
120 return ReverseReturnType(derived());
121}
Reverse< Derived, BothDirections > ReverseReturnType
Definition DenseBase.h:559

◆ reverse() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstReverseReturnType Eigen::DenseBase< Derived >::reverse ( ) const
inlineinherited

This is the const version of reverse().

565 {
566 return ConstReverseReturnType(derived());
567 }
const Reverse< const Derived, BothDirections > ConstReverseReturnType
Definition DenseBase.h:560

◆ reverseInPlace()

template<typename Derived >
void Eigen::DenseBase< Derived >::reverseInPlace
inlineinherited

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:

  • less error prone: doing the same operation with .reverse() requires special care:
    m = m.reverse().eval();
  • this API enables reverse operations without the need for a temporary
  • it allows future optimizations (cache friendliness, etc.)
See also
VectorwiseOp::reverseInPlace(), reverse()
140{
141 if(cols()>rows())
142 {
143 Index half = cols()/2;
144 leftCols(half).swap(rightCols(half).reverse());
145 if((cols()%2)==1)
146 {
147 Index half2 = rows()/2;
148 col(half).head(half2).swap(col(half).tail(half2).reverse());
149 }
150 }
151 else
152 {
153 Index half = rows()/2;
154 topRows(half).swap(bottomRows(half).reverse());
155 if((rows()%2)==1)
156 {
157 Index half2 = cols()/2;
158 row(half).head(half2).swap(row(half).tail(half2).reverse());
159 }
160 }
161}
EIGEN_DEVICE_FUNC ColsBlockXpr rightCols(Index n)
This is the const version of rightCols(Index).
Definition BlockMethods.h:658
EIGEN_DEVICE_FUNC ColsBlockXpr leftCols(Index n)
This is the const version of leftCols(Index).
Definition BlockMethods.h:602
EIGEN_DEVICE_FUNC RowsBlockXpr bottomRows(Index n)
This is the const version of bottomRows(Index).
Definition BlockMethods.h:488
EIGEN_DEVICE_FUNC RowsBlockXpr topRows(Index n)
This is the const version of topRows(Index).
Definition BlockMethods.h:432
EIGEN_DEVICE_FUNC ReverseReturnType reverse()
Definition Reverse.h:118

References bottomRows(), col(), leftCols(), rightCols(), row(), tail(), and topRows().

+ Here is the call graph for this function:

◆ rowwise() [1/2]

template<typename Derived >
DenseBase< Derived >::RowwiseReturnType Eigen::DenseBase< Derived >::rowwise
inlineinherited
Returns
a writable VectorwiseOp wrapper of *this providing additional partial reduction operations
See also
colwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
689{
690 return RowwiseReturnType(derived());
691}
VectorwiseOp< Derived, Horizontal > RowwiseReturnType
Definition DenseBase.h:491

◆ rowwise() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC ConstRowwiseReturnType Eigen::DenseBase< Derived >::rowwise ( ) const
inlineinherited
Returns
a VectorwiseOp wrapper of *this providing additional partial reduction operations

Example:

Output:

See also
colwise(), class VectorwiseOp, TutorialReductionsVisitorsBroadcasting
504 {
505 return ConstRowwiseReturnType(derived());
506 }
const VectorwiseOp< const Derived, Horizontal > ConstRowwiseReturnType
Definition DenseBase.h:492

Referenced by igl::normalize_row_sums(), and Eigen::umeyama().

+ Here is the caller graph for this function:

◆ select() [1/3]

template<typename Derived >
template<typename ThenDerived , typename ElseDerived >
const Select< Derived, ThenDerived, ElseDerived > Eigen::DenseBase< Derived >::select ( const DenseBase< ThenDerived > &  thenMatrix,
const DenseBase< ElseDerived > &  elseMatrix 
) const
inlineinherited
Returns
a matrix where each coefficient (i,j) is equal to thenMatrix(i,j) if *this(i,j), and elseMatrix(i,j) otherwise.

Example:

Output:

See also
class Select
126{
127 return Select<Derived,ThenDerived,ElseDerived>(derived(), thenMatrix.derived(), elseMatrix.derived());
128}

◆ select() [2/3]

template<typename Derived >
template<typename ThenDerived >
const Select< Derived, ThenDerived, typename ThenDerived::ConstantReturnType > Eigen::DenseBase< Derived >::select ( const DenseBase< ThenDerived > &  thenMatrix,
const typename ThenDerived::Scalar &  elseScalar 
) const
inlineinherited

Version of DenseBase::select(const DenseBase&, const DenseBase&) with the else expression being a scalar value.

See also
DenseBase::select(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
140{
141 return Select<Derived,ThenDerived,typename ThenDerived::ConstantReturnType>(
142 derived(), thenMatrix.derived(), ThenDerived::Constant(rows(),cols(),elseScalar));
143}

◆ select() [3/3]

template<typename Derived >
template<typename ElseDerived >
const Select< Derived, typename ElseDerived::ConstantReturnType, ElseDerived > Eigen::DenseBase< Derived >::select ( const typename ElseDerived::Scalar &  thenScalar,
const DenseBase< ElseDerived > &  elseMatrix 
) const
inlineinherited

Version of DenseBase::select(const DenseBase&, const DenseBase&) with the then expression being a scalar value.

See also
DenseBase::select(const DenseBase<ThenDerived>&, const DenseBase<ElseDerived>&) const, class Select
155{
156 return Select<Derived,typename ElseDerived::ConstantReturnType,ElseDerived>(
157 derived(), ElseDerived::Constant(rows(),cols(),thenScalar), elseMatrix.derived());
158}

◆ selfadjointView() [1/4]

template<typename Derived >
template<unsigned int UpLo>
EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Derived >::selfadjointView ( )

◆ selfadjointView() [2/4]

template<typename Derived >
template<unsigned int UpLo>
MatrixBase< Derived >::template SelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Derived >::selfadjointView ( )
Returns
an expression of a symmetric/self-adjoint view extracted from the upper or lower triangular part of the current matrix

The parameter UpLo can be either Upper or Lower

Example:

Output:

See also
class SelfAdjointView
346{
347 return typename SelfAdjointViewReturnType<UpLo>::Type(derived());
348}
SelfAdjointView< Derived, UpLo > Type
Definition MatrixBase.h:242

References Eigen::TriangularBase< SelfAdjointView< _MatrixType, UpLo > >::derived().

+ Here is the call graph for this function:

◆ selfadjointView() [3/4]

template<typename Derived >
template<unsigned int UpLo>
EIGEN_DEVICE_FUNC ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Derived >::selfadjointView ( ) const

◆ selfadjointView() [4/4]

template<typename Derived >
template<unsigned int UpLo>
MatrixBase< Derived >::template ConstSelfAdjointViewReturnType< UpLo >::Type Eigen::MatrixBase< Derived >::selfadjointView ( ) const

This is the const version of MatrixBase::selfadjointView()

329{
330 return typename ConstSelfAdjointViewReturnType<UpLo>::Type(derived());
331}
const SelfAdjointView< const Derived, UpLo > Type
Definition MatrixBase.h:243

References Eigen::TriangularBase< SelfAdjointView< _MatrixType, UpLo > >::derived().

+ Here is the call graph for this function:

◆ setConstant()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setConstant ( const Scalar val)
inherited

Sets all coefficients in this expression to value val.

See also
fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes()
326{
327 return derived() = Constant(rows(), cols(), val);
328}

Referenced by Eigen::ArrayBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ setIdentity() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::setIdentity

Writes the identity expression (not necessarily square) into *this.

Example:

Output:

See also
class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity()
775{
777}
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & run(Derived &m)
Definition CwiseNullaryOp.h:745

References Eigen::internal::setIdentity_impl< Derived, Big >::run().

+ Here is the call graph for this function:

◆ setIdentity() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::MatrixBase< Derived >::setIdentity ( Index  rows,
Index  cols 
)

Resizes to the given size, and writes the identity expression (not necessarily square) into *this.

Parameters
rowsthe new number of rows
colsthe new number of columns

Example:

Output:

See also
MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity()
791{
792 derived().resize(rows, cols);
793 return setIdentity();
794}
EIGEN_DEVICE_FUNC Derived & setIdentity()
Definition CwiseNullaryOp.h:774

◆ setLinSpaced() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setLinSpaced ( const Scalar low,
const Scalar high 
)
inherited

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.

\only_for_vectors

For integer scalar types, do not miss the explanations on the definition of even spacing .

See also
LinSpaced(Index,const Scalar&,const Scalar&), setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp
404{
406 return setLinSpaced(size(), low, high);
407}
EIGEN_DEVICE_FUNC Derived & setLinSpaced(Index size, const Scalar &low, const Scalar &high)
Sets a linearly spaced vector.
Definition CwiseNullaryOp.h:383

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ setLinSpaced() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setLinSpaced ( Index  newSize,
const Scalar low,
const Scalar high 
)
inherited

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.

\only_for_vectors

Example:

Output:

For integer scalar types, do not miss the explanations on the definition of even spacing .

See also
LinSpaced(Index,const Scalar&,const Scalar&), CwiseNullaryOp
384{
386 return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op<Scalar,PacketScalar>(low,high,newSize));
387}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ setOnes()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setOnes
inherited

Sets all coefficients in this expression to one.

Example:

Output:

See also
class CwiseNullaryOp, Ones()
626{
627 return setConstant(Scalar(1));
628}

◆ setRandom()

template<typename Derived >
Derived & Eigen::DenseBase< Derived >::setRandom
inlineinherited

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.

\not_reentrant

Example:

Output:

See also
class CwiseNullaryOp, setRandom(Index), setRandom(Index,Index)
132{
133 return *this = Random(rows(), cols());
134}
static const RandomReturnType Random()
Definition Random.h:113

◆ setZero()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & Eigen::DenseBase< Derived >::setZero
inherited

Sets all coefficients in this expression to zero.

Example:

Output:

See also
class CwiseNullaryOp, Zero()
500{
501 return setConstant(Scalar(0));
502}

Referenced by Eigen::SPQR< _MatrixType >::_solve_impl(), Eigen::PermutationBase< Derived >::evalTo(), and Eigen::InverseImpl< PermutationType, PermutationStorage >::evalTo().

+ Here is the caller graph for this function:

◆ sparseView()

template<typename Derived >
const SparseView< Derived > Eigen::MatrixBase< Derived >::sparseView ( const Scalar reference = Scalar(0),
const typename NumTraits< Scalar >::Real &  epsilon = NumTraits<Scalar>::dummy_precision() 
) const
Returns
a sparse expression of the dense expression *this with values smaller than reference * epsilon removed.

This method is typically used when prototyping to convert a quickly assembled dense Matrix D to a SparseMatrix S:

MatrixXd D(n,m);
S = D.sparseView(); // suppress numerical zeros (exact)
S = D.sparseView(reference);
S = D.sparseView(reference,epsilon);
A versatible sparse matrix representation.
Definition SparseMatrix.h:98

where reference is a meaningful non zero reference value, and epsilon is a tolerance factor defaulting to NumTraits<Scalar>::dummy_precision().

See also
SparseMatrixBase::pruned(), class SparseView
227{
228 return SparseView<Derived>(derived(), reference, epsilon);
229}

◆ squaredNorm()

template<typename Derived >
EIGEN_STRONG_INLINE NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::squaredNorm
Returns
, for vectors, the squared l2 norm of *this, and for matrices the Frobenius norm. In both cases, it consists in the sum of the square of all the matrix entries. For vectors, this is also equals to the dot product of *this with itself.
See also
dot(), norm(), lpNorm()
97{
98 return numext::real((*this).cwiseAbs2().sum());
99}

◆ stableNorm()

template<typename Derived >
NumTraits< typenameinternal::traits< Derived >::Scalar >::Real Eigen::MatrixBase< Derived >::stableNorm
inline
Returns
the l2 norm of *this avoiding underflow and overflow. This version use a blockwise two passes algorithm: 1 - find the absolute largest coefficient s 2 - compute $ s \Vert \frac{*this}{s} \Vert $ in a standard way

For architecture/scalar types supporting vectorization, this version is faster than blueNorm(). Otherwise the blueNorm() is much faster.

See also
norm(), blueNorm(), hypotNorm()
158{
159 using std::sqrt;
160 using std::abs;
161 const Index blockSize = 4096;
162 RealScalar scale(0);
163 RealScalar invScale(1);
164 RealScalar ssq(0); // sum of square
165
166 typedef typename internal::nested_eval<Derived,2>::type DerivedCopy;
167 typedef typename internal::remove_all<DerivedCopy>::type DerivedCopyClean;
168 const DerivedCopy copy(derived());
169
170 enum {
171 CanAlign = ( (int(DerivedCopyClean::Flags)&DirectAccessBit)
172 || (int(internal::evaluator<DerivedCopyClean>::Alignment)>0) // FIXME Alignment)>0 might not be enough
173 ) && (blockSize*sizeof(Scalar)*2<EIGEN_STACK_ALLOCATION_LIMIT)
174 && (EIGEN_MAX_STATIC_ALIGN_BYTES>0) // if we cannot allocate on the stack, then let's not bother about this optimization
175 };
176 typedef typename internal::conditional<CanAlign, Ref<const Matrix<Scalar,Dynamic,1,0,blockSize,1>, internal::evaluator<DerivedCopyClean>::Alignment>,
177 typename DerivedCopyClean::ConstSegmentReturnType>::type SegmentWrapper;
178 Index n = size();
179
180 if(n==1)
181 return abs(this->coeff(0));
182
184 if (bi>0)
185 internal::stable_norm_kernel(copy.head(bi), ssq, scale, invScale);
186 for (; bi<n; bi+=blockSize)
187 internal::stable_norm_kernel(SegmentWrapper(copy.segment(bi,numext::mini(blockSize, n - bi))), ssq, scale, invScale);
188 return scale * sqrt(ssq);
189}
#define EIGEN_MAX_STATIC_ALIGN_BYTES
Definition Macros.h:730
#define EIGEN_STACK_ALLOCATION_LIMIT
Definition Macros.h:801
int scale(const int val)
Definition WipeTowerDialog.cpp:14
const unsigned int DirectAccessBit
Definition Constants.h:150
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC half abs(const half &a)
Definition Half.h:445
T type
Definition Meta.h:78
static Index first_default_aligned(const DenseBase< Derived > &m)
Definition DenseCoeffsBase.h:646
void stable_norm_kernel(const ExpressionType &bl, Scalar &ssq, Scalar &scale, Scalar &invScale)
Definition StableNorm.h:18

References Eigen::DirectAccessBit, EIGEN_MAX_STATIC_ALIGN_BYTES, EIGEN_STACK_ALLOCATION_LIMIT, Eigen::internal::first_default_aligned(), Eigen::numext::mini(), scale(), sqrt(), and Eigen::internal::stable_norm_kernel().

+ Here is the call graph for this function:

◆ stableNormalize()

template<typename Derived >
EIGEN_STRONG_INLINE void Eigen::MatrixBase< Derived >::stableNormalize

Normalizes the vector while avoid underflow and overflow

\only_for_vectors

This method is analogue to the normalize() method, but it reduces the risk of underflow and overflow when computing the norm.

Warning
If the input vector is too small (i.e., this->norm()==0), then *this is left unchanged.
See also
stableNorm(), stableNormalized(), normalize()
192{
193 RealScalar w = cwiseAbs().maxCoeff();
194 RealScalar z = (derived()/w).squaredNorm();
195 if(z>RealScalar(0))
196 derived() /= numext::sqrt(z)*w;
197}

◆ stableNormalized()

template<typename Derived >
EIGEN_STRONG_INLINE const MatrixBase< Derived >::PlainObject Eigen::MatrixBase< Derived >::stableNormalized
Returns
an expression of the quotient of *this by its own norm while avoiding underflow and overflow.

\only_for_vectors

This method is analogue to the normalized() method, but it reduces the risk of underflow and overflow when computing the norm.

Warning
If the input vector is too small (i.e., this->norm()==0), then this function returns a copy of the input.
See also
stableNorm(), stableNormalize(), normalized()
168{
169 typedef typename internal::nested_eval<Derived,3>::type _Nested;
170 _Nested n(derived());
171 RealScalar w = n.cwiseAbs().maxCoeff();
172 RealScalar z = (n/w).squaredNorm();
173 if(z>RealScalar(0))
174 return n / (numext::sqrt(z)*w);
175 else
176 return n;
177}

References Eigen::numext::sqrt().

+ Here is the call graph for this function:

◆ sum()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::DenseBase< Derived >::sum
inherited
Returns
the sum of all coefficients of *this

If *this is empty, then the value 0 is returned.

See also
trace(), prod(), mean()
450{
452 return Scalar(0);
453 return derived().redux(Eigen::internal::scalar_sum_op<Scalar,Scalar>());
454}

References Eigen::Dynamic.

Referenced by igl::normalize_row_sums(), and Eigen::internal::lpNorm_selector< Derived, 1 >::run().

+ Here is the caller graph for this function:

◆ swap() [1/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::swap ( const DenseBase< OtherDerived > &  other)
inlineinherited

swaps *this with the expression other.

415 {
416 EIGEN_STATIC_ASSERT(!OtherDerived::IsPlainObjectBase,THIS_EXPRESSION_IS_NOT_A_LVALUE__IT_IS_READ_ONLY);
417 eigen_assert(rows()==other.rows() && cols()==other.cols());
418 call_assignment(derived(), other.const_cast_derived(), internal::swap_assign_op<Scalar>());
419 }

References eigen_assert, and EIGEN_STATIC_ASSERT.

Referenced by Eigen::internal::conservative_resize_like_impl< Derived, OtherDerived, IsVector >::run(), and Eigen::internal::conservative_resize_like_impl< Derived, OtherDerived, IsVector >::run().

+ Here is the caller graph for this function:

◆ swap() [2/2]

template<typename Derived >
template<typename OtherDerived >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::swap ( PlainObjectBase< OtherDerived > &  other)
inlineinherited

swaps *this with the matrix or array other.

427 {
428 eigen_assert(rows()==other.rows() && cols()==other.cols());
429 call_assignment(derived(), other.derived(), internal::swap_assign_op<Scalar>());
430 }

References Eigen::PlainObjectBase< Derived >::cols(), eigen_assert, and Eigen::PlainObjectBase< Derived >::rows().

+ Here is the call graph for this function:

◆ trace()

template<typename Derived >
EIGEN_STRONG_INLINE internal::traits< Derived >::Scalar Eigen::MatrixBase< Derived >::trace
Returns
the trace of *this, i.e. the sum of the coefficients on the main diagonal.

*this can be any matrix, not necessarily square.

See also
diagonal(), sum()
499{
500 return derived().diagonal().sum();
501}

◆ transpose() [1/2]

template<typename Derived >
Transpose< Derived > Eigen::DenseBase< Derived >::transpose
inlineinherited
Returns
an expression of the transpose of *this.

Example:

Output:

Warning
If you want to replace a matrix by its own transpose, do NOT do this:
m = m.transpose(); // bug!!! caused by aliasing effect
Instead, use the transposeInPlace() method:
m.transposeInPlace();
which gives Eigen good opportunities for optimization, or alternatively you can also do:
m = m.transpose().eval();
See also
transposeInPlace(), adjoint()
173{
174 return TransposeReturnType(derived());
175}
Transpose< Derived > TransposeReturnType
Definition DenseBase.h:319

Referenced by igl::AABB< DerivedV, DIM >::find(), igl::AABB< DerivedV, DIM >::init(), igl::project(), igl::signed_distance_winding_number(), and igl::unproject().

+ Here is the caller graph for this function:

◆ transpose() [2/2]

template<typename Derived >
DenseBase< Derived >::ConstTransposeReturnType Eigen::DenseBase< Derived >::transpose
inlineinherited

This is the const version of transpose().

Make sure you read the warning for transpose() !

See also
transposeInPlace(), adjoint()
185{
186 return ConstTransposeReturnType(derived());
187}
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition DenseBase.h:322

◆ transposeInPlace()

template<typename Derived >
void Eigen::DenseBase< Derived >::transposeInPlace
inlineinherited

This is the "in place" version of transpose(): it replaces *this by its own transpose. Thus, doing

m.transposeInPlace();

has the same effect on m as doing

m = m.transpose().eval();

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().

Note
if the matrix is not square, then *this must be a resizable matrix. This excludes (non-square) fixed-size matrices, block-expressions and maps.
See also
transpose(), adjoint(), adjointInPlace()
285{
287 && "transposeInPlace() called on a non-square non-resizable matrix");
288 internal::inplace_transpose_selector<Derived>::run(derived());
289}

References Eigen::Dynamic, and eigen_assert.

◆ triangularView() [1/4]

template<typename Derived >
template<unsigned int Mode>
EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Derived >::triangularView ( )

◆ triangularView() [2/4]

template<typename Derived >
template<unsigned int Mode>
MatrixBase< Derived >::template TriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Derived >::triangularView ( )
Returns
an expression of a triangular view extracted from the current matrix

The parameter Mode can have the following values: Upper, StrictlyUpper, UnitUpper, Lower, StrictlyLower, UnitLower.

Example:

Output:

See also
class TriangularView
629{
630 return typename TriangularViewReturnType<Mode>::Type(derived());
631}
TriangularView< Derived, Mode > Type
Definition MatrixBase.h:232

◆ triangularView() [3/4]

template<typename Derived >
template<unsigned int Mode>
EIGEN_DEVICE_FUNC ConstTriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Derived >::triangularView ( ) const

◆ triangularView() [4/4]

template<typename Derived >
template<unsigned int Mode>
MatrixBase< Derived >::template ConstTriangularViewReturnType< Mode >::Type Eigen::MatrixBase< Derived >::triangularView ( ) const

This is the const version of MatrixBase::triangularView()

638{
639 return typename ConstTriangularViewReturnType<Mode>::Type(derived());
640}
const TriangularView< const Derived, Mode > Type
Definition MatrixBase.h:233

◆ Unit() [1/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::Unit ( Index  i)
static
Returns
an expression of the i-th unit (basis) vector.

\only_for_vectors

This variant is for fixed-size vector only.

See also
MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
819{
821 return BasisReturnType(SquareMatrixType::Identity(),i);
822}
Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime > BasisReturnType
Definition MatrixBase.h:120

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ Unit() [2/2]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::Unit ( Index  newSize,
Index  i 
)
static
Returns
an expression of the i-th unit (basis) vector.

\only_for_vectors

See also
MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
804{
806 return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i);
807}

References EIGEN_STATIC_ASSERT_VECTOR_ONLY.

◆ UnitW()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::UnitW
static
Returns
an expression of the W axis unit vector (0,0,0,1)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
862{ return Derived::Unit(3); }

◆ UnitX()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::UnitX
static
Returns
an expression of the X axis unit vector (1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
832{ return Derived::Unit(0); }

◆ UnitY()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::UnitY
static
Returns
an expression of the Y axis unit vector (0,1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
842{ return Derived::Unit(1); }

◆ UnitZ()

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const MatrixBase< Derived >::BasisReturnType Eigen::MatrixBase< Derived >::UnitZ
static
Returns
an expression of the Z axis unit vector (0,0,1{,0}^*)

\only_for_vectors

See also
MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW()
852{ return Derived::Unit(2); }

◆ value()

template<typename Derived >
EIGEN_DEVICE_FUNC CoeffReturnType Eigen::DenseBase< Derived >::value ( ) const
inlineinherited
Returns
the unique coefficient of a 1x1 expression
481 {
483 eigen_assert(this->rows() == 1 && this->cols() == 1);
484 return derived().coeff(0,0);
485 }
#define EIGEN_STATIC_ASSERT_SIZE_1x1(TYPE)
Definition StaticAssert.h:194

References eigen_assert, and EIGEN_STATIC_ASSERT_SIZE_1x1.

Referenced by igl::find(), and Eigen::ArrayBase< Derived >::operator=().

+ Here is the caller graph for this function:

◆ visit()

template<typename Derived >
template<typename Visitor >
EIGEN_DEVICE_FUNC void Eigen::DenseBase< Derived >::visit ( Visitor &  visitor) const
inherited

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:

struct MyVisitor {
// called for the first coefficient
void init(const Scalar& value, Index i, Index j);
// called for all other coefficients
void operator() (const Scalar& value, Index i, Index j);
};
Note
compared to one or two for loops, visitors offer automatic unrolling for small fixed size matrix.
See also
minCoeff(Index*,Index*), maxCoeff(Index*,Index*), DenseBase::redux()
108{
109 typedef typename internal::visitor_evaluator<Derived> ThisEvaluator;
110 ThisEvaluator thisEval(derived());
111
112 enum {
113 unroll = SizeAtCompileTime != Dynamic
115 };
116 return internal::visitor_impl<Visitor, ThisEvaluator, unroll ? int(SizeAtCompileTime) : Dynamic>::run(thisEval, visitor);
117}
@ Cost
Definition XprHelper.h:150

References Eigen::Dynamic, and EIGEN_UNROLLING_LIMIT.

◆ Zero() [1/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero
staticinherited
Returns
an expression of a fixed-size zero matrix or vector.

This variant is only for fixed-size MatrixBase types. For dynamic-size types, you need to use the variants taking size arguments.

Example:

Output:

See also
Zero(Index), Zero(Index,Index)
468{
469 return Constant(Scalar(0));
470}

◆ Zero() [2/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero ( Index  rows,
Index  cols 
)
staticinherited
Returns
an expression of a zero matrix.

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:

See also
Zero(), Zero(Index)
428{
429 return Constant(rows, cols, Scalar(0));
430}

◆ Zero() [3/3]

template<typename Derived >
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const DenseBase< Derived >::ConstantReturnType Eigen::DenseBase< Derived >::Zero ( Index  size)
staticinherited
Returns
an expression of a zero vector.

The parameter size is the size of the returned vector. Must be compatible with this MatrixBase type.

\only_for_vectors

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:

See also
Zero(), Zero(Index,Index)
451{
452 return Constant(size, Scalar(0));
453}

Friends And Related Symbol Documentation

◆ operator<<()

template<typename Derived >
std::ostream & operator<< ( std::ostream &  s,
const DenseBase< Derived > &  m 
)
related

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.

See also
DenseBase::format()
219{
221}
#define EIGEN_DEFAULT_IO_FORMAT
Definition Macros.h:810
std::ostream & print_matrix(std::ostream &s, const Derived &_m, const IOFormat &fmt)
Definition IO.h:129

References EIGEN_DEFAULT_IO_FORMAT, and Eigen::internal::print_matrix().

+ Here is the call graph for this function:

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