2007-10-12 05:15:25 +00:00
|
|
|
// This file is part of Eigen, a lightweight C++ template library
|
2009-05-22 20:25:33 +02:00
|
|
|
// for linear algebra.
|
2007-09-05 10:42:15 +00:00
|
|
|
//
|
2009-06-28 21:27:37 +02:00
|
|
|
// Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
|
2010-06-24 23:21:58 +02:00
|
|
|
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
|
2007-09-05 10:42:15 +00:00
|
|
|
//
|
2012-07-13 14:42:47 -04:00
|
|
|
// This Source Code Form is subject to the terms of the Mozilla
|
|
|
|
|
// Public License v. 2.0. If a copy of the MPL was not distributed
|
|
|
|
|
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2007-09-05 10:42:15 +00:00
|
|
|
|
2007-11-28 15:34:40 +00:00
|
|
|
#ifndef EIGEN_MATRIXBASE_H
|
|
|
|
|
#define EIGEN_MATRIXBASE_H
|
2007-09-05 10:42:15 +00:00
|
|
|
|
2023-08-21 16:25:22 +00:00
|
|
|
// IWYU pragma: private
|
2021-09-10 19:12:26 +00:00
|
|
|
#include "./InternalHeaderCheck.h"
|
|
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
namespace Eigen {
|
|
|
|
|
|
2007-12-19 09:30:53 +00:00
|
|
|
/** \class MatrixBase
|
2010-07-06 13:10:08 +01:00
|
|
|
* \ingroup Core_Module
|
2007-12-19 09:30:53 +00:00
|
|
|
*
|
2009-11-16 18:19:08 +01:00
|
|
|
* \brief Base class for all dense matrices, vectors, and expressions
|
2007-12-19 09:30:53 +00:00
|
|
|
*
|
2010-01-04 19:00:16 +01:00
|
|
|
* This class is the base that is inherited by all matrix, vector, and related expression
|
|
|
|
|
* types. Most of the Eigen API is contained in this class, and its base classes. Other important
|
|
|
|
|
* classes for the Eigen API are Matrix, and VectorwiseOp.
|
2008-07-26 23:05:44 +00:00
|
|
|
*
|
2010-06-19 23:00:22 +02:00
|
|
|
* Note that some methods are defined in other modules such as the \ref LU_Module LU module
|
|
|
|
|
* for all functions related to matrix inversions.
|
2007-12-19 09:30:53 +00:00
|
|
|
*
|
2011-02-13 22:50:57 +00:00
|
|
|
* \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc.
|
2007-12-19 09:30:53 +00:00
|
|
|
*
|
|
|
|
|
* When writing a function taking Eigen objects as argument, if you want your function
|
|
|
|
|
* to take as argument any matrix, vector, or expression, just let it take a
|
|
|
|
|
* MatrixBase argument. As an example, here is a function printFirstRow which, given
|
|
|
|
|
* a matrix, vector, or expression \a x, prints the first row of \a x.
|
|
|
|
|
*
|
|
|
|
|
* \code
|
2008-03-10 17:23:11 +00:00
|
|
|
template<typename Derived>
|
|
|
|
|
void printFirstRow(const Eigen::MatrixBase<Derived>& x)
|
2007-12-19 09:30:53 +00:00
|
|
|
{
|
|
|
|
|
cout << x.row(0) << endl;
|
|
|
|
|
}
|
|
|
|
|
* \endcode
|
2010-08-22 18:28:19 +01:00
|
|
|
*
|
2011-02-13 22:50:57 +00:00
|
|
|
* This class can be extended with the help of the plugin mechanism described on the page
|
2016-08-30 11:10:08 +02:00
|
|
|
* \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN.
|
2011-02-13 22:50:57 +00:00
|
|
|
*
|
2015-12-30 16:45:44 +01:00
|
|
|
* \sa \blank \ref TopicClassHierarchy
|
2007-12-19 09:30:53 +00:00
|
|
|
*/
|
2008-06-19 17:33:57 +00:00
|
|
|
template <typename Derived>
|
2009-12-04 23:17:14 +01:00
|
|
|
class MatrixBase : public DenseBase<Derived> {
|
2007-09-05 10:42:15 +00:00
|
|
|
public:
|
2008-12-07 15:40:40 +00:00
|
|
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
2009-11-17 16:04:19 +01:00
|
|
|
typedef MatrixBase StorageBaseType;
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef typename internal::traits<Derived>::StorageKind StorageKind;
|
2015-02-13 18:57:41 +01:00
|
|
|
typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef typename internal::traits<Derived>::Scalar Scalar;
|
|
|
|
|
typedef typename internal::packet_traits<Scalar>::type PacketScalar;
|
2010-05-30 16:00:58 -04:00
|
|
|
typedef typename NumTraits<Scalar>::Real RealScalar;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-12-04 23:17:14 +01:00
|
|
|
typedef DenseBase<Derived> Base;
|
2009-12-16 19:18:40 +01:00
|
|
|
using Base::ColsAtCompileTime;
|
|
|
|
|
using Base::Flags;
|
|
|
|
|
using Base::IsVectorAtCompileTime;
|
|
|
|
|
using Base::MaxColsAtCompileTime;
|
|
|
|
|
using Base::MaxRowsAtCompileTime;
|
|
|
|
|
using Base::MaxSizeAtCompileTime;
|
|
|
|
|
using Base::RowsAtCompileTime;
|
|
|
|
|
using Base::SizeAtCompileTime;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-12-04 23:17:14 +01:00
|
|
|
using Base::coeff;
|
|
|
|
|
using Base::coeffRef;
|
2009-12-16 19:18:40 +01:00
|
|
|
using Base::cols;
|
|
|
|
|
using Base::const_cast_derived;
|
2009-12-04 23:17:14 +01:00
|
|
|
using Base::derived;
|
|
|
|
|
using Base::eval;
|
2009-12-16 19:18:40 +01:00
|
|
|
using Base::lazyAssign;
|
2010-01-04 19:00:16 +01:00
|
|
|
using Base::rows;
|
2009-12-04 23:17:14 +01:00
|
|
|
using Base::size;
|
2017-01-02 22:27:07 +01:00
|
|
|
using Base::operator-;
|
2009-12-16 19:18:40 +01:00
|
|
|
using Base::operator+=;
|
|
|
|
|
using Base::operator-=;
|
|
|
|
|
using Base::operator*=;
|
|
|
|
|
using Base::operator/=;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-12-16 19:18:40 +01:00
|
|
|
typedef typename Base::CoeffReturnType CoeffReturnType;
|
2010-12-22 17:45:37 -05:00
|
|
|
typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
|
2010-01-04 19:00:16 +01:00
|
|
|
typedef typename Base::RowXpr RowXpr;
|
|
|
|
|
typedef typename Base::ColXpr ColXpr;
|
2008-12-07 15:40:40 +00:00
|
|
|
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
2008-03-03 11:02:52 +00:00
|
|
|
|
2008-12-07 15:40:40 +00:00
|
|
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
2008-07-19 13:03:23 +00:00
|
|
|
/** type of the equivalent square matrix */
|
2021-12-10 19:27:01 +00:00
|
|
|
typedef Matrix<Scalar, internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime),
|
|
|
|
|
internal::max_size_prefer_dynamic(RowsAtCompileTime, ColsAtCompileTime)>
|
|
|
|
|
SquareMatrixType;
|
2008-12-07 15:40:40 +00:00
|
|
|
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
2008-07-19 13:03:23 +00:00
|
|
|
|
2009-05-10 16:24:39 +00:00
|
|
|
/** \returns the size of the main diagonal, which is min(rows(),cols()).
|
|
|
|
|
* \sa rows(), cols(), SizeAtCompileTime. */
|
2016-09-14 14:06:21 -07:00
|
|
|
EIGEN_DEVICE_FUNC inline Index diagonalSize() const { return (numext::mini)(rows(), cols()); }
|
2009-09-26 11:40:29 -04:00
|
|
|
|
2015-06-22 10:52:08 +02:00
|
|
|
typedef typename Base::PlainObject PlainObject;
|
2009-04-01 00:39:56 +00:00
|
|
|
|
2010-01-14 10:10:07 +01:00
|
|
|
#ifndef EIGEN_PARSED_BY_DOXYGEN
|
2008-12-18 20:36:25 +00:00
|
|
|
/** \internal Represents a matrix with all coefficients equal to one another*/
|
2015-06-22 10:52:08 +02:00
|
|
|
typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>, PlainObject> ConstantReturnType;
|
2008-07-29 16:33:07 +00:00
|
|
|
/** \internal the return type of MatrixBase::adjoint() */
|
2022-03-16 16:43:40 +00:00
|
|
|
typedef std::conditional_t<NumTraits<Scalar>::IsComplex,
|
|
|
|
|
CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, ConstTransposeReturnType>,
|
|
|
|
|
ConstTransposeReturnType>
|
|
|
|
|
AdjointReturnType;
|
2010-05-24 17:43:50 +01:00
|
|
|
/** \internal Return type of eigenvalues() */
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor>
|
|
|
|
|
EigenvaluesReturnType;
|
2008-07-29 16:33:07 +00:00
|
|
|
/** \internal the return type of identity */
|
2015-06-22 10:52:08 +02:00
|
|
|
typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>, PlainObject> IdentityReturnType;
|
2008-07-29 16:33:07 +00:00
|
|
|
/** \internal the return type of unit vectors */
|
2011-02-05 15:53:17 +01:00
|
|
|
typedef Block<const CwiseNullaryOp<internal::scalar_identity_op<Scalar>, SquareMatrixType>,
|
2010-10-25 10:15:22 -04:00
|
|
|
internal::traits<Derived>::RowsAtCompileTime, internal::traits<Derived>::ColsAtCompileTime>
|
|
|
|
|
BasisReturnType;
|
2008-12-07 15:40:40 +00:00
|
|
|
#endif // not EIGEN_PARSED_BY_DOXYGEN
|
2008-03-03 10:52:44 +00:00
|
|
|
|
2009-12-17 10:00:35 +01:00
|
|
|
#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
|
2016-09-16 10:40:50 +02:00
|
|
|
#define EIGEN_DOC_UNARY_ADDONS(X, Y)
|
2023-08-21 16:26:11 +00:00
|
|
|
#include "../plugins/CommonCwiseBinaryOps.inc"
|
|
|
|
|
#include "../plugins/MatrixCwiseUnaryOps.inc"
|
|
|
|
|
#include "../plugins/MatrixCwiseBinaryOps.inc"
|
2009-12-17 10:00:35 +01:00
|
|
|
#ifdef EIGEN_MATRIXBASE_PLUGIN
|
|
|
|
|
#include EIGEN_MATRIXBASE_PLUGIN
|
|
|
|
|
#endif
|
|
|
|
|
#undef EIGEN_CURRENT_STORAGE_BASE_CLASS
|
2016-09-16 10:40:50 +02:00
|
|
|
#undef EIGEN_DOC_UNARY_ADDONS
|
2008-03-14 10:38:37 +00:00
|
|
|
|
2008-01-07 09:34:21 +00:00
|
|
|
/** Special case of the template operator=, in order to prevent the compiler
|
|
|
|
|
* from generating a default operator= (issue hit with g++ 4.1)
|
|
|
|
|
*/
|
2009-06-28 21:27:37 +02:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const MatrixBase& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-06-14 23:02:49 +02:00
|
|
|
// We cannot inherit here via Base::operator= since it is causing
|
|
|
|
|
// trouble with MSVC.
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-06-14 23:02:49 +02:00
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator=(const DenseBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-06-14 14:33:10 +02:00
|
|
|
template <typename OtherDerived>
|
2010-06-14 23:02:49 +02:00
|
|
|
EIGEN_DEVICE_FUNC Derived& operator=(const EigenBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-06-14 23:02:49 +02:00
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC Derived& operator=(const ReturnByValue<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-03-14 10:38:37 +00:00
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator+=(const MatrixBase<OtherDerived>& other);
|
|
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE Derived& operator-=(const MatrixBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2013-02-07 19:06:14 +01:00
|
|
|
template <typename OtherDerived>
|
2013-11-07 16:38:14 +01:00
|
|
|
EIGEN_DEVICE_FUNC const Product<Derived, OtherDerived> operator*(const MatrixBase<OtherDerived>& other) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-02-09 14:34:31 +01:00
|
|
|
template <typename OtherDerived>
|
2013-12-03 17:17:53 +01:00
|
|
|
EIGEN_DEVICE_FUNC const Product<Derived, OtherDerived, LazyProduct> lazyProduct(
|
2010-02-09 14:34:31 +01:00
|
|
|
const MatrixBase<OtherDerived>& other) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-03-14 10:38:37 +00:00
|
|
|
template <typename OtherDerived>
|
2010-02-20 15:26:02 +01:00
|
|
|
Derived& operator*=(const EigenBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-09-16 14:35:42 +02:00
|
|
|
template <typename OtherDerived>
|
2010-02-20 15:26:02 +01:00
|
|
|
void applyOnTheLeft(const EigenBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-09-16 14:35:42 +02:00
|
|
|
template <typename OtherDerived>
|
2010-02-20 15:26:02 +01:00
|
|
|
void applyOnTheRight(const EigenBase<OtherDerived>& other);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2014-02-18 10:52:26 +01:00
|
|
|
template <typename DiagonalDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC const Product<Derived, DiagonalDerived, LazyProduct> operator*(
|
|
|
|
|
const DiagonalBase<DiagonalDerived>& diagonal) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-09-08 20:44:40 +00:00
|
|
|
template <typename SkewDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC const Product<Derived, SkewDerived, LazyProduct> operator*(
|
|
|
|
|
const SkewSymmetricBase<SkewDerived>& skew) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-09-08 20:44:40 +00:00
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,
|
|
|
|
|
typename internal::traits<OtherDerived>::Scalar>::ReturnType
|
|
|
|
|
dot(const MatrixBase<OtherDerived>& other) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
|
|
|
|
|
EIGEN_DEVICE_FUNC RealScalar norm() const;
|
|
|
|
|
RealScalar stableNorm() const;
|
2009-07-13 21:14:47 +02:00
|
|
|
RealScalar blueNorm() const;
|
2013-04-05 16:35:49 +02:00
|
|
|
RealScalar hypotNorm() const;
|
|
|
|
|
EIGEN_DEVICE_FUNC const PlainObject normalized() const;
|
|
|
|
|
EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const;
|
2016-01-23 22:40:11 +01:00
|
|
|
EIGEN_DEVICE_FUNC void normalize();
|
2013-04-05 16:35:49 +02:00
|
|
|
EIGEN_DEVICE_FUNC void stableNormalize();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2013-04-05 16:35:49 +02:00
|
|
|
EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
|
|
|
|
|
EIGEN_DEVICE_FUNC void adjointInPlace();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-12-22 17:45:37 -05:00
|
|
|
typedef Diagonal<Derived> DiagonalReturnType;
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC DiagonalReturnType diagonal();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-12-22 17:45:37 -05:00
|
|
|
typedef Diagonal<const Derived> ConstDiagonalReturnType;
|
2022-04-08 18:05:32 +00:00
|
|
|
EIGEN_DEVICE_FUNC const ConstDiagonalReturnType diagonal() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-04-08 18:05:32 +00:00
|
|
|
template <int Index>
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC Diagonal<Derived, Index> diagonal();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-04-08 18:05:32 +00:00
|
|
|
template <int Index>
|
|
|
|
|
EIGEN_DEVICE_FUNC const Diagonal<const Derived, Index> diagonal() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-04-08 18:05:32 +00:00
|
|
|
EIGEN_DEVICE_FUNC Diagonal<Derived, DynamicIndex> diagonal(Index index);
|
2013-07-31 15:30:50 +02:00
|
|
|
EIGEN_DEVICE_FUNC const Diagonal<const Derived, DynamicIndex> diagonal(Index index) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-04-08 18:05:32 +00:00
|
|
|
template <unsigned int Mode>
|
|
|
|
|
struct TriangularViewReturnType {
|
|
|
|
|
typedef TriangularView<Derived, Mode> Type;
|
2023-11-29 11:12:48 +00:00
|
|
|
};
|
2022-04-08 18:05:32 +00:00
|
|
|
template <unsigned int Mode>
|
|
|
|
|
struct ConstTriangularViewReturnType {
|
|
|
|
|
typedef const TriangularView<const Derived, Mode> Type;
|
2010-12-22 17:45:37 -05:00
|
|
|
};
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-12-22 17:45:37 -05:00
|
|
|
template <unsigned int Mode>
|
|
|
|
|
EIGEN_DEVICE_FUNC typename TriangularViewReturnType<Mode>::Type triangularView();
|
|
|
|
|
template <unsigned int Mode>
|
|
|
|
|
EIGEN_DEVICE_FUNC typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2013-08-01 16:26:57 +02:00
|
|
|
template <unsigned int UpLo>
|
|
|
|
|
struct SelfAdjointViewReturnType {
|
2010-12-22 17:45:37 -05:00
|
|
|
typedef SelfAdjointView<Derived, UpLo> Type;
|
|
|
|
|
};
|
|
|
|
|
template <unsigned int UpLo>
|
|
|
|
|
struct ConstSelfAdjointViewReturnType {
|
|
|
|
|
typedef const SelfAdjointView<const Derived, UpLo> Type;
|
|
|
|
|
};
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-12-22 17:45:37 -05:00
|
|
|
template <unsigned int UpLo>
|
2013-08-01 16:26:57 +02:00
|
|
|
EIGEN_DEVICE_FUNC typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
|
|
|
|
|
template <unsigned int UpLo>
|
|
|
|
|
EIGEN_DEVICE_FUNC typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-06-15 10:26:12 +02:00
|
|
|
const SparseView<Derived> sparseView(
|
|
|
|
|
const Scalar& m_reference = Scalar(0),
|
2012-06-28 02:08:59 +02:00
|
|
|
const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC static const IdentityReturnType Identity();
|
|
|
|
|
EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols);
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i);
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i);
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType UnitX();
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType UnitY();
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
|
|
|
|
|
EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2011-01-23 21:53:28 -05:00
|
|
|
EIGEN_DEVICE_FUNC const DiagonalWrapper<const Derived> asDiagonal() const;
|
2011-01-26 16:33:23 +01:00
|
|
|
const PermutationWrapper<const Derived> asPermutation() const;
|
2022-09-08 20:44:40 +00:00
|
|
|
EIGEN_DEVICE_FUNC const SkewSymmetricWrapper<const Derived> asSkewSymmetric() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-01-11 15:08:04 +00:00
|
|
|
EIGEN_DEVICE_FUNC Derived& setIdentity();
|
2013-08-01 16:26:57 +02:00
|
|
|
EIGEN_DEVICE_FUNC Derived& setIdentity(Index rows, Index cols);
|
2010-05-30 16:00:58 -04:00
|
|
|
EIGEN_DEVICE_FUNC Derived& setUnit(Index i);
|
2017-08-22 16:48:07 +02:00
|
|
|
EIGEN_DEVICE_FUNC Derived& setUnit(Index newSize, Index i);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2017-08-22 16:48:07 +02:00
|
|
|
bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2012-06-28 02:08:59 +02:00
|
|
|
bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2012-06-28 02:08:59 +02:00
|
|
|
bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
|
|
|
|
bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2012-06-28 02:08:59 +02:00
|
|
|
bool isSkewSymmetric(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2012-06-28 02:08:59 +02:00
|
|
|
template <typename OtherDerived>
|
2022-09-08 20:44:40 +00:00
|
|
|
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
|
|
|
|
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2012-06-28 02:08:59 +02:00
|
|
|
bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2012-06-28 02:08:59 +02:00
|
|
|
/** \returns true if each coefficients of \c *this and \a other are all exactly equal.
|
2009-12-17 10:00:35 +01:00
|
|
|
* \warning When using floating point scalar values you probably should rather use a
|
|
|
|
|
* fuzzy comparison such as isApprox()
|
|
|
|
|
* \sa isApprox(), operator!= */
|
|
|
|
|
template <typename OtherDerived>
|
2008-04-03 18:13:27 +00:00
|
|
|
EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase<OtherDerived>& other) const {
|
2022-09-16 21:14:29 +00:00
|
|
|
return cwiseEqual(other).all();
|
2009-11-18 18:15:19 +01:00
|
|
|
}
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-12-17 10:00:35 +01:00
|
|
|
/** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other.
|
|
|
|
|
* \warning When using floating point scalar values you probably should rather use a
|
|
|
|
|
* fuzzy comparison such as isApprox()
|
|
|
|
|
* \sa isApprox(), operator== */
|
2008-04-03 18:13:27 +00:00
|
|
|
template <typename OtherDerived>
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase<OtherDerived>& other) const {
|
2010-01-18 08:18:48 +01:00
|
|
|
return cwiseNotEqual(other).any();
|
|
|
|
|
}
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2017-08-17 11:51:22 +02:00
|
|
|
NoAlias<Derived, Eigen::MatrixBase> EIGEN_DEVICE_FUNC noalias();
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2014-09-23 14:28:23 +02:00
|
|
|
// TODO forceAlignedAccess is temporarily disabled
|
2014-02-19 14:05:56 +01:00
|
|
|
// Need to find a nicer workaround.
|
|
|
|
|
inline const Derived& forceAlignedAccess() const { return derived(); }
|
|
|
|
|
inline Derived& forceAlignedAccess() { return derived(); }
|
|
|
|
|
template <bool Enable>
|
|
|
|
|
inline const Derived& forceAlignedAccessIf() const {
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
|
|
|
|
template <bool Enable>
|
|
|
|
|
inline Derived& forceAlignedAccessIf() {
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC Scalar trace() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2013-04-05 16:35:49 +02:00
|
|
|
template <int p>
|
|
|
|
|
EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2013-04-05 16:35:49 +02:00
|
|
|
EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
|
|
|
|
|
EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2012-12-24 13:33:22 +01:00
|
|
|
/** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix
|
2010-06-28 18:38:28 +01:00
|
|
|
* \sa ArrayBase::matrix() */
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
|
2014-03-04 17:24:00 +01:00
|
|
|
/** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix
|
|
|
|
|
* \sa ArrayBase::matrix() */
|
2022-09-16 21:14:29 +00:00
|
|
|
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const {
|
|
|
|
|
return ArrayWrapper<const Derived>(derived());
|
|
|
|
|
}
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-06-02 20:08:37 +00:00
|
|
|
/////////// LU module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2023-03-07 20:28:05 +00:00
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const FullPivLU<PlainObject, PermutationIndex> fullPivLu() const;
|
|
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const PartialPivLU<PlainObject, PermutationIndex> partialPivLu() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2023-03-07 20:28:05 +00:00
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const PartialPivLU<PlainObject, PermutationIndex> lu() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
EIGEN_DEVICE_FUNC inline const Inverse<Derived> inverse() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-10-06 09:26:28 -04:00
|
|
|
template <typename ResultType>
|
2015-10-22 16:10:28 +02:00
|
|
|
inline void computeInverseAndDetWithCheck(
|
2009-10-26 11:18:23 -04:00
|
|
|
ResultType& inverse, typename ResultType::Scalar& determinant, bool& invertible,
|
2010-02-10 10:52:28 +01:00
|
|
|
const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-10-26 14:16:50 -04:00
|
|
|
template <typename ResultType>
|
2015-10-22 16:10:28 +02:00
|
|
|
inline void computeInverseWithCheck(
|
2009-10-26 14:16:50 -04:00
|
|
|
ResultType& inverse, bool& invertible,
|
2010-02-10 10:52:28 +01:00
|
|
|
const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-04-14 17:07:12 +00:00
|
|
|
EIGEN_DEVICE_FUNC Scalar determinant() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-07-19 22:59:05 +00:00
|
|
|
/////////// Cholesky module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
inline const LLT<PlainObject> llt() const;
|
|
|
|
|
inline const LDLT<PlainObject> ldlt() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-06-02 20:08:37 +00:00
|
|
|
/////////// QR module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
inline const HouseholderQR<PlainObject> householderQr() const;
|
2023-01-13 03:23:17 +00:00
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const ColPivHouseholderQR<PlainObject, PermutationIndex> colPivHouseholderQr() const;
|
|
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const FullPivHouseholderQR<PlainObject, PermutationIndex> fullPivHouseholderQr() const;
|
|
|
|
|
template <typename PermutationIndex = DefaultPermutationIndex>
|
|
|
|
|
inline const CompleteOrthogonalDecomposition<PlainObject, PermutationIndex> completeOrthogonalDecomposition() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
/////////// Eigenvalues module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
inline EigenvaluesReturnType eigenvalues() const;
|
|
|
|
|
inline RealScalar operatorNorm() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-08-19 17:52:04 +00:00
|
|
|
/////////// SVD module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-02-02 00:15:44 +00:00
|
|
|
template <int Options = 0>
|
|
|
|
|
inline JacobiSVD<PlainObject, Options> jacobiSvd() const;
|
|
|
|
|
template <int Options = 0>
|
|
|
|
|
EIGEN_DEPRECATED inline JacobiSVD<PlainObject, Options> jacobiSvd(unsigned int computationOptions) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2022-02-02 00:15:44 +00:00
|
|
|
template <int Options = 0>
|
|
|
|
|
inline BDCSVD<PlainObject, Options> bdcSvd() const;
|
|
|
|
|
template <int Options = 0>
|
|
|
|
|
EIGEN_DEPRECATED inline BDCSVD<PlainObject, Options> bdcSvd(unsigned int computationOptions) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-06-03 07:32:12 +00:00
|
|
|
/////////// Geometry module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2008-06-03 07:32:12 +00:00
|
|
|
template <typename OtherDerived>
|
2022-11-15 22:39:42 +00:00
|
|
|
EIGEN_DEVICE_FUNC inline typename internal::cross_impl<Derived, OtherDerived>::return_type cross(
|
2011-01-27 11:33:37 +01:00
|
|
|
const MatrixBase<OtherDerived>& other) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-03-11 14:20:36 +00:00
|
|
|
template <typename OtherDerived>
|
2015-10-22 16:10:28 +02:00
|
|
|
EIGEN_DEVICE_FUNC inline PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-10-22 16:10:28 +02:00
|
|
|
EIGEN_DEVICE_FUNC inline PlainObject unitOrthogonal(void) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2023-04-27 00:06:23 +00:00
|
|
|
EIGEN_DEPRECATED EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> eulerAngles(Index a0, Index a1, Index a2) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2023-05-19 15:42:22 +00:00
|
|
|
EIGEN_DEVICE_FUNC inline Matrix<Scalar, 3, 1> canonicalEulerAngles(Index a0, Index a1, Index a2) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2011-01-24 11:21:58 -05:00
|
|
|
// put this as separate enum value to work around possible GCC 4.3 bug (?)
|
2015-06-08 15:40:51 +02:00
|
|
|
enum {
|
|
|
|
|
HomogeneousReturnTypeDirection =
|
|
|
|
|
ColsAtCompileTime == 1 && RowsAtCompileTime == 1
|
|
|
|
|
? ((internal::traits<Derived>::Flags & RowMajorBit) == RowMajorBit ? Horizontal : Vertical)
|
|
|
|
|
: ColsAtCompileTime == 1 ? Vertical
|
|
|
|
|
: Horizontal
|
|
|
|
|
};
|
2011-01-24 11:21:58 -05:00
|
|
|
typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
|
2015-10-22 16:10:28 +02:00
|
|
|
EIGEN_DEVICE_FUNC inline HomogeneousReturnType homogeneous() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-03-05 10:25:22 +00:00
|
|
|
enum { SizeMinusOne = SizeAtCompileTime == Dynamic ? Dynamic : SizeAtCompileTime - 1 };
|
2010-10-25 10:15:22 -04:00
|
|
|
typedef Block<const Derived, internal::traits<Derived>::ColsAtCompileTime == 1 ? SizeMinusOne : 1,
|
2010-12-22 17:45:37 -05:00
|
|
|
internal::traits<Derived>::ColsAtCompileTime == 1 ? 1 : SizeMinusOne>
|
|
|
|
|
ConstStartMinusOne;
|
2016-06-14 11:28:03 +02:00
|
|
|
typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne, Scalar, quotient) HNormalizedReturnType;
|
2015-10-22 16:10:28 +02:00
|
|
|
EIGEN_DEVICE_FUNC inline const HNormalizedReturnType hnormalized() const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-08-03 16:06:57 +02:00
|
|
|
////////// Householder module ///////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-11-10 21:22:20 -05:00
|
|
|
EIGEN_DEVICE_FUNC void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
|
2009-08-03 16:06:57 +02:00
|
|
|
template <typename EssentialPart>
|
2009-11-10 21:22:20 -05:00
|
|
|
EIGEN_DEVICE_FUNC void makeHouseholder(EssentialPart& essential, Scalar& tau, RealScalar& beta) const;
|
2009-08-03 16:06:57 +02:00
|
|
|
template <typename EssentialPart>
|
|
|
|
|
EIGEN_DEVICE_FUNC void applyHouseholderOnTheLeft(const EssentialPart& essential, const Scalar& tau,
|
2009-08-16 19:22:15 +02:00
|
|
|
Scalar* workspace);
|
2009-09-02 15:04:10 +02:00
|
|
|
template <typename EssentialPart>
|
2009-08-17 17:04:32 +02:00
|
|
|
EIGEN_DEVICE_FUNC void applyHouseholderOnTheRight(const EssentialPart& essential, const Scalar& tau,
|
2009-08-16 19:22:15 +02:00
|
|
|
Scalar* workspace);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-03-16 17:26:55 +00:00
|
|
|
///////// Jacobi module /////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-09-02 15:04:10 +02:00
|
|
|
template <typename OtherScalar>
|
2009-08-03 16:06:57 +02:00
|
|
|
EIGEN_DEVICE_FUNC void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
|
|
|
|
|
template <typename OtherScalar>
|
|
|
|
|
EIGEN_DEVICE_FUNC void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-08-09 16:58:13 +02:00
|
|
|
///////// SparseCore module /////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-09-02 15:04:10 +02:00
|
|
|
template <typename OtherDerived>
|
2010-10-19 21:56:26 -04:00
|
|
|
EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
|
|
|
|
|
cwiseProduct(const SparseMatrixBase<OtherDerived>& other) const {
|
|
|
|
|
return other.cwiseProduct(derived());
|
2023-11-29 11:12:48 +00:00
|
|
|
}
|
|
|
|
|
|
2015-11-04 17:42:07 +01:00
|
|
|
///////// MatrixFunctions module /////////
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2015-11-04 17:42:07 +01:00
|
|
|
typedef typename internal::stem_function<Scalar>::type StemFunction;
|
|
|
|
|
#define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
|
|
|
|
|
/** \returns an expression of the matrix Description of \c *this. \brief This function requires the <a \
|
|
|
|
|
* href="unsupported/group__MatrixFunctions__Module.html"> unsupported MatrixFunctions module</a>. To compute the \
|
|
|
|
|
* coefficient-wise Description use ArrayBase::##Name . */ \
|
|
|
|
|
const ReturnType<Derived> Name() const;
|
2018-10-19 21:10:28 +02:00
|
|
|
#define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
|
|
|
|
|
/** \returns an expression of the matrix Description of \c *this. \brief This function requires the <a \
|
|
|
|
|
* href="unsupported/group__MatrixFunctions__Module.html"> unsupported MatrixFunctions module</a>. To compute the \
|
|
|
|
|
* coefficient-wise Description use ArrayBase::##Name . */ \
|
|
|
|
|
const ReturnType<Derived> Name(Argument) const;
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2018-10-19 21:10:28 +02:00
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential)
|
|
|
|
|
/** \brief Helper function for the <a href="unsupported/group__MatrixFunctions__Module.html"> unsupported
|
|
|
|
|
* MatrixFunctions module</a>.*/
|
2010-03-16 17:26:55 +00:00
|
|
|
const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
|
2018-10-19 21:10:28 +02:00
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine)
|
2019-01-11 17:45:37 -08:00
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine)
|
2018-10-19 21:10:28 +02:00
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue, pow, power to \c p, const RealScalar& p)
|
|
|
|
|
EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const std::complex<RealScalar>& p)
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-10-31 11:50:15 -04:00
|
|
|
protected:
|
2019-12-19 17:30:11 +01:00
|
|
|
EIGEN_DEFAULT_COPY_CONSTRUCTOR(MatrixBase)
|
|
|
|
|
EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MatrixBase)
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2009-10-31 11:50:15 -04:00
|
|
|
private:
|
2013-02-07 19:06:14 +01:00
|
|
|
EIGEN_DEVICE_FUNC explicit MatrixBase(int);
|
|
|
|
|
EIGEN_DEVICE_FUNC MatrixBase(int, int);
|
|
|
|
|
template <typename OtherDerived>
|
|
|
|
|
EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
|
2023-11-29 11:12:48 +00:00
|
|
|
|
2010-08-16 11:07:17 +02:00
|
|
|
protected:
|
|
|
|
|
// mixing arrays and matrices is not legal
|
2011-02-04 13:55:12 +01:00
|
|
|
template <typename OtherDerived>
|
|
|
|
|
Derived& operator+=(const ArrayBase<OtherDerived>&) {
|
2012-01-31 13:05:44 +01:00
|
|
|
EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
|
|
|
|
|
YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
2010-08-16 11:07:17 +02:00
|
|
|
// mixing arrays and matrices is not legal
|
2011-02-04 13:55:12 +01:00
|
|
|
template <typename OtherDerived>
|
2012-01-31 13:05:44 +01:00
|
|
|
Derived& operator-=(const ArrayBase<OtherDerived>&) {
|
|
|
|
|
EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar)) == -1,
|
|
|
|
|
YOU_CANNOT_MIX_ARRAYS_AND_MATRICES);
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
2007-09-05 10:42:15 +00:00
|
|
|
};
|
|
|
|
|
|
2014-02-12 14:03:39 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
* Implementation of matrix base methods
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
/** replaces \c *this by \c *this * \a other.
|
|
|
|
|
*
|
|
|
|
|
* \returns a reference to \c *this
|
|
|
|
|
*
|
|
|
|
|
* Example: \include MatrixBase_applyOnTheRight.cpp
|
|
|
|
|
* Output: \verbinclude MatrixBase_applyOnTheRight.out
|
|
|
|
|
*/
|
|
|
|
|
template <typename Derived>
|
|
|
|
|
template <typename OtherDerived>
|
|
|
|
|
inline Derived& MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived>& other) {
|
|
|
|
|
other.derived().applyThisOnTheRight(derived());
|
|
|
|
|
return derived();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=().
|
|
|
|
|
*
|
|
|
|
|
* Example: \include MatrixBase_applyOnTheRight.cpp
|
|
|
|
|
* Output: \verbinclude MatrixBase_applyOnTheRight.out
|
|
|
|
|
*/
|
|
|
|
|
template <typename Derived>
|
|
|
|
|
template <typename OtherDerived>
|
|
|
|
|
inline void MatrixBase<Derived>::applyOnTheRight(const EigenBase<OtherDerived>& other) {
|
|
|
|
|
other.derived().applyThisOnTheRight(derived());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** replaces \c *this by \a other * \c *this.
|
|
|
|
|
*
|
|
|
|
|
* Example: \include MatrixBase_applyOnTheLeft.cpp
|
|
|
|
|
* Output: \verbinclude MatrixBase_applyOnTheLeft.out
|
|
|
|
|
*/
|
|
|
|
|
template <typename Derived>
|
|
|
|
|
template <typename OtherDerived>
|
|
|
|
|
inline void MatrixBase<Derived>::applyOnTheLeft(const EigenBase<OtherDerived>& other) {
|
|
|
|
|
other.derived().applyThisOnTheLeft(derived());
|
|
|
|
|
}
|
|
|
|
|
|
2012-04-15 11:06:28 +01:00
|
|
|
} // end namespace Eigen
|
|
|
|
|
|
2007-11-28 15:34:40 +00:00
|
|
|
#endif // EIGEN_MATRIXBASE_H
|