From 4fdd797b3b02d37c2334bde5da15f94f69e33589 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Sat, 28 Jan 2012 00:06:21 +0000 Subject: [PATCH] Math-707 Renamed "TrivariateRealFunction" to "TrivariateFunction". git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1236932 13f79535-47bb-0310-9956-ffa450edef68 --- ...lFunction.java => TrivariateFunction.java} | 2 +- .../TricubicSplineInterpolatingFunction.java | 6 ++--- .../TrivariateRealGridInterpolator.java | 4 +-- ...icubicSplineInterpolatingFunctionTest.java | 26 +++++++++---------- .../TricubicSplineInterpolatorTest.java | 12 ++++----- 5 files changed, 25 insertions(+), 25 deletions(-) rename src/main/java/org/apache/commons/math/analysis/{TrivariateRealFunction.java => TrivariateFunction.java} (96%) diff --git a/src/main/java/org/apache/commons/math/analysis/TrivariateRealFunction.java b/src/main/java/org/apache/commons/math/analysis/TrivariateFunction.java similarity index 96% rename from src/main/java/org/apache/commons/math/analysis/TrivariateRealFunction.java rename to src/main/java/org/apache/commons/math/analysis/TrivariateFunction.java index d07c957b6..84b9795ff 100644 --- a/src/main/java/org/apache/commons/math/analysis/TrivariateRealFunction.java +++ b/src/main/java/org/apache/commons/math/analysis/TrivariateFunction.java @@ -23,7 +23,7 @@ package org.apache.commons.math.analysis; * @since 2.2 * @version $Id$ */ -public interface TrivariateRealFunction { +public interface TrivariateFunction { /** * Compute the value for the function. * diff --git a/src/main/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunction.java b/src/main/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunction.java index 84e1583de..14c481572 100644 --- a/src/main/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunction.java +++ b/src/main/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunction.java @@ -16,7 +16,7 @@ */ package org.apache.commons.math.analysis.interpolation; -import org.apache.commons.math.analysis.TrivariateRealFunction; +import org.apache.commons.math.analysis.TrivariateFunction; import org.apache.commons.math.exception.DimensionMismatchException; import org.apache.commons.math.exception.NoDataException; import org.apache.commons.math.exception.OutOfRangeException; @@ -36,7 +36,7 @@ import org.apache.commons.math.util.MathArrays; * @since 2.2 */ public class TricubicSplineInterpolatingFunction - implements TrivariateRealFunction { + implements TrivariateFunction { /** * Matrix to compute the spline coefficients from the function values * and function derivatives values @@ -421,7 +421,7 @@ public class TricubicSplineInterpolatingFunction * @version $Id$ */ class TricubicSplineFunction - implements TrivariateRealFunction { + implements TrivariateFunction { /** Number of points. */ private static final short N = 4; /** Coefficients */ diff --git a/src/main/java/org/apache/commons/math/analysis/interpolation/TrivariateRealGridInterpolator.java b/src/main/java/org/apache/commons/math/analysis/interpolation/TrivariateRealGridInterpolator.java index 837a376d8..89315eb32 100644 --- a/src/main/java/org/apache/commons/math/analysis/interpolation/TrivariateRealGridInterpolator.java +++ b/src/main/java/org/apache/commons/math/analysis/interpolation/TrivariateRealGridInterpolator.java @@ -16,7 +16,7 @@ */ package org.apache.commons.math.analysis.interpolation; -import org.apache.commons.math.analysis.TrivariateRealFunction; +import org.apache.commons.math.analysis.TrivariateFunction; /** * Interface representing a trivariate real interpolating function where the @@ -43,6 +43,6 @@ public interface TrivariateRealGridInterpolator { * @throws org.apache.commons.math.exception.DimensionMismatchException * if the array lengths are inconsistent. */ - TrivariateRealFunction interpolate(double[] xval, double[] yval, double[] zval, + TrivariateFunction interpolate(double[] xval, double[] yval, double[] zval, double[][][] fval); } diff --git a/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java b/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java index c2d39dab4..58fded113 100644 --- a/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java +++ b/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java @@ -19,7 +19,7 @@ package org.apache.commons.math.analysis.interpolation; import org.apache.commons.math.exception.DimensionMismatchException; import org.apache.commons.math.exception.MathIllegalArgumentException; import org.apache.commons.math.util.FastMath; -import org.apache.commons.math.analysis.TrivariateRealFunction; +import org.apache.commons.math.analysis.TrivariateFunction; import org.junit.Assert; import org.junit.Test; @@ -40,7 +40,7 @@ public final class TricubicSplineInterpolatingFunctionTest { double[][][] fval = new double[xval.length][yval.length][zval.length]; @SuppressWarnings("unused") - TrivariateRealFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, + TrivariateFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, fval, fval, fval, fval, fval, fval, fval, fval); @@ -281,7 +281,7 @@ public final class TricubicSplineInterpolatingFunctionTest { double[] zval = new double[] {-12, -8, -5.5, -3, 0, 2.5}; // Function values - TrivariateRealFunction f = new TrivariateRealFunction() { + TrivariateFunction f = new TrivariateFunction() { public double value(double x, double y, double z) { return 2 * x - 3 * y - 4 * z + 5; } @@ -340,7 +340,7 @@ public final class TricubicSplineInterpolatingFunctionTest { } } - TrivariateRealFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, + TrivariateFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, fval, dFdX, dFdY, dFdZ, d2FdXdY, d2FdXdZ, d2FdYdZ, d3FdXdYdZ); @@ -391,7 +391,7 @@ public final class TricubicSplineInterpolatingFunctionTest { final double ky = 1; // Function values - TrivariateRealFunction f = new TrivariateRealFunction() { + TrivariateFunction f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.cos(omega * z - kx * x - ky * y); } @@ -408,7 +408,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial derivatives with respect to x double[][][] dFdX = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction dFdX_f = new TrivariateRealFunction() { + TrivariateFunction dFdX_f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.sin(omega * z - kx * x - ky * y) * kx; } @@ -423,7 +423,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial derivatives with respect to y double[][][] dFdY = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction dFdY_f = new TrivariateRealFunction() { + TrivariateFunction dFdY_f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.sin(omega * z - kx * x - ky * y) * ky; } @@ -438,7 +438,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial derivatives with respect to z double[][][] dFdZ = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction dFdZ_f = new TrivariateRealFunction() { + TrivariateFunction dFdZ_f = new TrivariateFunction() { public double value(double x, double y, double z) { return -a * FastMath.sin(omega * z - kx * x - ky * y) * omega; } @@ -453,7 +453,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial second derivatives w.r.t. (x, y) double[][][] d2FdXdY = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction d2FdXdY_f = new TrivariateRealFunction() { + TrivariateFunction d2FdXdY_f = new TrivariateFunction() { public double value(double x, double y, double z) { return -a * FastMath.cos(omega * z - kx * x - ky * y) * kx * ky; } @@ -468,7 +468,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial second derivatives w.r.t. (x, z) double[][][] d2FdXdZ = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction d2FdXdZ_f = new TrivariateRealFunction() { + TrivariateFunction d2FdXdZ_f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.cos(omega * z - kx * x - ky * y) * kx * omega; } @@ -483,7 +483,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial second derivatives w.r.t. (y, z) double[][][] d2FdYdZ = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction d2FdYdZ_f = new TrivariateRealFunction() { + TrivariateFunction d2FdYdZ_f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.cos(omega * z - kx * x - ky * y) * ky * omega; } @@ -498,7 +498,7 @@ public final class TricubicSplineInterpolatingFunctionTest { // Partial third derivatives double[][][] d3FdXdYdZ = new double[xval.length][yval.length][zval.length]; - TrivariateRealFunction d3FdXdYdZ_f = new TrivariateRealFunction() { + TrivariateFunction d3FdXdYdZ_f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.sin(omega * z - kx * x - ky * y) * kx * ky * omega; } @@ -511,7 +511,7 @@ public final class TricubicSplineInterpolatingFunctionTest { } } - TrivariateRealFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, + TrivariateFunction tcf = new TricubicSplineInterpolatingFunction(xval, yval, zval, fval, dFdX, dFdY, dFdZ, d2FdXdY, d2FdXdZ, d2FdYdZ, d3FdXdYdZ); diff --git a/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatorTest.java b/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatorTest.java index 00f0fa5fb..3afff43aa 100644 --- a/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatorTest.java +++ b/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatorTest.java @@ -19,7 +19,7 @@ package org.apache.commons.math.analysis.interpolation; import org.apache.commons.math.exception.DimensionMismatchException; import org.apache.commons.math.exception.MathIllegalArgumentException; import org.apache.commons.math.util.FastMath; -import org.apache.commons.math.analysis.TrivariateRealFunction; +import org.apache.commons.math.analysis.TrivariateFunction; import org.junit.Assert; import org.junit.Test; @@ -42,7 +42,7 @@ public final class TricubicSplineInterpolatorTest { TrivariateRealGridInterpolator interpolator = new TricubicSplineInterpolator(); @SuppressWarnings("unused") - TrivariateRealFunction p = interpolator.interpolate(xval, yval, zval, fval); + TrivariateFunction p = interpolator.interpolate(xval, yval, zval, fval); double[] wxval = new double[] {3, 2, 5, 6.5}; try { @@ -98,7 +98,7 @@ public final class TricubicSplineInterpolatorTest { */ @Test public void testPlane() { - TrivariateRealFunction f = new TrivariateRealFunction() { + TrivariateFunction f = new TrivariateFunction() { public double value(double x, double y, double z) { return 2 * x - 3 * y - z + 5; } @@ -118,7 +118,7 @@ public final class TricubicSplineInterpolatorTest { } } - TrivariateRealFunction p = interpolator.interpolate(xval, yval, zval, fval); + TrivariateFunction p = interpolator.interpolate(xval, yval, zval, fval); double x, y, z; double expected, result; @@ -164,7 +164,7 @@ public final class TricubicSplineInterpolatorTest { final double ky = 1; // Function values - TrivariateRealFunction f = new TrivariateRealFunction() { + TrivariateFunction f = new TrivariateFunction() { public double value(double x, double y, double z) { return a * FastMath.cos(omega * z - kx * x - ky * y); } @@ -181,7 +181,7 @@ public final class TricubicSplineInterpolatorTest { TrivariateRealGridInterpolator interpolator = new TricubicSplineInterpolator(); - TrivariateRealFunction p = interpolator.interpolate(xval, yval, zval, fval); + TrivariateFunction p = interpolator.interpolate(xval, yval, zval, fval); double x, y, z; double expected, result;