diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-01-04 17:36:26 +0100 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-01-04 17:36:26 +0100 |
commit | 826bff58c68273d1d0088898c1f54a01c9a94b04 (patch) | |
tree | 99b7b75bb5e6bffbe23d3599d2dbbb7ee966d15f /Eigen/src/Core/SolveTriangular.h | |
parent | 80d1f9e96638cbc1a821408c70e6ad1513568fdb (diff) |
Fix #69 for the second time, and add the respective regression test
Diffstat (limited to 'Eigen/src/Core/SolveTriangular.h')
-rw-r--r-- | Eigen/src/Core/SolveTriangular.h | 22 |
1 files changed, 18 insertions, 4 deletions
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<typename Lhs, typename Rhs, int Side> +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<typename Lhs, typename Rhs, - int Mode, // can be Upper/Lower | UnitDiag int Side, // can be OnTheLeft/OnTheRight - int Unrolling = Rhs::IsVectorAtCompileTime && Rhs::SizeAtCompileTime <= 8 // FIXME - ? CompleteUnrolling : NoUnrolling, + int Mode, // can be Upper/Lower | UnitDiag + int Unrolling = ei_trsolve_traits<Lhs,Rhs,Side>::Unrolling, int StorageOrder = (int(Lhs::Flags) & RowMajorBit) ? RowMajor : ColMajor, - int RhsVectors = Rhs::IsVectorAtCompileTime ? 1 : Dynamic + int RhsVectors = ei_trsolve_traits<Lhs,Rhs,Side>::RhsVectors > struct ei_triangular_solver_selector; |