11 #ifndef EIGEN_MATRIXBASE_H
12 #define EIGEN_MATRIXBASE_H
54 #ifndef EIGEN_PARSED_BY_DOXYGEN
56 typedef typename internal::traits<Derived>::StorageKind
StorageKind;
57 typedef typename internal::traits<Derived>::StorageIndex
StorageIndex;
58 typedef typename internal::traits<Derived>::Scalar
Scalar;
59 typedef typename internal::packet_traits<Scalar>::type
PacketScalar;
63 using Base::RowsAtCompileTime;
64 using Base::ColsAtCompileTime;
65 using Base::SizeAtCompileTime;
66 using Base::MaxRowsAtCompileTime;
67 using Base::MaxColsAtCompileTime;
68 using Base::MaxSizeAtCompileTime;
69 using Base::IsVectorAtCompileTime;
73 using Base::const_cast_derived;
79 using Base::lazyAssign;
81 using Base::operator-;
82 using Base::operator+=;
83 using Base::operator-=;
84 using Base::operator*=;
85 using Base::operator/=;
89 typedef typename Base::RowXpr RowXpr;
90 typedef typename Base::ColXpr ColXpr;
95 #ifndef EIGEN_PARSED_BY_DOXYGEN
108 #ifndef EIGEN_PARSED_BY_DOXYGEN
112 typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
122 internal::traits<Derived>::RowsAtCompileTime,
123 internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
126 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
127 #define EIGEN_DOC_UNARY_ADDONS(X,Y)
128 # include "../plugins/CommonCwiseBinaryOps.h"
129 # include "../plugins/MatrixCwiseUnaryOps.h"
130 # include "../plugins/MatrixCwiseBinaryOps.h"
131 # ifdef EIGEN_MATRIXBASE_PLUGIN
132 # include EIGEN_MATRIXBASE_PLUGIN
134 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
135 #undef EIGEN_DOC_UNARY_ADDONS
146 template <
typename OtherDerived>
148 Derived&
operator=(
const DenseBase<OtherDerived>& other);
150 template <
typename OtherDerived>
152 Derived&
operator=(
const EigenBase<OtherDerived>& other);
154 template<
typename OtherDerived>
156 Derived&
operator=(
const ReturnByValue<OtherDerived>& other);
158 template<
typename OtherDerived>
160 Derived&
operator+=(
const MatrixBase<OtherDerived>& other);
161 template<
typename OtherDerived>
163 Derived&
operator-=(
const MatrixBase<OtherDerived>& other);
165 template<
typename OtherDerived>
167 const Product<Derived,OtherDerived>
168 operator*(
const MatrixBase<OtherDerived> &other)
const;
170 template<
typename OtherDerived>
172 const Product<Derived,OtherDerived,LazyProduct>
173 lazyProduct(
const MatrixBase<OtherDerived> &other)
const;
175 template<
typename OtherDerived>
178 template<
typename OtherDerived>
181 template<
typename OtherDerived>
184 template<
typename DiagonalDerived>
189 template<
typename SkewDerived>
194 template<
typename OtherDerived>
236 template<
unsigned int Mode>
239 template<
unsigned int Mode>
246 template<
unsigned int UpLo>
249 template<
unsigned int UpLo>
285 template<
typename OtherDerived>
294 template<
typename OtherDerived>
302 template<
typename OtherDerived>
339 template<
typename ResultType>
347 template<
typename ResultType>
376 template<
int Options = 0>
378 template<
int Options = 0>
382 template<
int Options = 0>
384 template<
int Options = 0>
390 template<
typename OtherDerived>
395 template<
typename OtherDerived>
418 typedef Block<
const Derived,
419 internal::traits<Derived>::ColsAtCompileTime==1 ?
SizeMinusOne : 1,
423 inline const HNormalizedReturnType
hnormalized()
const;
429 template<
typename EssentialPart>
433 template<
typename EssentialPart>
438 template<
typename EssentialPart>
446 template<
typename OtherScalar>
449 template<
typename OtherScalar>
455 template<
typename OtherDerived>
465 #define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
467 const ReturnType<Derived> Name() const;
468 #define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
470 const ReturnType<Derived> Name(Argument) const;
497 template<typename OtherDerived> Derived& operator+=(const
ArrayBase<OtherDerived>& )
498 {
EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
501 {
EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
516 template<
typename Derived>
517 template<
typename OtherDerived>
521 other.
derived().applyThisOnTheRight(derived());
530 template<
typename Derived>
531 template<
typename OtherDerived>
534 other.
derived().applyThisOnTheRight(derived());
542 template<
typename Derived>
543 template<
typename OtherDerived>
546 other.
derived().applyThisOnTheLeft(derived());
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)
#define EIGEN_DEVICE_FUNC
#define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description)
#define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument)
const CwiseBinaryEqualReturnType< OtherDerived > cwiseEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
const CwiseBinaryNotEqualReturnType< OtherDerived > cwiseNotEqual(const EIGEN_CURRENT_STORAGE_BASE_CLASS< OtherDerived > &other) const
#define EIGEN_STATIC_ASSERT(X, MSG)
Base class for all 1D and 2D array, and related expressions.
Expression of a mathematical vector or matrix as an array object.
class Bidiagonal Divide and Conquer SVD
Expression of a fixed-size or dynamic-size block.
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Complete orthogonal decomposition (COD) of a matrix.
Generic expression of a matrix where all coefficients are defined by a functor.
Generic expression where a coefficient-wise unary operator is applied to an expression.
Base class for all dense matrices, vectors, and arrays.
DenseCoeffsBase< Derived, internal::accessors_level< Derived >::value > Base
NumTraits< Scalar >::Real RealScalar
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
std::conditional_t< internal::is_same< typename internal::traits< Derived >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
Transpose< const Derived > ConstTransposeReturnType
internal::traits< Derived >::StorageKind StorageKind
Base::CoeffReturnType CoeffReturnType
internal::traits< Derived >::Scalar Scalar
internal::find_best_packet< Scalar, SizeAtCompileTime >::type PacketScalar
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Base class for diagonal matrices and expressions.
Expression of a diagonal matrix.
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Householder rank-revealing QR decomposition of a matrix with full pivoting.
LU decomposition of a matrix with complete pivoting, and related features.
Expression of one (or a set of) homogeneous vector(s)
Householder QR decomposition of a matrix.
Expression of the inverse of another expression.
Rotation given by a cosine-sine pair.
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Robust Cholesky decomposition of a matrix with pivoting.
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Base class for all dense matrices, vectors, and expressions.
static const BasisReturnType UnitY()
bool operator!=(const MatrixBase< OtherDerived > &other) const
const MatrixFunctionReturnValue< Derived > sin() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise sine u...
const LDLT< PlainObject > ldlt() const
const SkewSymmetricWrapper< const Derived > asSkewSymmetric() const
RealScalar operatorNorm() const
Computes the L2 operator norm.
Derived & operator-=(const MatrixBase< OtherDerived > &other)
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
const DiagonalWrapper< const Derived > asDiagonal() const
const MatrixFunctionReturnValue< Derived > matrixFunction(StemFunction f) const
Helper function for the unsupported MatrixFunctions module.
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
internal::cross_impl< Derived, OtherDerived >::return_type cross(const MatrixBase< OtherDerived > &other) const
ConstTriangularViewReturnType< Mode >::Type triangularView() const
NoAlias< Derived, Eigen::MatrixBase > noalias()
internal::stem_function< Scalar >::type StemFunction
DiagonalReturnType diagonal()
const PartialPivLU< PlainObject, PermutationIndex > lu() const
Derived & operator-=(const ArrayBase< OtherDerived > &)
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
RealScalar hypotNorm() const
const MatrixFunctionReturnValue< Derived > cos() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise cosine...
ArrayWrapper< Derived > array()
Derived & operator=(const MatrixBase &other)
Derived & operator*=(const EigenBase< OtherDerived > &other)
const PlainObject stableNormalized() const
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
RealScalar blueNorm() const
const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Derived >::Type cwiseProduct(const SparseMatrixBase< OtherDerived > &other) const
const ColPivHouseholderQR< PlainObject, PermutationIndex > colPivHouseholderQr() const
void applyOnTheRight(const EigenBase< OtherDerived > &other)
TriangularViewReturnType< Mode >::Type triangularView()
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
JacobiSVD< PlainObject, Options > jacobiSvd() const
const MatrixLogarithmReturnValue< Derived > log() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise logari...
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType
@ HomogeneousReturnTypeDirection
const Diagonal< const Derived, Index > diagonal() const
const PlainObject normalized() const
const MatrixFunctionReturnValue< Derived > cosh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise hyperb...
const FullPivHouseholderQR< PlainObject, PermutationIndex > fullPivHouseholderQr() const
SelfAdjointViewReturnType< UpLo >::Type selfadjointView()
BDCSVD< PlainObject, Options > bdcSvd() const
const MatrixExponentialReturnValue< Derived > exp() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise expone...
RealScalar lpNorm() const
MatrixBase< Derived > & matrix()
const ArrayWrapper< const Derived > array() const
const MatrixFunctionReturnValue< Derived > acosh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise invers...
const PartialPivLU< PlainObject, PermutationIndex > partialPivLu() const
const Inverse< Derived > inverse() const
const Derived & forceAlignedAccessIf() const
Scalar determinant() const
const MatrixPowerReturnValue< Derived > pow(const RealScalar &p) const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise power ...
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
bool operator==(const MatrixBase< OtherDerived > &other) const
Block< const Derived, internal::traits< Derived >::ColsAtCompileTime==1 ? SizeMinusOne :1, internal::traits< Derived >::ColsAtCompileTime==1 ? 1 :SizeMinusOne > ConstStartMinusOne
Derived & forceAlignedAccessIf()
static const BasisReturnType UnitX()
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
EIGEN_DEPRECATED BDCSVD< PlainObject, Options > bdcSvd(unsigned int computationOptions) const
const MatrixFunctionReturnValue< Derived > asinh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise invers...
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
const LLT< PlainObject > llt() const
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Derived & operator+=(const MatrixBase< OtherDerived > &other)
static const IdentityReturnType Identity()
const HouseholderQR< PlainObject > householderQr() const
const MatrixFunctionReturnValue< Derived > sinh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise hyperb...
const MatrixBase< Derived > & matrix() const
bool isSkewSymmetric(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
static const BasisReturnType UnitZ()
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Base::PlainObject PlainObject
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Index diagonalSize() const
RealScalar stableNorm() const
const MatrixFunctionReturnValue< Derived > atanh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise invers...
Diagonal< Derived, Index > diagonal()
const PermutationWrapper< const Derived > asPermutation() const
static const BasisReturnType Unit(Index size, Index i)
Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
RealScalar squaredNorm() const
EIGEN_DEPRECATED JacobiSVD< PlainObject, Options > jacobiSvd(unsigned int computationOptions) const
const Derived & forceAlignedAccess() const
const MatrixSquareRootReturnValue< Derived > sqrt() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise square...
ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
const FullPivLU< PlainObject, PermutationIndex > fullPivLu() const
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const CompleteOrthogonalDecomposition< PlainObject, PermutationIndex > completeOrthogonalDecomposition() const
Diagonal< Derived > DiagonalReturnType
Homogeneous< Derived, HomogeneousReturnTypeDirection > HomogeneousReturnType
ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
Diagonal< const Derived > ConstDiagonalReturnType
static const BasisReturnType UnitW()
const AdjointReturnType adjoint() const
Derived & forceAlignedAccess()
The matrix class, also used for vectors and row-vectors.
Pseudo expression providing an operator = assuming no aliasing.
LU decomposition of a matrix with partial pivoting, and related features.
Class to view a vector of integers as a permutation matrix.
Expression of the product of two arbitrary matrices or vectors.
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Base class for skew symmetric matrices and expressions.
Expression of a skew symmetric matrix.
Base class of any sparse matrices or sparse expressions.
const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
Expression of a dense or sparse matrix with zero or too small values removed.
Expression of the transpose of a matrix.
Expression of a triangular part in a matrix.
EIGEN_DEPRECATED Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
PlainObject unitOrthogonal(void) const
PlainObject cross3(const MatrixBase< OtherDerived > &other) const
const HNormalizedReturnType hnormalized() const
homogeneous normalization
HomogeneousReturnType homogeneous() const
Matrix< Scalar, 3, 1 > canonicalEulerAngles(Index a0, Index a1, Index a2) const
const SparseView< Derived > sparseView(const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
const unsigned int RowMajorBit
constexpr int max_size_prefer_dynamic(A a, B b)
EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_square_op< typename Derived::Scalar >, const Derived > square(const Eigen::ArrayBase< Derived > &x)
Eigen::Index Index
The interface type of indices.
const SelfAdjointView< const Derived, UpLo > Type
const TriangularView< const Derived, Mode > Type
SelfAdjointView< Derived, UpLo > Type
TriangularView< Derived, Mode > Type
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...