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/=;
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 144 template <
typename OtherDerived>
148 template <
typename OtherDerived>
152 template<
typename OtherDerived>
156 template<
typename OtherDerived>
159 template<
typename OtherDerived>
164 template<
typename OtherDerived>
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();
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>
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 395 template<
typename OtherDerived>
415 typedef Block<
const Derived,
416 internal::traits<Derived>::ColsAtCompileTime==1 ?
SizeMinusOne : 1,
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());
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 static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Generic expression of a matrix where all coefficients are defined by a functor.
Robust Cholesky decomposition of a matrix with pivoting.
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator+=(const MatrixBase< OtherDerived > &other)
#define EIGEN_STRONG_INLINE
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
Scalar determinant() const
const LDLT< PlainObject > ldlt() const
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::not_equal_to< Scalar >, const Derived, const OtherDerived > cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Matrix< Scalar, MatrixBase::RowsAtCompileTime, MatrixBase::ColsAtCompileTime > type
EIGEN_DEVICE_FUNC Index diagonalSize() const
Expression of the product of two arbitrary matrices or vectors.
Expression of a mathematical vector or matrix as an array object.
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Base::CoeffReturnType CoeffReturnType
CwiseNullaryOp< internal::scalar_identity_op< Scalar >, PlainObject > IdentityReturnType
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Pseudo expression providing an operator = assuming no aliasing.
EIGEN_DEVICE_FUNC Scalar trace() const
internal::stem_function< Scalar >::type StemFunction
Diagonal< Derived, Index > Type
ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType Scalar
SelfAdjointView< Derived, UpLo > Type
Proxy for the matrix square root of some matrix (expression).
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator-=(const MatrixBase< OtherDerived > &other)
MatrixBase StorageBaseType
internal::add_const< Transpose< const Derived > >::type ConstTransposeReturnType
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
RealScalar operatorNorm() const
Computes the L2 operator norm.
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
void applyOnTheRight(const EigenBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > array() const
LU decomposition of a matrix with partial pivoting, and related features.
const MatrixLogarithmReturnValue< Derived > log() const
Block< const Derived, internal::traits< Derived >::ColsAtCompileTime==1?SizeMinusOne:1, internal::traits< Derived >::ColsAtCompileTime==1?1:SizeMinusOne > ConstStartMinusOne
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
Rotation given by a cosine-sine pair.
EIGEN_DEVICE_FUNC MatrixBase< Derived > & matrix()
const Derived & forceAlignedAccess() const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
#define EIGEN_STATIC_ASSERT(CONDITION, MSG)
EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
Base::ConstTransposeReturnType ConstTransposeReturnType
internal::traits< Derived >::Scalar Scalar
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
Complete orthogonal decomposition (COD) of a matrix.
const unsigned int RowMajorBit
Base class for all dense matrices, vectors, and arrays.
const MatrixFunctionReturnValue< Derived > sinh() const
EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type selfadjointView()
const SparseView< Derived > sparseView(const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
const TriangularView< const Derived, Mode > Type
Proxy for the matrix function of some matrix (expression).
Proxy for the matrix power of some matrix (expression).
Block< Derived, internal::traits< Derived >::RowsAtCompileTime, 1,!IsRowMajor > ColXpr
internal::packet_traits< Scalar >::type PacketScalar
const PartialPivLU< PlainObject > partialPivLu() const
BDCSVD< PlainObject > bdcSvd(unsigned int computationOptions=0) const
const MatrixFunctionReturnValue< Derived > cos() const
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
EIGEN_DEVICE_FUNC void normalize()
const MatrixExponentialReturnValue< Derived > exp() const
Expression of the inverse of another expression.
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized() const
homogeneous normalization
EIGEN_DEVICE_FUNC void stableNormalize()
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
Base class of any sparse matrices or sparse expressions.
const MatrixPowerReturnValue< Derived > pow(const RealScalar &p) const
RealScalar blueNorm() const
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > ConstantReturnType
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > array()
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
const Diagonal< const Derived, Index > Type
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
const MatrixFunctionReturnValue< Derived > cosh() const
Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime > BasisReturnType
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const SelfAdjointView< const Derived, UpLo > Type
DenseBase< Derived > Base
NumTraits< Scalar >::Real RealScalar
Homogeneous< Derived, HomogeneousReturnTypeDirection > HomogeneousReturnType
EIGEN_DEVICE_FUNC const PlainObject normalized() const
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
internal::traits< Derived >::StorageKind StorageKind
EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type triangularView()
Base::PlainObject PlainObject
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType
EIGEN_DEVICE_FUNC const Scalar & q
Expression of a dense or sparse matrix with zero or too small values removed.
const CompleteOrthogonalDecomposition< PlainObject > completeOrthogonalDecomposition() const
Diagonal< Derived, DynamicIndex > DiagonalDynamicIndexReturnType
Block< Derived, 1, internal::traits< Derived >::ColsAtCompileTime, IsRowMajor > RowXpr
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
EIGEN_DEVICE_FUNC const MatrixBase< Derived > & matrix() const
Base class for all 1D and 2D array, and related expressions.
Class to view a vector of integers as a permutation matrix.
EIGEN_DEVICE_FUNC void adjointInPlace()
const MatrixSquareRootReturnValue< Derived > sqrt() const
RealScalar stableNorm() const
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const Derived & forceAlignedAccessIf() const
Derived & operator+=(const ArrayBase< OtherDerived > &)
class Bidiagonal Divide and Conquer SVD
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Derived & forceAlignedAccessIf()
Derived & operator-=(const ArrayBase< OtherDerived > &)
const PermutationWrapper< const Derived > asPermutation() const
internal::add_const< Diagonal< const Derived > >::type ConstDiagonalReturnType
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
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.
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC cross_product_return_type< OtherDerived >::type cross(const MatrixBase< OtherDerived > &other) const
Expression of a fixed-size or dynamic-size block.
EIGEN_DEVICE_FUNC bool operator==(const MatrixBase< OtherDerived > &other) const
Matrix< std::complex< RealScalar >, internal::traits< Derived >::ColsAtCompileTime, 1, ColMajor > EigenvaluesReturnType
internal::add_const< Diagonal< const Derived, DynamicIndex > >::type ConstDiagonalDynamicIndexReturnType
EIGEN_DEVICE_FUNC RealScalar lpNorm() const
RealScalar hypotNorm() const
LU decomposition of a matrix with complete pivoting, and related features.
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
const FullPivLU< PlainObject > fullPivLu() const
Householder QR decomposition of a matrix.
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Expression of a triangular part in a matrix.
EIGEN_DEVICE_FUNC MatrixBase()
Expression of a diagonal matrix.
Derived & forceAlignedAccess()
Proxy for the matrix exponential of some matrix (expression).
Derived & operator*=(const EigenBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
EIGEN_DEVICE_FUNC PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
NoAlias< Derived, Eigen::MatrixBase > noalias()
EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Derived >::Type cwiseProduct(const SparseMatrixBase< OtherDerived > &other) const
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
const MatrixFunctionReturnValue< Derived > matrixFunction(StemFunction f) const
const LLT< PlainObject > llt() const
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Generic expression where a coefficient-wise unary operator is applied to an expression.
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
The matrix class, also used for vectors and row-vectors.
Diagonal< Derived > DiagonalReturnType
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
internal::traits< Derived >::StorageIndex StorageIndex
TriangularView< Derived, Mode > Type
#define EIGEN_SIZE_MAX(a, b)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const MatrixBase &other)
Proxy for the matrix power of some matrix (expression).
EIGEN_DEVICE_FUNC Derived & derived()
const Inverse< Derived > inverse() const
Base class for all dense matrices, vectors, and expressions.
EIGEN_DEVICE_FUNC bool operator!=(const MatrixBase< OtherDerived > &other) const
Base::CoeffReturnType CoeffReturnType
EIGEN_DEVICE_FUNC Derived & setIdentity()
EIGEN_DEVICE_FUNC const CwiseBinaryOp< std::equal_to< Scalar >, const Derived, const OtherDerived > cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
Proxy for the matrix logarithm of some matrix (expression).
EIGEN_DEVICE_FUNC RealScalar norm() const
const HouseholderQR< PlainObject > householderQr() const
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
const MatrixFunctionReturnValue< Derived > sin() const
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
const PartialPivLU< PlainObject > lu() const
Matrix< Scalar, EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime), EIGEN_SIZE_MAX(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
Expression of one (or a set of) homogeneous vector(s)
EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)