From b57414909476ac4e22768cd33e157f112fdde975 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Fri, 4 Jun 2021 00:23:52 +0200 Subject: [PATCH] Adapt to new API ("Commons Numbers"). --- .../math4/legacy/fitting/HarmonicCurveFitterTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitterTest.java b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitterTest.java index 30b05cdc1..503d059be 100644 --- a/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitterTest.java +++ b/commons-math-legacy/src/test/java/org/apache/commons/math4/legacy/fitting/HarmonicCurveFitterTest.java @@ -53,7 +53,7 @@ public class HarmonicCurveFitterTest { final double[] fitted = fitter.fit(points.toList()); Assert.assertEquals(a, fitted[0], 1.0e-13); Assert.assertEquals(w, fitted[1], 1.0e-13); - Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.apply(Angle.Rad.of(fitted[2])).getAsDouble(), 1e-13); + Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.applyAsDouble(fitted[2]), 1e-13); final HarmonicOscillator ff = new HarmonicOscillator(fitted[0], fitted[1], fitted[2]); for (double x = -1.0; x < 1.0; x += 0.01) { @@ -78,7 +78,7 @@ public class HarmonicCurveFitterTest { final double[] fitted = fitter.fit(points.toList()); Assert.assertEquals(a, fitted[0], 7.6e-4); Assert.assertEquals(w, fitted[1], 2.7e-3); - Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.apply(Angle.Rad.of(fitted[2])).getAsDouble(), 1.3e-2); + Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.applyAsDouble(fitted[2]), 1.3e-2); } @Test @@ -115,7 +115,7 @@ public class HarmonicCurveFitterTest { final double[] fitted = fitter.fit(points.toList()); Assert.assertEquals(a, fitted[0], 1.2e-3); Assert.assertEquals(w, fitted[1], 3.3e-3); - Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.apply(Angle.Rad.of(fitted[2])).getAsDouble(), 1.7e-2); + Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.applyAsDouble(fitted[2]), 1.7e-2); } @Test @@ -157,7 +157,7 @@ public class HarmonicCurveFitterTest { final double[] fitted = fitter.fit(points.toList()); Assert.assertEquals(a, fitted[0], 7.6e-4); Assert.assertEquals(w, fitted[1], 3.5e-3); - Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.apply(Angle.Rad.of(fitted[2])).getAsDouble(), 1.5e-2); + Assert.assertEquals(p, Angle.Rad.WITHIN_0_AND_2PI.applyAsDouble(fitted[2]), 1.5e-2); } @Test(expected=MathIllegalStateException.class)