From e9662e4c4505d438da4eaf77504d351afd0ed4ba Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Wed, 25 Nov 2020 16:08:16 +0100 Subject: [PATCH] [apps/regression] Compute numberOfPoints automatically Change-Id: I35a1902aeda06cc80ae8808d886b3e161bae8ad9 --- apps/regression/test/model.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/regression/test/model.cpp b/apps/regression/test/model.cpp index 60fb061f9..850e097b0 100644 --- a/apps/regression/test/model.cpp +++ b/apps/regression/test/model.cpp @@ -196,7 +196,8 @@ QUIZ_CASE(trigonometric_regression) { double x[] = {1, 31, 61, 91, 121, 151, 181, 211, 241, 271, 301, 331, 361}; double y[] = {9.24, 10.05, 11.33, 12.72, 14.16, 14.98, 15.14, 14.41, 13.24, 11.88, 10.54, 9.48, 9.19}; double coefficients[] = {2.9723, 0.016780, -1.3067, 12.146}; - int numberOfPoints = 13; + int numberOfPoints = sizeof(x) / sizeof(double); + assert(sizeof(y) == sizeof(double) * numberOfPoints); // TODO : Ensure unicity with trigonometric coefficients. Poincare::Preferences::sharedPreferences()->setAngleUnit(Poincare::Preferences::AngleUnit::Radian);