From 75f0fe3795e6e04c338f01ab383b0a3d9a6be334 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 10 Dec 2015 12:01:06 +0100 Subject: [PATCH] Fix usage of "Index" as a compile time integral. --- Eigen/src/Core/SolveTriangular.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h index 0300220ca..4914f6ba8 100644 --- a/Eigen/src/Core/SolveTriangular.h +++ b/Eigen/src/Core/SolveTriangular.h @@ -107,32 +107,32 @@ struct triangular_solver_selector * meta-unrolling implementation ***************************************************************************/ -template +template struct triangular_solver_unroller; -template -struct triangular_solver_unroller { +template +struct triangular_solver_unroller { enum { IsLower = ((Mode&Lower)==Lower), - RowIndex = IsLower ? Index : Size - Index - 1, + RowIndex = IsLower ? LoopIndex : Size - LoopIndex - 1, S = IsLower ? 0 : RowIndex+1 }; static void run(const Lhs& lhs, Rhs& rhs) { - if (Index>0) - rhs.coeffRef(RowIndex) -= lhs.row(RowIndex).template segment(S).transpose() - .cwiseProduct(rhs.template segment(S)).sum(); + if (LoopIndex>0) + rhs.coeffRef(RowIndex) -= lhs.row(RowIndex).template segment(S).transpose() + .cwiseProduct(rhs.template segment(S)).sum(); if(!(Mode & UnitDiag)) rhs.coeffRef(RowIndex) /= lhs.coeff(RowIndex,RowIndex); - triangular_solver_unroller::run(lhs,rhs); + triangular_solver_unroller::run(lhs,rhs); } }; -template -struct triangular_solver_unroller { +template +struct triangular_solver_unroller { static void run(const Lhs&, Rhs&) {} };