Eigen  3.4.90 (git rev 67eeba6e720c5745abc77ae6c92ce0a44aa7b7ae)
MatrixBase.h
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
5 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
6 //
7 // This Source Code Form is subject to the terms of the Mozilla
8 // Public License v. 2.0. If a copy of the MPL was not distributed
9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 
11 #ifndef EIGEN_MATRIXBASE_H
12 #define EIGEN_MATRIXBASE_H
13 
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
50 template<typename Derived> class MatrixBase
51  : public DenseBase<Derived>
52 {
53  public:
54 #ifndef EIGEN_PARSED_BY_DOXYGEN
55  typedef MatrixBase StorageBaseType;
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;
60  typedef typename NumTraits<Scalar>::Real RealScalar;
61 
62  typedef DenseBase<Derived> Base;
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;
70  using Base::Flags;
71 
72  using Base::derived;
73  using Base::const_cast_derived;
74  using Base::rows;
75  using Base::cols;
76  using Base::size;
77  using Base::coeff;
78  using Base::coeffRef;
79  using Base::lazyAssign;
80  using Base::eval;
81  using Base::operator-;
82  using Base::operator+=;
83  using Base::operator-=;
84  using Base::operator*=;
85  using Base::operator/=;
86 
87  typedef typename Base::CoeffReturnType CoeffReturnType;
88  typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
89  typedef typename Base::RowXpr RowXpr;
90  typedef typename Base::ColXpr ColXpr;
91 #endif // not EIGEN_PARSED_BY_DOXYGEN
92 
93 
94 
95 #ifndef EIGEN_PARSED_BY_DOXYGEN
97  typedef Matrix<Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime),
98  internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType;
99 #endif // not EIGEN_PARSED_BY_DOXYGEN
100 
103  EIGEN_DEVICE_FUNC
104  inline Index diagonalSize() const { return (numext::mini)(rows(),cols()); }
105 
106  typedef typename Base::PlainObject PlainObject;
107 
108 #ifndef EIGEN_PARSED_BY_DOXYGEN
110  typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
112  typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
113  CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, ConstTransposeReturnType>,
114  ConstTransposeReturnType
115  > AdjointReturnType;
117  typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType;
119  typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,PlainObject> IdentityReturnType;
122  internal::traits<Derived>::RowsAtCompileTime,
123  internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
124 #endif // not EIGEN_PARSED_BY_DOXYGEN
125 
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
133 # endif
134 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
135 #undef EIGEN_DOC_UNARY_ADDONS
136 
140  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
141  Derived& operator=(const MatrixBase& other);
142 
143  // We cannot inherit here via Base::operator= since it is causing
144  // trouble with MSVC.
145 
146  template <typename OtherDerived>
147  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
148  Derived& operator=(const DenseBase<OtherDerived>& other);
149 
150  template <typename OtherDerived>
151  EIGEN_DEVICE_FUNC
152  Derived& operator=(const EigenBase<OtherDerived>& other);
153 
154  template<typename OtherDerived>
155  EIGEN_DEVICE_FUNC
156  Derived& operator=(const ReturnByValue<OtherDerived>& other);
157 
158  template<typename OtherDerived>
159  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
160  Derived& operator+=(const MatrixBase<OtherDerived>& other);
161  template<typename OtherDerived>
162  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
163  Derived& operator-=(const MatrixBase<OtherDerived>& other);
164 
165  template<typename OtherDerived>
166  EIGEN_DEVICE_FUNC
168  operator*(const MatrixBase<OtherDerived> &other) const;
169 
170  template<typename OtherDerived>
171  EIGEN_DEVICE_FUNC
173  lazyProduct(const MatrixBase<OtherDerived> &other) const;
174 
175  template<typename OtherDerived>
176  Derived& operator*=(const EigenBase<OtherDerived>& other);
177 
178  template<typename OtherDerived>
180 
181  template<typename OtherDerived>
183 
184  template<typename DiagonalDerived>
185  EIGEN_DEVICE_FUNC
187  operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
188 
189  template<typename OtherDerived>
190  EIGEN_DEVICE_FUNC
191  typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
192  dot(const MatrixBase<OtherDerived>& other) const;
193 
194  EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
195  EIGEN_DEVICE_FUNC RealScalar norm() const;
196  RealScalar stableNorm() const;
197  RealScalar blueNorm() const;
198  RealScalar hypotNorm() const;
199  EIGEN_DEVICE_FUNC const PlainObject normalized() const;
200  EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const;
201  EIGEN_DEVICE_FUNC void normalize();
202  EIGEN_DEVICE_FUNC void stableNormalize();
203 
204  EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
205  EIGEN_DEVICE_FUNC void adjointInPlace();
206 
208  EIGEN_DEVICE_FUNC
210 
212  EIGEN_DEVICE_FUNC
213  const ConstDiagonalReturnType diagonal() const;
214 
215  template<int Index>
216  EIGEN_DEVICE_FUNC
218 
219  template<int Index>
220  EIGEN_DEVICE_FUNC
222 
223  EIGEN_DEVICE_FUNC
225  EIGEN_DEVICE_FUNC
227 
228  template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
229  template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
230 
231  template<unsigned int Mode>
232  EIGEN_DEVICE_FUNC
233  typename TriangularViewReturnType<Mode>::Type triangularView();
234  template<unsigned int Mode>
235  EIGEN_DEVICE_FUNC
236  typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
237 
238  template<unsigned int UpLo> struct SelfAdjointViewReturnType { typedef SelfAdjointView<Derived, UpLo> Type; };
239  template<unsigned int UpLo> struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView<const Derived, UpLo> Type; };
240 
241  template<unsigned int UpLo>
242  EIGEN_DEVICE_FUNC
243  typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
244  template<unsigned int UpLo>
245  EIGEN_DEVICE_FUNC
246  typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
247 
248  const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
249  const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
250  EIGEN_DEVICE_FUNC static const IdentityReturnType Identity();
251  EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols);
252  EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i);
253  EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i);
254  EIGEN_DEVICE_FUNC static const BasisReturnType UnitX();
255  EIGEN_DEVICE_FUNC static const BasisReturnType UnitY();
256  EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
257  EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
258 
259  EIGEN_DEVICE_FUNC
260  const DiagonalWrapper<const Derived> asDiagonal() const;
261  const PermutationWrapper<const Derived> asPermutation() const;
262 
263  EIGEN_DEVICE_FUNC
264  Derived& setIdentity();
265  EIGEN_DEVICE_FUNC
266  Derived& setIdentity(Index rows, Index cols);
267  EIGEN_DEVICE_FUNC Derived& setUnit(Index i);
268  EIGEN_DEVICE_FUNC Derived& setUnit(Index newSize, Index i);
269 
270  bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
271  bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
272 
273  bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
274  bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
275 
276  template<typename OtherDerived>
277  bool isOrthogonal(const MatrixBase<OtherDerived>& other,
278  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
279  bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
280 
285  template<typename OtherDerived>
286  EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase<OtherDerived>& other) const
287  { return cwiseEqual(other).all(); }
288 
293  template<typename OtherDerived>
294  EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase<OtherDerived>& other) const
295  { return cwiseNotEqual(other).any(); }
296 
297  NoAlias<Derived,Eigen::MatrixBase > EIGEN_DEVICE_FUNC noalias();
298 
299  // TODO forceAlignedAccess is temporarily disabled
300  // Need to find a nicer workaround.
301  inline const Derived& forceAlignedAccess() const { return derived(); }
302  inline Derived& forceAlignedAccess() { return derived(); }
303  template<bool Enable> inline const Derived& forceAlignedAccessIf() const { return derived(); }
304  template<bool Enable> inline Derived& forceAlignedAccessIf() { return derived(); }
305 
306  EIGEN_DEVICE_FUNC Scalar trace() const;
307 
308  template<int p> EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
309 
310  EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
311  EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
312 
315  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
318  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const { return ArrayWrapper<const Derived>(derived()); }
319 
321 
322  inline const FullPivLU<PlainObject> fullPivLu() const;
323  inline const PartialPivLU<PlainObject> partialPivLu() const;
324 
325  inline const PartialPivLU<PlainObject> lu() const;
326 
327  EIGEN_DEVICE_FUNC
328  inline const Inverse<Derived> inverse() const;
329 
330  template<typename ResultType>
331  inline void computeInverseAndDetWithCheck(
332  ResultType& inverse,
333  typename ResultType::Scalar& determinant,
334  bool& invertible,
335  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
336  ) const;
337 
338  template<typename ResultType>
339  inline void computeInverseWithCheck(
340  ResultType& inverse,
341  bool& invertible,
342  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
343  ) const;
344 
345  EIGEN_DEVICE_FUNC
346  Scalar determinant() const;
347 
349 
350  inline const LLT<PlainObject> llt() const;
351  inline const LDLT<PlainObject> ldlt() const;
352 
354 
355  inline const HouseholderQR<PlainObject> householderQr() const;
359 
361 
362  inline EigenvaluesReturnType eigenvalues() const;
363  inline RealScalar operatorNorm() const;
364 
366 
367  template<int Options = 0>
368  inline JacobiSVD<PlainObject, Options> jacobiSvd() const;
369  template<int Options = 0>
370  EIGEN_DEPRECATED
371  inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
372 
373  template<int Options = 0>
374  inline BDCSVD<PlainObject, Options> bdcSvd() const;
375  template<int Options = 0>
376  EIGEN_DEPRECATED
377  inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
378 
380 
381  #ifndef EIGEN_PARSED_BY_DOXYGEN
383  template<typename OtherDerived> struct cross_product_return_type {
384  typedef typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
386  };
387  #endif // EIGEN_PARSED_BY_DOXYGEN
388  template<typename OtherDerived>
389  EIGEN_DEVICE_FUNC
390 #ifndef EIGEN_PARSED_BY_DOXYGEN
391  inline typename cross_product_return_type<OtherDerived>::type
392 #else
393  inline PlainObject
394 #endif
395  cross(const MatrixBase<OtherDerived>& other) const;
396 
397  template<typename OtherDerived>
398  EIGEN_DEVICE_FUNC
399  inline PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
400 
401  EIGEN_DEVICE_FUNC
402  inline PlainObject unitOrthogonal(void) const;
403 
404  EIGEN_DEVICE_FUNC
405  inline Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
406 
407  // put this as separate enum value to work around possible GCC 4.3 bug (?)
408  enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
410  typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
411  EIGEN_DEVICE_FUNC
412  inline HomogeneousReturnType homogeneous() const;
413 
414  enum {
415  SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1
416  };
417  typedef Block<const Derived,
418  internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
419  internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
420  typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType;
421  EIGEN_DEVICE_FUNC
422  inline const HNormalizedReturnType hnormalized() const;
423 
425 
426  EIGEN_DEVICE_FUNC
427  void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
428  template<typename EssentialPart>
429  EIGEN_DEVICE_FUNC
430  void makeHouseholder(EssentialPart& essential,
431  Scalar& tau, RealScalar& beta) const;
432  template<typename EssentialPart>
433  EIGEN_DEVICE_FUNC
434  void applyHouseholderOnTheLeft(const EssentialPart& essential,
435  const Scalar& tau,
436  Scalar* workspace);
437  template<typename EssentialPart>
438  EIGEN_DEVICE_FUNC
439  void applyHouseholderOnTheRight(const EssentialPart& essential,
440  const Scalar& tau,
441  Scalar* workspace);
442 
444 
445  template<typename OtherScalar>
446  EIGEN_DEVICE_FUNC
447  void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
448  template<typename OtherScalar>
449  EIGEN_DEVICE_FUNC
450  void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
451 
453 
454  template<typename OtherDerived>
455  EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
456  cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
457  {
458  return other.cwiseProduct(derived());
459  }
460 
462 
463  typedef typename internal::stem_function<Scalar>::type StemFunction;
464 #define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
465  \
466  const ReturnType<Derived> Name() const;
467 #define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
468  \
469  const ReturnType<Derived> Name(Argument) const;
470 
471  EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential)
473  const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
474  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine)
475  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine)
476 #if EIGEN_HAS_CXX11_MATH
477  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine)
478  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine)
479  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine)
480 #endif
481  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine)
482  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine)
483  EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root)
484  EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm)
485  EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue, pow, power to \c p, const RealScalar& p)
486  EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const std::complex<RealScalar>& p)
487 
488  protected:
489  EIGEN_DEFAULT_COPY_CONSTRUCTOR(MatrixBase)
490  EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MatrixBase)
491 
492  private:
493  EIGEN_DEVICE_FUNC explicit MatrixBase(int);
494  EIGEN_DEVICE_FUNC MatrixBase(int,int);
495  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
496  protected:
497  // mixing arrays and matrices is not legal
498  template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& )
499  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
500  // mixing arrays and matrices is not legal
501  template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& )
502  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
503 };
504 
505 
506 /***************************************************************************
507 * Implementation of matrix base methods
508 ***************************************************************************/
509 
517 template<typename Derived>
518 template<typename OtherDerived>
519 inline Derived&
521 {
522  other.derived().applyThisOnTheRight(derived());
523  return derived();
524 }
525 
531 template<typename Derived>
532 template<typename OtherDerived>
534 {
535  other.derived().applyThisOnTheRight(derived());
536 }
537 
543 template<typename Derived>
544 template<typename OtherDerived>
546 {
547  other.derived().applyThisOnTheLeft(derived());
548 }
549 
550 } // end namespace Eigen
551 
552 #endif // EIGEN_MATRIXBASE_H
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:43
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:45
class Bidiagonal Divide and Conquer SVD
Definition: BDCSVD.h:97
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:107
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Definition: ColPivHouseholderQR.h:55
Complete orthogonal decomposition (COD) of a matrix.
Definition: CompleteOrthogonalDecomposition.h:54
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:63
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:58
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:42
@ SizeAtCompileTime
Definition: DenseBase.h:108
@ ColsAtCompileTime
Definition: DenseBase.h:101
@ RowsAtCompileTime
Definition: DenseBase.h:95
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:58
std::conditional_t< internal::is_same< typename internal::traits< Homogeneous< MatrixType, Direction_ > >::XprKind, MatrixXpr >::value, PlainMatrix, PlainArray > PlainObject
The plain matrix or array type corresponding to this expression.
Definition: DenseBase.h:204
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:61
Derived & derived()
Definition: EigenBase.h:48
EIGEN_CONSTEXPR Index cols() const EIGEN_NOEXCEPT
Definition: EigenBase.h:65
EIGEN_CONSTEXPR Index rows() const EIGEN_NOEXCEPT
Definition: EigenBase.h:62
EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:69
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:67
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Definition: FullPivHouseholderQR.h:64
LU decomposition of a matrix with complete pivoting, and related features.
Definition: FullPivLU.h:64
Householder QR decomposition of a matrix.
Definition: HouseholderQR.h:60
Expression of the inverse of another expression.
Definition: Inverse.h:46
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: JacobiSVD.h:514
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:63
Standard Cholesky decomposition (LL^T) of a matrix and associated features.
Definition: LLT.h:70
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:52
static const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:942
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:294
const MatrixFunctionReturnValue< Derived > sin() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise sine u...
void stableNormalize()
Definition: Dot.h:188
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:678
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:122
Derived & operator-=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:164
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:420
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition: Householder.h:69
const DiagonalWrapper< const Derived > asDiagonal() const
Definition: DiagonalMatrix.h:327
Derived & setIdentity()
Definition: CwiseNullaryOp.h:875
RealScalar norm() const
Definition: Dot.h:105
const MatrixFunctionReturnValue< Derived > matrixFunction(StemFunction f) const
Helper function for the unsupported MatrixFunctions module.
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:692
const FullPivLU< PlainObject > fullPivLu() const
Definition: FullPivLU.h:867
NoAlias< Derived, Eigen::MatrixBase > noalias()
Definition: NoAlias.h:104
DiagonalReturnType diagonal()
Definition: Diagonal.h:189
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:69
RealScalar hypotNorm() const
Definition: StableNorm.h:243
const MatrixFunctionReturnValue< Derived > cos() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise cosine...
ArrayWrapper< Derived > array()
Definition: MatrixBase.h:315
Derived & operator=(const MatrixBase &other)
Definition: Assign.h:57
Derived & operator*=(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:520
const PlainObject stableNormalized() const
Definition: Dot.h:164
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:545
RealScalar blueNorm() const
Definition: StableNorm.h:231
void applyOnTheRight(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:533
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:818
const MatrixLogarithmReturnValue< Derived > log() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise logari...
void adjointInPlace()
Definition: Transpose.h:377
Scalar trace() const
Definition: Redux.h:510
const PlainObject normalized() const
Definition: Dot.h:121
const PartialPivLU< PlainObject > partialPivLu() const
Definition: PartialPivLU.h:599
const MatrixFunctionReturnValue< Derived > cosh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise hyperb...
const MatrixExponentialReturnValue< Derived > exp() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise expone...
RealScalar lpNorm() const
Definition: Dot.h:264
const ArrayWrapper< const Derived > array() const
Definition: MatrixBase.h:318
const MatrixFunctionReturnValue< Derived > acosh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise invers...
const Inverse< Derived > inverse() const
Definition: InverseImpl.h:350
Scalar determinant() const
Definition: Determinant.h:110
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
Definition: InverseImpl.h:379
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:286
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
Definition: FullPivHouseholderQR.h:703
static const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:932
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:299
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)
Definition: Householder.h:118
const LLT< PlainObject > llt() const
Definition: LLT.h:537
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: DiagonalMatrix.h:341
Derived & operator+=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:177
static const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:801
const HouseholderQR< PlainObject > householderQr() const
Definition: HouseholderQR.h:461
const MatrixFunctionReturnValue< Derived > sinh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise hyperb...
static const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:952
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:667
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:156
Index diagonalSize() const
Definition: MatrixBase.h:104
RealScalar stableNorm() const
Definition: StableNorm.h:215
const MatrixFunctionReturnValue< Derived > atanh() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise invers...
static const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:904
Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
Definition: CwiseNullaryOp.h:974
RealScalar squaredNorm() const
Definition: Dot.h:93
void normalize()
Definition: Dot.h:142
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:301
const MatrixSquareRootReturnValue< Derived > sqrt() const
This function requires the unsupported MatrixFunctions module. To compute the coefficient-wise square...
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
Definition: ColPivHouseholderQR.h:664
ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition: Dot.h:69
const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
Definition: GeneralProduct.h:444
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition: GeneralProduct.h:401
const CompleteOrthogonalDecomposition< PlainObject > completeOrthogonalDecomposition() const
Definition: CompleteOrthogonalDecomposition.h:627
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Definition: Householder.h:45
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:280
static const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:962
const AdjointReturnType adjoint() const
Definition: Transpose.h:223
const PartialPivLU< PlainObject > lu() const
Definition: PartialPivLU.h:614
Derived & forceAlignedAccess()
Definition: MatrixBase.h:302
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:182
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:34
LU decomposition of a matrix with partial pivoting, and related features.
Definition: PartialPivLU.h:80
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:77
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:190
PlainObject cross(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:37
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition: EulerAngles.h:39
PlainObject unitOrthogonal(void) const
Definition: OrthoMethods.h:229
PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:85
const HNormalizedReturnType hnormalized() const
homogeneous normalization
Definition: Homogeneous.h:176
HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:134
const SparseView< Derived > sparseView(const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
Definition: SparseView.h:228
@ ColMajor
Definition: Constants.h:321
@ Horizontal
Definition: Constants.h:269
@ Vertical
Definition: Constants.h:266
const unsigned int RowMajorBit
Definition: Constants.h:68
Namespace containing all symbols from the Eigen library.
Definition: Core:139
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:59
const int Dynamic
Definition: Constants.h:24
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_square_op< typename Derived::Scalar >, const Derived > square(const Eigen::ArrayBase< Derived > &x)
Definition: EigenBase.h:32
Derived & derived()
Definition: EigenBase.h:48
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:41
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:231
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:774