From f072be76d5652c502a5bd84cc47cb3dd86c25634 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Tue, 27 Aug 2024 13:39:59 +0200 Subject: [PATCH] COMMON: Fix flat idx (signed flip) Signed-off-by: Felix Schlepper --- Common/MathUtils/include/MathUtils/LegendrePols.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/MathUtils/include/MathUtils/LegendrePols.h b/Common/MathUtils/include/MathUtils/LegendrePols.h index dca71c1275962..d5e6a259573f4 100644 --- a/Common/MathUtils/include/MathUtils/LegendrePols.h +++ b/Common/MathUtils/include/MathUtils/LegendrePols.h @@ -200,7 +200,7 @@ class Legendre2DPolynominal final : public TNamed, boost::math::legendre_p(i - j, y); } - inline int getFlatIdx(int i, int j) const { return i * (i - 1) / 2 + j; } + inline int getFlatIdx(int i, int j) const { return i * (i + 1) / 2 + j; } unsigned int fOrder{0}; std::vector fParams;