diff options
author | 2009-08-03 16:05:15 +0200 | |
---|---|---|
committer | 2009-08-03 16:05:15 +0200 | |
commit | 3cf5bb31f6b6e3b6b8f229ed1658cb867fe6e8f5 (patch) | |
tree | 1b6f62f691f4879fe742c56a7234ca284a86e370 /Eigen/src/Core/products | |
parent | ce1dc1ab165929edd7608d83e448d81e4f968038 (diff) |
* Bye bye MultiplierBase, extend a bit AnyMatrixBase to allow =, +=, and -=
* This probably makes ReturnByValue needless
Diffstat (limited to 'Eigen/src/Core/products')
-rw-r--r-- | Eigen/src/Core/products/TriangularMatrixMatrix.h | 19 | ||||
-rw-r--r-- | Eigen/src/Core/products/TriangularMatrixVector.h | 19 |
2 files changed, 22 insertions, 16 deletions
diff --git a/Eigen/src/Core/products/TriangularMatrixMatrix.h b/Eigen/src/Core/products/TriangularMatrixMatrix.h index ce18941ee..f69c04365 100644 --- a/Eigen/src/Core/products/TriangularMatrixMatrix.h +++ b/Eigen/src/Core/products/TriangularMatrixMatrix.h @@ -321,12 +321,15 @@ struct ei_product_triangular_matrix_matrix<Scalar,Mode,false, ***************************************************************************/ template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs> -struct ei_triangular_product_returntype<Mode,LhsIsTriangular,Lhs,false,Rhs,false> - : public ReturnByValue<ei_triangular_product_returntype<Mode,LhsIsTriangular,Lhs,false,Rhs,false>, - Matrix<typename ei_traits<Rhs>::Scalar, - Lhs::RowsAtCompileTime,Rhs::ColsAtCompileTime> > +struct ei_traits<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false> > + : ei_traits<Matrix<typename ei_traits<Rhs>::Scalar,Lhs::RowsAtCompileTime,Rhs::ColsAtCompileTime> > +{}; + +template<int Mode, bool LhsIsTriangular, typename Lhs, typename Rhs> +struct TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false> + : public AnyMatrixBase<TriangularProduct<Mode,LhsIsTriangular,Lhs,false,Rhs,false> > { - ei_triangular_product_returntype(const Lhs& lhs, const Rhs& rhs) + TriangularProduct(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {} @@ -347,12 +350,12 @@ struct ei_triangular_product_returntype<Mode,LhsIsTriangular,Lhs,false,Rhs,false typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; typedef typename ei_cleantype<ActualRhsType>::type _ActualRhsType; - template<typename Dest> inline void _addTo(Dest& dst) const + template<typename Dest> inline void addToDense(Dest& dst) const { evalTo(dst,1); } - template<typename Dest> inline void _subTo(Dest& dst) const + template<typename Dest> inline void subToDense(Dest& dst) const { evalTo(dst,-1); } - template<typename Dest> void evalTo(Dest& dst) const + template<typename Dest> void evalToDense(Dest& dst) const { dst.resize(m_lhs.rows(), m_rhs.cols()); dst.setZero(); diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index 18d76b95c..42239fac0 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -118,10 +118,13 @@ struct ei_product_triangular_vector_selector<Lhs,Rhs,Result,Mode,ConjLhs,ConjRhs ***************************************************************************/ template<int Mode, /*bool LhsIsTriangular, */typename Lhs, typename Rhs> -struct ei_triangular_product_returntype<Mode,true,Lhs,false,Rhs,true> - : public ReturnByValue<ei_triangular_product_returntype<Mode,true,Lhs,false,Rhs,true>, - Matrix<typename ei_traits<Rhs>::Scalar, - Rhs::RowsAtCompileTime,Rhs::ColsAtCompileTime> > +struct ei_traits<TriangularProduct<Mode,true,Lhs,false,Rhs,true> > + : ei_traits<Matrix<typename ei_traits<Rhs>::Scalar,Lhs::RowsAtCompileTime,Rhs::ColsAtCompileTime> > +{}; + +template<int Mode, /*bool LhsIsTriangular, */typename Lhs, typename Rhs> +struct TriangularProduct<Mode,true,Lhs,false,Rhs,true> + : public AnyMatrixBase<TriangularProduct<Mode,true,Lhs,false,Rhs,true> > { typedef typename Lhs::Scalar Scalar; @@ -137,19 +140,19 @@ struct ei_triangular_product_returntype<Mode,true,Lhs,false,Rhs,true> typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; typedef typename ei_cleantype<ActualRhsType>::type _ActualRhsType; - ei_triangular_product_returntype(const Lhs& lhs, const Rhs& rhs) + TriangularProduct(const Lhs& lhs, const Rhs& rhs) : m_lhs(lhs), m_rhs(rhs) {} inline int rows() const { return m_lhs.rows(); } inline int cols() const { return m_rhs.cols(); } - template<typename Dest> inline void _addTo(Dest& dst) const + template<typename Dest> inline void addToDense(Dest& dst) const { evalTo(dst,1); } - template<typename Dest> inline void _subTo(Dest& dst) const + template<typename Dest> inline void subToDense(Dest& dst) const { evalTo(dst,-1); } - template<typename Dest> void evalTo(Dest& dst) const + template<typename Dest> void evalToDense(Dest& dst) const { dst.setZero(); evalTo(dst,1); |