Eigne Matrix Class Library

Dependents:   Eigen_test Odometry_test AttitudeEstimation_usingTicker MPU9250_Quaternion_Binary_Serial ... more

Eigen Matrix Class Library for mbed.

Finally, you can use Eigen on your mbed!!!

Committer:
ykuroda
Date:
Thu Oct 13 04:07:23 2016 +0000
Revision:
0:13a5d365ba16
First commint, Eigne Matrix Class Library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ykuroda 0:13a5d365ba16 1 // This file is part of Eigen, a lightweight C++ template library
ykuroda 0:13a5d365ba16 2 // for linear algebra.
ykuroda 0:13a5d365ba16 3 //
ykuroda 0:13a5d365ba16 4 // Copyright (C) 2006-2009 Benoit Jacob <jacob.benoit.1@gmail.com>
ykuroda 0:13a5d365ba16 5 // Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
ykuroda 0:13a5d365ba16 6 //
ykuroda 0:13a5d365ba16 7 // This Source Code Form is subject to the terms of the Mozilla
ykuroda 0:13a5d365ba16 8 // Public License v. 2.0. If a copy of the MPL was not distributed
ykuroda 0:13a5d365ba16 9 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
ykuroda 0:13a5d365ba16 10
ykuroda 0:13a5d365ba16 11 #ifndef EIGEN_MATRIXBASE_H
ykuroda 0:13a5d365ba16 12 #define EIGEN_MATRIXBASE_H
ykuroda 0:13a5d365ba16 13
ykuroda 0:13a5d365ba16 14 namespace Eigen {
ykuroda 0:13a5d365ba16 15
ykuroda 0:13a5d365ba16 16 /** \class MatrixBase
ykuroda 0:13a5d365ba16 17 * \ingroup Core_Module
ykuroda 0:13a5d365ba16 18 *
ykuroda 0:13a5d365ba16 19 * \brief Base class for all dense matrices, vectors, and expressions
ykuroda 0:13a5d365ba16 20 *
ykuroda 0:13a5d365ba16 21 * This class is the base that is inherited by all matrix, vector, and related expression
ykuroda 0:13a5d365ba16 22 * types. Most of the Eigen API is contained in this class, and its base classes. Other important
ykuroda 0:13a5d365ba16 23 * classes for the Eigen API are Matrix, and VectorwiseOp.
ykuroda 0:13a5d365ba16 24 *
ykuroda 0:13a5d365ba16 25 * Note that some methods are defined in other modules such as the \ref LU_Module LU module
ykuroda 0:13a5d365ba16 26 * for all functions related to matrix inversions.
ykuroda 0:13a5d365ba16 27 *
ykuroda 0:13a5d365ba16 28 * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc.
ykuroda 0:13a5d365ba16 29 *
ykuroda 0:13a5d365ba16 30 * When writing a function taking Eigen objects as argument, if you want your function
ykuroda 0:13a5d365ba16 31 * to take as argument any matrix, vector, or expression, just let it take a
ykuroda 0:13a5d365ba16 32 * MatrixBase argument. As an example, here is a function printFirstRow which, given
ykuroda 0:13a5d365ba16 33 * a matrix, vector, or expression \a x, prints the first row of \a x.
ykuroda 0:13a5d365ba16 34 *
ykuroda 0:13a5d365ba16 35 * \code
ykuroda 0:13a5d365ba16 36 template<typename Derived>
ykuroda 0:13a5d365ba16 37 void printFirstRow(const Eigen::MatrixBase<Derived>& x)
ykuroda 0:13a5d365ba16 38 {
ykuroda 0:13a5d365ba16 39 cout << x.row(0) << endl;
ykuroda 0:13a5d365ba16 40 }
ykuroda 0:13a5d365ba16 41 * \endcode
ykuroda 0:13a5d365ba16 42 *
ykuroda 0:13a5d365ba16 43 * This class can be extended with the help of the plugin mechanism described on the page
ykuroda 0:13a5d365ba16 44 * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN.
ykuroda 0:13a5d365ba16 45 *
ykuroda 0:13a5d365ba16 46 * \sa \ref TopicClassHierarchy
ykuroda 0:13a5d365ba16 47 */
ykuroda 0:13a5d365ba16 48 template<typename Derived> class MatrixBase
ykuroda 0:13a5d365ba16 49 : public DenseBase<Derived>
ykuroda 0:13a5d365ba16 50 {
ykuroda 0:13a5d365ba16 51 public:
ykuroda 0:13a5d365ba16 52 #ifndef EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 53 typedef MatrixBase StorageBaseType;
ykuroda 0:13a5d365ba16 54 typedef typename internal::traits<Derived>::StorageKind StorageKind;
ykuroda 0:13a5d365ba16 55 typedef typename internal::traits<Derived>::Index Index;
ykuroda 0:13a5d365ba16 56 typedef typename internal::traits<Derived>::Scalar Scalar;
ykuroda 0:13a5d365ba16 57 typedef typename internal::packet_traits<Scalar>::type PacketScalar;
ykuroda 0:13a5d365ba16 58 typedef typename NumTraits<Scalar>::Real RealScalar;
ykuroda 0:13a5d365ba16 59
ykuroda 0:13a5d365ba16 60 typedef DenseBase<Derived> Base;
ykuroda 0:13a5d365ba16 61 using Base::RowsAtCompileTime;
ykuroda 0:13a5d365ba16 62 using Base::ColsAtCompileTime;
ykuroda 0:13a5d365ba16 63 using Base::SizeAtCompileTime;
ykuroda 0:13a5d365ba16 64 using Base::MaxRowsAtCompileTime;
ykuroda 0:13a5d365ba16 65 using Base::MaxColsAtCompileTime;
ykuroda 0:13a5d365ba16 66 using Base::MaxSizeAtCompileTime;
ykuroda 0:13a5d365ba16 67 using Base::IsVectorAtCompileTime;
ykuroda 0:13a5d365ba16 68 using Base::Flags;
ykuroda 0:13a5d365ba16 69 using Base::CoeffReadCost;
ykuroda 0:13a5d365ba16 70
ykuroda 0:13a5d365ba16 71 using Base::derived;
ykuroda 0:13a5d365ba16 72 using Base::const_cast_derived;
ykuroda 0:13a5d365ba16 73 using Base::rows;
ykuroda 0:13a5d365ba16 74 using Base::cols;
ykuroda 0:13a5d365ba16 75 using Base::size;
ykuroda 0:13a5d365ba16 76 using Base::coeff;
ykuroda 0:13a5d365ba16 77 using Base::coeffRef;
ykuroda 0:13a5d365ba16 78 using Base::lazyAssign;
ykuroda 0:13a5d365ba16 79 using Base::eval;
ykuroda 0:13a5d365ba16 80 using Base::operator+=;
ykuroda 0:13a5d365ba16 81 using Base::operator-=;
ykuroda 0:13a5d365ba16 82 using Base::operator*=;
ykuroda 0:13a5d365ba16 83 using Base::operator/=;
ykuroda 0:13a5d365ba16 84
ykuroda 0:13a5d365ba16 85 typedef typename Base::CoeffReturnType CoeffReturnType;
ykuroda 0:13a5d365ba16 86 typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType;
ykuroda 0:13a5d365ba16 87 typedef typename Base::RowXpr RowXpr;
ykuroda 0:13a5d365ba16 88 typedef typename Base::ColXpr ColXpr;
ykuroda 0:13a5d365ba16 89 #endif // not EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 90
ykuroda 0:13a5d365ba16 91
ykuroda 0:13a5d365ba16 92
ykuroda 0:13a5d365ba16 93 #ifndef EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 94 /** type of the equivalent square matrix */
ykuroda 0:13a5d365ba16 95 typedef Matrix<Scalar,EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime),
ykuroda 0:13a5d365ba16 96 EIGEN_SIZE_MAX(RowsAtCompileTime,ColsAtCompileTime)> SquareMatrixType;
ykuroda 0:13a5d365ba16 97 #endif // not EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 98
ykuroda 0:13a5d365ba16 99 /** \returns the size of the main diagonal, which is min(rows(),cols()).
ykuroda 0:13a5d365ba16 100 * \sa rows(), cols(), SizeAtCompileTime. */
ykuroda 0:13a5d365ba16 101 inline Index diagonalSize() const { return (std::min)(rows(),cols()); }
ykuroda 0:13a5d365ba16 102
ykuroda 0:13a5d365ba16 103 /** \brief The plain matrix type corresponding to this expression.
ykuroda 0:13a5d365ba16 104 *
ykuroda 0:13a5d365ba16 105 * This is not necessarily exactly the return type of eval(). In the case of plain matrices,
ykuroda 0:13a5d365ba16 106 * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed
ykuroda 0:13a5d365ba16 107 * that the return type of eval() is either PlainObject or const PlainObject&.
ykuroda 0:13a5d365ba16 108 */
ykuroda 0:13a5d365ba16 109 typedef Matrix<typename internal::traits<Derived>::Scalar,
ykuroda 0:13a5d365ba16 110 internal::traits<Derived>::RowsAtCompileTime,
ykuroda 0:13a5d365ba16 111 internal::traits<Derived>::ColsAtCompileTime,
ykuroda 0:13a5d365ba16 112 AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor),
ykuroda 0:13a5d365ba16 113 internal::traits<Derived>::MaxRowsAtCompileTime,
ykuroda 0:13a5d365ba16 114 internal::traits<Derived>::MaxColsAtCompileTime
ykuroda 0:13a5d365ba16 115 > PlainObject;
ykuroda 0:13a5d365ba16 116
ykuroda 0:13a5d365ba16 117 #ifndef EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 118 /** \internal Represents a matrix with all coefficients equal to one another*/
ykuroda 0:13a5d365ba16 119 typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,Derived> ConstantReturnType;
ykuroda 0:13a5d365ba16 120 /** \internal the return type of MatrixBase::adjoint() */
ykuroda 0:13a5d365ba16 121 typedef typename internal::conditional<NumTraits<Scalar>::IsComplex,
ykuroda 0:13a5d365ba16 122 CwiseUnaryOp<internal::scalar_conjugate_op<Scalar>, ConstTransposeReturnType>,
ykuroda 0:13a5d365ba16 123 ConstTransposeReturnType
ykuroda 0:13a5d365ba16 124 >::type AdjointReturnType;
ykuroda 0:13a5d365ba16 125 /** \internal Return type of eigenvalues() */
ykuroda 0:13a5d365ba16 126 typedef Matrix<std::complex<RealScalar>, internal::traits<Derived>::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType;
ykuroda 0:13a5d365ba16 127 /** \internal the return type of identity */
ykuroda 0:13a5d365ba16 128 typedef CwiseNullaryOp<internal::scalar_identity_op<Scalar>,Derived> IdentityReturnType;
ykuroda 0:13a5d365ba16 129 /** \internal the return type of unit vectors */
ykuroda 0:13a5d365ba16 130 typedef Block<const CwiseNullaryOp<internal::scalar_identity_op<Scalar>, SquareMatrixType>,
ykuroda 0:13a5d365ba16 131 internal::traits<Derived>::RowsAtCompileTime,
ykuroda 0:13a5d365ba16 132 internal::traits<Derived>::ColsAtCompileTime> BasisReturnType;
ykuroda 0:13a5d365ba16 133 #endif // not EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 134
ykuroda 0:13a5d365ba16 135 #define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase
ykuroda 0:13a5d365ba16 136 # include "../plugins/CommonCwiseUnaryOps.h"
ykuroda 0:13a5d365ba16 137 # include "../plugins/CommonCwiseBinaryOps.h"
ykuroda 0:13a5d365ba16 138 # include "../plugins/MatrixCwiseUnaryOps.h"
ykuroda 0:13a5d365ba16 139 # include "../plugins/MatrixCwiseBinaryOps.h"
ykuroda 0:13a5d365ba16 140 # ifdef EIGEN_MATRIXBASE_PLUGIN
ykuroda 0:13a5d365ba16 141 # include EIGEN_MATRIXBASE_PLUGIN
ykuroda 0:13a5d365ba16 142 # endif
ykuroda 0:13a5d365ba16 143 #undef EIGEN_CURRENT_STORAGE_BASE_CLASS
ykuroda 0:13a5d365ba16 144
ykuroda 0:13a5d365ba16 145 /** Special case of the template operator=, in order to prevent the compiler
ykuroda 0:13a5d365ba16 146 * from generating a default operator= (issue hit with g++ 4.1)
ykuroda 0:13a5d365ba16 147 */
ykuroda 0:13a5d365ba16 148 Derived& operator=(const MatrixBase& other);
ykuroda 0:13a5d365ba16 149
ykuroda 0:13a5d365ba16 150 // We cannot inherit here via Base::operator= since it is causing
ykuroda 0:13a5d365ba16 151 // trouble with MSVC.
ykuroda 0:13a5d365ba16 152
ykuroda 0:13a5d365ba16 153 template <typename OtherDerived>
ykuroda 0:13a5d365ba16 154 Derived& operator=(const DenseBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 155
ykuroda 0:13a5d365ba16 156 template <typename OtherDerived>
ykuroda 0:13a5d365ba16 157 Derived& operator=(const EigenBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 158
ykuroda 0:13a5d365ba16 159 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 160 Derived& operator=(const ReturnByValue<OtherDerived>& other);
ykuroda 0:13a5d365ba16 161
ykuroda 0:13a5d365ba16 162 template<typename ProductDerived, typename Lhs, typename Rhs>
ykuroda 0:13a5d365ba16 163 Derived& lazyAssign(const ProductBase<ProductDerived, Lhs,Rhs>& other);
ykuroda 0:13a5d365ba16 164
ykuroda 0:13a5d365ba16 165 template<typename MatrixPower, typename Lhs, typename Rhs>
ykuroda 0:13a5d365ba16 166 Derived& lazyAssign(const MatrixPowerProduct<MatrixPower, Lhs,Rhs>& other);
ykuroda 0:13a5d365ba16 167
ykuroda 0:13a5d365ba16 168 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 169 Derived& operator+=(const MatrixBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 170 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 171 Derived& operator-=(const MatrixBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 172
ykuroda 0:13a5d365ba16 173 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 174 const typename ProductReturnType<Derived,OtherDerived>::Type
ykuroda 0:13a5d365ba16 175 operator*(const MatrixBase<OtherDerived> &other) const;
ykuroda 0:13a5d365ba16 176
ykuroda 0:13a5d365ba16 177 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 178 const typename LazyProductReturnType<Derived,OtherDerived>::Type
ykuroda 0:13a5d365ba16 179 lazyProduct(const MatrixBase<OtherDerived> &other) const;
ykuroda 0:13a5d365ba16 180
ykuroda 0:13a5d365ba16 181 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 182 Derived& operator*=(const EigenBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 183
ykuroda 0:13a5d365ba16 184 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 185 void applyOnTheLeft(const EigenBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 186
ykuroda 0:13a5d365ba16 187 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 188 void applyOnTheRight(const EigenBase<OtherDerived>& other);
ykuroda 0:13a5d365ba16 189
ykuroda 0:13a5d365ba16 190 template<typename DiagonalDerived>
ykuroda 0:13a5d365ba16 191 const DiagonalProduct<Derived, DiagonalDerived, OnTheRight>
ykuroda 0:13a5d365ba16 192 operator*(const DiagonalBase<DiagonalDerived> &diagonal) const;
ykuroda 0:13a5d365ba16 193
ykuroda 0:13a5d365ba16 194 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 195 typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType
ykuroda 0:13a5d365ba16 196 dot(const MatrixBase<OtherDerived>& other) const;
ykuroda 0:13a5d365ba16 197
ykuroda 0:13a5d365ba16 198 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 199 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 200 Scalar eigen2_dot(const MatrixBase<OtherDerived>& other) const;
ykuroda 0:13a5d365ba16 201 #endif
ykuroda 0:13a5d365ba16 202
ykuroda 0:13a5d365ba16 203 RealScalar squaredNorm() const;
ykuroda 0:13a5d365ba16 204 RealScalar norm() const;
ykuroda 0:13a5d365ba16 205 RealScalar stableNorm() const;
ykuroda 0:13a5d365ba16 206 RealScalar blueNorm() const;
ykuroda 0:13a5d365ba16 207 RealScalar hypotNorm() const;
ykuroda 0:13a5d365ba16 208 const PlainObject normalized() const;
ykuroda 0:13a5d365ba16 209 void normalize();
ykuroda 0:13a5d365ba16 210
ykuroda 0:13a5d365ba16 211 const AdjointReturnType adjoint() const;
ykuroda 0:13a5d365ba16 212 void adjointInPlace();
ykuroda 0:13a5d365ba16 213
ykuroda 0:13a5d365ba16 214 typedef Diagonal<Derived> DiagonalReturnType;
ykuroda 0:13a5d365ba16 215 DiagonalReturnType diagonal();
ykuroda 0:13a5d365ba16 216 typedef typename internal::add_const<Diagonal<const Derived> >::type ConstDiagonalReturnType;
ykuroda 0:13a5d365ba16 217 ConstDiagonalReturnType diagonal() const;
ykuroda 0:13a5d365ba16 218
ykuroda 0:13a5d365ba16 219 template<int Index> struct DiagonalIndexReturnType { typedef Diagonal<Derived,Index> Type; };
ykuroda 0:13a5d365ba16 220 template<int Index> struct ConstDiagonalIndexReturnType { typedef const Diagonal<const Derived,Index> Type; };
ykuroda 0:13a5d365ba16 221
ykuroda 0:13a5d365ba16 222 template<int Index> typename DiagonalIndexReturnType<Index>::Type diagonal();
ykuroda 0:13a5d365ba16 223 template<int Index> typename ConstDiagonalIndexReturnType<Index>::Type diagonal() const;
ykuroda 0:13a5d365ba16 224
ykuroda 0:13a5d365ba16 225 typedef Diagonal<Derived,DynamicIndex> DiagonalDynamicIndexReturnType;
ykuroda 0:13a5d365ba16 226 typedef typename internal::add_const<Diagonal<const Derived,DynamicIndex> >::type ConstDiagonalDynamicIndexReturnType;
ykuroda 0:13a5d365ba16 227
ykuroda 0:13a5d365ba16 228 DiagonalDynamicIndexReturnType diagonal(Index index);
ykuroda 0:13a5d365ba16 229 ConstDiagonalDynamicIndexReturnType diagonal(Index index) const;
ykuroda 0:13a5d365ba16 230
ykuroda 0:13a5d365ba16 231 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 232 template<unsigned int Mode> typename internal::eigen2_part_return_type<Derived, Mode>::type part();
ykuroda 0:13a5d365ba16 233 template<unsigned int Mode> const typename internal::eigen2_part_return_type<Derived, Mode>::type part() const;
ykuroda 0:13a5d365ba16 234
ykuroda 0:13a5d365ba16 235 // huuuge hack. make Eigen2's matrix.part<Diagonal>() work in eigen3. Problem: Diagonal is now a class template instead
ykuroda 0:13a5d365ba16 236 // of an integer constant. Solution: overload the part() method template wrt template parameters list.
ykuroda 0:13a5d365ba16 237 template<template<typename T, int N> class U>
ykuroda 0:13a5d365ba16 238 const DiagonalWrapper<ConstDiagonalReturnType> part() const
ykuroda 0:13a5d365ba16 239 { return diagonal().asDiagonal(); }
ykuroda 0:13a5d365ba16 240 #endif // EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 241
ykuroda 0:13a5d365ba16 242 template<unsigned int Mode> struct TriangularViewReturnType { typedef TriangularView<Derived, Mode> Type; };
ykuroda 0:13a5d365ba16 243 template<unsigned int Mode> struct ConstTriangularViewReturnType { typedef const TriangularView<const Derived, Mode> Type; };
ykuroda 0:13a5d365ba16 244
ykuroda 0:13a5d365ba16 245 template<unsigned int Mode> typename TriangularViewReturnType<Mode>::Type triangularView();
ykuroda 0:13a5d365ba16 246 template<unsigned int Mode> typename ConstTriangularViewReturnType<Mode>::Type triangularView() const;
ykuroda 0:13a5d365ba16 247
ykuroda 0:13a5d365ba16 248 template<unsigned int UpLo> struct SelfAdjointViewReturnType { typedef SelfAdjointView<Derived, UpLo> Type; };
ykuroda 0:13a5d365ba16 249 template<unsigned int UpLo> struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView<const Derived, UpLo> Type; };
ykuroda 0:13a5d365ba16 250
ykuroda 0:13a5d365ba16 251 template<unsigned int UpLo> typename SelfAdjointViewReturnType<UpLo>::Type selfadjointView();
ykuroda 0:13a5d365ba16 252 template<unsigned int UpLo> typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
ykuroda 0:13a5d365ba16 253
ykuroda 0:13a5d365ba16 254 const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
ykuroda 0:13a5d365ba16 255 const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 256 static const IdentityReturnType Identity();
ykuroda 0:13a5d365ba16 257 static const IdentityReturnType Identity(Index rows, Index cols);
ykuroda 0:13a5d365ba16 258 static const BasisReturnType Unit(Index size, Index i);
ykuroda 0:13a5d365ba16 259 static const BasisReturnType Unit(Index i);
ykuroda 0:13a5d365ba16 260 static const BasisReturnType UnitX();
ykuroda 0:13a5d365ba16 261 static const BasisReturnType UnitY();
ykuroda 0:13a5d365ba16 262 static const BasisReturnType UnitZ();
ykuroda 0:13a5d365ba16 263 static const BasisReturnType UnitW();
ykuroda 0:13a5d365ba16 264
ykuroda 0:13a5d365ba16 265 const DiagonalWrapper<const Derived> asDiagonal() const;
ykuroda 0:13a5d365ba16 266 const PermutationWrapper<const Derived> asPermutation() const;
ykuroda 0:13a5d365ba16 267
ykuroda 0:13a5d365ba16 268 Derived& setIdentity();
ykuroda 0:13a5d365ba16 269 Derived& setIdentity(Index rows, Index cols);
ykuroda 0:13a5d365ba16 270
ykuroda 0:13a5d365ba16 271 bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 272 bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 273
ykuroda 0:13a5d365ba16 274 bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 275 bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 276
ykuroda 0:13a5d365ba16 277 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 278 bool isOrthogonal(const MatrixBase<OtherDerived>& other,
ykuroda 0:13a5d365ba16 279 const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 280 bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
ykuroda 0:13a5d365ba16 281
ykuroda 0:13a5d365ba16 282 /** \returns true if each coefficients of \c *this and \a other are all exactly equal.
ykuroda 0:13a5d365ba16 283 * \warning When using floating point scalar values you probably should rather use a
ykuroda 0:13a5d365ba16 284 * fuzzy comparison such as isApprox()
ykuroda 0:13a5d365ba16 285 * \sa isApprox(), operator!= */
ykuroda 0:13a5d365ba16 286 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 287 inline bool operator==(const MatrixBase<OtherDerived>& other) const
ykuroda 0:13a5d365ba16 288 { return cwiseEqual(other).all(); }
ykuroda 0:13a5d365ba16 289
ykuroda 0:13a5d365ba16 290 /** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other.
ykuroda 0:13a5d365ba16 291 * \warning When using floating point scalar values you probably should rather use a
ykuroda 0:13a5d365ba16 292 * fuzzy comparison such as isApprox()
ykuroda 0:13a5d365ba16 293 * \sa isApprox(), operator== */
ykuroda 0:13a5d365ba16 294 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 295 inline bool operator!=(const MatrixBase<OtherDerived>& other) const
ykuroda 0:13a5d365ba16 296 { return cwiseNotEqual(other).any(); }
ykuroda 0:13a5d365ba16 297
ykuroda 0:13a5d365ba16 298 NoAlias<Derived,Eigen::MatrixBase > noalias();
ykuroda 0:13a5d365ba16 299
ykuroda 0:13a5d365ba16 300 inline const ForceAlignedAccess<Derived> forceAlignedAccess() const;
ykuroda 0:13a5d365ba16 301 inline ForceAlignedAccess<Derived> forceAlignedAccess();
ykuroda 0:13a5d365ba16 302 template<bool Enable> inline typename internal::add_const_on_value_type<typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type>::type forceAlignedAccessIf() const;
ykuroda 0:13a5d365ba16 303 template<bool Enable> inline typename internal::conditional<Enable,ForceAlignedAccess<Derived>,Derived&>::type forceAlignedAccessIf();
ykuroda 0:13a5d365ba16 304
ykuroda 0:13a5d365ba16 305 Scalar trace() const;
ykuroda 0:13a5d365ba16 306
ykuroda 0:13a5d365ba16 307 /////////// Array module ///////////
ykuroda 0:13a5d365ba16 308
ykuroda 0:13a5d365ba16 309 template<int p> RealScalar lpNorm() const;
ykuroda 0:13a5d365ba16 310
ykuroda 0:13a5d365ba16 311 MatrixBase<Derived>& matrix() { return *this; }
ykuroda 0:13a5d365ba16 312 const MatrixBase<Derived>& matrix() const { return *this; }
ykuroda 0:13a5d365ba16 313
ykuroda 0:13a5d365ba16 314 /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix
ykuroda 0:13a5d365ba16 315 * \sa ArrayBase::matrix() */
ykuroda 0:13a5d365ba16 316 ArrayWrapper<Derived> array() { return derived(); }
ykuroda 0:13a5d365ba16 317 const ArrayWrapper<const Derived> array() const { return derived(); }
ykuroda 0:13a5d365ba16 318
ykuroda 0:13a5d365ba16 319 /////////// LU module ///////////
ykuroda 0:13a5d365ba16 320
ykuroda 0:13a5d365ba16 321 const FullPivLU<PlainObject> fullPivLu() const;
ykuroda 0:13a5d365ba16 322 const PartialPivLU<PlainObject> partialPivLu() const;
ykuroda 0:13a5d365ba16 323
ykuroda 0:13a5d365ba16 324 #if EIGEN2_SUPPORT_STAGE < STAGE20_RESOLVE_API_CONFLICTS
ykuroda 0:13a5d365ba16 325 const LU<PlainObject> lu() const;
ykuroda 0:13a5d365ba16 326 #endif
ykuroda 0:13a5d365ba16 327
ykuroda 0:13a5d365ba16 328 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 329 const LU<PlainObject> eigen2_lu() const;
ykuroda 0:13a5d365ba16 330 #endif
ykuroda 0:13a5d365ba16 331
ykuroda 0:13a5d365ba16 332 #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS
ykuroda 0:13a5d365ba16 333 const PartialPivLU<PlainObject> lu() const;
ykuroda 0:13a5d365ba16 334 #endif
ykuroda 0:13a5d365ba16 335
ykuroda 0:13a5d365ba16 336 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 337 template<typename ResultType>
ykuroda 0:13a5d365ba16 338 void computeInverse(MatrixBase<ResultType> *result) const {
ykuroda 0:13a5d365ba16 339 *result = this->inverse();
ykuroda 0:13a5d365ba16 340 }
ykuroda 0:13a5d365ba16 341 #endif
ykuroda 0:13a5d365ba16 342
ykuroda 0:13a5d365ba16 343 const internal::inverse_impl<Derived> inverse() const;
ykuroda 0:13a5d365ba16 344 template<typename ResultType>
ykuroda 0:13a5d365ba16 345 void computeInverseAndDetWithCheck(
ykuroda 0:13a5d365ba16 346 ResultType& inverse,
ykuroda 0:13a5d365ba16 347 typename ResultType::Scalar& determinant,
ykuroda 0:13a5d365ba16 348 bool& invertible,
ykuroda 0:13a5d365ba16 349 const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
ykuroda 0:13a5d365ba16 350 ) const;
ykuroda 0:13a5d365ba16 351 template<typename ResultType>
ykuroda 0:13a5d365ba16 352 void computeInverseWithCheck(
ykuroda 0:13a5d365ba16 353 ResultType& inverse,
ykuroda 0:13a5d365ba16 354 bool& invertible,
ykuroda 0:13a5d365ba16 355 const RealScalar& absDeterminantThreshold = NumTraits<Scalar>::dummy_precision()
ykuroda 0:13a5d365ba16 356 ) const;
ykuroda 0:13a5d365ba16 357 Scalar determinant() const;
ykuroda 0:13a5d365ba16 358
ykuroda 0:13a5d365ba16 359 /////////// Cholesky module ///////////
ykuroda 0:13a5d365ba16 360
ykuroda 0:13a5d365ba16 361 const LLT<PlainObject> llt() const;
ykuroda 0:13a5d365ba16 362 const LDLT<PlainObject> ldlt() const;
ykuroda 0:13a5d365ba16 363
ykuroda 0:13a5d365ba16 364 /////////// QR module ///////////
ykuroda 0:13a5d365ba16 365
ykuroda 0:13a5d365ba16 366 const HouseholderQR<PlainObject> householderQr() const;
ykuroda 0:13a5d365ba16 367 const ColPivHouseholderQR<PlainObject> colPivHouseholderQr() const;
ykuroda 0:13a5d365ba16 368 const FullPivHouseholderQR<PlainObject> fullPivHouseholderQr() const;
ykuroda 0:13a5d365ba16 369
ykuroda 0:13a5d365ba16 370 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 371 const QR<PlainObject> qr() const;
ykuroda 0:13a5d365ba16 372 #endif
ykuroda 0:13a5d365ba16 373
ykuroda 0:13a5d365ba16 374 EigenvaluesReturnType eigenvalues() const;
ykuroda 0:13a5d365ba16 375 RealScalar operatorNorm() const;
ykuroda 0:13a5d365ba16 376
ykuroda 0:13a5d365ba16 377 /////////// SVD module ///////////
ykuroda 0:13a5d365ba16 378
ykuroda 0:13a5d365ba16 379 JacobiSVD<PlainObject> jacobiSvd(unsigned int computationOptions = 0) const;
ykuroda 0:13a5d365ba16 380
ykuroda 0:13a5d365ba16 381 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 382 SVD<PlainObject> svd() const;
ykuroda 0:13a5d365ba16 383 #endif
ykuroda 0:13a5d365ba16 384
ykuroda 0:13a5d365ba16 385 /////////// Geometry module ///////////
ykuroda 0:13a5d365ba16 386
ykuroda 0:13a5d365ba16 387 #ifndef EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 388 /// \internal helper struct to form the return type of the cross product
ykuroda 0:13a5d365ba16 389 template<typename OtherDerived> struct cross_product_return_type {
ykuroda 0:13a5d365ba16 390 typedef typename internal::scalar_product_traits<typename internal::traits<Derived>::Scalar,typename internal::traits<OtherDerived>::Scalar>::ReturnType Scalar;
ykuroda 0:13a5d365ba16 391 typedef Matrix<Scalar,MatrixBase::RowsAtCompileTime,MatrixBase::ColsAtCompileTime> type;
ykuroda 0:13a5d365ba16 392 };
ykuroda 0:13a5d365ba16 393 #endif // EIGEN_PARSED_BY_DOXYGEN
ykuroda 0:13a5d365ba16 394 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 395 typename cross_product_return_type<OtherDerived>::type
ykuroda 0:13a5d365ba16 396 cross(const MatrixBase<OtherDerived>& other) const;
ykuroda 0:13a5d365ba16 397 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 398 PlainObject cross3(const MatrixBase<OtherDerived>& other) const;
ykuroda 0:13a5d365ba16 399 PlainObject unitOrthogonal(void) const;
ykuroda 0:13a5d365ba16 400 Matrix<Scalar,3,1> eulerAngles(Index a0, Index a1, Index a2) const;
ykuroda 0:13a5d365ba16 401
ykuroda 0:13a5d365ba16 402 #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS
ykuroda 0:13a5d365ba16 403 ScalarMultipleReturnType operator*(const UniformScaling<Scalar>& s) const;
ykuroda 0:13a5d365ba16 404 // put this as separate enum value to work around possible GCC 4.3 bug (?)
ykuroda 0:13a5d365ba16 405 enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1?Vertical:Horizontal };
ykuroda 0:13a5d365ba16 406 typedef Homogeneous<Derived, HomogeneousReturnTypeDirection> HomogeneousReturnType;
ykuroda 0:13a5d365ba16 407 HomogeneousReturnType homogeneous() const;
ykuroda 0:13a5d365ba16 408 #endif
ykuroda 0:13a5d365ba16 409
ykuroda 0:13a5d365ba16 410 enum {
ykuroda 0:13a5d365ba16 411 SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1
ykuroda 0:13a5d365ba16 412 };
ykuroda 0:13a5d365ba16 413 typedef Block<const Derived,
ykuroda 0:13a5d365ba16 414 internal::traits<Derived>::ColsAtCompileTime==1 ? SizeMinusOne : 1,
ykuroda 0:13a5d365ba16 415 internal::traits<Derived>::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne;
ykuroda 0:13a5d365ba16 416 typedef CwiseUnaryOp<internal::scalar_quotient1_op<typename internal::traits<Derived>::Scalar>,
ykuroda 0:13a5d365ba16 417 const ConstStartMinusOne > HNormalizedReturnType;
ykuroda 0:13a5d365ba16 418
ykuroda 0:13a5d365ba16 419 const HNormalizedReturnType hnormalized() const;
ykuroda 0:13a5d365ba16 420
ykuroda 0:13a5d365ba16 421 ////////// Householder module ///////////
ykuroda 0:13a5d365ba16 422
ykuroda 0:13a5d365ba16 423 void makeHouseholderInPlace(Scalar& tau, RealScalar& beta);
ykuroda 0:13a5d365ba16 424 template<typename EssentialPart>
ykuroda 0:13a5d365ba16 425 void makeHouseholder(EssentialPart& essential,
ykuroda 0:13a5d365ba16 426 Scalar& tau, RealScalar& beta) const;
ykuroda 0:13a5d365ba16 427 template<typename EssentialPart>
ykuroda 0:13a5d365ba16 428 void applyHouseholderOnTheLeft(const EssentialPart& essential,
ykuroda 0:13a5d365ba16 429 const Scalar& tau,
ykuroda 0:13a5d365ba16 430 Scalar* workspace);
ykuroda 0:13a5d365ba16 431 template<typename EssentialPart>
ykuroda 0:13a5d365ba16 432 void applyHouseholderOnTheRight(const EssentialPart& essential,
ykuroda 0:13a5d365ba16 433 const Scalar& tau,
ykuroda 0:13a5d365ba16 434 Scalar* workspace);
ykuroda 0:13a5d365ba16 435
ykuroda 0:13a5d365ba16 436 ///////// Jacobi module /////////
ykuroda 0:13a5d365ba16 437
ykuroda 0:13a5d365ba16 438 template<typename OtherScalar>
ykuroda 0:13a5d365ba16 439 void applyOnTheLeft(Index p, Index q, const JacobiRotation<OtherScalar>& j);
ykuroda 0:13a5d365ba16 440 template<typename OtherScalar>
ykuroda 0:13a5d365ba16 441 void applyOnTheRight(Index p, Index q, const JacobiRotation<OtherScalar>& j);
ykuroda 0:13a5d365ba16 442
ykuroda 0:13a5d365ba16 443 ///////// SparseCore module /////////
ykuroda 0:13a5d365ba16 444
ykuroda 0:13a5d365ba16 445 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 446 EIGEN_STRONG_INLINE const typename SparseMatrixBase<OtherDerived>::template CwiseProductDenseReturnType<Derived>::Type
ykuroda 0:13a5d365ba16 447 cwiseProduct(const SparseMatrixBase<OtherDerived> &other) const
ykuroda 0:13a5d365ba16 448 {
ykuroda 0:13a5d365ba16 449 return other.cwiseProduct(derived());
ykuroda 0:13a5d365ba16 450 }
ykuroda 0:13a5d365ba16 451
ykuroda 0:13a5d365ba16 452 ///////// MatrixFunctions module /////////
ykuroda 0:13a5d365ba16 453
ykuroda 0:13a5d365ba16 454 typedef typename internal::stem_function<Scalar>::type StemFunction;
ykuroda 0:13a5d365ba16 455 const MatrixExponentialReturnValue<Derived> exp() const;
ykuroda 0:13a5d365ba16 456 const MatrixFunctionReturnValue<Derived> matrixFunction(StemFunction f) const;
ykuroda 0:13a5d365ba16 457 const MatrixFunctionReturnValue<Derived> cosh() const;
ykuroda 0:13a5d365ba16 458 const MatrixFunctionReturnValue<Derived> sinh() const;
ykuroda 0:13a5d365ba16 459 const MatrixFunctionReturnValue<Derived> cos() const;
ykuroda 0:13a5d365ba16 460 const MatrixFunctionReturnValue<Derived> sin() const;
ykuroda 0:13a5d365ba16 461 const MatrixSquareRootReturnValue<Derived> sqrt() const;
ykuroda 0:13a5d365ba16 462 const MatrixLogarithmReturnValue<Derived> log() const;
ykuroda 0:13a5d365ba16 463 const MatrixPowerReturnValue<Derived> pow(const RealScalar& p) const;
ykuroda 0:13a5d365ba16 464
ykuroda 0:13a5d365ba16 465 #ifdef EIGEN2_SUPPORT
ykuroda 0:13a5d365ba16 466 template<typename ProductDerived, typename Lhs, typename Rhs>
ykuroda 0:13a5d365ba16 467 Derived& operator+=(const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
ykuroda 0:13a5d365ba16 468 EvalBeforeAssigningBit>& other);
ykuroda 0:13a5d365ba16 469
ykuroda 0:13a5d365ba16 470 template<typename ProductDerived, typename Lhs, typename Rhs>
ykuroda 0:13a5d365ba16 471 Derived& operator-=(const Flagged<ProductBase<ProductDerived, Lhs,Rhs>, 0,
ykuroda 0:13a5d365ba16 472 EvalBeforeAssigningBit>& other);
ykuroda 0:13a5d365ba16 473
ykuroda 0:13a5d365ba16 474 /** \deprecated because .lazy() is deprecated
ykuroda 0:13a5d365ba16 475 * Overloaded for cache friendly product evaluation */
ykuroda 0:13a5d365ba16 476 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 477 Derived& lazyAssign(const Flagged<OtherDerived, 0, EvalBeforeAssigningBit>& other)
ykuroda 0:13a5d365ba16 478 { return lazyAssign(other._expression()); }
ykuroda 0:13a5d365ba16 479
ykuroda 0:13a5d365ba16 480 template<unsigned int Added>
ykuroda 0:13a5d365ba16 481 const Flagged<Derived, Added, 0> marked() const;
ykuroda 0:13a5d365ba16 482 const Flagged<Derived, 0, EvalBeforeAssigningBit> lazy() const;
ykuroda 0:13a5d365ba16 483
ykuroda 0:13a5d365ba16 484 inline const Cwise<Derived> cwise() const;
ykuroda 0:13a5d365ba16 485 inline Cwise<Derived> cwise();
ykuroda 0:13a5d365ba16 486
ykuroda 0:13a5d365ba16 487 VectorBlock<Derived> start(Index size);
ykuroda 0:13a5d365ba16 488 const VectorBlock<const Derived> start(Index size) const;
ykuroda 0:13a5d365ba16 489 VectorBlock<Derived> end(Index size);
ykuroda 0:13a5d365ba16 490 const VectorBlock<const Derived> end(Index size) const;
ykuroda 0:13a5d365ba16 491 template<int Size> VectorBlock<Derived,Size> start();
ykuroda 0:13a5d365ba16 492 template<int Size> const VectorBlock<const Derived,Size> start() const;
ykuroda 0:13a5d365ba16 493 template<int Size> VectorBlock<Derived,Size> end();
ykuroda 0:13a5d365ba16 494 template<int Size> const VectorBlock<const Derived,Size> end() const;
ykuroda 0:13a5d365ba16 495
ykuroda 0:13a5d365ba16 496 Minor<Derived> minor(Index row, Index col);
ykuroda 0:13a5d365ba16 497 const Minor<Derived> minor(Index row, Index col) const;
ykuroda 0:13a5d365ba16 498 #endif
ykuroda 0:13a5d365ba16 499
ykuroda 0:13a5d365ba16 500 protected:
ykuroda 0:13a5d365ba16 501 MatrixBase() : Base() {}
ykuroda 0:13a5d365ba16 502
ykuroda 0:13a5d365ba16 503 private:
ykuroda 0:13a5d365ba16 504 explicit MatrixBase(int);
ykuroda 0:13a5d365ba16 505 MatrixBase(int,int);
ykuroda 0:13a5d365ba16 506 template<typename OtherDerived> explicit MatrixBase(const MatrixBase<OtherDerived>&);
ykuroda 0:13a5d365ba16 507 protected:
ykuroda 0:13a5d365ba16 508 // mixing arrays and matrices is not legal
ykuroda 0:13a5d365ba16 509 template<typename OtherDerived> Derived& operator+=(const ArrayBase<OtherDerived>& )
ykuroda 0:13a5d365ba16 510 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
ykuroda 0:13a5d365ba16 511 // mixing arrays and matrices is not legal
ykuroda 0:13a5d365ba16 512 template<typename OtherDerived> Derived& operator-=(const ArrayBase<OtherDerived>& )
ykuroda 0:13a5d365ba16 513 {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;}
ykuroda 0:13a5d365ba16 514 };
ykuroda 0:13a5d365ba16 515
ykuroda 0:13a5d365ba16 516
ykuroda 0:13a5d365ba16 517 /***************************************************************************
ykuroda 0:13a5d365ba16 518 * Implementation of matrix base methods
ykuroda 0:13a5d365ba16 519 ***************************************************************************/
ykuroda 0:13a5d365ba16 520
ykuroda 0:13a5d365ba16 521 /** replaces \c *this by \c *this * \a other.
ykuroda 0:13a5d365ba16 522 *
ykuroda 0:13a5d365ba16 523 * \returns a reference to \c *this
ykuroda 0:13a5d365ba16 524 *
ykuroda 0:13a5d365ba16 525 * Example: \include MatrixBase_applyOnTheRight.cpp
ykuroda 0:13a5d365ba16 526 * Output: \verbinclude MatrixBase_applyOnTheRight.out
ykuroda 0:13a5d365ba16 527 */
ykuroda 0:13a5d365ba16 528 template<typename Derived>
ykuroda 0:13a5d365ba16 529 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 530 inline Derived&
ykuroda 0:13a5d365ba16 531 MatrixBase<Derived>::operator*=(const EigenBase<OtherDerived> &other)
ykuroda 0:13a5d365ba16 532 {
ykuroda 0:13a5d365ba16 533 other.derived().applyThisOnTheRight(derived());
ykuroda 0:13a5d365ba16 534 return derived();
ykuroda 0:13a5d365ba16 535 }
ykuroda 0:13a5d365ba16 536
ykuroda 0:13a5d365ba16 537 /** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=().
ykuroda 0:13a5d365ba16 538 *
ykuroda 0:13a5d365ba16 539 * Example: \include MatrixBase_applyOnTheRight.cpp
ykuroda 0:13a5d365ba16 540 * Output: \verbinclude MatrixBase_applyOnTheRight.out
ykuroda 0:13a5d365ba16 541 */
ykuroda 0:13a5d365ba16 542 template<typename Derived>
ykuroda 0:13a5d365ba16 543 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 544 inline void MatrixBase<Derived>::applyOnTheRight(const EigenBase<OtherDerived> &other)
ykuroda 0:13a5d365ba16 545 {
ykuroda 0:13a5d365ba16 546 other.derived().applyThisOnTheRight(derived());
ykuroda 0:13a5d365ba16 547 }
ykuroda 0:13a5d365ba16 548
ykuroda 0:13a5d365ba16 549 /** replaces \c *this by \a other * \c *this.
ykuroda 0:13a5d365ba16 550 *
ykuroda 0:13a5d365ba16 551 * Example: \include MatrixBase_applyOnTheLeft.cpp
ykuroda 0:13a5d365ba16 552 * Output: \verbinclude MatrixBase_applyOnTheLeft.out
ykuroda 0:13a5d365ba16 553 */
ykuroda 0:13a5d365ba16 554 template<typename Derived>
ykuroda 0:13a5d365ba16 555 template<typename OtherDerived>
ykuroda 0:13a5d365ba16 556 inline void MatrixBase<Derived>::applyOnTheLeft(const EigenBase<OtherDerived> &other)
ykuroda 0:13a5d365ba16 557 {
ykuroda 0:13a5d365ba16 558 other.derived().applyThisOnTheLeft(derived());
ykuroda 0:13a5d365ba16 559 }
ykuroda 0:13a5d365ba16 560
ykuroda 0:13a5d365ba16 561 } // end namespace Eigen
ykuroda 0:13a5d365ba16 562
ykuroda 0:13a5d365ba16 563 #endif // EIGEN_MATRIXBASE_H