ArrayBase.h revision c981c48f5bc9aefeffc0bcb0cc3934c2fae179dd
1ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// This file is part of Eigen, a lightweight C++ template library 2ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// for linear algebra. 3ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// 4ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// Copyright (C) 2009 Gael Guennebaud <gael.guennebaud@inria.fr> 5ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// 6ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// This Source Code Form is subject to the terms of the Mozilla 7ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// Public License v. 2.0. If a copy of the MPL was not distributed 8ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976eepoger@google.com// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 98a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#ifndef EIGEN_ARRAYBASE_H 118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#define EIGEN_ARRAYBASE_H 128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 138a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comnamespace Eigen { 148a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename ExpressionType> class MatrixWrapper; 16e552dc82be1512df0a8a7f24310d27d2740d7601djsollen@google.com 178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** \class ArrayBase 188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \ingroup Core_Module 196336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * 206336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * \brief Base class for all 1D and 2D array, and related expressions 216336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * 226336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * An array is similar to a dense vector or matrix. While matrices are mathematical 236336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * objects with well defined linear algebra operators, an array is just a collection 246336f7c225f7806f5bbccea90ba6d2c881e8a470djordje.pesut * of scalar values arranged in a one or two dimensionnal fashion. As the main consequence, 2589351ec35a05eaf59edb7431d23a754cd084a363commit-bot@chromium.org * all operations applied to an array are performed coefficient wise. Furthermore, 26867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * arrays support scalar math functions of the c++ standard library (e.g., std::sin(x)), and convenient 27867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * constructors allowing to easily write generic code working for both scalar values 28867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * and arrays. 29867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * 30867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * This class is the base that is inherited by all array expression types. 31867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * 328a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \tparam Derived is the derived type, e.g., an array or an expression type. 338a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 348a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * This class can be extended with the help of the plugin mechanism described on the page 358a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_ARRAYBASE_PLUGIN. 368a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 378a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \sa class MatrixBase, \ref TopicClassHierarchy 388a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 398a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename Derived> class ArrayBase 408a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com : public DenseBase<Derived> 418a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 428a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com public: 43fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com#ifndef EIGEN_PARSED_BY_DOXYGEN 448a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com /** The base class for a given storage type. */ 458a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef ArrayBase StorageBaseType; 468a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 478a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl; 488a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 498a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com using internal::special_scalar_op_base<Derived,typename internal::traits<Derived>::Scalar, 50fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com typename NumTraits<typename internal::traits<Derived>::Scalar>::Real>::operator*; 518a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 528a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef typename internal::traits<Derived>::StorageKind StorageKind; 538a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef typename internal::traits<Derived>::Index Index; 548a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef typename internal::traits<Derived>::Scalar Scalar; 558a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef typename internal::packet_traits<Scalar>::type PacketScalar; 568a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef typename NumTraits<Scalar>::Real RealScalar; 578a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 588a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com typedef DenseBase<Derived> Base; 591fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::RowsAtCompileTime; 601fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::ColsAtCompileTime; 611fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::SizeAtCompileTime; 621fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::MaxRowsAtCompileTime; 63a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com using Base::MaxColsAtCompileTime; 64a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com using Base::MaxSizeAtCompileTime; 651fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::IsVectorAtCompileTime; 661fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::Flags; 67a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com using Base::CoeffReadCost; 68a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com 691fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::derived; 70fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com using Base::const_cast_derived; 711fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::rows; 721fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::cols; 73ea16cfa037bca933f6930a487b42f3c0faab9fe4reed@android.com using Base::size; 741fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::coeff; 751fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::coeffRef; 761fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::lazyAssign; 771fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::operator=; 781fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::operator+=; 79fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com using Base::operator-=; 801fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::operator*=; 811fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com using Base::operator/=; 82fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com 831fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com typedef typename Base::CoeffReturnType CoeffReturnType; 841fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 851fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com#endif // not EIGEN_PARSED_BY_DOXYGEN 861fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 871fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com#ifndef EIGEN_PARSED_BY_DOXYGEN 881fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com /** \internal the plain matrix type corresponding to this expression. Note that is not necessarily 891fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com * exactly the return type of eval(): in the case of plain matrices, the return type of eval() is a const 90a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com * reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either 91a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com * PlainObject or const PlainObject&. 92ea16cfa037bca933f6930a487b42f3c0faab9fe4reed@android.com */ 931fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com typedef Array<typename internal::traits<Derived>::Scalar, 94a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com internal::traits<Derived>::RowsAtCompileTime, 95a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com internal::traits<Derived>::ColsAtCompileTime, 96fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor), 971fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com internal::traits<Derived>::MaxRowsAtCompileTime, 981fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com internal::traits<Derived>::MaxColsAtCompileTime 991fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com > PlainObject; 1001fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 101867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com 1021fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com /** \internal Represents a matrix with all coefficients equal to one another*/ 1031fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com typedef CwiseNullaryOp<internal::scalar_constant_op<Scalar>,Derived> ConstantReturnType; 1041fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com#endif // not EIGEN_PARSED_BY_DOXYGEN 1051fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 106a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase 107a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com# include "../plugins/CommonCwiseUnaryOps.h" 108fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com# include "../plugins/MatrixCwiseUnaryOps.h" 1091fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# include "../plugins/ArrayCwiseUnaryOps.h" 1101fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# include "../plugins/CommonCwiseBinaryOps.h" 1111fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# include "../plugins/MatrixCwiseBinaryOps.h" 112867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com# include "../plugins/ArrayCwiseBinaryOps.h" 1131fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# ifdef EIGEN_ARRAYBASE_PLUGIN 1141fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# include EIGEN_ARRAYBASE_PLUGIN 1151fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com# endif 11687fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org#undef EIGEN_CURRENT_STORAGE_BASE_CLASS 11787fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org 1181fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com /** Special case of the template operator=, in order to prevent the compiler 1191fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com * from generating a default operator= (issue hit with g++ 4.1) 120a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com */ 121a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com Derived& operator=(const ArrayBase& other) 1221fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com { 123fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com return internal::assign_selector<Derived,Derived>::run(derived(), other.derived()); 1241fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com } 1251fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 1261fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com Derived& operator+=(const Scalar& scalar) 1271fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com { return *this = derived() + scalar; } 128fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com Derived& operator-=(const Scalar& scalar) 1291fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com { return *this = derived() - scalar; } 1301fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 1311fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com template<typename OtherDerived> 132fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com Derived& operator+=(const ArrayBase<OtherDerived>& other); 1331fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com template<typename OtherDerived> 1341fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com Derived& operator-=(const ArrayBase<OtherDerived>& other); 1351fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 1361fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com template<typename OtherDerived> 1371fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com Derived& operator*=(const ArrayBase<OtherDerived>& other); 1381fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 13987fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org template<typename OtherDerived> 14087fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org Derived& operator/=(const ArrayBase<OtherDerived>& other); 1411fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 142a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com public: 143a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com ArrayBase<Derived>& array() { return *this; } 1441fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com const ArrayBase<Derived>& array() const { return *this; } 145fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com 1461fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com /** \returns an \link MatrixBase Matrix \endlink expression of this array 1471fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com * \sa MatrixBase::array() */ 1481fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com MatrixWrapper<Derived> matrix() { return derived(); } 1491fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com const MatrixWrapper<const Derived> matrix() const { return derived(); } 1501fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 1511fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com// template<typename Dest> 15287fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org// inline void evalTo(Dest& dst) const { dst = matrix(); } 15387fcd950198a16211b3988610beebb5ca5bcf323commit-bot@chromium.org 1541fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com protected: 1551fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com ArrayBase() : Base() {} 156a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com 157a87cd2af4c7f46ba8437c2e500805c9deb9e3a40tomhudson@google.com private: 158fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com explicit ArrayBase(Index); 1591fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com ArrayBase(Index,Index); 1601fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com template<typename OtherDerived> explicit ArrayBase(const ArrayBase<OtherDerived>&); 1611fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com protected: 1621fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com // mixing arrays and matrices is not legal 163fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com template<typename OtherDerived> Derived& operator+=(const MatrixBase<OtherDerived>& ) 1641fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} 1651fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com // mixing arrays and matrices is not legal 166fbfcd5602128ec010c82cb733c9cdc0a3254f9f3rmistry@google.com template<typename OtherDerived> Derived& operator-=(const MatrixBase<OtherDerived>& ) 1671fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} 1681fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com}; 1691fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com 1701fc4c605def61d9e10489f9cd63dc378baa6ade3reed@android.com/** replaces \c *this by \c *this - \a other. 171867ee807cc95c77aff830e9e6c1988bfbe604405reed@android.com * 1728a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \returns a reference to \c *this 173dafaf7ac4d89f183dc515907665cdac3e3098466reed@android.com */ 1748a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename Derived> 1758a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename OtherDerived> 1768a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comEIGEN_STRONG_INLINE Derived & 1778a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comArrayBase<Derived>::operator-=(const ArrayBase<OtherDerived> &other) 1788a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 1798a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SelfCwiseBinaryOp<internal::scalar_difference_op<Scalar>, Derived, OtherDerived> tmp(derived()); 1808a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com tmp = other.derived(); 1818a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return derived(); 1828a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 1838a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 1848a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** replaces \c *this by \c *this + \a other. 1858a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 1868a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \returns a reference to \c *this 1878a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 1888a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename Derived> 1898a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename OtherDerived> 1908a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comEIGEN_STRONG_INLINE Derived & 1918a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comArrayBase<Derived>::operator+=(const ArrayBase<OtherDerived>& other) 1928a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 1938a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SelfCwiseBinaryOp<internal::scalar_sum_op<Scalar>, Derived, OtherDerived> tmp(derived()); 1948a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com tmp = other.derived(); 1958a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return derived(); 1968a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 1978a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 1988a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** replaces \c *this by \c *this * \a other coefficient wise. 1998a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * 2008a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com * \returns a reference to \c *this 2018a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 2028a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename Derived> 2038a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename OtherDerived> 2048a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comEIGEN_STRONG_INLINE Derived & 2058a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comArrayBase<Derived>::operator*=(const ArrayBase<OtherDerived>& other) 2068a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 2078a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SelfCwiseBinaryOp<internal::scalar_product_op<Scalar>, Derived, OtherDerived> tmp(derived()); 2088a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com tmp = other.derived(); 2098a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return derived(); 2108a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 2118a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 2128a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com/** replaces \c *this by \c *this / \a other coefficient wise. 213333d6cb2448d0febcbeb7c8c7310c0ff2d1a6104tomhudson@google.com * 214333d6cb2448d0febcbeb7c8c7310c0ff2d1a6104tomhudson@google.com * \returns a reference to \c *this 2158a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com */ 2168a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename Derived> 2178a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comtemplate<typename OtherDerived> 2188a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.comEIGEN_STRONG_INLINE Derived & 2197989186dab6bc2f1c1927daf91bddd32b7fd8d0creed@google.comArrayBase<Derived>::operator/=(const ArrayBase<OtherDerived>& other) 2208a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com{ 2218a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com SelfCwiseBinaryOp<internal::scalar_quotient_op<Scalar>, Derived, OtherDerived> tmp(derived()); 222e5f48243bdbed2662be7a31be0888abc273b09e8scroggo@google.com tmp = other.derived(); 2238a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com return derived(); 2248a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} 2258a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 2268a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com} // end namespace Eigen 2278a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com 2288a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com#endif // EIGEN_ARRAYBASE_H 2298a1c16ff38322f0210116fa7293eb8817c7e477ereed@android.com