[apps/regression] Compute numberOfPoints automatically

Change-Id: I35a1902aeda06cc80ae8808d886b3e161bae8ad9
This commit is contained in:
Hugo Saint-Vignes
2020-11-25 16:08:16 +01:00
committed by EmilieNumworks
parent 72e8ac7d02
commit e9662e4c45

View File

@@ -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);