Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:56:15

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
0005 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
0006 //
0007 // This Source Code Form is subject to the terms of the Mozilla
0008 // Public License v. 2.0. If a copy of the MPL was not distributed
0009 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0010 
0011 #ifndef EIGEN_MATRIXBASE_H
0012 #define EIGEN_MATRIXBASE_H
0013 
0014 namespace Eigen {
0015 
0016 /** \class MatrixBase
0017   * \ingroup Core_Module
0018   *
0019   * \brief Base class for all dense matrices, vectors, and expressions
0020   *
0021   * This class is the base that is inherited by all matrix, vector, and related expression
0022   * types. Most of the Eigen API is contained in this class, and its base classes. Other important
0023   * classes for the Eigen API are Matrix, and VectorwiseOp.
0024   *
0025   * Note that some methods are defined in other modules such as the \ref LU_Module LU module
0026   * for all functions related to matrix inversions.
0027   *
0028   * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc.
0029   *
0030   * When writing a function taking Eigen objects as argument, if you want your function
0031   * to take as argument any matrix, vector, or expression, just let it take a
0032   * MatrixBase argument. As an example, here is a function printFirstRow which, given
0033   * a matrix, vector, or expression \a x, prints the first row of \a x.
0034   *
0035   * \code
0036     template<typename Derived>
0037     void printFirstRow(const Eigen::MatrixBase<Derived>& x)
0038     {
0039       cout << x.row(0) << endl;
0040     }
0041   * \endcode
0042   *
0043   * This class can be extended with the help of the plugin mechanism described on the page
0044   * \ref TopicCustomizing_Plugins by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN.
0045   *
0046   * \sa \blank \ref TopicClassHierarchy
0047   */
0048 template<typename Derived> class MatrixBase
0049   : public DenseBase<Derived>
0050 {
0051   public:
0052 #ifndef EIGEN_PARSED_BY_DOXYGEN
0053     typedef MatrixBase StorageBaseType;
0054     typedef typename internal::traits<Derived>::StorageKind StorageKind;
0055     typedef typename internal::traits<Derived>::StorageIndex StorageIndex;
0056     typedef typename internal::traits<Derived>::Scalar Scalar;
0057     typedef typename internal::packet_traits<Scalar>::type PacketScalar;
0058     typedef typename NumTraits<Scalar>::Real RealScalar;
0059 
0060     typedef DenseBase<Derived> Base;
0061     using Base::RowsAtCompileTime;
0062     using Base::ColsAtCompileTime;
0063     using Base::SizeAtCompileTime;
0064     using Base::MaxRowsAtCompileTime;
0065     using Base::MaxColsAtCompileTime;
0066     using Base::MaxSizeAtCompileTime;
0067     using Base::IsVectorAtCompileTime;
0068     using Base::Flags;
0069 
0070     using Base::derived;
0071     using Base::const_cast_derived;
0072     using Base::rows;
0073     using Base::cols;
0074     using Base::size;
0075     using Base::coeff;
0076     using Base::coeffRef;
0077     using Base::lazyAssign;
0078     using Base::eval;
0079     using Base::operator-;
0080     using Base::operator+=;
0081     using Base::operator-=;
0082     using Base::operator*=;
0083     using Base::operator/=;
0084 
0085     typedef typename Base::CoeffReturnType CoeffReturnType;
0086     typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
0087     typedef typename Base::RowXpr RowXpr;
0088     typedef typename Base::ColXpr ColXpr;
0089 #endif // not EIGEN_PARSED_BY_DOXYGEN
0090 
0091 
0092 
0093 #ifndef EIGEN_PARSED_BY_DOXYGEN
0094     /** type of the equivalent square matrix */
0095     typedef Matrix<Scalar,EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime),
0096                           EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime)> SquareMatrixType;
0097 #endif // not EIGEN_PARSED_BY_DOXYGEN
0098 
0099     /** \returns the size of the main diagonal, which is min(rows(),cols()).
0100       * \sa rows(), cols(), SizeAtCompileTime. */
0101     EIGEN_DEVICE_FUNC
0102     inline Index diagonalSize() const { return (numext::mini)(rows(),cols()); }
0103 
0104     typedef typename Base::PlainObject PlainObject;
0105 
0106 #ifndef EIGEN_PARSED_BY_DOXYGEN
0107     /** \internal Represents a matrix with all coefficients equal to one another*/
0108     typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,PlainObject> ConstantReturnType;
0109     /** \internal the return type of MatrixBase::adjoint() */
0110     typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
0111                         CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, ConstTransposeReturnType>,
0112                         ConstTransposeReturnType
0113                      >::type AdjointReturnType;
0114     /** \internal Return type of eigenvalues() */
0115     typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType;
0116     /** \internal the return type of identity */
0117     typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,PlainObject> IdentityReturnType;
0118     /** \internal the return type of unit vectors */
0119     typedef Block<const CwiseNullaryOp<internal::scalar_identity_op<Scalar>, SquareMatrixType>,
0120                   internal::traits<Derived>::RowsAtCompileTime,
0121                   internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
0122 #endif // not EIGEN_PARSED_BY_DOXYGEN
0123 
0124 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
0125 #define EIGEN_DOC_UNARY_ADDONS(X,Y)
0126 #   include "../plugins/CommonCwiseBinaryOps.h"
0127 #   include "../plugins/MatrixCwiseUnaryOps.h"
0128 #   include "../plugins/MatrixCwiseBinaryOps.h"
0129 #   ifdef EIGEN_MATRIXBASE_PLUGIN
0130 #     include EIGEN_MATRIXBASE_PLUGIN
0131 #   endif
0132 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
0133 #undef EIGEN_DOC_UNARY_ADDONS
0134 
0135     /** Special case of the template operator=, in order to prevent the compiler
0136       * from generating a default operator= (issue hit with g++ 4.1)
0137       */
0138     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0139     Derived& operator=(const MatrixBase& other);
0140 
0141     // We cannot inherit here via Base::operator= since it is causing
0142     // trouble with MSVC.
0143 
0144     template <typename OtherDerived>
0145     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0146     Derived& operator=(const DenseBase<OtherDerived>& other);
0147 
0148     template <typename OtherDerived>
0149     EIGEN_DEVICE_FUNC
0150     Derived& operator=(const EigenBase<OtherDerived>& other);
0151 
0152     template<typename OtherDerived>
0153     EIGEN_DEVICE_FUNC
0154     Derived& operator=(const ReturnByValue<OtherDerived>& other);
0155 
0156     template<typename OtherDerived>
0157     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0158     Derived& operator+=(const MatrixBase<OtherDerived>& other);
0159     template<typename OtherDerived>
0160     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
0161     Derived& operator-=(const MatrixBase<OtherDerived>& other);
0162 
0163     template<typename OtherDerived>
0164     EIGEN_DEVICE_FUNC
0165     const Product<Derived,OtherDerived>
0166     operator*(const MatrixBase<OtherDerived> &other) const;
0167 
0168     template<typename OtherDerived>
0169     EIGEN_DEVICE_FUNC
0170     const Product<Derived,OtherDerived,LazyProduct>
0171     lazyProduct(const MatrixBase<OtherDerived> &other) const;
0172 
0173     template<typename OtherDerived>
0174     Derived& operator*=(const EigenBase<OtherDerived>& other);
0175 
0176     template<typename OtherDerived>
0177     void applyOnTheLeft(const EigenBase<OtherDerived>& other);
0178 
0179     template<typename OtherDerived>
0180     void applyOnTheRight(const EigenBase<OtherDerived>& other);
0181 
0182     template<typename DiagonalDerived>
0183     EIGEN_DEVICE_FUNC
0184     const Product<Derived, DiagonalDerived, LazyProduct>
0185     operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
0186 
0187     template<typename OtherDerived>
0188     EIGEN_DEVICE_FUNC
0189     typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
0190     dot(const MatrixBase<OtherDerived>& other) const;
0191 
0192     EIGEN_DEVICE_FUNC RealScalar squaredNorm() const;
0193     EIGEN_DEVICE_FUNC RealScalar norm() const;
0194     RealScalar stableNorm() const;
0195     RealScalar blueNorm() const;
0196     RealScalar hypotNorm() const;
0197     EIGEN_DEVICE_FUNC const PlainObject normalized() const;
0198     EIGEN_DEVICE_FUNC const PlainObject stableNormalized() const;
0199     EIGEN_DEVICE_FUNC void normalize();
0200     EIGEN_DEVICE_FUNC void stableNormalize();
0201 
0202     EIGEN_DEVICE_FUNC const AdjointReturnType adjoint() const;
0203     EIGEN_DEVICE_FUNC void adjointInPlace();
0204 
0205     typedef Diagonal<Derived> DiagonalReturnType;
0206     EIGEN_DEVICE_FUNC
0207     DiagonalReturnType diagonal();
0208 
0209     typedef typename internal::add_const<Diagonal<const Derived> >::type ConstDiagonalReturnType;
0210     EIGEN_DEVICE_FUNC
0211     ConstDiagonalReturnType diagonal() const;
0212 
0213     template<int Index> struct DiagonalIndexReturnType { typedef Diagonal<Derived,Index> Type; };
0214     template<int Index> struct ConstDiagonalIndexReturnType { typedef const Diagonal<const Derived,Index> Type; };
0215 
0216     template<int Index>
0217     EIGEN_DEVICE_FUNC
0218     typename DiagonalIndexReturnType<Index>::Type diagonal();
0219 
0220     template<int Index>
0221     EIGEN_DEVICE_FUNC
0222     typename ConstDiagonalIndexReturnType<Index>::Type diagonal() const;
0223 
0224     typedef Diagonal<Derived,DynamicIndex> DiagonalDynamicIndexReturnType;
0225     typedef typename internal::add_const<Diagonal<const Derived,DynamicIndex> >::type ConstDiagonalDynamicIndexReturnType;
0226 
0227     EIGEN_DEVICE_FUNC
0228     DiagonalDynamicIndexReturnType diagonal(Index index);
0229     EIGEN_DEVICE_FUNC
0230     ConstDiagonalDynamicIndexReturnType diagonal(Index index) const;
0231 
0232     template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
0233     template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
0234 
0235     template<unsigned int Mode>
0236     EIGEN_DEVICE_FUNC
0237     typename TriangularViewReturnType<Mode>::Type triangularView();
0238     template<unsigned int Mode>
0239     EIGEN_DEVICE_FUNC
0240     typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
0241 
0242     template<unsigned int UpLo> struct SelfAdjointViewReturnType { typedef SelfAdjointView<Derived, UpLo> Type; };
0243     template<unsigned int UpLo> struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView<const Derived, UpLo> Type; };
0244 
0245     template<unsigned int UpLo>
0246     EIGEN_DEVICE_FUNC
0247     typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
0248     template<unsigned int UpLo>
0249     EIGEN_DEVICE_FUNC
0250     typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
0251 
0252     const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
0253                                          const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
0254     EIGEN_DEVICE_FUNC static const IdentityReturnType Identity();
0255     EIGEN_DEVICE_FUNC static const IdentityReturnType Identity(Index rows, Index cols);
0256     EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index size, Index i);
0257     EIGEN_DEVICE_FUNC static const BasisReturnType Unit(Index i);
0258     EIGEN_DEVICE_FUNC static const BasisReturnType UnitX();
0259     EIGEN_DEVICE_FUNC static const BasisReturnType UnitY();
0260     EIGEN_DEVICE_FUNC static const BasisReturnType UnitZ();
0261     EIGEN_DEVICE_FUNC static const BasisReturnType UnitW();
0262 
0263     EIGEN_DEVICE_FUNC
0264     const DiagonalWrapper<const Derived> asDiagonal() const;
0265     const PermutationWrapper<const Derived> asPermutation() const;
0266 
0267     EIGEN_DEVICE_FUNC
0268     Derived& setIdentity();
0269     EIGEN_DEVICE_FUNC
0270     Derived& setIdentity(Index rows, Index cols);
0271     EIGEN_DEVICE_FUNC Derived& setUnit(Index i);
0272     EIGEN_DEVICE_FUNC Derived& setUnit(Index newSize, Index i);
0273 
0274     bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0275     bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0276 
0277     bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0278     bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0279 
0280     template<typename OtherDerived>
0281     bool isOrthogonal(const MatrixBase<OtherDerived>& other,
0282                       const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0283     bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
0284 
0285     /** \returns true if each coefficients of \c *this and \a other are all exactly equal.
0286       * \warning When using floating point scalar values you probably should rather use a
0287       *          fuzzy comparison such as isApprox()
0288       * \sa isApprox(), operator!= */
0289     template<typename OtherDerived>
0290     EIGEN_DEVICE_FUNC inline bool operator==(const MatrixBase<OtherDerived>& other) const
0291     { return cwiseEqual(other).all(); }
0292 
0293     /** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other.
0294       * \warning When using floating point scalar values you probably should rather use a
0295       *          fuzzy comparison such as isApprox()
0296       * \sa isApprox(), operator== */
0297     template<typename OtherDerived>
0298     EIGEN_DEVICE_FUNC inline bool operator!=(const MatrixBase<OtherDerived>& other) const
0299     { return cwiseNotEqual(other).any(); }
0300 
0301     NoAlias<Derived,Eigen::MatrixBase > EIGEN_DEVICE_FUNC noalias();
0302 
0303     // TODO forceAlignedAccess is temporarily disabled
0304     // Need to find a nicer workaround.
0305     inline const Derived& forceAlignedAccess() const { return derived(); }
0306     inline Derived& forceAlignedAccess() { return derived(); }
0307     template<bool Enable> inline const Derived& forceAlignedAccessIf() const { return derived(); }
0308     template<bool Enable> inline Derived& forceAlignedAccessIf() { return derived(); }
0309 
0310     EIGEN_DEVICE_FUNC Scalar trace() const;
0311 
0312     template<int p> EIGEN_DEVICE_FUNC RealScalar lpNorm() const;
0313 
0314     EIGEN_DEVICE_FUNC MatrixBase<Derived>& matrix() { return *this; }
0315     EIGEN_DEVICE_FUNC const MatrixBase<Derived>& matrix() const { return *this; }
0316 
0317     /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix
0318       * \sa ArrayBase::matrix() */
0319     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE ArrayWrapper<Derived> array() { return ArrayWrapper<Derived>(derived()); }
0320     /** \returns a const \link Eigen::ArrayBase Array \endlink expression of this matrix
0321       * \sa ArrayBase::matrix() */
0322     EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const ArrayWrapper<const Derived> array() const { return ArrayWrapper<const Derived>(derived()); }
0323 
0324 /////////// LU module ///////////
0325 
0326     inline const FullPivLU<PlainObject> fullPivLu() const;
0327     inline const PartialPivLU<PlainObject> partialPivLu() const;
0328 
0329     inline const PartialPivLU<PlainObject> lu() const;
0330 
0331     EIGEN_DEVICE_FUNC
0332     inline const Inverse<Derived> inverse() const;
0333 
0334     template<typename ResultType>
0335     inline void computeInverseAndDetWithCheck(
0336       ResultType& inverse,
0337       typename ResultType::Scalar& determinant,
0338       bool& invertible,
0339       const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
0340     ) const;
0341 
0342     template<typename ResultType>
0343     inline void computeInverseWithCheck(
0344       ResultType& inverse,
0345       bool& invertible,
0346       const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
0347     ) const;
0348 
0349     EIGEN_DEVICE_FUNC
0350     Scalar determinant() const;
0351 
0352 /////////// Cholesky module ///////////
0353 
0354     inline const LLT<PlainObject>  llt() const;
0355     inline const LDLT<PlainObject> ldlt() const;
0356 
0357 /////////// QR module ///////////
0358 
0359     inline const HouseholderQR<PlainObject> householderQr() const;
0360     inline const ColPivHouseholderQR<PlainObject> colPivHouseholderQr() const;
0361     inline const FullPivHouseholderQR<PlainObject> fullPivHouseholderQr() const;
0362     inline const CompleteOrthogonalDecomposition<PlainObject> completeOrthogonalDecomposition() const;
0363 
0364 /////////// Eigenvalues module ///////////
0365 
0366     inline EigenvaluesReturnType eigenvalues() const;
0367     inline RealScalar operatorNorm() const;
0368 
0369 /////////// SVD module ///////////
0370 
0371     inline JacobiSVD<PlainObject> jacobiSvd(unsigned int computationOptions = 0) const;
0372     inline BDCSVD<PlainObject>    bdcSvd(unsigned int computationOptions = 0) const;
0373 
0374 /////////// Geometry module ///////////
0375 
0376     #ifndef EIGEN_PARSED_BY_DOXYGEN
0377     /// \internal helper struct to form the return type of the cross product
0378     template<typename OtherDerived> struct cross_product_return_type {
0379       typedef typename ScalarBinaryOpTraits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
0380       typedef Matrix<Scalar,MatrixBase::RowsAtCompileTime,MatrixBase::ColsAtCompileTime> type;
0381     };
0382     #endif // EIGEN_PARSED_BY_DOXYGEN
0383     template<typename OtherDerived>
0384     EIGEN_DEVICE_FUNC
0385 #ifndef EIGEN_PARSED_BY_DOXYGEN
0386     inline typename cross_product_return_type<OtherDerived>::type
0387 #else
0388     inline PlainObject
0389 #endif
0390     cross(const MatrixBase<OtherDerived>& other) const;
0391 
0392     template<typename OtherDerived>
0393     EIGEN_DEVICE_FUNC
0394     inline PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
0395 
0396     EIGEN_DEVICE_FUNC
0397     inline PlainObject unitOrthogonal(void) const;
0398 
0399     EIGEN_DEVICE_FUNC
0400     inline Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
0401 
0402     // put this as separate enum value to work around possible GCC 4.3 bug (?)
0403     enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1&&RowsAtCompileTime==1 ? ((internal::traits<Derived>::Flags&RowMajorBit)==RowMajorBit ? Horizontal : Vertical)
0404                                           : ColsAtCompileTime==1 ? Vertical : Horizontal };
0405     typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
0406     EIGEN_DEVICE_FUNC
0407     inline HomogeneousReturnType homogeneous() const;
0408 
0409     enum {
0410       SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1
0411     };
0412     typedef Block<const Derived,
0413                   internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
0414                   internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
0415     typedef EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(ConstStartMinusOne,Scalar,quotient) HNormalizedReturnType;
0416     EIGEN_DEVICE_FUNC
0417     inline const HNormalizedReturnType hnormalized() const;
0418 
0419 ////////// Householder module ///////////
0420 
0421     EIGEN_DEVICE_FUNC
0422     void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
0423     template<typename EssentialPart>
0424     EIGEN_DEVICE_FUNC
0425     void makeHouseholder(EssentialPart& essential,
0426                          Scalar& tau, RealScalar& beta) const;
0427     template<typename EssentialPart>
0428     EIGEN_DEVICE_FUNC
0429     void applyHouseholderOnTheLeft(const EssentialPart& essential,
0430                                    const Scalar& tau,
0431                                    Scalar* workspace);
0432     template<typename EssentialPart>
0433     EIGEN_DEVICE_FUNC
0434     void applyHouseholderOnTheRight(const EssentialPart& essential,
0435                                     const Scalar& tau,
0436                                     Scalar* workspace);
0437 
0438 ///////// Jacobi module /////////
0439 
0440     template<typename OtherScalar>
0441     EIGEN_DEVICE_FUNC
0442     void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
0443     template<typename OtherScalar>
0444     EIGEN_DEVICE_FUNC
0445     void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
0446 
0447 ///////// SparseCore module /////////
0448 
0449     template<typename OtherDerived>
0450     EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
0451     cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
0452     {
0453       return other.cwiseProduct(derived());
0454     }
0455 
0456 ///////// MatrixFunctions module /////////
0457 
0458     typedef typename internal::stem_function<Scalar>::type StemFunction;
0459 #define EIGEN_MATRIX_FUNCTION(ReturnType, Name, Description) \
0460     /** \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 . */ \
0461     const ReturnType<Derived> Name() const;
0462 #define EIGEN_MATRIX_FUNCTION_1(ReturnType, Name, Description, Argument) \
0463     /** \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 . */ \
0464     const ReturnType<Derived> Name(Argument) const;
0465 
0466     EIGEN_MATRIX_FUNCTION(MatrixExponentialReturnValue, exp, exponential)
0467     /** \brief Helper function for the <a href="unsupported/group__MatrixFunctions__Module.html"> unsupported MatrixFunctions module</a>.*/
0468     const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
0469     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cosh, hyperbolic cosine)
0470     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sinh, hyperbolic sine)
0471 #if EIGEN_HAS_CXX11_MATH
0472     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, atanh, inverse hyperbolic cosine)
0473     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, acosh, inverse hyperbolic cosine)
0474     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, asinh, inverse hyperbolic sine)
0475 #endif
0476     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, cos, cosine)
0477     EIGEN_MATRIX_FUNCTION(MatrixFunctionReturnValue, sin, sine)
0478     EIGEN_MATRIX_FUNCTION(MatrixSquareRootReturnValue, sqrt, square root)
0479     EIGEN_MATRIX_FUNCTION(MatrixLogarithmReturnValue, log, logarithm)
0480     EIGEN_MATRIX_FUNCTION_1(MatrixPowerReturnValue,        pow, power to \c p, const RealScalar& p)
0481     EIGEN_MATRIX_FUNCTION_1(MatrixComplexPowerReturnValue, pow, power to \c p, const std::complex<RealScalar>& p)
0482 
0483   protected:
0484     EIGEN_DEFAULT_COPY_CONSTRUCTOR(MatrixBase)
0485     EIGEN_DEFAULT_EMPTY_CONSTRUCTOR_AND_DESTRUCTOR(MatrixBase)
0486 
0487   private:
0488     EIGEN_DEVICE_FUNC explicit MatrixBase(int);
0489     EIGEN_DEVICE_FUNC MatrixBase(int,int);
0490     template<typename OtherDerived> EIGEN_DEVICE_FUNC explicit MatrixBase(const MatrixBase<OtherDerived>&);
0491   protected:
0492     // mixing arrays and matrices is not legal
0493     template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& )
0494     {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
0495     // mixing arrays and matrices is not legal
0496     template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& )
0497     {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
0498 };
0499 
0500 
0501 /***************************************************************************
0502 * Implementation of matrix base methods
0503 ***************************************************************************/
0504 
0505 /** replaces \c *this by \c *this * \a other.
0506   *
0507   * \returns a reference to \c *this
0508   *
0509   * Example: \include MatrixBase_applyOnTheRight.cpp
0510   * Output: \verbinclude MatrixBase_applyOnTheRight.out
0511   */
0512 template<typename Derived>
0513 template<typename OtherDerived>
0514 inline Derived&
0515 MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived> &other)
0516 {
0517   other.derived().applyThisOnTheRight(derived());
0518   return derived();
0519 }
0520 
0521 /** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=().
0522   *
0523   * Example: \include MatrixBase_applyOnTheRight.cpp
0524   * Output: \verbinclude MatrixBase_applyOnTheRight.out
0525   */
0526 template<typename Derived>
0527 template<typename OtherDerived>
0528 inline void MatrixBase<Derived>::applyOnTheRight(const EigenBase<OtherDerived> &other)
0529 {
0530   other.derived().applyThisOnTheRight(derived());
0531 }
0532 
0533 /** replaces \c *this by \a other * \c *this.
0534   *
0535   * Example: \include MatrixBase_applyOnTheLeft.cpp
0536   * Output: \verbinclude MatrixBase_applyOnTheLeft.out
0537   */
0538 template<typename Derived>
0539 template<typename OtherDerived>
0540 inline void MatrixBase<Derived>::applyOnTheLeft(const EigenBase<OtherDerived> &other)
0541 {
0542   other.derived().applyThisOnTheLeft(derived());
0543 }
0544 
0545 } // end namespace Eigen
0546 
0547 #endif // EIGEN_MATRIXBASE_H