11 #ifndef EIGEN_MATRIXBASE_H 12 #define EIGEN_MATRIXBASE_H 52 #ifndef EIGEN_PARSED_BY_DOXYGEN 54 typedef typename internal::traits<Derived>::StorageKind StorageKind;
55 typedef typename internal::traits<Derived>::Index
Index;
56 typedef typename internal::traits<Derived>::Scalar Scalar;
57 typedef typename internal::packet_traits<Scalar>::type PacketScalar;
61 using Base::RowsAtCompileTime;
62 using Base::ColsAtCompileTime;
63 using Base::SizeAtCompileTime;
64 using Base::MaxRowsAtCompileTime;
65 using Base::MaxColsAtCompileTime;
66 using Base::MaxSizeAtCompileTime;
67 using Base::IsVectorAtCompileTime;
69 using Base::CoeffReadCost;
72 using Base::const_cast_derived;
78 using Base::lazyAssign;
80 using Base::operator+=;
81 using Base::operator-=;
82 using Base::operator*=;
83 using Base::operator/=;
85 typedef typename Base::CoeffReturnType CoeffReturnType;
87 typedef typename Base::RowXpr RowXpr;
88 typedef typename Base::ColXpr ColXpr;
89 #endif // not EIGEN_PARSED_BY_DOXYGEN 93 #ifndef EIGEN_PARSED_BY_DOXYGEN 97 #endif // not EIGEN_PARSED_BY_DOXYGEN 101 inline Index
diagonalSize()
const {
return (std::min)(rows(),cols()); }
110 internal::traits<Derived>::RowsAtCompileTime,
111 internal::traits<Derived>::ColsAtCompileTime,
113 internal::traits<Derived>::MaxRowsAtCompileTime,
114 internal::traits<Derived>::MaxColsAtCompileTime
117 #ifndef EIGEN_PARSED_BY_DOXYGEN 121 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
123 ConstTransposeReturnType
124 >::type AdjointReturnType;
131 internal::traits<Derived>::RowsAtCompileTime,
132 internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
133 #endif // not EIGEN_PARSED_BY_DOXYGEN 135 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase 136 # include "../plugins/CommonCwiseUnaryOps.h" 137 # include "../plugins/CommonCwiseBinaryOps.h" 138 # include "../plugins/MatrixCwiseUnaryOps.h" 139 # include "../plugins/MatrixCwiseBinaryOps.h" 140 # ifdef EIGEN_MATRIXBASE_PLUGIN 141 # include EIGEN_MATRIXBASE_PLUGIN 143 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS 153 template <
typename OtherDerived>
156 template <
typename OtherDerived>
159 template<
typename OtherDerived>
160 Derived&
operator=(
const ReturnByValue<OtherDerived>& other);
162 #ifndef EIGEN_PARSED_BY_DOXYGEN 163 template<
typename ProductDerived,
typename Lhs,
typename Rhs>
164 Derived& lazyAssign(
const ProductBase<ProductDerived, Lhs,Rhs>& other);
166 template<
typename MatrixPower,
typename Lhs,
typename Rhs>
167 Derived& lazyAssign(
const MatrixPowerProduct<MatrixPower, Lhs,Rhs>& other);
168 #endif // not EIGEN_PARSED_BY_DOXYGEN 170 template<
typename OtherDerived>
172 template<
typename OtherDerived>
175 template<
typename OtherDerived>
179 template<
typename OtherDerived>
183 template<
typename OtherDerived>
186 template<
typename OtherDerived>
189 template<
typename OtherDerived>
192 template<
typename DiagonalDerived>
193 const DiagonalProduct<Derived, DiagonalDerived, OnTheRight>
196 template<
typename OtherDerived>
197 typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,
typename internal::traits<OtherDerived>::Scalar>::ReturnType
200 #ifdef EIGEN2_SUPPORT 201 template<
typename OtherDerived>
206 RealScalar
norm()
const;
213 const AdjointReturnType
adjoint()
const;
219 ConstDiagonalReturnType
diagonal()
const;
224 template<
int Index>
typename DiagonalIndexReturnType<Index>::Type
diagonal();
225 template<
int Index>
typename ConstDiagonalIndexReturnType<Index>::Type
diagonal()
const;
229 #if (defined _MSC_VER) && (_MSC_VER >= 1500) // 2008 or later 230 typename MatrixBase::template DiagonalIndexReturnType<DynamicIndex>::Type
diagonal(Index index);
231 typename MatrixBase::template ConstDiagonalIndexReturnType<DynamicIndex>::Type
diagonal(Index index)
const;
233 typename DiagonalIndexReturnType<DynamicIndex>::Type
diagonal(Index index);
234 typename ConstDiagonalIndexReturnType<DynamicIndex>::Type
diagonal(Index index)
const;
237 #ifdef EIGEN2_SUPPORT 238 template<
unsigned int Mode>
typename internal::eigen2_part_return_type<Derived, Mode>::type part();
239 template<
unsigned int Mode>
const typename internal::eigen2_part_return_type<Derived, Mode>::type part()
const;
243 template<
template<
typename T,
int N>
class U>
246 #endif // EIGEN2_SUPPORT 251 template<
unsigned int Mode>
typename TriangularViewReturnType<Mode>::Type triangularView();
252 template<
unsigned int Mode>
typename ConstTriangularViewReturnType<Mode>::Type triangularView()
const;
257 template<
unsigned int UpLo>
typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
258 template<
unsigned int UpLo>
typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView()
const;
260 const SparseView<Derived> sparseView(
const Scalar& m_reference = Scalar(0),
262 static const IdentityReturnType
Identity();
263 static const IdentityReturnType
Identity(Index rows, Index cols);
264 static const BasisReturnType
Unit(Index size, Index i);
265 static const BasisReturnType
Unit(Index i);
266 static const BasisReturnType
UnitX();
267 static const BasisReturnType
UnitY();
268 static const BasisReturnType
UnitZ();
269 static const BasisReturnType
UnitW();
283 template<
typename OtherDerived>
292 template<
typename OtherDerived>
300 template<
typename OtherDerived>
308 template<
bool Enable>
inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type
forceAlignedAccessIf()
const;
309 template<
bool Enable>
inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type
forceAlignedAccessIf();
311 Scalar
trace()
const;
315 template<
int p> RealScalar lpNorm()
const;
330 #if EIGEN2_SUPPORT_STAGE < STAGE20_RESOLVE_API_CONFLICTS 331 const LU<PlainObject>
lu()
const;
334 #ifdef EIGEN2_SUPPORT 335 const LU<PlainObject> eigen2_lu()
const;
338 #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS 342 #ifdef EIGEN2_SUPPORT 343 template<
typename ResultType>
349 const internal::inverse_impl<Derived>
inverse()
const;
350 template<
typename ResultType>
357 template<
typename ResultType>
376 #ifdef EIGEN2_SUPPORT 377 const QR<PlainObject> qr()
const;
387 #ifdef EIGEN2_SUPPORT 388 SVD<PlainObject> svd()
const;
393 #ifndef EIGEN_PARSED_BY_DOXYGEN 394 template<
typename OtherDerived>
struct cross_product_return_type {
396 typedef typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,
typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
399 #endif // EIGEN_PARSED_BY_DOXYGEN 400 template<
typename OtherDerived>
401 typename cross_product_return_type<OtherDerived>::type
403 template<
typename OtherDerived>
408 #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS 409 ScalarMultipleReturnType
operator*(
const UniformScaling<Scalar>& s)
const;
419 typedef Block<
const Derived,
420 internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
421 internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne>
ConstStartMinusOne;
430 template<
typename EssentialPart>
432 Scalar& tau, RealScalar& beta)
const;
433 template<
typename EssentialPart>
437 template<
typename EssentialPart>
444 template<
typename OtherScalar>
446 template<
typename OtherScalar>
451 typedef typename internal::stem_function<Scalar>::type StemFunction;
452 const MatrixExponentialReturnValue<Derived> exp()
const;
453 const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f)
const;
454 const MatrixFunctionReturnValue<Derived> cosh()
const;
455 const MatrixFunctionReturnValue<Derived> sinh()
const;
456 const MatrixFunctionReturnValue<Derived> cos()
const;
457 const MatrixFunctionReturnValue<Derived> sin()
const;
458 const MatrixSquareRootReturnValue<Derived> sqrt()
const;
459 const MatrixLogarithmReturnValue<Derived> log()
const;
460 const MatrixPowerReturnValue<Derived> pow(
const RealScalar& p)
const;
462 #ifdef EIGEN2_SUPPORT 463 template<
typename ProductDerived,
typename Lhs,
typename Rhs>
464 Derived&
operator+=(
const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
467 template<
typename ProductDerived,
typename Lhs,
typename Rhs>
468 Derived&
operator-=(
const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
473 template<
typename OtherDerived>
474 Derived& lazyAssign(
const Flagged<OtherDerived, 0, EvalBeforeAssigningBit>& other)
475 {
return lazyAssign(other._expression()); }
477 template<
unsigned int Added>
478 const Flagged<Derived, Added, 0> marked()
const;
479 const Flagged<Derived, 0, EvalBeforeAssigningBit> lazy()
const;
481 inline const Cwise<Derived> cwise()
const;
482 inline Cwise<Derived> cwise();
493 Minor<Derived> minor(Index
row, Index
col);
494 const Minor<Derived> minor(Index row, Index col)
const;
507 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
510 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(
sizeof(
typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
return *
this;}
525 template<
typename Derived>
526 template<
typename OtherDerived>
530 other.
derived().applyThisOnTheRight(derived());
539 template<
typename Derived>
540 template<
typename OtherDerived>
543 other.
derived().applyThisOnTheRight(derived());
551 template<
typename Derived>
552 template<
typename OtherDerived>
555 other.
derived().applyThisOnTheLeft(derived());
560 #endif // EIGEN_MATRIXBASE_H Index diagonalSize() const
Definition: MatrixBase.h:101
Expression of the product of two general matrices or vectors.
Definition: GeneralProduct.h:36
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:49
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:48
const internal::inverse_impl< Derived > inverse() const
Definition: Inverse.h:320
const PartialPivLU< PlainObject > partialPivLu() const
Definition: PartialPivLU.h:477
PlainObject unitOrthogonal(void) const
Definition: OrthoMethods.h:210
RowXpr row(Index i)
Definition: DenseBase.h:750
Scalar determinant() const
Definition: Determinant.h:92
Definition: DenseBase.h:115
Enforce aligned packet loads and stores regardless of what is requested.
Definition: ForceAlignedAccess.h:34
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:149
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
Definition: JacobiSVD.h:954
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:36
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Definition: ForwardDeclarations.h:223
Definition: Constants.h:266
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:31
HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:127
const ScalarMultipleReturnType operator*(const Scalar &scalar) const
Definition: MatrixBase.h:50
Expression of the transpose of a matrix.
Definition: Transpose.h:57
RealScalar stableNorm() const
Definition: StableNorm.h:153
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:247
RealScalar squaredNorm() const
Definition: Dot.h:113
NoAlias< Derived, Eigen::MatrixBase > noalias()
Definition: NoAlias.h:127
LU decomposition of a matrix with partial pivoting, and related features.
Definition: ForwardDeclarations.h:217
const CwiseBinaryOp< std::not_equal_to< Scalar >, const Derived, const OtherDerived > cwiseNotEqual(const Eigen::MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:61
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:228
const LazyProductReturnType< Derived, OtherDerived >::Type lazyProduct(const MatrixBase< OtherDerived > &other) const
Definition: GeneralProduct.h:612
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:88
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:717
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:808
RealScalar norm() const
Definition: Dot.h:125
static const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:849
ColXpr col(Index i)
Definition: DenseBase.h:733
const LLT< PlainObject > llt() const
Definition: LLT.h:473
Definition: DenseBase.h:108
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
static const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:859
Definition: Constants.h:212
Definition: Constants.h:264
Definition: EigenBase.h:26
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:112
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:553
Expression of a fixed-size or dynamic-size sub-vector.
Definition: ForwardDeclarations.h:83
RealScalar blueNorm() const
Definition: StableNorm.h:184
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:228
void applyOnTheRight(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:541
const CwiseUnaryOp< std::binder1st< std::equal_to< Scalar > >, const Derived > cwiseEqual(const Scalar &s) const
Definition: MatrixBase.h:64
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:597
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:782
const DiagonalWrapper< const Derived > asDiagonal() const
Definition: DiagonalMatrix.h:278
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:301
Derived & derived()
Definition: EigenBase.h:34
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Definition: ForwardDeclarations.h:222
Definition: Constants.h:268
Scalar trace() const
Definition: Redux.h:401
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:50
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:67
const FullPivLU< PlainObject > fullPivLu() const
Definition: FullPivLU.h:736
DiagonalReturnType diagonal()
Definition: Diagonal.h:168
RealScalar hypotNorm() const
Definition: StableNorm.h:196
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:53
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: Inverse.h:386
internal::add_const_on_value_type< typename internal::conditional< Enable, ForceAlignedAccess< Derived >, Derived & >::type >::type forceAlignedAccessIf() const
Definition: ForceAlignedAccess.h:128
PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:74
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:483
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:122
const PartialPivLU< PlainObject > lu() const
Definition: PartialPivLU.h:493
ArrayWrapper< Derived > array()
Definition: MatrixBase.h:322
Derived & operator+=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:220
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition: Householder.h:65
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: Inverse.h:347
static const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:829
void adjointInPlace()
Definition: Transpose.h:323
void normalize()
Definition: Dot.h:154
Definition: Constants.h:209
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
Definition: FullPivHouseholderQR.h:607
internal::traits< Derived >::Index Index
The type of indices.
Definition: DenseBase.h:61
const unsigned int EvalBeforeAssigningBit
Definition: Constants.h:63
const PlainObject normalized() const
Definition: Dot.h:139
const HNormalizedReturnType hnormalized() const
Definition: Homogeneous.h:158
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:102
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Definition: Householder.h:42
internal::scalar_product_traits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition: Dot.h:63
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
Definition: ColPivHouseholderQR.h:573
LU decomposition of a matrix with complete pivoting, and related features.
Definition: ForwardDeclarations.h:216
const HouseholderQR< PlainObject > householderQr() const
Definition: HouseholderQR.h:367
Householder QR decomposition of a matrix.
Definition: ForwardDeclarations.h:221
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: ForwardDeclarations.h:224
Base class for triangular part in a matrix.
Definition: TriangularMatrix.h:158
const AdjointReturnType adjoint() const
Definition: Transpose.h:237
static const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:700
Derived & setIdentity()
Definition: CwiseNullaryOp.h:772
Expression of a diagonal matrix.
Definition: DiagonalMatrix.h:248
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:293
const unsigned int RowMajorBit
Definition: Constants.h:53
static const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:839
const ForceAlignedAccess< Derived > forceAlignedAccess() const
Definition: ForceAlignedAccess.h:107
Derived & operator-=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:206
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:64
Definition: DenseBase.h:102
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:59
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:127
static const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:801
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
Derived & operator*=(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:528
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition: EulerAngles.h:37
Expression of one (or a set of) homogeneous vector(s)
Definition: ForwardDeclarations.h:265
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: DiagonalMatrix.h:292
Derived & operator=(const MatrixBase &other)
Definition: Assign.h:555