Removal of two duplicate methods in TestUtils. Code now passes mvn clean verify as requested in contributing.md
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/90662a96 Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/90662a96 Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/90662a96 Branch: refs/heads/feature-MATH-1290 Commit: 90662a9624f6bf80fb5adc7b472d5526791e60db Parents: ea4c2fd Author: Eric Barnhill <[email protected]> Authored: Tue Apr 19 22:04:47 2016 +0200 Committer: Eric Barnhill <[email protected]> Committed: Tue Apr 19 22:04:47 2016 +0200 ---------------------------------------------------------------------- .../org/apache/commons/math4/TestUtils.java | 68 -------------------- 1 file changed, 68 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-math/blob/90662a96/src/test/java/org/apache/commons/math4/TestUtils.java ---------------------------------------------------------------------- diff --git a/src/test/java/org/apache/commons/math4/TestUtils.java b/src/test/java/org/apache/commons/math4/TestUtils.java index c75aaea..5dde4e4 100644 --- a/src/test/java/org/apache/commons/math4/TestUtils.java +++ b/src/test/java/org/apache/commons/math4/TestUtils.java @@ -433,74 +433,6 @@ public class TestUtils { } } - /** verifies that two arrays are close (sup norm) */ - public static void assertEquals(String msg, float[] expected, float[] observed, float tolerance) { - StringBuilder out = new StringBuilder(msg); - if (expected.length != observed.length) { - out.append("\n Arrays not same length. \n"); - out.append("expected has length "); - out.append(expected.length); - out.append(" observed length = "); - out.append(observed.length); - Assert.fail(out.toString()); - } - boolean failure = false; - for (int i=0; i < expected.length; i++) { - if (!Precision.equalsIncludingNaN(expected[i], observed[i], tolerance)) { - failure = true; - out.append("\n Elements at index "); - out.append(i); - out.append(" differ. "); - out.append(" expected = "); - out.append(expected[i]); - out.append(" observed = "); - out.append(observed[i]); - } - } - if (failure) { - Assert.fail(out.toString()); - } - } - - /** verifies that two arrays are close (sup norm) */ - public static void assertEquals(String msg, Complex[] expected, Complex[] observed, double tolerance) { - StringBuilder out = new StringBuilder(msg); - if (expected.length != observed.length) { - out.append("\n Arrays not same length. \n"); - out.append("expected has length "); - out.append(expected.length); - out.append(" observed length = "); - out.append(observed.length); - Assert.fail(out.toString()); - } - boolean failure = false; - for (int i=0; i < expected.length; i++) { - if (!Precision.equalsIncludingNaN(expected[i].getReal(), observed[i].getReal(), tolerance)) { - failure = true; - out.append("\n Real elements at index "); - out.append(i); - out.append(" differ. "); - out.append(" expected = "); - out.append(expected[i].getReal()); - out.append(" observed = "); - out.append(observed[i].getReal()); - } - if (!Precision.equalsIncludingNaN(expected[i].getImaginary(), observed[i].getImaginary(), tolerance)) { - failure = true; - out.append("\n Imaginary elements at index "); - out.append(i); - out.append(" differ. "); - out.append(" expected = "); - out.append(expected[i].getImaginary()); - out.append(" observed = "); - out.append(observed[i].getImaginary()); - } - } - if (failure) { - Assert.fail(out.toString()); - } - } - /** verifies that two arrays are equal */ public static <T extends FieldElement<T>> void assertEquals(T[] m, T[] n) { if (m.length != n.length) {
