diff options
author | Tim Murray <timmurray@google.com> | 2015-02-05 10:29:43 -0800 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2015-02-17 11:34:24 -0800 |
commit | 615d816d068b4d0f5e8df601930b5f160bf7eda1 (patch) | |
tree | aa235908947bacf48c08d47ffefbfabca71d6b4d /Eigen/src/Core/TriangularMatrix.h | |
parent | 7faaa9f3f0df9d23790277834d426c3d992ac3ba (diff) | |
download | eigen-615d816d068b4d0f5e8df601930b5f160bf7eda1.tar.gz |
Rebase Eigen to 3.2.4.
Change-Id: Ia5161a916545b0a7903825b57faac438086320f3
Diffstat (limited to 'Eigen/src/Core/TriangularMatrix.h')
-rw-r--r-- | Eigen/src/Core/TriangularMatrix.h | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index 845ae1aec..4d65392c6 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -380,19 +380,19 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView EIGEN_STRONG_INLINE TriangularView& operator=(const ProductBase<ProductDerived, Lhs,Rhs>& other) { setZero(); - return assignProduct(other,1); + return assignProduct(other.derived(),1); } template<typename ProductDerived, typename Lhs, typename Rhs> EIGEN_STRONG_INLINE TriangularView& operator+=(const ProductBase<ProductDerived, Lhs,Rhs>& other) { - return assignProduct(other,1); + return assignProduct(other.derived(),1); } template<typename ProductDerived, typename Lhs, typename Rhs> EIGEN_STRONG_INLINE TriangularView& operator-=(const ProductBase<ProductDerived, Lhs,Rhs>& other) { - return assignProduct(other,-1); + return assignProduct(other.derived(),-1); } @@ -400,25 +400,34 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularView EIGEN_STRONG_INLINE TriangularView& operator=(const ScaledProduct<ProductDerived>& other) { setZero(); - return assignProduct(other,other.alpha()); + return assignProduct(other.derived(),other.alpha()); } template<typename ProductDerived> EIGEN_STRONG_INLINE TriangularView& operator+=(const ScaledProduct<ProductDerived>& other) { - return assignProduct(other,other.alpha()); + return assignProduct(other.derived(),other.alpha()); } template<typename ProductDerived> EIGEN_STRONG_INLINE TriangularView& operator-=(const ScaledProduct<ProductDerived>& other) { - return assignProduct(other,-other.alpha()); + return assignProduct(other.derived(),-other.alpha()); } protected: template<typename ProductDerived, typename Lhs, typename Rhs> EIGEN_STRONG_INLINE TriangularView& assignProduct(const ProductBase<ProductDerived, Lhs,Rhs>& prod, const Scalar& alpha); + + template<int Mode, bool LhsIsTriangular, + typename Lhs, bool LhsIsVector, + typename Rhs, bool RhsIsVector> + EIGEN_STRONG_INLINE TriangularView& assignProduct(const TriangularProduct<Mode, LhsIsTriangular, Lhs, LhsIsVector, Rhs, RhsIsVector>& prod, const Scalar& alpha) + { + lazyAssign(alpha*prod.eval()); + return *this; + } MatrixTypeNested m_matrix; }; |