diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2620bc7aa..13193e5d1 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -54,6 +54,10 @@ If the output is not quite correct, check for invisible trailing spaces! + + Lifted unnecessary restriction on constructor's argument of + "MicrosphereInterpolator" (package "o.a.c.m.analysis.interpolation"). + Fixed error message for unknown parameter name in ODE. diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatingFunction.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatingFunction.java index 9e754a906..ff468a29c 100644 --- a/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatingFunction.java @@ -144,7 +144,7 @@ public class MicrosphereInterpolatingFunction */ public MicrosphereInterpolatingFunction(double[][] xval, double[] yval, - int brightnessExponent, + double brightnessExponent, int microsphereElements, UnitSphereRandomVectorGenerator rand) throws DimensionMismatchException, diff --git a/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolator.java b/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolator.java index 0cc54f151..9ff4e84ea 100644 --- a/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolator.java +++ b/src/main/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolator.java @@ -40,7 +40,7 @@ public class MicrosphereInterpolator /** * Default exponent used the weights calculation. */ - public static final int DEFAULT_BRIGHTNESS_EXPONENT = 2; + public static final double DEFAULT_BRIGHTNESS_EXPONENT = 2d; /** * Number of surface elements of the microsphere. */ @@ -49,7 +49,7 @@ public class MicrosphereInterpolator * Exponent used in the power law that computes the weights of the * sample data. */ - private final int brightnessExponent; + private final double brightnessExponent; /** * Create a microsphere interpolator with default settings. @@ -70,7 +70,7 @@ public class MicrosphereInterpolator * @throws NotStrictlyPositiveException if {@code elements <= 0}. */ public MicrosphereInterpolator(final int elements, - final int exponent) + final double exponent) throws NotPositiveException, NotStrictlyPositiveException { if (exponent < 0) { diff --git a/src/test/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatorTest.java b/src/test/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatorTest.java index eab4faa28..1fd798d05 100644 --- a/src/test/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math4/analysis/interpolation/MicrosphereInterpolatorTest.java @@ -96,7 +96,7 @@ public final class MicrosphereInterpolatorTest { } }; - MultivariateInterpolator interpolator = new MicrosphereInterpolator(); + MultivariateInterpolator interpolator = new MicrosphereInterpolator(567, 0.89); // Interpolating points in [-10, 10][-10, 10] by steps of 2. final int n = 121;