From 408b8277aee1a99ebdf347749ef238180b48c9f9 Mon Sep 17 00:00:00 2001 From: Guillaume Bittoun Date: Sat, 6 Dec 2014 23:18:10 +0000 Subject: [PATCH] simplex_interpolator: bug fixing on matrix computing --- src/lol/math/simplex_interpolator.h | 2 +- src/t/math/simplex_interpolator.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lol/math/simplex_interpolator.h b/src/lol/math/simplex_interpolator.h index ba444b78..7dee0d98 100644 --- a/src/lol/math/simplex_interpolator.h +++ b/src/lol/math/simplex_interpolator.h @@ -136,7 +136,7 @@ protected: */ float b = (1.f - lol::sqrt(N + 1.f)) / lol::sqrt((float)N * N * N); - float a = b + lol::sqrt(N + 1.f) / N; + float a = b + lol::sqrt((N + 1.f) / N); // determinant of matrix M float det = a * (a + (N - 2) * b) - (b * b) * (N - 1); diff --git a/src/t/math/simplex_interpolator.cpp b/src/t/math/simplex_interpolator.cpp index 35737ae8..3a4db250 100644 --- a/src/t/math/simplex_interpolator.cpp +++ b/src/t/math/simplex_interpolator.cpp @@ -39,7 +39,7 @@ public: { std::cout << this->m_base[i][j] << ", "; } - std::cout << std::endl; + std::cout << ";"; } std::cout << std::endl; @@ -50,8 +50,10 @@ public: { std::cout << this->m_base_inverse[i][j] << ", "; } - std::cout << std::endl; + std::cout << ";"; } + + std::cout << std::endl; } };