1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-21 16:02:04 +02:00

Limit polynomial degree to 100

100 is still high, but it should avoid abnormal figures causing
out-of-memory errors. Fixes #251.
This commit is contained in:
Erik Johansson
2018-04-29 21:13:12 +02:00
parent 0bc5289dba
commit bf97314327

View File

@@ -319,7 +319,9 @@ public class GraphFragment extends Fragment implements FragmentUpdateListener {
floatingActionBar.removeAllViews();
PolynomialFitter polyFitter = new PolynomialFitter(Integer.parseInt(prefs.getString("regressionLineOrder", "1")));
PolynomialFitter polyFitter = new PolynomialFitter(
Math.min(Integer.parseInt(prefs.getString("regressionLineOrder", "1")),
100));
for (MeasurementView view : measurementViews) {
if (view instanceof FloatMeasurementView) {