11#ifndef EIGEN_MATRIXBASE_H
12#define EIGEN_MATRIXBASE_H
52#ifndef EIGEN_PARSED_BY_DOXYGEN
57 typedef typename internal::packet_traits<Scalar>::type PacketScalar;
58 typedef typename NumTraits<Scalar>::Real RealScalar;
71 using Base::const_cast_derived;
79 using Base::operator+=;
80 using Base::operator-=;
81 using Base::operator*=;
82 using Base::operator/=;
83 using Base::operator*;
84 using Base::operator/;
86 typedef typename Base::CoeffReturnType CoeffReturnType;
88 typedef typename Base::RowXpr RowXpr;
89 typedef typename Base::ColXpr ColXpr;
94#ifndef EIGEN_PARSED_BY_DOXYGEN
103 inline Index
diagonalSize()
const {
return (std::min)(rows(),cols()); }
107#ifndef EIGEN_PARSED_BY_DOXYGEN
113 ConstTransposeReturnType
114 >::type AdjointReturnType;
125#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
126# include "../plugins/CommonCwiseUnaryOps.h"
127# include "../plugins/CommonCwiseBinaryOps.h"
128# include "../plugins/MatrixCwiseUnaryOps.h"
129# include "../plugins/MatrixCwiseBinaryOps.h"
130# ifdef EIGEN_MATRIXBASE_PLUGIN
131# include EIGEN_MATRIXBASE_PLUGIN
133#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
144 template <
typename OtherDerived>
148 template <
typename OtherDerived>
152 template<
typename OtherDerived>
156 template<
typename OtherDerived>
159 template<
typename OtherDerived>
164 template<
typename OtherDerived>
168 {
return this->lazyProduct(other); }
171 template<
typename OtherDerived>
172 const Product<Derived,OtherDerived>
173 operator*(
const MatrixBase<OtherDerived> &other)
const;
177 template<
typename OtherDerived>
179 const Product<Derived,OtherDerived,LazyProduct>
180 lazyProduct(
const MatrixBase<OtherDerived> &other)
const;
182 template<
typename OtherDerived>
185 template<
typename OtherDerived>
188 template<
typename OtherDerived>
191 template<
typename DiagonalDerived>
196 template<
typename OtherDerived>
242 template<
unsigned int Mode>
245 template<
unsigned int Mode>
252 template<
unsigned int UpLo>
255 template<
unsigned int UpLo>
285 template<
typename OtherDerived>
294 template<
typename OtherDerived>
296 {
return cwiseEqual(other).all(); }
302 template<
typename OtherDerived>
304 {
return cwiseNotEqual(other).any(); }
312 template<
bool Enable>
inline const Derived& forceAlignedAccessIf()
const {
return derived(); }
313 template<
bool Enable>
inline Derived& forceAlignedAccessIf() {
return derived(); }
315 EIGEN_DEVICE_FUNC Scalar
trace()
const;
317 template<
int p> EIGEN_DEVICE_FUNC RealScalar lpNorm()
const;
319 EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() {
return *
this; }
320 EIGEN_DEVICE_FUNC
const MatrixBase<Derived>& matrix()
const {
return *
this; }
342 template<
typename ResultType>
349 template<
typename ResultType>
380 #ifndef EIGEN_PARSED_BY_DOXYGEN
387 template<
typename OtherDerived>
392 template<
typename OtherDerived>
411 typedef Block<
const Derived,
415 const ConstStartMinusOne > HNormalizedReturnType;
417 inline const HNormalizedReturnType
hnormalized()
const;
422 template<
typename EssentialPart>
424 Scalar&
tau, RealScalar& beta)
const;
425 template<
typename EssentialPart>
429 template<
typename EssentialPart>
436 template<
typename OtherScalar>
438 template<
typename OtherScalar>
443 template<
typename OtherDerived>
447 return other.cwiseProduct(derived());
452 typedef typename internal::stem_function<Scalar>::type StemFunction;
453 const MatrixExponentialReturnValue<Derived> exp()
const;
454 const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f)
const;
455 const MatrixFunctionReturnValue<Derived> cosh()
const;
456 const MatrixFunctionReturnValue<Derived> sinh()
const;
457 const MatrixFunctionReturnValue<Derived> cos()
const;
458 const MatrixFunctionReturnValue<Derived> sin()
const;
459 const MatrixSquareRootReturnValue<Derived> sqrt()
const;
460 const MatrixLogarithmReturnValue<Derived> log()
const;
461 const MatrixPowerReturnValue<Derived> pow(
const RealScalar& p)
const;
462 const MatrixComplexPowerReturnValue<Derived> pow(
const std::complex<RealScalar>& p)
const;
465 EIGEN_DEVICE_FUNC MatrixBase() : Base() {}
468 EIGEN_DEVICE_FUNC
explicit MatrixBase(
int);
469 EIGEN_DEVICE_FUNC MatrixBase(
int,
int);
470 template<
typename OtherDerived> EIGEN_DEVICE_FUNC
explicit MatrixBase(
const MatrixBase<OtherDerived>&);
473 template<
typename OtherDerived> Derived& operator+=(
const ArrayBase<OtherDerived>& )
474 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
476 template<
typename OtherDerived> Derived& operator-=(
const ArrayBase<OtherDerived>& )
477 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
492template<
typename Derived>
493template<
typename OtherDerived>
497 other.derived().applyThisOnTheRight(derived());
506template<
typename Derived>
507template<
typename OtherDerived>
510 other.derived().applyThisOnTheRight(derived());
518template<
typename Derived>
519template<
typename OtherDerived>
522 other.derived().applyThisOnTheLeft(derived());
Expression of a fixed-size or dynamic-size block.
Definition Block.h:106
Base class for all dense matrices, vectors, and arrays.
Definition DenseBase.h:49
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition DenseBase.h:405
@ IsVectorAtCompileTime
This is set to true if either the number of rows or the number of columns is known at compile-time to...
Definition DenseBase.h:157
@ SizeAtCompileTime
This is equal to the number of coefficients, i.e.
Definition DenseBase.h:117
@ MaxSizeAtCompileTime
This value is equal to the maximum possible number of coefficients that this expression might have.
Definition DenseBase.h:145
@ Flags
This stores expression Flags flags which may or may not be inherited by new expressions constructed f...
Definition DenseBase.h:164
@ ColsAtCompileTime
The number of columns at compile-time.
Definition DenseBase.h:110
@ MaxColsAtCompileTime
This value is equal to the maximum possible number of columns that this expression might have.
Definition DenseBase.h:134
@ MaxRowsAtCompileTime
This value is equal to the maximum possible number of rows that this expression might have.
Definition DenseBase.h:123
@ RowsAtCompileTime
The number of rows at compile-time.
Definition DenseBase.h:104
internal::conditional< internal::is_same< typenameinternal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray >::type PlainObject
The plain matrix or array type corresponding to this expression.
Definition DenseBase.h:209
EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
\ínternal Copies other into *this without evaluating other.
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:50
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:303
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
Definition CwiseNullaryOp.h:705
const LDLT< PlainObject > ldlt() const
\cholesky_module
Definition LDLT.h:593
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition MatrixBaseEigenvalues.h:122
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
\lu_module
Definition InverseImpl.h:397
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Computes the elementary reflector H such that: where the transformation H is: and the vector v is: ...
Definition Householder.h:65
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
Definition DiagonalMatrix.h:278
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > array() const
Definition MatrixBase.h:327
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition TriangularMatrix.h:676
@ SizeAtCompileTime
This is equal to the number of coefficients, i.e.
Definition DenseBase.h:117
EIGEN_DEVICE_FUNC const FullPivLU< PlainObject > fullPivLu() const
\lu_module
Definition FullPivLU.h:853
NoAlias< Derived, Eigen::MatrixBase > noalias()
Definition NoAlias.h:101
EIGEN_DEVICE_FUNC Scalar trace() const
Definition Redux.h:487
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
Definition CwiseNullaryOp.h:866
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition MatrixBaseEigenvalues.h:67
EIGEN_DEVICE_FUNC Derived & setIdentity()
Writes the identity expression (not necessarily square) into *this.
Definition CwiseNullaryOp.h:779
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
Definition CwiseNullaryOp.h:836
Derived & operator*=(const EigenBase< OtherDerived > &other)
replaces *this by *this * other.
Definition MatrixBase.h:495
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
replaces *this by other * *this.
Definition MatrixBase.h:520
EIGEN_DEVICE_FUNC Index diagonalSize() const
Definition MatrixBase.h:103
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
type of the equivalent square matrix
Definition MatrixBase.h:97
void applyOnTheRight(const EigenBase< OtherDerived > &other)
replaces *this by *this * other.
Definition MatrixBase.h:508
RealScalar blueNorm() const
Definition StableNorm.h:200
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:722
EIGEN_DEVICE_FUNC void adjointInPlace()
This is the "in place" version of adjoint(): it replaces *this by its own transpose.
Definition Transpose.h:309
RealScalar hypotNorm() const
Definition StableNorm.h:212
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
\svd_module
Definition JacobiSVD.h:795
EIGEN_DEVICE_FUNC const PlainObject normalized() const
Definition Dot.h:114
EIGEN_DEVICE_FUNC const PartialPivLU< PlainObject > partialPivLu() const
\lu_module
Definition PartialPivLU.h:538
RealScalar stableNorm() const
Definition StableNorm.h:157
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > array()
Definition MatrixBase.h:324
EIGEN_DEVICE_FUNC Derived & operator=(const MatrixBase &other)
Special case of the template operator=, in order to prevent the compiler from generating a default op...
Definition Assign.h:55
EIGEN_DEVICE_FUNC internal::scalar_product_traits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition Dot.h:66
EIGEN_DEVICE_FUNC const Inverse< Derived > inverse() const
\lu_module
Definition InverseImpl.h:331
@ ColsAtCompileTime
The number of columns at compile-time.
Definition DenseBase.h:110
Scalar determinant() const
\lu_module
Definition Determinant.h:92
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
\lu_module
Definition InverseImpl.h:358
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:295
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
Definition FullPivHouseholderQR.h:654
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Dot.h:227
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
Definition CwiseNullaryOp.h:856
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Apply the elementary reflector H given by with from the left to a vector or matrix.
Definition Householder.h:113
const LLT< PlainObject > llt() const
\cholesky_module
Definition LLT.h:473
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition DiagonalMatrix.h:292
const HouseholderQR< PlainObject > householderQr() const
Definition HouseholderQR.h:384
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
Definition OrthoMethods.h:219
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition Dot.h:88
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition TriangularMatrix.h:650
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Apply the elementary reflector H given by with from the right to a vector or matrix.
Definition Householder.h:150
EIGEN_DEVICE_FUNC void normalize()
Normalizes the vector, i.e.
Definition Dot.h:128
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
Definition CwiseNullaryOp.h:808
const Derived & forceAlignedAccess() const
Definition MatrixBase.h:310
EIGEN_DEVICE_FUNC RealScalar norm() const
Definition Dot.h:100
@ RowsAtCompileTime
The number of rows at compile-time.
Definition DenseBase.h:104
const HNormalizedReturnType hnormalized() const
\geometry_module
Definition Homogeneous.h:159
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
Definition ColPivHouseholderQR.h:606
BDCSVD< PlainObject > bdcSvd(unsigned int computationOptions=0) const
\svd_module
Definition BDCSVD.h:1200
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition GeneralProduct.h:390
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
Definition CwiseNullaryOp.h:846
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Computes the elementary reflector H such that: where the transformation H is: and the vector v is: ...
Definition Householder.h:42
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Dot.h:208
HomogeneousReturnType homogeneous() const
\geometry_module
Definition Homogeneous.h:128
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition Transpose.h:204
EIGEN_DEVICE_FUNC const PartialPivLU< PlainObject > lu() const
\lu_module
Definition PartialPivLU.h:555
Derived & forceAlignedAccess()
Definition MatrixBase.h:311
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition Diagonal.h:188
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:180
Pseudo expression representing a solving operation.
Definition Solve.h:63
Base class of any sparse matrices or sparse expressions.
Definition SparseMatrixBase.h:34
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
\geometry_module
Definition EulerAngles.h:37
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition Constants.h:320
@ Horizontal
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows.
Definition Constants.h:268
@ Vertical
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns.
Definition Constants.h:265
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition Constants.h:61
Definition MatrixBase.h:221
Definition MatrixBase.h:250
Definition MatrixBase.h:240
Definition MatrixBase.h:220
Definition MatrixBase.h:249
Definition MatrixBase.h:239
Definition MatrixBase.h:382
Holds information about the various numeric (i.e.
Definition NumTraits.h:108
Definition ForwardDeclarations.h:17