Eigen  5.0.1-dev+60122df6
 
Loading...
Searching...
No Matches
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// IWYU pragma: private
15#include "./InternalHeaderCheck.h"
16
17namespace Eigen {
18
23 *
24 * This class is the base that is inherited by all matrix, vector, and related expression
25 * types. Most of the Eigen API is contained in this class, and its base classes. Other important
26 * classes for the Eigen API are Matrix, and VectorwiseOp.
27 *
28 * Note that some methods are defined in other modules such as the \ref LU_Module LU module
29 * for all functions related to matrix inversions.
30 *
31 * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc.
32 *
33 * When writing a function taking Eigen objects as argument, if you want your function
34 * to take as argument any matrix, vector, or expression, just let it take a
35 * MatrixBase argument. As an example, here is a function printFirstRow which, given
36 * a matrix, vector, or expression \a x, prints the first row of \a x.
37 *
38 * \code
39 template<typename Derived>
40 void printFirstRow(const Eigen::MatrixBase<Derived>& x)
41 {
42 cout << x.row(0) << endl;
43 }
44 * \endcode
45 *
46 * This class can be extended with the help of the plugin mechanism described on the page
47 * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN.
48 *
49 * \sa \blank \ref TopicClassHierarchy
50 */
51template <typename Derived>
52class MatrixBase : public DenseBase<Derived> {
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::ColsAtCompileTime;
64 using Base::Flags;
65 using Base::IsVectorAtCompileTime;
66 using Base::MaxColsAtCompileTime;
67 using Base::MaxRowsAtCompileTime;
68 using Base::MaxSizeAtCompileTime;
69 using Base::RowsAtCompileTime;
70 using Base::SizeAtCompileTime;
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
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#ifndef EIGEN_PARSED_BY_DOXYGEN
95 typedef Matrix<Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime),
96 internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)>
97 SquareMatrixType;
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;
106#ifndef EIGEN_PARSED_BY_DOXYGEN
108 typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> ConstantReturnType;
110 typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
112 ConstTransposeReturnType>
113 AdjointReturnType;
114 /** \internal Return type of eigenvalues() */
115 typedef Matrix<internal::make_complex_t<Scalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor>
116 EigenvaluesReturnType;
118 typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>, PlainObject> IdentityReturnType;
121 internal::traits<Derived>::RowsAtCompileTime, internal::traits<Derived>::ColsAtCompileTime>
122 BasisReturnType;
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
139 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const MatrixBase& other);
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);
147 template <typename OtherDerived>
148 EIGEN_DEVICE_FUNC Derived& operator=(const EigenBase<OtherDerived>& other);
149
150 template <typename OtherDerived>
151 EIGEN_DEVICE_FUNC Derived& operator=(const ReturnByValue<OtherDerived>& other);
152
153 template <typename OtherDerived>
154 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const MatrixBase<OtherDerived>& other);
155 template <typename OtherDerived>
156 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const MatrixBase<OtherDerived>& other);
157
158 template <typename OtherDerived>
159 EIGEN_DEVICE_FUNC const Product<Derived, OtherDerived> operator*(const MatrixBase<OtherDerived>& other) const;
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
187 EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
188 EIGEN_DEVICE_FUNC RealScalar norm() const;
189 RealScalar stableNorm() const;
190 RealScalar blueNorm() const;
191 RealScalar hypotNorm() const;
192 EIGEN_DEVICE_FUNC const PlainObject normalized() const;
193 EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const;
194 EIGEN_DEVICE_FUNC void normalize();
195 EIGEN_DEVICE_FUNC void stableNormalize();
196
197 EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
198 EIGEN_DEVICE_FUNC void adjointInPlace();
200 typedef Diagonal<Derived> DiagonalReturnType;
201 EIGEN_DEVICE_FUNC DiagonalReturnType diagonal();
202
203 typedef Diagonal<const Derived> ConstDiagonalReturnType;
204 EIGEN_DEVICE_FUNC const ConstDiagonalReturnType diagonal() const;
205
206 template <int Index>
207 EIGEN_DEVICE_FUNC Diagonal<Derived, Index> diagonal();
208
209 template <int Index>
210 EIGEN_DEVICE_FUNC const Diagonal<const Derived, Index> diagonal() const;
211
213 EIGEN_DEVICE_FUNC const Diagonal<const Derived, DynamicIndex> diagonal(Index index) const;
214
215 template <unsigned int Mode>
216 struct TriangularViewReturnType {
218 };
219 template <unsigned int Mode>
220 struct ConstTriangularViewReturnType {
221 typedef const TriangularView<const Derived, Mode> Type;
222 };
223
224 template <unsigned int Mode>
225 EIGEN_DEVICE_FUNC typename TriangularViewReturnType<Mode>::Type triangularView();
226 template <unsigned int Mode>
227 EIGEN_DEVICE_FUNC typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
228
229 template <unsigned int UpLo>
230 struct SelfAdjointViewReturnType {
232 };
233 template <unsigned int UpLo>
234 struct ConstSelfAdjointViewReturnType {
235 typedef const SelfAdjointView<const Derived, UpLo> Type;
236 };
237
238 template <unsigned int UpLo>
239 EIGEN_DEVICE_FUNC typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
240 template <unsigned int UpLo>
241 EIGEN_DEVICE_FUNC typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
242
244 const Scalar& m_reference = Scalar(0),
245 const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
246 EIGEN_DEVICE_FUNC static const IdentityReturnType Identity();
247 EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols);
248 EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i);
249 EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i);
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
255 EIGEN_DEVICE_FUNC const DiagonalWrapper<const Derived> asDiagonal() const;
256 const PermutationWrapper<const Derived> asPermutation() const;
258
259 EIGEN_DEVICE_FUNC Derived& setIdentity();
260 EIGEN_DEVICE_FUNC Derived& setIdentity(Index rows, Index cols);
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
267 bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
268 bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
269
270 bool isSkewSymmetric(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
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
310 EIGEN_DEVICE_FUNC Scalar trace() const;
311
312 template <int p>
313 EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
314
315 EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
316 EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
317
320 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
323 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const {
324 return ArrayWrapper<const Derived>(derived());
325 }
326
328
329 template <typename PermutationIndex = DefaultPermutationIndex>
330 inline const FullPivLU<PlainObject, PermutationIndex> fullPivLu() const;
331 template <typename PermutationIndex = DefaultPermutationIndex>
332 inline const PartialPivLU<PlainObject, PermutationIndex> partialPivLu() const;
333
334 template <typename PermutationIndex = DefaultPermutationIndex>
335 inline const PartialPivLU<PlainObject, PermutationIndex> lu() const;
336
337 EIGEN_DEVICE_FUNC inline const Inverse<Derived> inverse() const;
338
339 template <typename ResultType>
341 ResultType& inverse, typename ResultType::Scalar& determinant, bool& invertible,
342 const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
343
344 template <typename ResultType>
346 ResultType& inverse, bool& invertible,
347 const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
348
349 EIGEN_DEVICE_FUNC Scalar determinant() const;
350
352
353 inline const LLT<PlainObject> llt() const;
354 inline const LDLT<PlainObject> ldlt() const;
355
357
359 template <typename PermutationIndex = DefaultPermutationIndex>
360 inline const ColPivHouseholderQR<PlainObject, PermutationIndex> colPivHouseholderQr() const;
361 template <typename PermutationIndex = DefaultPermutationIndex>
362 inline const FullPivHouseholderQR<PlainObject, PermutationIndex> fullPivHouseholderQr() const;
363 template <typename PermutationIndex = DefaultPermutationIndex>
364 inline const CompleteOrthogonalDecomposition<PlainObject, PermutationIndex> completeOrthogonalDecomposition() const;
365
367
368 inline EigenvaluesReturnType eigenvalues() const;
369 inline RealScalar operatorNorm() const;
370
372
373 template <int Options = 0>
374 inline JacobiSVD<PlainObject, Options> jacobiSvd() const;
375 template <int Options = 0>
376 EIGEN_DEPRECATED_WITH_REASON("Options should be specified using method's template parameter.")
377 inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
378
379 template <int Options = 0>
380 inline BDCSVD<PlainObject, Options> bdcSvd() const;
381 template <int Options = 0>
382 EIGEN_DEPRECATED_WITH_REASON("Options should be specified using method's template parameter.")
383 inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
384
386
387 template <typename OtherDerived>
388 EIGEN_DEVICE_FUNC inline typename internal::cross_impl<Derived, OtherDerived>::return_type cross(
389 const MatrixBase<OtherDerived>& other) const;
390
391 template <typename OtherDerived>
392 EIGEN_DEVICE_FUNC inline PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
393
394 EIGEN_DEVICE_FUNC inline PlainObject unitOrthogonal(void) const;
395
396 EIGEN_DEPRECATED_WITH_REASON("Use .canonicalEulerAngles() instead.")
397 EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> eulerAngles(Index a0, Index a1, Index a2) const;
398
399 EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> canonicalEulerAngles(Index a0, Index a1, Index a2) const;
400
401 // put this as separate enum value to work around possible GCC 4.3 bug (?)
402 enum {
403 HomogeneousReturnTypeDirection =
405 ? ((internal::traits<Derived>::Flags & RowMajorBit) == RowMajorBit ? Horizontal : Vertical)
407 : Horizontal
408 };
409 typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
410 EIGEN_DEVICE_FUNC inline HomogeneousReturnType homogeneous() const;
411
412 enum { SizeMinusOne = SizeAtCompileTime == Dynamic ? Dynamic : SizeAtCompileTime - 1 };
414 internal::traits<Derived>::ColsAtCompileTime == 1 ? 1 : SizeMinusOne>
415 ConstStartMinusOne;
416 typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType;
417 EIGEN_DEVICE_FUNC inline const HNormalizedReturnType hnormalized() const;
418
420
421 EIGEN_DEVICE_FUNC void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
422 template <typename EssentialPart>
423 EIGEN_DEVICE_FUNC void makeHouseholder(EssentialPart& essential, Scalar& tau, RealScalar& beta) const;
424 template <typename EssentialPart>
425 EIGEN_DEVICE_FUNC void applyHouseholderOnTheLeft(const EssentialPart& essential, const Scalar& tau,
426 Scalar* workspace);
427 template <typename EssentialPart>
428 EIGEN_DEVICE_FUNC void applyHouseholderOnTheRight(const EssentialPart& essential, const Scalar& tau,
429 Scalar* workspace);
430
432
433 template <typename OtherScalar>
434 EIGEN_DEVICE_FUNC void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
435 template <typename OtherScalar>
436 EIGEN_DEVICE_FUNC void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
437
439
440 template <typename OtherDerived>
441 EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
442 cwiseProduct(const SparseMatrixBase<OtherDerived>& other) const {
443 return other.cwiseProduct(derived());
444 }
445
447
448 typedef typename internal::stem_function<Scalar>::type StemFunction;
449#define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
450 \
453 const ReturnType<Derived> Name() const;
454#define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
455 \
458 const ReturnType<Derived> Name(Argument) const;
460 EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential)
463 const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
464 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine)
465 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine)
466 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine)
467 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine)
468 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine)
469 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine)
470 EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine)
471 EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root)
472 EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm)
473 EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue, pow, power to \c p, const RealScalar& p)
474 EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const internal::make_complex_t<Scalar>& p)
475
476 protected:
477 EIGEN_DEFAULT_COPY_CONSTRUCTOR(MatrixBase)
478 EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MatrixBase)
479
480 private:
481 EIGEN_DEVICE_FUNC explicit MatrixBase(int);
482 EIGEN_DEVICE_FUNC MatrixBase(int, int);
483 template <typename OtherDerived>
484 EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
485
486 protected:
487 // mixing arrays and matrices is not legal
488 template <typename OtherDerived>
489 Derived& operator+=(const ArrayBase<OtherDerived>&) {
490 EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
491 YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
492 return *this;
493 }
494 // mixing arrays and matrices is not legal
495 template <typename OtherDerived>
496 Derived& operator-=(const ArrayBase<OtherDerived>&) {
497 EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
498 YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
499 return *this;
500 }
501};
502
503/***************************************************************************
504 * Implementation of matrix base methods
505 ***************************************************************************/
506
512 * Output: \verbinclude MatrixBase_applyOnTheRight.out
513 */
514template <typename Derived>
515template <typename OtherDerived>
516inline Derived& MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived>& other) {
517 other.derived().applyThisOnTheRight(derived());
518 return derived();
519}
520
524 * Output: \verbinclude MatrixBase_applyOnTheRight.out
525 */
526template <typename Derived>
527template <typename OtherDerived>
529 other.derived().applyThisOnTheRight(derived());
530}
531
535 * Output: \verbinclude MatrixBase_applyOnTheLeft.out
536 */
537template <typename Derived>
538template <typename OtherDerived>
540 other.derived().applyThisOnTheLeft(derived());
541}
542
543} // end namespace Eigen
544
545#endif // EIGEN_MATRIXBASE_H
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
internal::traits< Derived >::StorageIndex StorageIndex
The type used to store indices.
Definition DenseBase.h:59
internal::traits< Derived >::Scalar Scalar
Definition DenseBase.h:62
@ SizeAtCompileTime
Definition DenseBase.h:108
@ ColsAtCompileTime
Definition DenseBase.h:102
@ RowsAtCompileTime
Definition DenseBase.h:96
constexpr DenseBase()=default
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
static const BasisReturnType UnitY()
Definition CwiseNullaryOp.h:911
bool operator!=(const MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:291
void stableNormalize()
Definition Dot.h:156
const LDLT< PlainObject > ldlt() const
Definition LDLT.h:643
const SkewSymmetricWrapper< const Derived > asSkewSymmetric() const
Definition SkewSymmetricMatrix3.h:311
RealScalar operatorNorm() const
Computes the L2 operator norm.
Definition MatrixBaseEigenvalues.h:111
Derived & operator-=(const MatrixBase< OtherDerived > &other)
Definition CwiseBinaryOp.h:148
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > matrixFunction(StemFunction f) const
void computeInverseWithCheck(ResultType &inverse, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition InverseImpl.h:343
void makeHouseholder(EssentialPart &essential, Scalar &tau, RealScalar &beta) const
Definition Householder.h:65
const MatrixLogarithmReturnValue< MatrixWrapper< ExpressionType > > log() const
const DiagonalWrapper< const Derived > asDiagonal() const
Definition DiagonalMatrix.h:347
const Product< Derived, SkewDerived, LazyProduct > operator*(const SkewSymmetricBase< SkewDerived > &skew) const
Definition SkewSymmetricMatrix3.h:328
Derived & setIdentity()
Definition CwiseNullaryOp.h:843
bool isLowerTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition TriangularMatrix.h:607
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > asinh() const
NoAlias< Derived, Eigen::MatrixBase > noalias()
Definition NoAlias.h:96
EigenvaluesReturnType eigenvalues() const
Computes the eigenvalues of a matrix.
Definition MatrixBaseEigenvalues.h:63
const Product< Derived, DiagonalDerived, LazyProduct > operator*(const DiagonalBase< DiagonalDerived > &diagonal) const
Definition DiagonalProduct.h:23
Derived & operator=(const MatrixBase &other)
Definition Assign.h:51
Derived & operator*=(const EigenBase< OtherDerived > &other)
Definition MatrixBase.h:512
const PlainObject stableNormalized() const
Definition Dot.h:133
void applyOnTheLeft(const EigenBase< OtherDerived > &other)
Definition MatrixBase.h:535
const MatrixExponentialReturnValue< MatrixWrapper< ExpressionType > > exp() const
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > cosh() const
void applyOnTheRight(const EigenBase< OtherDerived > &other)
Definition MatrixBase.h:524
RealScalar blueNorm() const
Definition StableNorm.h:198
const CwiseBinaryEqualReturnType< OtherDerived > cwiseEqual(const Eigen::MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:59
bool isIdentity(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition CwiseNullaryOp.h:800
void adjointInPlace()
Definition Transpose.h:350
Scalar trace() const
Definition Redux.h:529
RealScalar hypotNorm() const
Definition StableNorm.h:208
const PlainObject normalized() const
Definition Dot.h:92
RealScalar stableNorm() const
Definition StableNorm.h:184
ArrayWrapper< Derived > array()
Definition MatrixBase.h:320
RealScalar lpNorm() const
Definition Dot.h:224
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > atanh() const
const Inverse< Derived > inverse() const
Definition InverseImpl.h:279
ScalarBinaryOpTraits< typenameinternal::traits< Derived >::Scalar, typenameinternal::traits< OtherDerived >::Scalar >::ReturnType dot(const MatrixBase< OtherDerived > &other) const
Definition Dot.h:52
void computeInverseAndDetWithCheck(ResultType &inverse, typename ResultType::Scalar &determinant, bool &invertible, const RealScalar &absDeterminantThreshold=NumTraits< Scalar >::dummy_precision()) const
Definition InverseImpl.h:307
bool operator==(const MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:282
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > sin() const
static const BasisReturnType UnitX()
Definition CwiseNullaryOp.h:899
bool isUnitary(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Dot.h:256
void applyHouseholderOnTheLeft(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition Householder.h:105
const Diagonal< const Derived, DynamicIndex > diagonal(Index index) const
Definition Diagonal.h:189
Derived & setUnit(Index newSize, Index i)
Resizes to the given newSize, and writes the i-th unit (basis) vector into *this.
Definition CwiseNullaryOp.h:966
const LLT< PlainObject > llt() const
Definition LLT.h:498
bool isDiagonal(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition DiagonalMatrix.h:360
const ConstDiagonalReturnType diagonal() const
Definition Diagonal.h:166
Derived & setIdentity(Index rows, Index cols)
Resizes to the given size, and writes the identity expression (not necessarily square) into *this.
Definition CwiseNullaryOp.h:858
Derived & operator+=(const MatrixBase< OtherDerived > &other)
Definition CwiseBinaryOp.h:159
static const IdentityReturnType Identity()
Definition CwiseNullaryOp.h:785
const HouseholderQR< PlainObject > householderQr() const
Definition HouseholderQR.h:537
const MatrixPowerReturnValue< MatrixWrapper< ExpressionType > > pow(const RealScalar &p) const
static const BasisReturnType Unit(Index i)
Definition CwiseNullaryOp.h:885
void applyOnTheRight(Index p, Index q, const JacobiRotation< OtherScalar > &j)
Definition Jacobi.h:276
const ArrayWrapper< const Derived > array() const
Definition MatrixBase.h:323
const MatrixSquareRootReturnValue< MatrixWrapper< ExpressionType > > sqrt() const
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > sinh() const
bool isSkewSymmetric(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition SkewSymmetricMatrix3.h:319
static const BasisReturnType UnitZ()
Definition CwiseNullaryOp.h:923
bool isUpperTriangular(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition TriangularMatrix.h:585
void applyHouseholderOnTheRight(const EssentialPart &essential, const Scalar &tau, Scalar *workspace)
Definition Householder.h:137
Index diagonalSize() const
Definition MatrixBase.h:102
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > cos() const
RealScalar squaredNorm() const
Definition Dot.h:66
static const BasisReturnType Unit(Index size, Index i)
Definition CwiseNullaryOp.h:870
Derived & setUnit(Index i)
Set the coefficients of *this to the i-th unit (basis) vector.
Definition CwiseNullaryOp.h:948
const MatrixFunctionReturnValue< MatrixWrapper< ExpressionType > > acosh() const
static const IdentityReturnType Identity(Index rows, Index cols)
Definition CwiseNullaryOp.h:769
void normalize()
Definition Dot.h:113
const Derived & forceAlignedAccess() const
Definition MatrixBase.h:299
RealScalar norm() const
Definition Dot.h:78
const Product< Derived, OtherDerived, LazyProduct > lazyProduct(const MatrixBase< OtherDerived > &other) const
Definition GeneralProduct.h:497
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
Definition GeneralProduct.h:455
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > cwiseProduct(const Eigen::MatrixBase< OtherDerived > &other) const
Definition MatrixBase.h:23
void applyOnTheLeft(Index p, Index q, const JacobiRotation< OtherScalar > &j)
Definition Jacobi.h:261
void makeHouseholderInPlace(Scalar &tau, RealScalar &beta)
Definition Householder.h:43
bool isOrthogonal(const MatrixBase< OtherDerived > &other, const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
Definition Dot.h:238
static const BasisReturnType UnitW()
Definition CwiseNullaryOp.h:935
const AdjointReturnType adjoint() const
Definition Transpose.h:197
Derived & forceAlignedAccess()
Definition MatrixBase.h:300
The matrix class, also used for vectors and row-vectors.
Definition 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:453
Expression of the product of two arbitrary matrices or vectors.
Definition Product.h:202
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
const CwiseBinaryOp< internal::scalar_product_op< Derived ::Scalar, OtherDerived ::Scalar >, const Derived, const OtherDerived > cwiseProduct(const Eigen::SparseMatrixBase< OtherDerived > &other) const
Definition SparseMatrixBase.h:23
Expression of a dense or sparse matrix with zero or too small values removed.
Definition SparseView.h:45
Expression of a triangular part in a matrix.
Definition TriangularMatrix.h:167
Matrix< Scalar, 3, 1 > eulerAngles(Index a0, Index a1, Index a2) const
PlainObject cross3(const MatrixBase< OtherDerived > &other) const
internal::cross_impl< MatrixWrapper< ExpressionType >, OtherDerived >::return_type cross(const MatrixBase< OtherDerived > &other) const
const HNormalizedReturnType hnormalized() const
homogeneous normalization
Definition Homogeneous.h:164
HomogeneousReturnType homogeneous() const
Definition Homogeneous.h:124
Matrix< Scalar, 3, 1 > canonicalEulerAngles(Index a0, Index a1, Index a2) const
const SparseView< Derived > sparseView(const Scalar &m_reference=Scalar(0), const typename NumTraits< Scalar >::Real &m_epsilon=NumTraits< Scalar >::dummy_precision()) const
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
Namespace containing all symbols from the Eigen library.
Definition B01_Experimental.dox:1
EIGEN_DEPRECATED_WITH_REASON("Initialization is no longer needed.") inline void initParallel()
Definition Parallelizer.h:50
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_square_op< typename Derived::Scalar >, const Derived > square(const Eigen::ArrayBase< Derived > &x)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:82
const int Dynamic
Definition Constants.h:25
Definition EigenBase.h:33
constexpr Derived & derived()
Definition EigenBase.h:49
Determines whether the given binary operation of two numeric types is allowed and what the scalar ret...
Definition XprHelper.h:1047