MatrixBase.h
Go to the documentation of this file.
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 // IWYU pragma: private
15 #include "./InternalHeaderCheck.h"
16 
17 namespace Eigen {
18 
51 template <typename Derived>
52 class MatrixBase : public DenseBase<Derived> {
53  public:
54 #ifndef EIGEN_PARSED_BY_DOXYGEN
61 
64  using Base::Flags;
71 
72  using Base::coeff;
73  using Base::coeffRef;
74  using Base::cols;
75  using Base::const_cast_derived;
76  using Base::derived;
77  using Base::eval;
78  using Base::lazyAssign;
79  using Base::rows;
80  using Base::size;
81  using Base::operator-;
82  using Base::operator+=;
83  using Base::operator-=;
84  using Base::operator*=;
85  using Base::operator/=;
86 
89  typedef typename Base::RowXpr RowXpr;
90  typedef typename Base::ColXpr ColXpr;
91 #endif // not EIGEN_PARSED_BY_DOXYGEN
92 
93 #ifndef EIGEN_PARSED_BY_DOXYGEN
98 #endif // not EIGEN_PARSED_BY_DOXYGEN
99 
102  EIGEN_DEVICE_FUNC inline Index diagonalSize() const { return (numext::mini)(rows(), cols()); }
103 
104  typedef typename Base::PlainObject PlainObject;
105 
106 #ifndef EIGEN_PARSED_BY_DOXYGEN
123 #endif // not EIGEN_PARSED_BY_DOXYGEN
124 
125 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
126 #define EIGEN_DOC_UNARY_ADDONS(X, Y)
127 #include "../plugins/CommonCwiseBinaryOps.inc"
128 #include "../plugins/MatrixCwiseUnaryOps.inc"
129 #include "../plugins/MatrixCwiseBinaryOps.inc"
130 #ifdef EIGEN_MATRIXBASE_PLUGIN
131 #include EIGEN_MATRIXBASE_PLUGIN
132 #endif
133 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
134 #undef EIGEN_DOC_UNARY_ADDONS
135 
140 
141  // We cannot inherit here via Base::operator= since it is causing
142  // trouble with MSVC.
143 
144  template <typename OtherDerived>
145  EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
146 
147  template <typename OtherDerived>
149 
150  template <typename OtherDerived>
152 
153  template <typename OtherDerived>
155  template <typename OtherDerived>
157 
158  template <typename OtherDerived>
160 
161  template <typename OtherDerived>
163  const MatrixBase<OtherDerived>& other) const;
164 
165  template <typename OtherDerived>
166  Derived& operator*=(const EigenBase<OtherDerived>& other);
167 
168  template <typename OtherDerived>
170 
171  template <typename OtherDerived>
173 
174  template <typename DiagonalDerived>
177 
178  template <typename SkewDerived>
180  const SkewSymmetricBase<SkewDerived>& skew) const;
181 
182  template <typename OtherDerived>
184  typename internal::traits<OtherDerived>::Scalar>::ReturnType
185  dot(const MatrixBase<OtherDerived>& other) const;
186 
189  RealScalar stableNorm() const;
190  RealScalar blueNorm() const;
191  RealScalar hypotNorm() const;
196 
199 
202 
205 
206  template <int Index>
208 
209  template <int Index>
211 
214 
215  template <unsigned int Mode>
218  };
219  template <unsigned int Mode>
222  };
223 
224  template <unsigned int Mode>
226  template <unsigned int Mode>
228 
229  template <unsigned int UpLo>
232  };
233  template <unsigned int UpLo>
236  };
237 
238  template <unsigned int UpLo>
240  template <unsigned int UpLo>
242 
244  const Scalar& m_reference = Scalar(0),
245  const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
250  EIGEN_DEVICE_FUNC static const BasisReturnType UnitX();
251  EIGEN_DEVICE_FUNC static const BasisReturnType UnitY();
252  EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
253  EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
254 
258 
259  EIGEN_DEVICE_FUNC Derived& setIdentity();
261  EIGEN_DEVICE_FUNC Derived& setUnit(Index i);
262  EIGEN_DEVICE_FUNC Derived& setUnit(Index newSize, Index i);
263 
264  bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
265  bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
266 
269 
271 
272  template <typename OtherDerived>
273  bool isOrthogonal(const MatrixBase<OtherDerived>& other,
274  const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
275  bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
276 
281  template <typename OtherDerived>
282  EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase<OtherDerived>& other) const {
283  return (this->rows() == other.rows()) && (this->cols() == other.cols()) && cwiseEqual(other).all();
284  }
285 
290  template <typename OtherDerived>
291  EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase<OtherDerived>& other) const {
292  return !(*this == other);
293  }
294 
296 
297  // TODO forceAlignedAccess is temporarily disabled
298  // Need to find a nicer workaround.
299  inline const Derived& forceAlignedAccess() const { return derived(); }
300  inline Derived& forceAlignedAccess() { return derived(); }
301  template <bool Enable>
302  inline const Derived& forceAlignedAccessIf() const {
303  return derived();
304  }
305  template <bool Enable>
306  inline Derived& forceAlignedAccessIf() {
307  return derived();
308  }
309 
311 
312  template <int p>
314 
316  EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
317 
324  return ArrayWrapper<const Derived>(derived());
325  }
326 
328 
329  template <typename PermutationIndex = DefaultPermutationIndex>
331  template <typename PermutationIndex = DefaultPermutationIndex>
333 
334  template <typename PermutationIndex = DefaultPermutationIndex>
336 
337  EIGEN_DEVICE_FUNC inline const Inverse<Derived> inverse() const;
338 
339  template <typename ResultType>
340  inline void computeInverseAndDetWithCheck(
341  ResultType& inverse, typename ResultType::Scalar& determinant, bool& invertible,
342  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
343 
344  template <typename ResultType>
345  inline void computeInverseWithCheck(
346  ResultType& inverse, bool& invertible,
347  const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
348 
350 
352 
353  inline const LLT<PlainObject> llt() const;
354  inline const LDLT<PlainObject> ldlt() const;
355 
357 
358  inline const HouseholderQR<PlainObject> householderQr() const;
359  template <typename PermutationIndex = DefaultPermutationIndex>
361  template <typename PermutationIndex = DefaultPermutationIndex>
363  template <typename PermutationIndex = DefaultPermutationIndex>
365 
367 
368  inline EigenvaluesReturnType eigenvalues() const;
369  inline RealScalar operatorNorm() const;
370 
372 
373  template <int Options = 0>
375  template <int Options = 0>
376  EIGEN_DEPRECATED inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
377 
378  template <int Options = 0>
380  template <int Options = 0>
381  EIGEN_DEPRECATED inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
382 
384 
385  template <typename OtherDerived>
387  const MatrixBase<OtherDerived>& other) const;
388 
389  template <typename OtherDerived>
391 
392  EIGEN_DEVICE_FUNC inline PlainObject unitOrthogonal(void) const;
393 
395 
397 
398  // put this as separate enum value to work around possible GCC 4.3 bug (?)
399  enum {
403  : ColsAtCompileTime == 1 ? Vertical
404  : Horizontal
405  };
408 
413  typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType;
414  EIGEN_DEVICE_FUNC inline const HNormalizedReturnType hnormalized() const;
415 
417 
419  template <typename EssentialPart>
420  EIGEN_DEVICE_FUNC void makeHouseholder(EssentialPart& essential, Scalar& tau, RealScalar& beta) const;
421  template <typename EssentialPart>
422  EIGEN_DEVICE_FUNC void applyHouseholderOnTheLeft(const EssentialPart& essential, const Scalar& tau,
423  Scalar* workspace);
424  template <typename EssentialPart>
425  EIGEN_DEVICE_FUNC void applyHouseholderOnTheRight(const EssentialPart& essential, const Scalar& tau,
426  Scalar* workspace);
427 
429 
430  template <typename OtherScalar>
432  template <typename OtherScalar>
434 
436 
437  template <typename OtherDerived>
440  return other.cwiseProduct(derived());
441  }
442 
444 
446 #define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
447  \
450  const ReturnType<Derived> Name() const;
451 #define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
452  \
455  const ReturnType<Derived> Name(Argument) const;
456 
457  EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential)
460  const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
461  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine)
462  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine)
463  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine)
464  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine)
465  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine)
466  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine)
467  EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine)
468  EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root)
469  EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm)
470  EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue, pow, power to \c p, const RealScalar& p)
471  EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const std::complex<RealScalar>& p)
472 
473  protected:
476 
477  private:
478  EIGEN_DEVICE_FUNC explicit MatrixBase(int);
479  EIGEN_DEVICE_FUNC MatrixBase(int, int);
480  template <typename OtherDerived>
481  EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
482 
483  protected:
484  // mixing arrays and matrices is not legal
485  template <typename OtherDerived>
486  Derived& operator+=(const ArrayBase<OtherDerived>&) {
487  EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
488  YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
489  return *this;
490  }
491  // mixing arrays and matrices is not legal
492  template <typename OtherDerived>
493  Derived& operator-=(const ArrayBase<OtherDerived>&) {
494  EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
495  YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
496  return *this;
497  }
498 };
499 
500 /***************************************************************************
501  * Implementation of matrix base methods
502  ***************************************************************************/
503 
511 template <typename Derived>
512 template <typename OtherDerived>
513 inline Derived& MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived>& other) {
514  other.derived().applyThisOnTheRight(derived());
515  return derived();
516 }
517 
523 template <typename Derived>
524 template <typename OtherDerived>
525 inline void MatrixBase<Derived>::applyOnTheRight(const EigenBase<OtherDerived>& other) {
526  other.derived().applyThisOnTheRight(derived());
527 }
528 
534 template <typename Derived>
535 template <typename OtherDerived>
536 inline void MatrixBase<Derived>::applyOnTheLeft(const EigenBase<OtherDerived>& other) {
537  other.derived().applyThisOnTheLeft(derived());
538 }
539 
540 } // end namespace Eigen
541 
542 #endif // EIGEN_MATRIXBASE_H
AnnoyingScalar cos(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:136
AnnoyingScalar sin(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:137
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define EIGEN_DEFAULT_COPY_CONSTRUCTOR(CLASS)
Macro to explicitly define the default copy constructor. This is necessary, because the implicit defi...
Definition: Macros.h:1119
#define EIGEN_DEPRECATED
Definition: Macros.h:931
#define EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(Derived)
Macro to manually define default constructors and destructors. This is necessary when the copy constr...
Definition: Macros.h:1137
#define EIGEN_DEVICE_FUNC
Definition: Macros.h:892
#define EIGEN_STRONG_INLINE
Definition: Macros.h:834
#define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description)
Definition: MatrixBase.h:446
#define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument)
Definition: MatrixBase.h:449
#define EIGEN_STATIC_ASSERT(X, MSG)
Definition: StaticAssert.h:26
float * p
Definition: Tutorial_Map_using.cpp:9
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
NumTraits< Scalar >::Real RealScalar
Definition: bench_gemm.cpp:46
Base class for all 1D and 2D array, and related expressions.
Definition: ArrayBase.h:44
Expression of a mathematical vector or matrix as an array object.
Definition: ArrayWrapper.h:43
class Bidiagonal Divide and Conquer SVD
Definition: BDCSVD.h:85
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:110
Householder rank-revealing QR decomposition of a matrix with column-pivoting.
Definition: ColPivHouseholderQR.h:54
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:64
Generic expression where a coefficient-wise unary operator is applied to an expression.
Definition: CwiseUnaryOp.h:53
Base class for all dense matrices, vectors, and arrays.
Definition: DenseBase.h:44
@ IsVectorAtCompileTime
Definition: DenseBase.h:147
@ SizeAtCompileTime
Definition: DenseBase.h:108
@ MaxSizeAtCompileTime
Definition: DenseBase.h:135
@ Flags
Definition: DenseBase.h:161
@ ColsAtCompileTime
Definition: DenseBase.h:102
@ MaxColsAtCompileTime
Definition: DenseBase.h:124
@ MaxRowsAtCompileTime
Definition: DenseBase.h:113
@ RowsAtCompileTime
Definition: DenseBase.h:96
NumTraits< Scalar >::Real RealScalar
Definition: DenseBase.h:69
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.
Definition: DenseBase.h:204
Transpose< const Derived > ConstTransposeReturnType
Definition: DenseBase.h:301
Base::CoeffReturnType CoeffReturnType
Definition: DenseBase.h:92
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EvalReturnType eval() const
Definition: DenseBase.h:381
internal::traits< Derived >::Scalar Scalar
Definition: DenseBase.h:62
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Derived & lazyAssign(const DenseBase< OtherDerived > &other)
Base class for diagonal matrices and expressions.
Definition: DiagonalMatrix.h:33
Expression of a diagonal matrix.
Definition: DiagonalMatrix.h:320
Expression of a diagonal/subdiagonal/superdiagonal in a matrix.
Definition: Diagonal.h:68
Householder rank-revealing QR decomposition of a matrix with full pivoting.
Definition: FullPivHouseholderQR.h:63
LU decomposition of a matrix with complete pivoting, and related features.
Definition: FullPivLU.h:63
Expression of one (or a set of) homogeneous vector(s)
Definition: Homogeneous.h:62
Householder QR decomposition of a matrix.
Definition: HouseholderQR.h:59
Expression of the inverse of another expression.
Definition: Inverse.h:43
Rotation given by a cosine-sine pair.
Definition: Jacobi.h:38
Two-sided Jacobi SVD decomposition of a rectangular matrix.
Definition: JacobiSVD.h:500
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
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const
Definition: Dot.h:66
EIGEN_DEVICE_FUNC internal::cross_impl< Derived, OtherDerived >::return_type cross(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Definition: Householder.h:43
const LDLT< PlainObject > ldlt() const
Definition: LDLT.h:643
EIGEN_DEVICE_FUNC bool operator==(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:282
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition: MatrixBaseEigenvalues.h:111
const MatrixFunctionReturnValue< Derived > matrixFunction(StemFunction f) const
Helper function for the unsupported MatrixFunctions module.
Definition: MatrixFunction.h:507
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:343
EIGEN_DEVICE_FUNC MatrixBase< Derived > & matrix()
Definition: MatrixBase.h:315
static EIGEN_DEVICE_FUNC const BasisReturnType UnitZ()
Definition: CwiseNullaryOp.h:925
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal()
Definition: Diagonal.h:162
DenseBase< Derived > Base
Definition: MatrixBase.h:62
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:607
static EIGEN_DEVICE_FUNC const BasisReturnType Unit(Index size, Index i)
Definition: CwiseNullaryOp.h:872
EIGEN_DEVICE_FUNC const DiagonalWrapper< const Derived > asDiagonal() const
Definition: DiagonalMatrix.h:347
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC ScalarBinaryOpTraits< typename internal::traits< Derived >::Scalar, typename internal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
internal::stem_function< Scalar >::type StemFunction
Definition: MatrixBase.h:445
const PartialPivLU< PlainObject, PermutationIndex > lu() const
static EIGEN_DEVICE_FUNC const IdentityReturnType Identity()
Definition: CwiseNullaryOp.h:787
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition: MatrixBaseEigenvalues.h:63
RealScalar hypotNorm() const
Definition: StableNorm.h:208
EIGEN_DEVICE_FUNC RealScalar lpNorm() const
Derived & operator*=(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:509
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:532
EIGEN_DEVICE_FUNC Index diagonalSize() const
Definition: MatrixBase.h:102
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper< const Derived > array() const
Definition: MatrixBase.h:323
RealScalar blueNorm() const
Definition: StableNorm.h:198
const ColPivHouseholderQR< PlainObject, PermutationIndex > colPivHouseholderQr() const
void applyOnTheRight(const EigenBase< OtherDerived > &other)
Definition: MatrixBase.h:521
EIGEN_DEVICE_FUNC void stableNormalize()
Definition: Dot.h:156
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: CwiseNullaryOp.h:802
JacobiSVD< PlainObject, Options > jacobiSvd() const
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType
EIGEN_DEVICE_FUNC Derived & operator=(const ReturnByValue< OtherDerived > &other)
internal::traits< Derived >::StorageKind StorageKind
Definition: MatrixBase.h:56
EIGEN_DEVICE_FUNC Derived & operator=(const EigenBase< OtherDerived > &other)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator-=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:148
const FullPivHouseholderQR< PlainObject, PermutationIndex > fullPivHouseholderQr() const
EIGEN_DEVICE_FUNC const MatrixBase< Derived > & matrix() const
Definition: MatrixBase.h:316
EIGEN_DEVICE_FUNC RealScalar norm() const
Definition: Dot.h:78
NumTraits< Scalar >::Real RealScalar
Definition: MatrixBase.h:60
BDCSVD< PlainObject, Options > bdcSvd() const
EIGEN_DEVICE_FUNC MatrixBase(int)
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator=(const MatrixBase &other)
Definition: Assign.h:51
EIGEN_DEVICE_FUNC TriangularViewReturnType< Mode >::Type triangularView()
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const
Definition: Transpose.h:197
const PartialPivLU< PlainObject, PermutationIndex > partialPivLu() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper< Derived > array()
Definition: MatrixBase.h:320
const Derived & forceAlignedAccessIf() const
Definition: MatrixBase.h:302
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition: InverseImpl.h:307
NoAlias< Derived, Eigen::MatrixBase > EIGEN_DEVICE_FUNC noalias()
Definition: NoAlias.h:96
CwiseNullaryOp< internal::scalar_constant_op< Scalar >, PlainObject > ConstantReturnType
Definition: MatrixBase.h:108
EIGEN_DEVICE_FUNC void normalize()
Definition: Dot.h:113
Derived & forceAlignedAccessIf()
Definition: MatrixBase.h:306
Block< const Derived, internal::traits< Derived >::ColsAtCompileTime==1 ? SizeMinusOne :1, internal::traits< Derived >::ColsAtCompileTime==1 ? 1 :SizeMinusOne > ConstStartMinusOne
Definition: MatrixBase.h:412
Base::ConstTransposeReturnType ConstTransposeReturnType
Definition: MatrixBase.h:88
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:256
EIGEN_DEPRECATED BDCSVD< PlainObject, Options > bdcSvd(unsigned int computationOptions) const
const LLT< PlainObject > llt() const
Definition: LLT.h:498
EIGEN_STRONG_INLINE const SparseMatrixBase< OtherDerived >::template CwiseProductDenseReturnType< Derived >::Type cwiseProduct(const SparseMatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:439
EIGEN_DEVICE_FUNC bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition: MatrixBase.h:291
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: DiagonalMatrix.h:360
Matrix< std::complex< RealScalar >, internal::traits< Derived >::ColsAtCompileTime, 1, ColMajor > EigenvaluesReturnType
Definition: MatrixBase.h:116
const HouseholderQR< PlainObject > householderQr() const
Definition: HouseholderQR.h:526
EIGEN_DEVICE_FUNC void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:106
bool isSkewSymmetric(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: SkewSymmetricMatrix3.h:319
EIGEN_DEVICE_FUNC void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition: Householder.h:65
std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType > AdjointReturnType
Definition: MatrixBase.h:113
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: TriangularMatrix.h:585
Base::CoeffReturnType CoeffReturnType
Definition: MatrixBase.h:87
Base::PlainObject PlainObject
Definition: MatrixBase.h:104
EIGEN_DEVICE_FUNC const PlainObject normalized() const
Definition: Dot.h:92
Matrix< Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime), internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)> SquareMatrixType
Definition: MatrixBase.h:97
EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const
Definition: Dot.h:133
EIGEN_DEVICE_FUNC Scalar trace() const
Definition: Redux.h:522
MatrixBase StorageBaseType
Definition: MatrixBase.h:55
Block< const CwiseNullaryOp< internal::scalar_identity_op< Scalar >, SquareMatrixType >, internal::traits< Derived >::RowsAtCompileTime, internal::traits< Derived >::ColsAtCompileTime > BasisReturnType
Definition: MatrixBase.h:122
RealScalar stableNorm() const
Definition: StableNorm.h:184
static EIGEN_DEVICE_FUNC const BasisReturnType UnitY()
Definition: CwiseNullaryOp.h:913
Base::RowXpr RowXpr
Definition: MatrixBase.h:89
internal::packet_traits< Scalar >::type PacketScalar
Definition: MatrixBase.h:59
EIGEN_DEVICE_FUNC Diagonal< Derived, Index > diagonal()
static EIGEN_DEVICE_FUNC const BasisReturnType UnitX()
Definition: CwiseNullaryOp.h:901
CwiseNullaryOp< internal::scalar_identity_op< Scalar >, PlainObject > IdentityReturnType
Definition: MatrixBase.h:118
static EIGEN_DEVICE_FUNC const BasisReturnType UnitW()
Definition: CwiseNullaryOp.h:937
internal::traits< Derived >::StorageIndex StorageIndex
Definition: MatrixBase.h:57
const PermutationWrapper< const Derived > asPermutation() const
Definition: PermutationMatrix.h:537
@ HomogeneousReturnTypeDirection
Definition: MatrixBase.h:400
EIGEN_DEVICE_FUNC ConstSelfAdjointViewReturnType< UpLo >::Type selfadjointView() const
internal::traits< Derived >::Scalar Scalar
Definition: MatrixBase.h:58
EIGEN_DEPRECATED JacobiSVD< PlainObject, Options > jacobiSvd(unsigned int computationOptions) const
EIGEN_DEVICE_FUNC void adjointInPlace()
Definition: Transpose.h:350
const Derived & forceAlignedAccess() const
Definition: MatrixBase.h:299
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived & operator+=(const MatrixBase< OtherDerived > &other)
Definition: CwiseBinaryOp.h:159
EIGEN_DEVICE_FUNC void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition: Householder.h:138
EIGEN_DEVICE_FUNC Scalar determinant() const
Definition: Determinant.h:90
EIGEN_DEVICE_FUNC const Inverse< Derived > inverse() const
Definition: InverseImpl.h:279
EIGEN_DEVICE_FUNC const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
EIGEN_DEVICE_FUNC ConstTriangularViewReturnType< Mode >::Type triangularView() const
@ SizeMinusOne
Definition: MatrixBase.h:409
EIGEN_DEVICE_FUNC Derived & setIdentity()
Definition: CwiseNullaryOp.h:845
Base::ColXpr ColXpr
Definition: MatrixBase.h:90
const FullPivLU< PlainObject, PermutationIndex > fullPivLu() const
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition: Dot.h:238
const CompleteOrthogonalDecomposition< PlainObject, PermutationIndex > completeOrthogonalDecomposition() const
Diagonal< Derived > DiagonalReturnType
Definition: MatrixBase.h:200
EIGEN_DEVICE_FUNC const SkewSymmetricWrapper< const Derived > asSkewSymmetric() const
Definition: SkewSymmetricMatrix3.h:311
Homogeneous< Derived, HomogeneousReturnTypeDirection > HomogeneousReturnType
Definition: MatrixBase.h:406
Diagonal< const Derived > ConstDiagonalReturnType
Definition: MatrixBase.h:203
EIGEN_DEVICE_FUNC const Diagonal< const Derived, Index > diagonal() const
EIGEN_DEVICE_FUNC Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
Definition: CwiseNullaryOp.h:950
EIGEN_DEVICE_FUNC SelfAdjointViewReturnType< UpLo >::Type selfadjointView()
Derived & forceAlignedAccess()
Definition: MatrixBase.h:300
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
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:77
Class to view a vector of integers as a permutation matrix.
Definition: PermutationMatrix.h:450
Expression of the product of two arbitrary matrices or vectors.
Definition: Product.h:202
Definition: ReturnByValue.h:50
Expression of a selfadjoint matrix from a triangular part of a dense matrix.
Definition: SelfAdjointView.h:51
Base class for skew symmetric matrices and expressions.
Definition: SkewSymmetricMatrix3.h:35
Expression of a skew symmetric matrix.
Definition: SkewSymmetricMatrix3.h:287
Base class of any sparse matrices or sparse expressions.
Definition: SparseMatrixBase.h:30
EIGEN_STRONG_INLINE const CwiseProductDenseReturnType< OtherDerived >::Type cwiseProduct(const MatrixBase< OtherDerived > &other) const
Expression of a dense or sparse matrix with zero or too small values removed.
Definition: SparseView.h:45
Expression of the transpose of a matrix.
Definition: Transpose.h:56
Expression of a triangular part in a matrix.
Definition: TriangularMatrix.h:167
@ IsComplex
Definition: common.h:73
static int f(const TensorMap< Tensor< int, 3 > > &tensor)
Definition: cxx11_tensor_map.cpp:237
EIGEN_DEVICE_FUNC PlainObject unitOrthogonal(void) const
Definition: OrthoMethods.h:254
EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > canonicalEulerAngles(Index a0, Index a1, Index a2) const
Definition: Eigen/src/Geometry/EulerAngles.h:45
EIGEN_DEVICE_FUNC HomogeneousReturnType homogeneous() const
Definition: Homogeneous.h:126
EIGEN_DEVICE_FUNC const HNormalizedReturnType hnormalized() const
homogeneous normalization
Definition: Homogeneous.h:166
EIGEN_DEVICE_FUNC PlainObject cross3(const MatrixBase< OtherDerived > &other) const
Definition: OrthoMethods.h:127
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
Definition: Eigen/src/Geometry/EulerAngles.h:137
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:201
@ ColMajor
Definition: Constants.h:318
@ Horizontal
Definition: Constants.h:269
@ Vertical
Definition: Constants.h:266
const unsigned int RowMajorBit
Definition: Constants.h:70
Scalar beta
Definition: level2_cplx_impl.h:36
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 cosh(const bfloat16 &a)
Definition: BFloat16.h:638
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 atanh(const bfloat16 &a)
Definition: BFloat16.h:642
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 exp(const bfloat16 &a)
Definition: BFloat16.h:615
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 pow(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:625
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 log(const bfloat16 &a)
Definition: BFloat16.h:618
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 sinh(const bfloat16 &a)
Definition: BFloat16.h:637
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 acosh(const bfloat16 &a)
Definition: BFloat16.h:641
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 asinh(const bfloat16 &a)
Definition: BFloat16.h:640
constexpr int max_size_prefer_dynamic(A a, B b)
Definition: Meta.h:695
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T mini(const T &x, const T &y)
Definition: MathFunctions.h:920
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
squared absolute sa ArrayBase::abs2 DOXCOMMA MatrixBase::cwiseAbs2 square(power 2)
const int Dynamic
Definition: Constants.h:25
int c
Definition: calibrate.py:100
Type
Type of JSON value.
Definition: rapidjson.h:513
Definition: EigenBase.h:33
const SelfAdjointView< const Derived, UpLo > Type
Definition: MatrixBase.h:235
const TriangularView< const Derived, Mode > Type
Definition: MatrixBase.h:221
SelfAdjointView< Derived, UpLo > Type
Definition: MatrixBase.h:231
TriangularView< Derived, Mode > Type
Definition: MatrixBase.h:217
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
Definition: NumTraits.h:217
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition: XprHelper.h:1043
Definition: ForwardDeclarations.h:499
Definition: ForwardDeclarations.h:21
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2