diff options
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/MapBase.h | 18 | ||||
-rw-r--r-- | Eigen/src/Core/Matrix.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/MatrixBase.h | 9 | ||||
-rw-r--r-- | Eigen/src/Core/Product.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/ReturnByValue.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/SelfAdjointView.h | 6 | ||||
-rw-r--r-- | Eigen/src/Core/products/TriangularMatrixMatrix.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/products/TriangularMatrixVector.h | 3 |
8 files changed, 31 insertions, 18 deletions
diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index e643144ff..20103408b 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -173,14 +173,16 @@ template<typename Derived> class MapBase using Base::operator=; using Base::operator*=; - - template<typename Lhs,typename Rhs> - Derived& operator+=(const Flagged<Product<Lhs,Rhs,CacheFriendlyProduct>, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit>& other) - { return Base::operator+=(other); } - - template<typename Lhs,typename Rhs> - Derived& operator-=(const Flagged<Product<Lhs,Rhs,CacheFriendlyProduct>, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit>& other) - { return Base::operator-=(other); } + using Base::operator+=; + using Base::operator-=; + +// template<typename Lhs,typename Rhs> +// Derived& operator+=(const Flagged<Product<Lhs,Rhs,CacheFriendlyProduct>, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit>& other) +// { return Base::operator+=(other); } +// +// template<typename Lhs,typename Rhs> +// Derived& operator-=(const Flagged<Product<Lhs,Rhs,CacheFriendlyProduct>, 0, EvalBeforeNestingBit | EvalBeforeAssigningBit>& other) +// { return Base::operator-=(other); } template<typename OtherDerived> Derived& operator+=(const MatrixBase<OtherDerived>& other) diff --git a/Eigen/src/Core/Matrix.h b/Eigen/src/Core/Matrix.h index c4adc1c33..8937596f2 100644 --- a/Eigen/src/Core/Matrix.h +++ b/Eigen/src/Core/Matrix.h @@ -334,7 +334,10 @@ class Matrix template<typename OtherDerived,typename OtherEvalType> EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue<OtherDerived,OtherEvalType>& func) - { return Base::operator=(func); } + { + resize(func.rows(), func.cols()); + return Base::operator=(func); + } using Base::operator +=; using Base::operator -=; @@ -438,6 +441,7 @@ class Matrix EIGEN_STRONG_INLINE Matrix(const ReturnByValue<OtherDerived,OtherEvalType>& other) { _check_template_params(); + resize(other.rows(), other.cols()); other.evalTo(*this); } /** Destructor */ diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index ac2b2532f..b881c09c3 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -409,15 +409,8 @@ template<typename Derived> class MatrixBase const typename ProductReturnType<Derived,OtherDerived>::Type operator*(const MatrixBase<OtherDerived> &other) const; - /** replaces \c *this by \c *this * \a other. - * - * \returns a reference to \c *this - */ template<typename OtherDerived> - Derived& operator*=(const MultiplierBase<OtherDerived>& other) - { - return *this = *this * other.derived(); - } + Derived& operator*=(const MultiplierBase<OtherDerived>& other); template<typename DiagonalDerived> const DiagonalProduct<Derived, DiagonalDerived, DiagonalOnTheRight> diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index b46440ec0..ff45cba3c 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -294,7 +294,7 @@ MatrixBase<Derived>::operator*(const MatrixBase<OtherDerived> &other) const template<typename Derived> template<typename OtherDerived> inline Derived & -MatrixBase<Derived>::operator*=(const MatrixBase<OtherDerived> &other) +MatrixBase<Derived>::operator*=(const MultiplierBase<OtherDerived> &other) { return derived() = derived() * other.derived(); } diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h index 72f4a8f43..58b205edc 100644 --- a/Eigen/src/Core/ReturnByValue.h +++ b/Eigen/src/Core/ReturnByValue.h @@ -76,6 +76,8 @@ template<typename Functor, typename _Scalar,int _Rows,int _Cols,int _Options,int { EvalType res; evalTo(res); dst += res; } template<typename Dest> inline void _subTo(Dest& dst) const { EvalType res; evalTo(res); dst -= res; } + inline int rows() const { return static_cast<const Functor* const>(this)->rows(); } + inline int cols() const { return static_cast<const Functor* const>(this)->cols(); } }; template<typename Derived> diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index 5644e2fab..48d368ea4 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -228,6 +228,9 @@ struct ei_selfadjoint_product_returntype<Lhs,LhsMode,false,Rhs,0,true> : m_lhs(lhs), m_rhs(rhs) {} + inline int rows() const { return m_lhs.rows(); } + inline int cols() const { return m_lhs.cols(); } + template<typename Dest> inline void _addTo(Dest& dst) const { evalTo(dst,1); } template<typename Dest> inline void _subTo(Dest& dst) const @@ -278,6 +281,9 @@ struct ei_selfadjoint_product_returntype<Lhs,LhsMode,false,Rhs,RhsMode,false> : m_lhs(lhs), m_rhs(rhs) {} + inline int rows() const { return m_lhs.rows(); } + inline int cols() const { return m_lhs.cols(); } + typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Nested LhsNested; diff --git a/Eigen/src/Core/products/TriangularMatrixMatrix.h b/Eigen/src/Core/products/TriangularMatrixMatrix.h index 39a2bc4c5..b97eaeabf 100644 --- a/Eigen/src/Core/products/TriangularMatrixMatrix.h +++ b/Eigen/src/Core/products/TriangularMatrixMatrix.h @@ -330,6 +330,9 @@ struct ei_triangular_product_returntype<Mode,LhsIsTriangular,Lhs,false,Rhs,false : m_lhs(lhs), m_rhs(rhs) {} + inline int rows() const { return m_lhs.rows(); } + inline int cols() const { return m_lhs.cols(); } + typedef typename Lhs::Scalar Scalar; typedef typename Lhs::Nested LhsNested; diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index de65b1ece..864b89afc 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -141,6 +141,9 @@ struct ei_triangular_product_returntype<Mode,true,Lhs,false,Rhs,true> : m_lhs(lhs), m_rhs(rhs) {} + inline int rows() const { return m_lhs.rows(); } + inline int cols() const { return m_lhs.cols(); } + template<typename Dest> inline void _addTo(Dest& dst) const { evalTo(dst,1); } template<typename Dest> inline void _subTo(Dest& dst) const |