11 #ifndef EIGEN_MATRIXBASE_H 12 #define EIGEN_MATRIXBASE_H 52 #ifndef EIGEN_PARSED_BY_DOXYGEN 71 using Base::const_cast_derived;
79 using Base::operator+=;
80 using Base::operator-=;
81 using Base::operator*=;
82 using Base::operator/=;
84 typedef typename Base::CoeffReturnType CoeffReturnType;
86 typedef typename Base::RowXpr
RowXpr;
87 typedef typename Base::ColXpr
ColXpr;
88 #endif // not EIGEN_PARSED_BY_DOXYGEN 92 #ifndef EIGEN_PARSED_BY_DOXYGEN 96 #endif // not EIGEN_PARSED_BY_DOXYGEN 105 #ifndef EIGEN_PARSED_BY_DOXYGEN 111 ConstTransposeReturnType
121 #endif // not EIGEN_PARSED_BY_DOXYGEN 123 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase 124 #define EIGEN_DOC_UNARY_ADDONS(X,Y) 125 # include "../plugins/CommonCwiseUnaryOps.h" 126 # include "../plugins/CommonCwiseBinaryOps.h" 127 # include "../plugins/MatrixCwiseUnaryOps.h" 128 # include "../plugins/MatrixCwiseBinaryOps.h" 129 # ifdef EIGEN_MATRIXBASE_PLUGIN 130 # include EIGEN_MATRIXBASE_PLUGIN 132 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 133 #undef EIGEN_DOC_UNARY_ADDONS 138 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
144 template <
typename OtherDerived>
145 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
148 template <
typename OtherDerived>
152 template<
typename OtherDerived>
156 template<
typename OtherDerived>
157 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
159 template<
typename OtherDerived>
160 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
164 template<
typename OtherDerived>
168 {
return this->lazyProduct(other); }
171 template<
typename OtherDerived>
177 template<
typename OtherDerived>
182 template<
typename OtherDerived>
185 template<
typename OtherDerived>
188 template<
typename OtherDerived>
191 template<
typename DiagonalDerived>
196 template<
typename OtherDerived>
202 EIGEN_DEVICE_FUNC RealScalar
norm()
const;
206 EIGEN_DEVICE_FUNC
const PlainObject
normalized()
const;
211 EIGEN_DEVICE_FUNC
const AdjointReturnType
adjoint()
const;
220 ConstDiagonalReturnType
diagonal()
const;
239 ConstDiagonalDynamicIndexReturnType
diagonal(
Index index)
const;
244 template<
unsigned int Mode>
247 template<
unsigned int Mode>
254 template<
unsigned int UpLo>
257 template<
unsigned int UpLo>
263 EIGEN_DEVICE_FUNC
static const IdentityReturnType
Identity();
265 EIGEN_DEVICE_FUNC
static const BasisReturnType
Unit(
Index size,
Index i);
266 EIGEN_DEVICE_FUNC
static const BasisReturnType
Unit(
Index i);
267 EIGEN_DEVICE_FUNC
static const BasisReturnType
UnitX();
268 EIGEN_DEVICE_FUNC
static const BasisReturnType
UnitY();
269 EIGEN_DEVICE_FUNC
static const BasisReturnType
UnitZ();
270 EIGEN_DEVICE_FUNC
static const BasisReturnType
UnitW();
287 template<
typename OtherDerived>
296 template<
typename OtherDerived>
304 template<
typename OtherDerived>
314 template<
bool Enable>
inline const Derived& forceAlignedAccessIf()
const {
return derived(); }
315 template<
bool Enable>
inline Derived& forceAlignedAccessIf() {
return derived(); }
317 EIGEN_DEVICE_FUNC Scalar
trace()
const;
319 template<
int p> EIGEN_DEVICE_FUNC RealScalar lpNorm()
const;
340 template<
typename ResultType>
347 template<
typename ResultType>
379 #ifndef EIGEN_PARSED_BY_DOXYGEN 380 template<
typename OtherDerived>
struct cross_product_return_type {
385 #endif // EIGEN_PARSED_BY_DOXYGEN 386 template<
typename OtherDerived>
388 #ifndef EIGEN_PARSED_BY_DOXYGEN 389 inline typename cross_product_return_type<OtherDerived>::type
395 template<
typename OtherDerived>
415 typedef Block<
const Derived,
416 internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
417 internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne>
ConstStartMinusOne;
418 typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType;
420 inline const HNormalizedReturnType
hnormalized()
const;
425 template<
typename EssentialPart>
427 Scalar& tau, RealScalar& beta)
const;
428 template<
typename EssentialPart>
432 template<
typename EssentialPart>
439 template<
typename OtherScalar>
441 template<
typename OtherScalar>
446 template<
typename OtherDerived>
450 return other.cwiseProduct(derived());
471 EIGEN_DEVICE_FUNC
explicit MatrixBase(
int);
472 EIGEN_DEVICE_FUNC MatrixBase(
int,
int);
477 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
480 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
495 template<
typename Derived>
496 template<
typename OtherDerived>
500 other.
derived().applyThisOnTheRight(derived());
509 template<
typename Derived>
510 template<
typename OtherDerived>
513 other.
derived().applyThisOnTheRight(derived());
521 template<
typename Derived>
522 template<
typename OtherDerived>
525 other.
derived().applyThisOnTheLeft(derived());
530 #endif // EIGEN_MATRIXBASE_H Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:60
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:50
This stores expression Flags flags which may or may not be inherited by new expressions constructed f...
Definition: DenseBase.h:160
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
RealScalar blueNorm() const
Definition: StableNorm.h:201
BDCSVD< PlainObject > bdcSvd(unsigned int computationOptions=0) const
Definition: BDCSVD.h:1222
internal::traits< Derived >::Scalar Scalar
The numeric type of the expression' coefficients, e.g.
Definition: DenseBase.h:66
Storage order is column major (see TopicStorageOrders).
Definition: Constants.h:320
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:861
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:41
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Definition: ForwardDeclarations.h:256
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition: Transpose.h:210
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
Definition: OrthoMethods.h:226
const CompleteOrthogonalDecomposition< PlainObject > completeOrthogonalDecomposition() const
Definition: CompleteOrthogonalDecomposition.h:556
The number of rows at compile-time.
Definition: DenseBase.h:100
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
replaces *this by other * *this.
Definition: MatrixBase.h:523
For Reverse, all columns are reversed; for PartialReduxExpr and VectorwiseOp, act on columns...
Definition: Constants.h:265
EIGEN_DEVICE_FUNC Derived & setIdentity()
Writes the identity expression (not necessarily square) into *this.
Definition: CwiseNullaryOp.h:774
EIGEN_DEVICE_FUNC PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:82
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:31
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:130
The number of columns at compile-time.
Definition: DenseBase.h:106
Proxy for the matrix square root of some matrix (expression).
Definition: ForwardDeclarations.h:286
Expression of the transpose of a matrix.
Definition: Transpose.h:52
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:298
This value is equal to the maximum possible number of coefficients that this expression might have...
Definition: DenseBase.h:141
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
Definition: ColPivHouseholderQR.h:646
void applyOnTheRight(const EigenBase< OtherDerived > &other)
replaces *this by *this * other.
Definition: MatrixBase.h:511
EIGEN_DEVICE_FUNC Scalar trace() const
Definition: Redux.h:498
LU decomposition of a matrix with partial pivoting, and related features.
Definition: ForwardDeclarations.h:250
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Definition: ForwardDeclarations.h:263
Holds information about the various numeric (i.e.
Definition: NumTraits.h:150
EIGEN_DEVICE_FUNC const PlainObject normalized() const
Definition: Dot.h:120
Definition: MatrixBase.h:242
Complete orthogonal decomposition (COD) of a matrix.
Definition: ForwardDeclarations.h:257
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:841
RealScalar stableNorm() const
Definition: StableNorm.h:157
const FullPivLU< PlainObject > fullPivLu() const
Definition: FullPivLU.h:884
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:61
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
Proxy for the matrix function of some matrix (expression).
Definition: ForwardDeclarations.h:285
Proxy for the matrix power of some matrix (expression).
Definition: ForwardDeclarations.h:289
EIGEN_DEVICE_FUNC Index diagonalSize() const
Definition: MatrixBase.h:101
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition: Dot.h:92
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:63
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:28
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
Definition: ReturnByValue.h:50
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:362
EIGEN_DEVICE_FUNC void normalize()
Normalizes the vector, i.e.
Definition: Dot.h:141
EIGEN_DEVICE_FUNC RealScalar norm() const
Definition: Dot.h:104
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized() const
Definition: Homogeneous.h:172
Expression of the inverse of another expression.
Definition: Inverse.h:43
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:305
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:642
EIGEN_DEVICE_FUNC void stableNormalize()
Normalizes the vector while avoid underflow and overflow.
Definition: Dot.h:187
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:312
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:281
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition: EulerAngles.h:37
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
Definition: JacobiSVD.h:793
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > array()
Definition: MatrixBase.h:326
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition: GeneralProduct.h:372
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Definition: ForwardDeclarations.h:255
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:52
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: MatrixBase.h:241
const HouseholderQR< PlainObject > householderQr() const
Definition: HouseholderQR.h:402
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: DiagonalMatrix.h:291
This value is equal to the maximum possible number of rows that this expression might have...
Definition: DenseBase.h:119
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:49
Definition: ForwardDeclarations.h:126
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
Definition: DiagonalMatrix.h:277
Definition: MatrixBase.h:222
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:39
Class to view a vector of integers as a permutation matrix.
Definition: PermutationMatrix.h:514
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:851
EIGEN_DEVICE_FUNC void adjointInPlace()
This is the "in place" version of adjoint(): it replaces *this by its own transpose.
Definition: Transpose.h:315
Definition: ForwardDeclarations.h:293
const PartialPivLU< PlainObject > partialPivLu() const
Definition: PartialPivLU.h:589
class Bidiagonal Divide and Conquer SVD
Definition: ForwardDeclarations.h:259
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:662
For Reverse, all rows are reversed; for PartialReduxExpr and VectorwiseOp, act on rows...
Definition: Constants.h:268
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition: Dot.h:68
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:700
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:122
Definition: MatrixBase.h:252
EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const
Definition: Dot.h:163
const Inverse< Derived > inverse() const
Definition: InverseImpl.h:335
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:667
This is equal to the number of coefficients, i.e.
Definition: DenseBase.h:113
internal::conditional< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray >::type PlainObject
The plain matrix or array type corresponding to this expression.
Definition: DenseBase.h:205
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Definition: MatrixBase.h:251
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::equal_to< Scalar >, const Derived, const OtherDerived > cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Definition: MatrixBase.h:44
LU decomposition of a matrix with complete pivoting, and related features.
Definition: ForwardDeclarations.h:249
This value is equal to the maximum possible number of columns that this expression might have...
Definition: DenseBase.h:130
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
Householder QR decomposition of a matrix.
Definition: ForwardDeclarations.h:254
Definition: DiagonalMatrix.h:18
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:258
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:186
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition: DenseBase.h:401
Expression of a diagonal matrix.
Definition: DiagonalMatrix.h:245
Derived & forceAlignedAccess()
Definition: MatrixBase.h:313
const LLT< PlainObject > llt() const
Definition: LLT.h:516
Proxy for the matrix exponential of some matrix (expression).
Definition: ForwardDeclarations.h:284
Definition: MatrixBase.h:223
Derived & operator*=(const EigenBase< OtherDerived > &other)
replaces *this by *this * other.
Definition: MatrixBase.h:498
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition: Diagonal.h:188
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:757
NoAlias< Derived, Eigen::MatrixBase > noalias()
Definition: NoAlias.h:101
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:279
const PartialPivLU< PlainObject > lu() const
Definition: PartialPivLU.h:604
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:63
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
const int Dynamic
This value means that a positive quantity (e.g., a size) is not known at compile-time, and that instead the value is stored in some runtime variable.
Definition: Constants.h:21
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > array() const
Definition: MatrixBase.h:329
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:717
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:831
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:55
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:401
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: MatrixBase.h:64
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:297
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
Definition: FullPivHouseholderQR.h:669
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE 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
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:67
Proxy for the matrix power of some matrix (expression).
Definition: ForwardDeclarations.h:288
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:44
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:803
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Definition: ForwardDeclarations.h:17
Scalar determinant() const
Definition: Determinant.h:92
Proxy for the matrix logarithm of some matrix (expression).
Definition: ForwardDeclarations.h:287
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
type of the equivalent square matrix
Definition: MatrixBase.h:95
Definition: ForwardDeclarations.h:278
RealScalar hypotNorm() const
Definition: StableNorm.h:213
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:153
EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
\ínternal Copies other into *this without evaluating other.