diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-07-27 12:13:53 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-07-27 12:13:53 +0200 |
commit | b5e40642898e3af17e67a7b78fa3b63191e11bb7 (patch) | |
tree | f087c9bdd19f6027e226287572d1a03c8c59b839 /Eigen/src | |
parent | f95b77be6216db7b5448d7d728339cae81129bc9 (diff) |
cleaning and fix a perf issue
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/products/SelfadjointRank2Update.h | 2 | ||||
-rw-r--r-- | Eigen/src/Core/products/TriangularMatrixVector.h | 52 |
2 files changed, 3 insertions, 51 deletions
diff --git a/Eigen/src/Core/products/SelfadjointRank2Update.h b/Eigen/src/Core/products/SelfadjointRank2Update.h index 6c8a28f65..65a321fde 100644 --- a/Eigen/src/Core/products/SelfadjointRank2Update.h +++ b/Eigen/src/Core/products/SelfadjointRank2Update.h @@ -63,7 +63,7 @@ struct ei_selfadjoint_rank2_update_selector<Scalar,UType,VType,UpperTriangular> }; template<bool Cond, typename T> struct ei_conj_expr_if - : ei_meta_if<!Cond, T, + : ei_meta_if<!Cond, const T&, CwiseUnaryOp<ei_scalar_conjugate_op<typename ei_traits<T>::Scalar>,T> > {}; diff --git a/Eigen/src/Core/products/TriangularMatrixVector.h b/Eigen/src/Core/products/TriangularMatrixVector.h index 0fbbb50d2..c557e5237 100644 --- a/Eigen/src/Core/products/TriangularMatrixVector.h +++ b/Eigen/src/Core/products/TriangularMatrixVector.h @@ -37,12 +37,12 @@ struct ei_product_triangular_vector_selector<Lhs,Rhs,Result,Mode,ConjLhs,ConjRhs IsLowerTriangular = ((Mode&LowerTriangularBit)==LowerTriangularBit), HasUnitDiag = (Mode & UnitDiagBit)==UnitDiagBit }; - static void run(const Lhs& lhs, const Rhs& rhs, Result& res, typename ei_traits<Lhs>::Scalar alpha) + static EIGEN_DONT_INLINE void run(const Lhs& lhs, const Rhs& rhs, Result& res, typename ei_traits<Lhs>::Scalar alpha) { static const int PanelWidth = EIGEN_TUNE_TRIANGULAR_PANEL_WIDTH; typename ei_conj_expr_if<ConjLhs,Lhs>::ret cjLhs(lhs); typename ei_conj_expr_if<ConjRhs,Rhs>::ret cjRhs(rhs); - + int size = lhs.cols(); for (int pi=0; pi<size; pi+=PanelWidth) { @@ -113,52 +113,6 @@ struct ei_product_triangular_vector_selector<Lhs,Rhs,Result,Mode,ConjLhs,ConjRhs } }; -// template<typename Lhs,typename Rhs> -// struct ei_triangular_vector_product_returntype -// : public ReturnByValue<ei_triangular_vector_product_returntype<Lhs,Rhs>, -// Matrix<typename ei_traits<Rhs>::Scalar, -// Rhs::RowsAtCompileTime,Rhs::ColsAtCompileTime> > -// { -// typedef typename Lhs::Scalar Scalar; -// typedef typename ei_cleantype<typename Rhs::Nested>::type RhsNested; -// ei_triangular_vector_product_returntype(const Lhs& lhs, const Rhs& rhs, Scalar alpha) -// : m_lhs(lhs), m_rhs(rhs), m_alpha(alpha) -// {} -// -// template<typename Dest> void evalTo(Dest& dst) const -// { -// typedef typename Lhs::MatrixType MatrixType; -// -// typedef ei_blas_traits<MatrixType> LhsBlasTraits; -// typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; -// typedef typename ei_cleantype<ActualLhsType>::type _ActualLhsType; -// const ActualLhsType actualLhs = LhsBlasTraits::extract(m_lhs._expression()); -// -// typedef ei_blas_traits<Rhs> RhsBlasTraits; -// typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; -// typedef typename ei_cleantype<ActualRhsType>::type _ActualRhsType; -// const ActualRhsType actualRhs = RhsBlasTraits::extract(m_rhs); -// -// Scalar actualAlpha = m_alpha * LhsBlasTraits::extractScalarFactor(m_lhs._expression()) -// * RhsBlasTraits::extractScalarFactor(m_rhs); -// -// dst.resize(m_rhs.rows(), m_rhs.cols()); -// dst.setZero(); -// ei_product_triangular_vector_selector -// <_ActualLhsType,_ActualRhsType,Dest, -// ei_traits<Lhs>::Mode, -// LhsBlasTraits::NeedToConjugate, -// RhsBlasTraits::NeedToConjugate, -// ei_traits<Lhs>::Flags&RowMajorBit> -// ::run(actualLhs,actualRhs,dst,actualAlpha); -// } -// -// const Lhs m_lhs; -// const typename Rhs::Nested m_rhs; -// const Scalar m_alpha; -// }; - - /*************************************************************************** * Wrapper to ei_product_triangular_vector ***************************************************************************/ @@ -207,8 +161,6 @@ struct ei_triangular_product_returntype<Mode,true,Lhs,false,Rhs,true> Scalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(m_lhs) * RhsBlasTraits::extractScalarFactor(m_rhs); - dst.resize(m_rhs.rows(), m_rhs.cols()); - dst.setZero(); ei_product_triangular_vector_selector <_ActualLhsType,_ActualRhsType,Dest, Mode, |