Eigen  3.2.93
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 namespace Eigen {
15 
48 template<typename Derived> class MatrixBase
49  : public DenseBase<Derived>
50 {
51  public:
52 #ifndef EIGEN_PARSED_BY_DOXYGEN
53  typedef MatrixBase StorageBaseType;
54  typedef typename internal::traits<Derived>::StorageKind StorageKind;
55  typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
56  typedef typename internal::traits<Derived>::Scalar Scalar;
57  typedef typename internal::packet_traits<Scalar>::type PacketScalar;
58  typedef typename NumTraits<Scalar>::Real RealScalar;
59 
60  typedef DenseBase<Derived> Base;
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;
68  using Base::Flags;
69 
70  using Base::derived;
71  using Base::const_cast_derived;
72  using Base::rows;
73  using Base::cols;
74  using Base::size;
75  using Base::coeff;
76  using Base::coeffRef;
77  using Base::lazyAssign;
78  using Base::eval;
79  using Base::operator+=;
80  using Base::operator-=;
81  using Base::operator*=;
82  using Base::operator/=;
83 
84  typedef typename Base::CoeffReturnType CoeffReturnType;
85  typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
86  typedef typename Base::RowXpr RowXpr;
87  typedef typename Base::ColXpr ColXpr;
88 #endif // not EIGEN_PARSED_BY_DOXYGEN
89 
90 
91 
92 #ifndef EIGEN_PARSED_BY_DOXYGEN
93 
94  typedef Matrix<Scalar,EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime),
95  EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime)> SquareMatrixType;
96 #endif // not EIGEN_PARSED_BY_DOXYGEN
97 
100  EIGEN_DEVICE_FUNC
101  inline Index diagonalSize() const { return (std::min)(rows(),cols()); }
102 
103  typedef typename Base::PlainObject PlainObject;
104 
105 #ifndef EIGEN_PARSED_BY_DOXYGEN
106 
107  typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
109  typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
111  ConstTransposeReturnType
112  >::type AdjointReturnType;
114  typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType;
116  typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,PlainObject> IdentityReturnType;
119  internal::traits<Derived>::RowsAtCompileTime,
120  internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
121 #endif // not EIGEN_PARSED_BY_DOXYGEN
122 
123 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
124 # include "../plugins/CommonCwiseUnaryOps.h"
125 # include "../plugins/CommonCwiseBinaryOps.h"
126 # include "../plugins/MatrixCwiseUnaryOps.h"
127 # include "../plugins/MatrixCwiseBinaryOps.h"
128 # ifdef EIGEN_MATRIXBASE_PLUGIN
129 # include EIGEN_MATRIXBASE_PLUGIN
130 # endif
131 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
132 
136  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
137  Derived& operator=(const MatrixBase& other);
138 
139  // We cannot inherit here via Base::operator= since it is causing
140  // trouble with MSVC.
141 
142  template <typename OtherDerived>
143  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
144  Derived& operator=(const DenseBase<OtherDerived>& other);
145 
146  template <typename OtherDerived>
147  EIGEN_DEVICE_FUNC
148  Derived& operator=(const EigenBase<OtherDerived>& other);
149 
150  template<typename OtherDerived>
151  EIGEN_DEVICE_FUNC
152  Derived& operator=(const ReturnByValue<OtherDerived>& other);
153 
154  template<typename OtherDerived>
155  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
156  Derived& operator+=(const MatrixBase<OtherDerived>& other);
157  template<typename OtherDerived>
158  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
159  Derived& operator-=(const MatrixBase<OtherDerived>& other);
160 
161 #ifdef __CUDACC__
162  template<typename OtherDerived>
163  EIGEN_DEVICE_FUNC
165  operator*(const MatrixBase<OtherDerived> &other) const
166  { return this->lazyProduct(other); }
167 #else
168 
169  template<typename OtherDerived>
171  operator*(const MatrixBase<OtherDerived> &other) const;
172 
173 #endif
174 
175  template<typename OtherDerived>
176  EIGEN_DEVICE_FUNC
178  lazyProduct(const MatrixBase<OtherDerived> &other) const;
179 
180  template<typename OtherDerived>
181  Derived& operator*=(const EigenBase<OtherDerived>& other);
182 
183  template<typename OtherDerived>
184  void applyOnTheLeft(const EigenBase<OtherDerived>& other);
185 
186  template<typename OtherDerived>
187  void applyOnTheRight(const EigenBase<OtherDerived>& other);
188 
189  template<typename DiagonalDerived>
190  EIGEN_DEVICE_FUNC
192  operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
193 
194  template<typename OtherDerived>
195  EIGEN_DEVICE_FUNC
196  typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
197  dot(const MatrixBase<OtherDerived>& other) const;
198 
199  EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
200  EIGEN_DEVICE_FUNC RealScalar norm() const;
201  RealScalar stableNorm() const;
202  RealScalar blueNorm() const;
203  RealScalar hypotNorm() const;
204  EIGEN_DEVICE_FUNC const PlainObject normalized() const;
205  EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const;
206  EIGEN_DEVICE_FUNC void normalize();
207  EIGEN_DEVICE_FUNC void stableNormalize();
208 
209  EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
210  EIGEN_DEVICE_FUNC void adjointInPlace();
211 
213  EIGEN_DEVICE_FUNC
214  DiagonalReturnType diagonal();
215 
216  typedef typename internal::add_const<Diagonal<const Derived> >::type ConstDiagonalReturnType;
217  EIGEN_DEVICE_FUNC
218  ConstDiagonalReturnType diagonal() const;
219 
220  template<int Index> struct DiagonalIndexReturnType { typedef Diagonal<Derived,Index> Type; };
221  template<int Index> struct ConstDiagonalIndexReturnType { typedef const Diagonal<const Derived,Index> Type; };
222 
223  template<int Index>
224  EIGEN_DEVICE_FUNC
225  typename DiagonalIndexReturnType<Index>::Type diagonal();
226 
227  template<int Index>
228  EIGEN_DEVICE_FUNC
229  typename ConstDiagonalIndexReturnType<Index>::Type diagonal() const;
230 
232  typedef typename internal::add_const<Diagonal<const Derived,DynamicIndex> >::type ConstDiagonalDynamicIndexReturnType;
233 
234  EIGEN_DEVICE_FUNC
235  DiagonalDynamicIndexReturnType diagonal(Index index);
236  EIGEN_DEVICE_FUNC
237  ConstDiagonalDynamicIndexReturnType diagonal(Index index) const;
238 
239  template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
240  template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
241 
242  template<unsigned int Mode>
243  EIGEN_DEVICE_FUNC
244  typename TriangularViewReturnType<Mode>::Type triangularView();
245  template<unsigned int Mode>
246  EIGEN_DEVICE_FUNC
247  typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
248 
249  template<unsigned int UpLo> struct SelfAdjointViewReturnType { typedef SelfAdjointView<Derived, UpLo> Type; };
250  template<unsigned int UpLo> struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView<const Derived, UpLo> Type; };
251 
252  template<unsigned int UpLo>
253  EIGEN_DEVICE_FUNC
254  typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
255  template<unsigned int UpLo>
256  EIGEN_DEVICE_FUNC
257  typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
258 
259  const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
260  const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
261  EIGEN_DEVICE_FUNC static const IdentityReturnType Identity();
262  EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols);
263  EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i);
264  EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i);
265  EIGEN_DEVICE_FUNC static const BasisReturnType UnitX();
266  EIGEN_DEVICE_FUNC static const BasisReturnType UnitY();
267  EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
268  EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
269 
270  EIGEN_DEVICE_FUNC
272  const PermutationWrapper<const Derived> asPermutation() const;
273 
274  EIGEN_DEVICE_FUNC
275  Derived& setIdentity();
276  EIGEN_DEVICE_FUNC
277  Derived& setIdentity(Index rows, Index cols);
278 
279  bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
280  bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
281 
282  bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
283  bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
284 
285  template<typename OtherDerived>
286  bool isOrthogonal(const MatrixBase<OtherDerived>& other,
287  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
288  bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
289 
294  template<typename OtherDerived>
295  inline bool operator==(const MatrixBase<OtherDerived>& other) const
296  { return cwiseEqual(other).all(); }
297 
302  template<typename OtherDerived>
303  inline bool operator!=(const MatrixBase<OtherDerived>& other) const
304  { return cwiseNotEqual(other).any(); }
305 
307 
308  // TODO forceAlignedAccess is temporarily disabled
309  // Need to find a nicer workaround.
310  inline const Derived& forceAlignedAccess() const { return derived(); }
311  inline Derived& forceAlignedAccess() { return derived(); }
312  template<bool Enable> inline const Derived& forceAlignedAccessIf() const { return derived(); }
313  template<bool Enable> inline Derived& forceAlignedAccessIf() { return derived(); }
314 
315  EIGEN_DEVICE_FUNC Scalar trace() const;
316 
317  template<int p> EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
318 
319  EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
320  EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
321 
324  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
327  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const { return ArrayWrapper<const Derived>(derived()); }
328 
330 
331  EIGEN_DEVICE_FUNC
332  inline const FullPivLU<PlainObject> fullPivLu() const;
333  EIGEN_DEVICE_FUNC
334  inline const PartialPivLU<PlainObject> partialPivLu() const;
335 
336  EIGEN_DEVICE_FUNC
337  inline const PartialPivLU<PlainObject> lu() const;
338 
339  EIGEN_DEVICE_FUNC
340  inline const Inverse<Derived> inverse() const;
341 
342  template<typename ResultType>
343  inline void computeInverseAndDetWithCheck(
344  ResultType& inverse,
345  typename ResultType::Scalar& determinant,
346  bool& invertible,
347  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
348  ) const;
349  template<typename ResultType>
350  inline void computeInverseWithCheck(
351  ResultType& inverse,
352  bool& invertible,
353  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
354  ) const;
355  Scalar determinant() const;
356 
358 
359  inline const LLT<PlainObject> llt() const;
360  inline const LDLT<PlainObject> ldlt() const;
361 
363 
364  inline const HouseholderQR<PlainObject> householderQr() const;
368 
370 
371  inline EigenvaluesReturnType eigenvalues() const;
372  inline RealScalar operatorNorm() const;
373 
375 
376  inline JacobiSVD<PlainObject> jacobiSvd(unsigned int computationOptions = 0) const;
377  inline BDCSVD<PlainObject> bdcSvd(unsigned int computationOptions = 0) const;
378 
380 
381  #ifndef EIGEN_PARSED_BY_DOXYGEN
382  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  inline Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
405 
406  // put this as separate enum value to work around possible GCC 4.3 bug (?)
407  enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
408  : ColsAtCompileTime==1 ? Vertical : Horizontal };
410  inline HomogeneousReturnType homogeneous() const;
411 
412  enum {
413  SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1
414  };
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;
419 
420  inline const HNormalizedReturnType hnormalized() const;
421 
423 
424  void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
425  template<typename EssentialPart>
426  void makeHouseholder(EssentialPart& essential,
427  Scalar& tau, RealScalar& beta) const;
428  template<typename EssentialPart>
429  void applyHouseholderOnTheLeft(const EssentialPart& essential,
430  const Scalar& tau,
431  Scalar* workspace);
432  template<typename EssentialPart>
433  void applyHouseholderOnTheRight(const EssentialPart& essential,
434  const Scalar& tau,
435  Scalar* workspace);
436 
438 
439  template<typename OtherScalar>
441  template<typename OtherScalar>
443 
445 
446  template<typename OtherDerived>
447  EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
448  cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
449  {
450  return other.cwiseProduct(derived());
451  }
452 
454 
455  typedef typename internal::stem_function<Scalar>::type StemFunction;
456  const MatrixExponentialReturnValue<Derived> exp() const;
457  const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
458  const MatrixFunctionReturnValue<Derived> cosh() const;
459  const MatrixFunctionReturnValue<Derived> sinh() const;
460  const MatrixFunctionReturnValue<Derived> cos() const;
461  const MatrixFunctionReturnValue<Derived> sin() const;
462  const MatrixSquareRootReturnValue<Derived> sqrt() const;
463  const MatrixLogarithmReturnValue<Derived> log() const;
464  const MatrixPowerReturnValue<Derived> pow(const RealScalar& p) const;
465  const MatrixComplexPowerReturnValue<Derived> pow(const std::complex<RealScalar>& p) const;
466 
467  protected:
468  EIGEN_DEVICE_FUNC MatrixBase() : Base() {}
469 
470  private:
471  EIGEN_DEVICE_FUNC explicit MatrixBase(int);
472  EIGEN_DEVICE_FUNC MatrixBase(int,int);
473  template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
474  protected:
475  // mixing arrays and matrices is not legal
476  template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& )
477  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
478  // mixing arrays and matrices is not legal
479  template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& )
480  {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
481 };
482 
483 
484 /***************************************************************************
485 * Implementation of matrix base methods
486 ***************************************************************************/
487 
495 template<typename Derived>
496 template<typename OtherDerived>
497 inline Derived&
499 {
500  other.derived().applyThisOnTheRight(derived());
501  return derived();
502 }
503 
509 template<typename Derived>
510 template<typename OtherDerived>
512 {
513  other.derived().applyThisOnTheRight(derived());
514 }
515 
521 template<typename Derived>
522 template<typename OtherDerived>
524 {
525  other.derived().applyThisOnTheLeft(derived());
526 }
527 
528 } // end namespace Eigen
529 
530 #endif // EIGEN_MATRIXBASE_H
Generic expression of a matrix where all coefficients are defined by a functor.
Definition: CwiseNullaryOp.h:43
Scalar trace() const
Definition: Redux.h:498
Robust Cholesky decomposition of a matrix with pivoting.
Definition: LDLT.h:50
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition: Householder.h:65
RealScalar blueNorm() const
Definition: StableNorm.h:201
BDCSVD< PlainObject > bdcSvd(unsigned int computationOptions=0) const
Definition: BDCSVD.h:1222
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sinh_op< typename Derived::Scalar >, const Derived > sinh(const Eigen::ArrayBase< Derived > &x)
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:66
Definition: Constants.h:320
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:71
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
const AdjointReturnType adjoint() const
Definition: Transpose.h:205
const CompleteOrthogonalDecomposition< PlainObject > completeOrthogonalDecomposition() const
Definition: CompleteOrthogonalDecomposition.h:556
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:523
Definition: Constants.h:265
Pseudo expression providing an operator = assuming no aliasing.
Definition: NoAlias.h:31
Expression of the transpose of a matrix.
Definition: Transpose.h:52
static const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:865
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:296
const ColPivHouseholderQR< PlainObject > colPivHouseholderQr() const
Definition: ColPivHouseholderQR.h:650
void applyOnTheRight(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:511
LU decomposition of a matrix with partial pivoting, and related features.
Definition: ForwardDeclarations.h:250
Namespace containing all symbols from the Eigen library.
Definition: Core:271
Rotation given by a cosine-sine pair.
Definition: ForwardDeclarations.h:263
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
Definition: NumTraits.h:167
const PlainObject normalized() const
Definition: Dot.h:118
Derived & setIdentity()
Definition: CwiseNullaryOp.h:778
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition: EulerAngles.h:37
Derived & derived()
Definition: EigenBase.h:44
Complete orthogonal decomposition (COD) of a matrix.
Definition: ForwardDeclarations.h:257
RealScalar stableNorm() const
Definition: StableNorm.h:157
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:37
const FullPivLU< PlainObject > fullPivLu() const
Definition: FullPivLU.h:885
const unsigned int RowMajorBit
Definition: Constants.h:61
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:41
PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:82
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition: DenseBase.h:63
Definition: EigenBase.h:28
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:113
PlainObject unitOrthogonal(void) const
Definition: OrthoMethods.h:225
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:358
void normalize()
Definition: Dot.h:139
RealScalar norm() const
Definition: Dot.h:102
Expression of the inverse of another expression.
Definition: Inverse.h:43
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:303
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:642
static const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:835
Derived & operator+=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:174
void stableNormalize()
Definition: Dot.h:185
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:310
RealScalar squaredNorm() const
Definition: Dot.h:90
Base class of any sparse matrices or sparse expressions.
Definition: ForwardDeclarations.h:281
Index size() const
Definition: EigenBase.h:65
JacobiSVD< PlainObject > jacobiSvd(unsigned int computationOptions=0) const
Definition: JacobiSVD.h:796
PlainObject cross(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:34
Index rows() const
Definition: EigenBase.h:58
ArrayWrapper< Derived > array()
Definition: MatrixBase.h:324
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
const HouseholderQR< PlainObject > householderQr() const
Definition: HouseholderQR.h:406
const ArrayWrapper< const Derived > array() const
Definition: MatrixBase.h:327
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: DiagonalMatrix.h:291
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:49
const DiagonalWrapper< const Derived > asDiagonal() const
Definition: DiagonalMatrix.h:277
static const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:845
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
Definition: DenseBase.h:113
void adjointInPlace()
Definition: Transpose.h:310
static const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:807
const PartialPivLU< PlainObject > partialPivLu() const
Definition: PartialPivLU.h:590
class Bidiagonal Divide and Conquer SVD
Definition: ForwardDeclarations.h:259
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:642
Definition: Constants.h:268
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:122
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_cosh_op< typename Derived::Scalar >, const Derived > cosh(const Eigen::ArrayBase< Derived > &x)
const PlainObject stableNormalized() const
Definition: Dot.h:161
const Inverse< Derived > inverse() const
Definition: InverseImpl.h:331
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:668
const HNormalizedReturnType hnormalized() const
Definition: Homogeneous.h:159
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
static const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:704
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:103
Derived & operator-=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:161
ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition: Dot.h:68
LU decomposition of a matrix with complete pivoting, and related features.
Definition: ForwardDeclarations.h:249
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:150
RealScalar lpNorm() const
Definition: Dot.h:261
Householder QR decomposition of a matrix.
Definition: ForwardDeclarations.h:254
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
Derived & operator=(const MatrixBase &other)
Definition: Assign.h:55
Expression of a diagonal matrix.
Definition: DiagonalMatrix.h:245
Derived & forceAlignedAccess()
Definition: MatrixBase.h:311
const LLT< PlainObject > llt() const
Definition: LLT.h:517
Derived & operator*=(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:498
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:741
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:277
const PartialPivLU< PlainObject > lu() const
Definition: PartialPivLU.h:607
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:63
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Definition: Householder.h:42
const int Dynamic
Definition: Constants.h:21
Definition: DenseBase.h:106
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:721
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:397
HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:128
Index cols() const
Definition: EigenBase.h:61
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:295
Index diagonalSize() const
Definition: MatrixBase.h:101
const FullPivHouseholderQR< PlainObject > fullPivHouseholderQr() const
Definition: FullPivHouseholderQR.h:673
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:67
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:48
const CwiseBinaryOp< internal::scalar_product_op< Scalar, T >, Derived, Constant< T > > operator*(const T &scalar) const
Scalar determinant() const
Definition: Determinant.h:92
Definition: DenseBase.h:100
static const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:855
const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
Definition: GeneralProduct.h:413
Expression of one (or a set of) homogeneous vector(s)
Definition: ForwardDeclarations.h:278
RealScalar hypotNorm() const
Definition: StableNorm.h:213