From 826bff58c68273d1d0088898c1f54a01c9a94b04 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 4 Jan 2010 17:36:26 +0100 Subject: Fix #69 for the second time, and add the respective regression test --- Eigen/src/Core/SolveTriangular.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'Eigen/src/Core/SolveTriangular.h') diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 15717a120..9c4a49c3c 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -25,13 +25,27 @@ #ifndef EIGEN_SOLVETRIANGULAR_H #define EIGEN_SOLVETRIANGULAR_H +template +class ei_trsolve_traits +{ + private: + enum { + RhsIsVectorAtCompileTime = (Side==OnTheLeft ? Rhs::ColsAtCompileTime : Rhs::RowsAtCompileTime)==1 + }; + public: + enum { + Unrolling = (RhsIsVectorAtCompileTime && Rhs::SizeAtCompileTime <= 8) + ? CompleteUnrolling : NoUnrolling, + RhsVectors = RhsIsVectorAtCompileTime ? 1 : Dynamic + }; +}; + template::Unrolling, int StorageOrder = (int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor, - int RhsVectors = Rhs::IsVectorAtCompileTime ? 1 : Dynamic + int RhsVectors = ei_trsolve_traits::RhsVectors > struct ei_triangular_solver_selector; -- cgit v1.2.3