You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2015/11/27 18:55:52 UTC
[1/3] [math] Removed trailing spaces. No code change.
Repository: commons-math
Updated Branches:
refs/heads/master f7ab3a70e -> 49bb370a6
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/special/ErfTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/special/ErfTest.java b/src/test/java/org/apache/commons/math4/special/ErfTest.java
index e9d6813..3bd9bf0 100644
--- a/src/test/java/org/apache/commons/math4/special/ErfTest.java
+++ b/src/test/java/org/apache/commons/math4/special/ErfTest.java
@@ -89,7 +89,7 @@ public class ErfTest {
Assert.assertEquals(expected, actual, 1.0e-5);
Assert.assertEquals(1 - expected, Erf.erfc(-x), 1.0e-5);
}
-
+
/**
* MATH-301, MATH-456
*/
@@ -107,14 +107,14 @@ public class ErfTest {
Assert.assertTrue(result >= 0 && result < 1);
result = Erf.erfc(-i);
Assert.assertFalse(Double.isNaN(result));
- Assert.assertTrue(result >= 1 && result <= 2);
+ Assert.assertTrue(result >= 1 && result <= 2);
}
Assert.assertEquals(-1, Erf.erf(Double.NEGATIVE_INFINITY), 0);
Assert.assertEquals(1, Erf.erf(Double.POSITIVE_INFINITY), 0);
Assert.assertEquals(2, Erf.erfc(Double.NEGATIVE_INFINITY), 0);
Assert.assertEquals(0, Erf.erfc(Double.POSITIVE_INFINITY), 0);
}
-
+
/**
* Compare Erf.erf against reference values computed using GCC 4.2.1 (Apple OSX packaged version)
* erfl (extended precision erf).
@@ -122,15 +122,15 @@ public class ErfTest {
@Test
public void testErfGnu() {
final double tol = 1E-15;
- final double[] gnuValues = new double[] {-1, -1, -1, -1, -1,
- -1, -1, -1, -0.99999999999999997848,
- -0.99999999999999264217, -0.99999999999846254017, -0.99999999980338395581, -0.99999998458274209971,
- -0.9999992569016276586, -0.99997790950300141459, -0.99959304798255504108, -0.99532226501895273415,
- -0.96610514647531072711, -0.84270079294971486948, -0.52049987781304653809, 0,
- 0.52049987781304653809, 0.84270079294971486948, 0.96610514647531072711, 0.99532226501895273415,
- 0.99959304798255504108, 0.99997790950300141459, 0.9999992569016276586, 0.99999998458274209971,
- 0.99999999980338395581, 0.99999999999846254017, 0.99999999999999264217, 0.99999999999999997848,
- 1, 1, 1, 1,
+ final double[] gnuValues = new double[] {-1, -1, -1, -1, -1,
+ -1, -1, -1, -0.99999999999999997848,
+ -0.99999999999999264217, -0.99999999999846254017, -0.99999999980338395581, -0.99999998458274209971,
+ -0.9999992569016276586, -0.99997790950300141459, -0.99959304798255504108, -0.99532226501895273415,
+ -0.96610514647531072711, -0.84270079294971486948, -0.52049987781304653809, 0,
+ 0.52049987781304653809, 0.84270079294971486948, 0.96610514647531072711, 0.99532226501895273415,
+ 0.99959304798255504108, 0.99997790950300141459, 0.9999992569016276586, 0.99999998458274209971,
+ 0.99999999980338395581, 0.99999999999846254017, 0.99999999999999264217, 0.99999999999999997848,
+ 1, 1, 1, 1,
1, 1, 1, 1};
double x = -10d;
for (int i = 0; i < 41; i++) {
@@ -138,7 +138,7 @@ public class ErfTest {
x += 0.5d;
}
}
-
+
/**
* Compare Erf.erfc against reference values computed using GCC 4.2.1 (Apple OSX packaged version)
* erfcl (extended precision erfc).
@@ -146,15 +146,15 @@ public class ErfTest {
@Test
public void testErfcGnu() {
final double tol = 1E-15;
- final double[] gnuValues = new double[] { 2, 2, 2, 2, 2,
- 2, 2, 2, 1.9999999999999999785,
- 1.9999999999999926422, 1.9999999999984625402, 1.9999999998033839558, 1.9999999845827420998,
- 1.9999992569016276586, 1.9999779095030014146, 1.9995930479825550411, 1.9953222650189527342,
- 1.9661051464753107271, 1.8427007929497148695, 1.5204998778130465381, 1,
- 0.47950012218695346194, 0.15729920705028513051, 0.033894853524689272893, 0.0046777349810472658333,
- 0.00040695201744495893941, 2.2090496998585441366E-05, 7.4309837234141274516E-07, 1.5417257900280018858E-08,
- 1.966160441542887477E-10, 1.5374597944280348501E-12, 7.3578479179743980661E-15, 2.1519736712498913103E-17,
- 3.8421483271206474691E-20, 4.1838256077794144006E-23, 2.7766493860305691016E-26, 1.1224297172982927079E-29,
+ final double[] gnuValues = new double[] { 2, 2, 2, 2, 2,
+ 2, 2, 2, 1.9999999999999999785,
+ 1.9999999999999926422, 1.9999999999984625402, 1.9999999998033839558, 1.9999999845827420998,
+ 1.9999992569016276586, 1.9999779095030014146, 1.9995930479825550411, 1.9953222650189527342,
+ 1.9661051464753107271, 1.8427007929497148695, 1.5204998778130465381, 1,
+ 0.47950012218695346194, 0.15729920705028513051, 0.033894853524689272893, 0.0046777349810472658333,
+ 0.00040695201744495893941, 2.2090496998585441366E-05, 7.4309837234141274516E-07, 1.5417257900280018858E-08,
+ 1.966160441542887477E-10, 1.5374597944280348501E-12, 7.3578479179743980661E-15, 2.1519736712498913103E-17,
+ 3.8421483271206474691E-20, 4.1838256077794144006E-23, 2.7766493860305691016E-26, 1.1224297172982927079E-29,
2.7623240713337714448E-33, 4.1370317465138102353E-37, 3.7692144856548799402E-41, 2.0884875837625447567E-45};
double x = -10d;
for (int i = 0; i < 41; i++) {
@@ -162,9 +162,9 @@ public class ErfTest {
x += 0.5d;
}
}
-
+
/**
- * Tests erfc against reference data computed using Maple reported in Marsaglia, G,,
+ * Tests erfc against reference data computed using Maple reported in Marsaglia, G,,
* "Evaluating the Normal Distribution," Journal of Statistical Software, July, 2004.
* http//www.jstatsoft.org/v11/a05/paper
*/
@@ -176,13 +176,13 @@ public class ErfTest {
{2.3, 1.07241100216758e-02},
{3.4, 3.36929265676881e-04},
{4.5, 3.39767312473006e-06},
- {5.6, 1.07175902583109e-08},
+ {5.6, 1.07175902583109e-08},
{6.7, 1.04209769879652e-11},
{7.8, 3.09535877195870e-15},
{8.9, 2.79233437493966e-19},
{10.0, 7.61985302416053e-24},
{11.1, 6.27219439321703e-29},
- {12.2, 1.55411978638959e-34},
+ {12.2, 1.55411978638959e-34},
{13.3, 1.15734162836904e-40},
{14.4, 2.58717592540226e-47},
{15.5, 1.73446079179387e-54},
@@ -194,7 +194,7 @@ public class ErfTest {
TestUtils.assertRelativelyEquals(ref[i][1], result, 1E-13);
}
}
-
+
/**
* Test the implementation of Erf.erf(double, double) for consistency with results
* obtained from Erf.erf(double) and Erf.erfc(double).
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/StatUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/StatUtilsTest.java b/src/test/java/org/apache/commons/math4/stat/StatUtilsTest.java
index 2528f3c..eae66fb 100644
--- a/src/test/java/org/apache/commons/math4/stat/StatUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/StatUtilsTest.java
@@ -271,7 +271,7 @@ public final class StatUtilsTest {
x = new double[] {ONE, TWO, TWO, THREE};
TestUtils.assertEquals(0.5, StatUtils.variance(x,2.5, 2, 2), TOLERANCE);
}
-
+
@Test
public void testPopulationVariance() {
double[] x = null;
@@ -463,10 +463,10 @@ public final class StatUtilsTest {
Assert.assertEquals(FastMath.exp(0.5 * StatUtils.sumLog(test, 0, 2)),
StatUtils.geometricMean(test, 0, 2), Double.MIN_VALUE);
}
-
-
+
+
/**
- * Run the test with the values 50 and 100 and assume standardized values
+ * Run the test with the values 50 and 100 and assume standardized values
*/
@Test
@@ -487,7 +487,7 @@ public final class StatUtilsTest {
@Test
public void testNormalize2() {
- // create an sample with 77 values
+ // create an sample with 77 values
int length = 77;
double sample[] = new double[length];
for (int i = 0; i < length; i++) {
@@ -501,14 +501,14 @@ public final class StatUtilsTest {
for (int i = 0; i < length; i++) {
stats.addValue(standardizedSample[i]);
}
- // the calculations do have a limited precision
+ // the calculations do have a limited precision
double distance = 1E-10;
// check the mean an standard deviation
Assert.assertEquals(0.0, stats.getMean(), distance);
Assert.assertEquals(1.0, stats.getStandardDeviation(), distance);
}
-
+
@Test
public void testMode() {
final double[] singleMode = {0, 1, 0, 2, 7, 11, 12};
@@ -544,7 +544,7 @@ public final class StatUtilsTest {
final double[] nansOnly = {Double.NaN, Double.NaN};
final double[] modeNansOnly = StatUtils.mode(nansOnly);
Assert.assertEquals(0, modeNansOnly.length);
-
+
final double[] nullArray = null;
try {
StatUtils.mode(nullArray);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java b/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
index 09a2297..dc2197b 100644
--- a/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/correlation/StorelessCovarianceTest.java
@@ -223,7 +223,7 @@ public class StorelessCovarianceTest {
}
}
}
-
+
/**
* Test equality of covariance. chk: covariance of two
* samples separately and adds them together. cov: computes
@@ -234,22 +234,22 @@ public class StorelessCovarianceTest {
int num_sets = 2;
StorelessBivariateCovariance cov = new StorelessBivariateCovariance();// covariance of the superset
StorelessBivariateCovariance chk = new StorelessBivariateCovariance();// check covariance made by appending covariance of subsets
-
+
ISAACRandom rand = new ISAACRandom(10L);// Seed can be changed
for (int s = 0; s < num_sets; s++) {// loop through sets of samlpes
StorelessBivariateCovariance covs = new StorelessBivariateCovariance();
for (int i = 0; i < 5; i++) { // loop through individual samlpes.
double x = rand.nextDouble();
double y = rand.nextDouble();
- covs.increment(x, y);// add sample to the subset
+ covs.increment(x, y);// add sample to the subset
cov.increment(x, y);// add sample to the superset
}
chk.append(covs);
}
-
+
TestUtils.assertEquals("covariance subset test", chk.getResult(), cov.getResult(), 10E-7);
}
-
+
protected RealMatrix createRealMatrix(double[] data, int nRows, int nCols) {
double[][] matrixData = new double[nRows][nCols];
int ptr = 0;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValuesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValuesTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValuesTest.java
index 1c27d8c..0917ba7 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValuesTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/StatisticalSummaryValuesTest.java
@@ -64,7 +64,7 @@ public final class StatisticalSummaryValuesTest {
TestUtils.assertEquals("min",s.getMin(),u.getMin(), 0);
TestUtils.assertEquals("max",s.getMax(),u.getMax(), 0);
}
-
+
@Test
public void testToString() {
StatisticalSummaryValues u = new StatisticalSummaryValues(4.5, 16, 10, 5, 4, 45);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
index 8b2107b..65a25b1 100644
--- a/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/descriptive/rank/PercentileTest.java
@@ -776,12 +776,12 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{
Assert.assertEquals(2d,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_1).withNaNStrategy(NaNStrategy.REMOVED).evaluate(specialValues),0d);
Assert.assertEquals(Double.NaN,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_5).withNaNStrategy(NaNStrategy.REMOVED).evaluate(new double[] {Double.NaN,Double.NaN,Double.NaN}),0d);
Assert.assertEquals(50d,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_7).withNaNStrategy(NaNStrategy.MINIMAL).evaluate(new double[] {50d,50d,50d},1,2),0d);
-
+
specialValues = new double[] { 0d, 1d, 2d, 3d, 4d, Double.NaN, Double.NaN };
Assert.assertEquals(3.5,new Percentile().evaluate(specialValues, 3, 4),0d);
Assert.assertEquals(4d,new Percentile().evaluate(specialValues, 4, 3),0d);
Assert.assertTrue(Double.isNaN(new Percentile().evaluate(specialValues, 5, 2)));
-
+
specialValues = new double[] { 0d, 1d, 2d, 3d, 4d, Double.NaN, Double.NaN, 5d, 6d };
Assert.assertEquals(4.5,new Percentile().evaluate(specialValues, 3, 6),0d);
Assert.assertEquals(5d,new Percentile().evaluate(specialValues, 4, 5),0d);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/AgrestiCoullIntervalTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/AgrestiCoullIntervalTest.java b/src/test/java/org/apache/commons/math4/stat/interval/AgrestiCoullIntervalTest.java
index ec804d1..77b64d3 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/AgrestiCoullIntervalTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/AgrestiCoullIntervalTest.java
@@ -32,7 +32,7 @@ public class AgrestiCoullIntervalTest extends BinomialConfidenceIntervalAbstract
protected BinomialConfidenceInterval createBinomialConfidenceInterval() {
return new AgrestiCoullInterval();
}
-
+
@Test
public void testStandardInterval() {
ConfidenceInterval confidenceInterval = createStandardTestInterval();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/BinomialConfidenceIntervalAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/BinomialConfidenceIntervalAbstractTest.java b/src/test/java/org/apache/commons/math4/stat/interval/BinomialConfidenceIntervalAbstractTest.java
index 621c8ac..3909353 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/BinomialConfidenceIntervalAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/BinomialConfidenceIntervalAbstractTest.java
@@ -35,10 +35,10 @@ public abstract class BinomialConfidenceIntervalAbstractTest {
private final double confidenceLevel = 0.9;
protected abstract BinomialConfidenceInterval createBinomialConfidenceInterval();
-
+
/**
* Returns the confidence interval for the given statistic with the following values:
- *
+ *
* <ul>
* <li>trials: 500</li>
* <li>successes: 50</li>
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/ClopperPearsonIntervalTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/ClopperPearsonIntervalTest.java b/src/test/java/org/apache/commons/math4/stat/interval/ClopperPearsonIntervalTest.java
index e0bcc5b..e50ab58 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/ClopperPearsonIntervalTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/ClopperPearsonIntervalTest.java
@@ -32,7 +32,7 @@ public class ClopperPearsonIntervalTest extends BinomialConfidenceIntervalAbstra
protected BinomialConfidenceInterval createBinomialConfidenceInterval() {
return new ClopperPearsonInterval();
}
-
+
@Test
public void testStandardInterval() {
ConfidenceInterval confidenceInterval = createStandardTestInterval();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/IntervalUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/IntervalUtilsTest.java b/src/test/java/org/apache/commons/math4/stat/interval/IntervalUtilsTest.java
index a1715a6..2a5bbb8 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/IntervalUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/IntervalUtilsTest.java
@@ -27,14 +27,14 @@ import org.junit.Test;
/**
* Test cases for the IntervalUtils class.
- *
+ *
*/
public class IntervalUtilsTest {
private final int successes = 50;
private final int trials = 500;
private final double confidenceLevel = 0.9;
-
+
// values to test must be exactly the same
private final double eps = 0.0;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/NormalApproximationIntervalTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/NormalApproximationIntervalTest.java b/src/test/java/org/apache/commons/math4/stat/interval/NormalApproximationIntervalTest.java
index 269b93c..25209d3 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/NormalApproximationIntervalTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/NormalApproximationIntervalTest.java
@@ -32,7 +32,7 @@ public class NormalApproximationIntervalTest extends BinomialConfidenceIntervalA
protected BinomialConfidenceInterval createBinomialConfidenceInterval() {
return new NormalApproximationInterval();
}
-
+
@Test
public void testStandardInterval() {
ConfidenceInterval confidenceInterval = createStandardTestInterval();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/interval/WilsonScoreIntervalTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/interval/WilsonScoreIntervalTest.java b/src/test/java/org/apache/commons/math4/stat/interval/WilsonScoreIntervalTest.java
index 7ed37cb..2355cd2 100644
--- a/src/test/java/org/apache/commons/math4/stat/interval/WilsonScoreIntervalTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/interval/WilsonScoreIntervalTest.java
@@ -32,7 +32,7 @@ public class WilsonScoreIntervalTest extends BinomialConfidenceIntervalAbstractT
protected BinomialConfidenceInterval createBinomialConfidenceInterval() {
return new WilsonScoreInterval();
}
-
+
@Test
public void testStandardInterval() {
ConfidenceInterval confidenceInterval = createStandardTestInterval();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java b/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
index e713720..73e0370 100644
--- a/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/ranking/NaturalRankingTest.java
@@ -46,28 +46,28 @@ public class NaturalRankingTest {
public void testDefault() { // Ties averaged, NaNs failed
NaturalRanking ranking = new NaturalRanking();
double[] ranks;
-
+
try {
ranks = ranking.rank(exampleData);
Assert.fail("expected NotANumberException due to NaNStrategy.FAILED");
} catch (NotANumberException e) {
// expected
}
-
+
ranks = ranking.rank(tiesFirst);
double[] correctRanks = new double[] { 1.5, 1.5, 4, 3, 5 };
TestUtils.assertEquals(correctRanks, ranks, 0d);
ranks = ranking.rank(tiesLast);
correctRanks = new double[] { 3.5, 3.5, 2, 1 };
TestUtils.assertEquals(correctRanks, ranks, 0d);
-
+
try {
ranks = ranking.rank(multipleNaNs);
Assert.fail("expected NotANumberException due to NaNStrategy.FAILED");
} catch (NotANumberException e) {
// expected
}
-
+
ranks = ranking.rank(multipleTies);
correctRanks = new double[] { 3, 2, 4.5, 4.5, 6.5, 6.5, 1 };
TestUtils.assertEquals(correctRanks, ranks, 0d);
@@ -209,14 +209,14 @@ public class NaturalRankingTest {
correctRanks = new double[] { 3, 4, 1.5, 1.5 };
TestUtils.assertEquals(correctRanks, ranks, 0d);
}
-
+
@Test(expected=NotANumberException.class)
public void testNaNsFailed() {
double[] data = { 0, Double.POSITIVE_INFINITY, Double.NaN, Double.NEGATIVE_INFINITY };
NaturalRanking ranking = new NaturalRanking(NaNStrategy.FAILED);
ranking.rank(data);
}
-
+
@Test
public void testNoNaNsFailed() {
double[] data = { 1, 2, 3, 4 };
@@ -224,5 +224,5 @@ public class NaturalRankingTest {
double[] ranks = ranking.rank(data);
TestUtils.assertEquals(data, ranks, 0d);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java b/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
index c31b8c3..e37dda0 100644
--- a/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
+++ b/src/test/java/org/apache/commons/math4/stat/regression/SimpleRegressionTest.java
@@ -551,7 +551,7 @@ public final class SimpleRegressionTest {
Assert.assertTrue(regression.getSlope() > 0.0);
Assert.assertTrue(regression.getSumSquaredErrors() >= 0.0);
}
-
+
@Test
public void testPerfect2() {
SimpleRegression regression = new SimpleRegression();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java
index 336126a..fece225 100644
--- a/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/util/ArithmeticUtilsTest.java
@@ -587,7 +587,7 @@ public class ArithmeticUtilsTest {
// success
}
}
-
+
/**
* Testing helper method.
* @return an array of int numbers containing corner cases:<ul>
@@ -619,7 +619,7 @@ public class ArithmeticUtilsTest {
}
return ints;
}
-
+
/**
* Testing helper method.
* @return an array of long numbers containing corner cases:<ul>
@@ -656,37 +656,37 @@ public class ArithmeticUtilsTest {
}
return longs;
}
-
+
private static long toUnsignedLong(int number) {
return number < 0 ? 0x100000000L + (long)number : (long)number;
}
-
+
private static int remainderUnsignedExpected(int dividend, int divisor) {
return (int)remainderUnsignedExpected(toUnsignedLong(dividend), toUnsignedLong(divisor));
}
-
+
private static int divideUnsignedExpected(int dividend, int divisor) {
return (int)divideUnsignedExpected(toUnsignedLong(dividend), toUnsignedLong(divisor));
}
-
+
private static BigInteger toUnsignedBigInteger(long number) {
return number < 0L ? BigInteger.ONE.shiftLeft(64).add(BigInteger.valueOf(number)) : BigInteger.valueOf(number);
}
-
+
private static long remainderUnsignedExpected(long dividend, long divisor) {
return toUnsignedBigInteger(dividend).remainder(toUnsignedBigInteger(divisor)).longValue();
}
-
+
private static long divideUnsignedExpected(long dividend, long divisor) {
return toUnsignedBigInteger(dividend).divide(toUnsignedBigInteger(divisor)).longValue();
}
-
+
@Test(timeout=5000L)
public void testRemainderUnsignedInt() {
Assert.assertEquals(36, ArithmeticUtils.remainderUnsigned(-2147479015, 63));
Assert.assertEquals(6, ArithmeticUtils.remainderUnsigned(-2147479015, 25));
}
-
+
@Test(timeout=5000L)
public void testRemainderUnsignedIntSpecialCases() {
int ints[] = getIntSpecialCases();
@@ -705,12 +705,12 @@ public class ArithmeticUtilsTest {
}
}
}
-
+
@Test(timeout=5000L)
public void testRemainderUnsignedLong() {
Assert.assertEquals(48L, ArithmeticUtils.remainderUnsigned(-2147479015L, 63L));
}
-
+
@Test//(timeout=5000L)
public void testRemainderUnsignedLongSpecialCases() {
long longs[] = getLongSpecialCases();
@@ -729,7 +729,7 @@ public class ArithmeticUtilsTest {
}
}
}
-
+
@Test(timeout=5000L)
public void testDivideUnsignedInt() {
Assert.assertEquals(34087115, ArithmeticUtils.divideUnsigned(-2147479015, 63));
@@ -743,7 +743,7 @@ public class ArithmeticUtilsTest {
Assert.assertEquals(1, ArithmeticUtils.divideUnsigned(-16, 2147483647));
Assert.assertEquals(1, ArithmeticUtils.divideUnsigned(-16, 2147483646));
}
-
+
@Test(timeout=5000L)
public void testDivideUnsignedIntSpecialCases() {
int ints[] = getIntSpecialCases();
@@ -762,12 +762,12 @@ public class ArithmeticUtilsTest {
}
}
}
-
+
@Test(timeout=5000L)
public void testDivideUnsignedLong() {
Assert.assertEquals(292805461453366231L, ArithmeticUtils.divideUnsigned(-2147479015L, 63L));
}
-
+
@Test(timeout=5000L)
public void testDivideUnsignedLongSpecialCases() {
long longs[] = getLongSpecialCases();
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/util/CombinationsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/util/CombinationsTest.java b/src/test/java/org/apache/commons/math4/util/CombinationsTest.java
index 83baa89..a2b0c4b 100644
--- a/src/test/java/org/apache/commons/math4/util/CombinationsTest.java
+++ b/src/test/java/org/apache/commons/math4/util/CombinationsTest.java
@@ -148,7 +148,7 @@ public class CombinationsTest {
* Verifies that the iterator generates a lexicographically
* increasing sequence of b(n,k) arrays, each having length k
* and each array itself increasing.
- *
+ *
* @param c Combinations.
*/
private void checkLexicographicIterator(Combinations c) {
@@ -180,7 +180,7 @@ public class CombinationsTest {
Assert.assertEquals(CombinatoricsUtils.binomialCoefficient(n, k),
numIterates);
}
-
+
@Test
public void testCombinationsIteratorFail() {
try {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/util/FastMathTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/util/FastMathTest.java b/src/test/java/org/apache/commons/math4/util/FastMathTest.java
index 1e93148..26c1cd9 100644
--- a/src/test/java/org/apache/commons/math4/util/FastMathTest.java
+++ b/src/test/java/org/apache/commons/math4/util/FastMathTest.java
@@ -184,14 +184,14 @@ public class FastMathTest {
for (double x = start; x < end; x += 1e-3) {
final double tst = FastMath.cosh(x);
final double ref = Math.cosh(x);
- maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
+ maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
}
Assert.assertEquals(0, maxErr, 3);
for (double x = start; x < end; x += 1e-3) {
final double tst = FastMath.sinh(x);
final double ref = Math.sinh(x);
- maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
+ maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
}
Assert.assertEquals(0, maxErr, 3);
}
@@ -206,18 +206,18 @@ public class FastMathTest {
for (double x = start; x > end; x -= 1e-3) {
final double tst = FastMath.cosh(x);
final double ref = Math.cosh(x);
- maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
+ maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
}
Assert.assertEquals(0, maxErr, 3);
for (double x = start; x > end; x -= 1e-3) {
final double tst = FastMath.sinh(x);
final double ref = Math.sinh(x);
- maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
+ maxErr = FastMath.max(maxErr, FastMath.abs(ref - tst) / FastMath.ulp(ref));
}
Assert.assertEquals(0, maxErr, 3);
}
-
+
@Test
public void testMath1269() {
final double arg = 709.8125;
@@ -1029,13 +1029,13 @@ public class FastMathTest {
*/
@Test
public void testAcosSpecialCases() {
-
+
Assert.assertTrue("acos(NaN) should be NaN", Double.isNaN(FastMath.acos(Double.NaN)));
-
+
Assert.assertTrue("acos(-1.1) should be NaN", Double.isNaN(FastMath.acos(-1.1)));
Assert.assertTrue("acos(-1.1) should be NaN", Double.isNaN(FastMath.acos(1.1)));
-
+
Assert.assertEquals("acos(-1.0) should be PI", FastMath.acos(-1.0), FastMath.PI, Precision.EPSILON);
Assert.assertEquals("acos(1.0) should be 0.0", FastMath.acos(1.0), 0.0, Precision.EPSILON);
@@ -1048,13 +1048,13 @@ public class FastMathTest {
*/
@Test
public void testAsinSpecialCases() {
-
+
Assert.assertTrue("asin(NaN) should be NaN", Double.isNaN(FastMath.asin(Double.NaN)));
-
+
Assert.assertTrue("asin(1.1) should be NaN", Double.isNaN(FastMath.asin(1.1)));
-
+
Assert.assertTrue("asin(-1.1) should be NaN", Double.isNaN(FastMath.asin(-1.1)));
-
+
Assert.assertEquals("asin(1.0) should be PI/2", FastMath.asin(1.0), FastMath.PI / 2.0, Precision.EPSILON);
Assert.assertEquals("asin(-1.0) should be -PI/2", FastMath.asin(-1.0), -FastMath.PI / 2.0, Precision.EPSILON);
@@ -1460,7 +1460,7 @@ public class FastMathTest {
public void testIntPowLongMinValue() {
Assert.assertEquals(1.0, FastMath.pow(1.0, Long.MIN_VALUE), -1.0);
}
-
+
@Test(timeout=5000L)
public void testIntPowSpecialCases() {
final double EXACT = -1.0;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/util/IncrementorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/util/IncrementorTest.java b/src/test/java/org/apache/commons/math4/util/IncrementorTest.java
index 72cde88..f25b3ff 100644
--- a/src/test/java/org/apache/commons/math4/util/IncrementorTest.java
+++ b/src/test/java/org/apache/commons/math4/util/IncrementorTest.java
@@ -135,4 +135,4 @@ public class IncrementorTest {
i.incrementCount(1);
Assert.assertEquals(3, i.getCount());
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java b/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
index 88392e1..be897a5 100644
--- a/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
+++ b/src/test/java/org/apache/commons/math4/util/ResizableDoubleArrayTest.java
@@ -124,7 +124,7 @@ public class ResizableDoubleArrayTest extends DoubleArrayAbstractTest {
ResizableDoubleArray copyDa = new ResizableDoubleArray(testDa);
Assert.assertEquals(copyDa, testDa);
Assert.assertEquals(testDa, copyDa);
-
+
// JIRA: MATH-1252
final double[] values = {1};
testDa = new ResizableDoubleArray(values);
[2/3] [math] Removed trailing spaces. No code change.
Posted by ps...@apache.org.
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java b/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java
index 03409de..45e2a2b 100644
--- a/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/UniformCrossoverTest.java
@@ -49,20 +49,20 @@ public class UniformCrossoverTest {
public void testRatioTooLow() {
new UniformCrossover<Integer>(-0.5d);
}
-
+
@Test(expected = OutOfRangeException.class)
public void testRatioTooHigh() {
new UniformCrossover<Integer>(1.5d);
}
-
+
@Test
public void testCrossover() {
// test crossover with different ratios
performCrossover(0.5);
performCrossover(0.7);
- performCrossover(0.2);
+ performCrossover(0.2);
}
-
+
private void performCrossover(double ratio) {
final DummyBinaryChromosome p1c = new DummyBinaryChromosome(p1);
final DummyBinaryChromosome p2c = new DummyBinaryChromosome(p2);
@@ -107,7 +107,7 @@ public class UniformCrossoverTest {
Assert.assertEquals(1.0 - ratio, (double) from2 / LEN, 0.1);
}
}
-
+
@Test(expected = DimensionMismatchException.class)
public void testCrossoverDimensionMismatchException(){
@SuppressWarnings("boxing")
@@ -121,7 +121,7 @@ public class UniformCrossoverTest {
final CrossoverPolicy cp = new UniformCrossover<Integer>(0.5d);
cp.crossover(p1c, p2c);
}
-
+
@Test(expected = MathIllegalArgumentException.class)
public void testCrossoverInvalidFixedLengthChromosomeFirst() {
@SuppressWarnings("boxing")
@@ -137,7 +137,7 @@ public class UniformCrossoverTest {
final CrossoverPolicy cp = new UniformCrossover<Integer>(0.5d);
cp.crossover(p1c, p2c);
}
-
+
@Test(expected = MathIllegalArgumentException.class)
public void testCrossoverInvalidFixedLengthChromosomeSecond() {
@SuppressWarnings("boxing")
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
index d59850f..24e5515 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/FieldVector3DTest.java
@@ -488,7 +488,7 @@ public class FieldVector3DTest {
Assert.assertEquals(FastMath.PI / 2, createVector(0, 1, 0, 3).getAlpha().getReal(), 1.0e-10);
Assert.assertEquals(0, createVector(0, 1, 0, 3).getDelta().getReal(), 1.0e-10);
Assert.assertEquals(FastMath.PI / 2, createVector(0, 0, 1, 3).getDelta().getReal(), 1.0e-10);
-
+
FieldVector3D<DerivativeStructure> u = createVector(-1, 1, -1, 3);
Assert.assertEquals(3 * FastMath.PI /4, u.getAlpha().getReal(), 1.0e-10);
Assert.assertEquals(-1.0 / FastMath.sqrt(3), u.getDelta().sin().getReal(), 1.0e-10);
@@ -634,8 +634,8 @@ public class FieldVector3DTest {
final FieldVector3D<DerivativeStructure> u2 = createVector( 1796571811118507.0 / 2147483648.0,
7853468008299307.0 / 2147483648.0,
2599586637357461.0 / 17179869184.0, 3);
- final FieldVector3D<DerivativeStructure> u3 = createVector(12753243807587107.0 / 18446744073709551616.0,
- -2313766922703915.0 / 18446744073709551616.0,
+ final FieldVector3D<DerivativeStructure> u3 = createVector(12753243807587107.0 / 18446744073709551616.0,
+ -2313766922703915.0 / 18446744073709551616.0,
-227970081415313.0 / 288230376151711744.0, 3);
FieldVector3D<DerivativeStructure> cNaive = new FieldVector3D<DerivativeStructure>(u1.getY().multiply(u2.getZ()).subtract(u1.getZ().multiply(u2.getY())),
u1.getZ().multiply(u2.getX()).subtract(u1.getX().multiply(u2.getZ())),
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java
index 66418bd..ad03bfa 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/LineTest.java
@@ -131,7 +131,7 @@ public class LineTest {
@Test
public void testRevert() {
-
+
// setup
Line line = new Line(new Vector3D(1653345.6696423641, 6170370.041579291, 90000),
new Vector3D(1650757.5050732433, 6160710.879908984, 0.9),
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
index 8d4b003..5630f34 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/PolyhedronsSetTest.java
@@ -258,20 +258,20 @@ public class PolyhedronsSetTest {
@Test
public void testIssue780() throws MathArithmeticException {
float[] coords = {
- 1.000000f, -1.000000f, -1.000000f,
- 1.000000f, -1.000000f, 1.000000f,
- -1.000000f, -1.000000f, 1.000000f,
- -1.000000f, -1.000000f, -1.000000f,
- 1.000000f, 1.000000f, -1f,
- 0.999999f, 1.000000f, 1.000000f, // 1.000000f, 1.000000f, 1.000000f,
- -1.000000f, 1.000000f, 1.000000f,
+ 1.000000f, -1.000000f, -1.000000f,
+ 1.000000f, -1.000000f, 1.000000f,
+ -1.000000f, -1.000000f, 1.000000f,
+ -1.000000f, -1.000000f, -1.000000f,
+ 1.000000f, 1.000000f, -1f,
+ 0.999999f, 1.000000f, 1.000000f, // 1.000000f, 1.000000f, 1.000000f,
+ -1.000000f, 1.000000f, 1.000000f,
-1.000000f, 1.000000f, -1.000000f};
int[] indices = {
- 0, 1, 2, 0, 2, 3,
- 4, 7, 6, 4, 6, 5,
- 0, 4, 5, 0, 5, 1,
- 1, 5, 6, 1, 6, 2,
- 2, 6, 7, 2, 7, 3,
+ 0, 1, 2, 0, 2, 3,
+ 4, 7, 6, 4, 6, 5,
+ 0, 4, 5, 0, 5, 1,
+ 1, 5, 6, 1, 6, 2,
+ 2, 6, 7, 2, 7, 3,
4, 0, 3, 4, 3, 7};
ArrayList<SubHyperplane<Euclidean3D>> subHyperplaneList = new ArrayList<SubHyperplane<Euclidean3D>>();
for (int idx = 0; idx < indices.length; idx += 3) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java
index 0320175..6739625 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/RotationTest.java
@@ -539,7 +539,7 @@ public class RotationTest {
Assert.assertEquals(1.0, q2, 1.0e-14);
Assert.assertEquals(0.0, Vector3D.angle(v1, quat.applyTo(u1)), 1.0e-14);
Assert.assertEquals(0.0, Vector3D.angle(v2, quat.applyTo(u2)), 1.0e-14);
-
+
}
private void checkVector(Vector3D v1, Vector3D v2) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
index deb0cc3..5fdc4f6 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphereGeneratorTest.java
@@ -151,7 +151,7 @@ public class SphereGeneratorTest {
Assert.assertEquals(0.0, refCenter.distance(sphere.getCenter()), 4e-7 * refRadius);
Assert.assertEquals(refRadius, sphere.getRadius(), 1e-7 * refRadius);
}
-
+
}
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java
index b1d4e68..48e5fca 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SphericalCoordinatesTest.java
@@ -98,7 +98,7 @@ public class SphericalCoordinatesTest {
cvalue.getPartialDerivative(0, 0, 1));
Vector3D testCGradient = new Vector3D(sc.toCartesianGradient(sGradient));
-
+
Assert.assertEquals(0, testCGradient.distance(refCGradient) / refCGradient.getNorm(), 5.0e-14);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java
index a2509fa..2c2b17d 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/SubLineTest.java
@@ -156,7 +156,7 @@ public class SubLineTest {
Assert.assertNull(sub1.intersection(sub2, true));
Assert.assertNull(sub1.intersection(sub2, false));
}
-
+
@Test
public void testIntersectionNotIntersecting() throws MathIllegalArgumentException {
SubLine sub1 = new SubLine(new Vector3D(1, 1, 1), new Vector3D(1.5, 1, 1), 1.0e-10);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
index d53a0f5..41b0e3a 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/threed/Vector3DTest.java
@@ -260,7 +260,7 @@ public class Vector3DTest {
Assert.assertEquals(0, Vector3D.PLUS_J.getDelta(), 1.0e-10);
Assert.assertEquals(0, Vector3D.PLUS_K.getAlpha(), 1.0e-10);
Assert.assertEquals(FastMath.PI / 2, Vector3D.PLUS_K.getDelta(), 1.0e-10);
-
+
Vector3D u = new Vector3D(-1, 1, -1);
Assert.assertEquals(3 * FastMath.PI /4, u.getAlpha(), 1.0e-10);
Assert.assertEquals(-1.0 / FastMath.sqrt(3), FastMath.sin(u.getDelta()), 1.0e-10);
@@ -377,8 +377,8 @@ public class Vector3DTest {
final Vector3D u2 = new Vector3D( 1796571811118507.0 / 2147483648.0,
7853468008299307.0 / 2147483648.0,
2599586637357461.0 / 17179869184.0);
- final Vector3D u3 = new Vector3D(12753243807587107.0 / 18446744073709551616.0,
- -2313766922703915.0 / 18446744073709551616.0,
+ final Vector3D u3 = new Vector3D(12753243807587107.0 / 18446744073709551616.0,
+ -2313766922703915.0 / 18446744073709551616.0,
-227970081415313.0 / 288230376151711744.0);
Vector3D cNaive = new Vector3D(u1.getY() * u2.getZ() - u1.getZ() * u2.getY(),
u1.getZ() * u2.getX() - u1.getX() * u2.getZ(),
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
index f26d467..5ca9295 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/DiskGeneratorTest.java
@@ -116,6 +116,6 @@ public class DiskGeneratorTest {
Assert.assertEquals(0.0, refCenter.distance(disk.getCenter()), 3e-9 * refRadius);
Assert.assertEquals(refRadius, disk.getRadius(), 7e-10 * refRadius);
}
-
+
}
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
index 34f10c2..28b5eda 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/PolygonsSetTest.java
@@ -226,7 +226,7 @@ public class PolygonsSetTest {
Assert.assertEquals(3.0, p.getY(), 1.0e-10);
Assert.assertEquals(+v.distance(new Vector2D(3, 3)), projection.getOffset(), 1.0e-10);
}
-
+
}
}
@@ -1108,15 +1108,15 @@ public class PolygonsSetTest {
public void testIssue1162() {
PolygonsSet p = new PolygonsSet(1.0e-10,
new Vector2D(4.267199999996532, -11.928637756014894),
- new Vector2D(4.267200000026445, -14.12360595809307),
- new Vector2D(9.144000000273694, -14.12360595809307),
+ new Vector2D(4.267200000026445, -14.12360595809307),
+ new Vector2D(9.144000000273694, -14.12360595809307),
new Vector2D(9.144000000233383, -11.928637756020067));
PolygonsSet w = new PolygonsSet(1.0e-10,
new Vector2D(2.56735636510452512E-9, -11.933116461089332),
- new Vector2D(2.56735636510452512E-9, -12.393225665247766),
- new Vector2D(2.56735636510452512E-9, -27.785625665247778),
- new Vector2D(4.267200000030211, -27.785625665247778),
+ new Vector2D(2.56735636510452512E-9, -12.393225665247766),
+ new Vector2D(2.56735636510452512E-9, -27.785625665247778),
+ new Vector2D(4.267200000030211, -27.785625665247778),
new Vector2D(4.267200000030211, -11.933116461089332));
Assert.assertFalse(p.contains(w));
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java
index 255324a..ef2c0f7 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/Vector2DTest.java
@@ -28,13 +28,13 @@ public class Vector2DTest {
Vector2D p1 = new Vector2D(1, 1);
Vector2D p2 = new Vector2D(2, 2);
-
+
Vector2D p3 = new Vector2D(3, 3);
Assert.assertEquals(0.0, p3.crossProduct(p1, p2), epsilon);
-
+
Vector2D p4 = new Vector2D(1, 2);
Assert.assertEquals(1.0, p4.crossProduct(p1, p2), epsilon);
-
+
Vector2D p5 = new Vector2D(2, 1);
Assert.assertEquals(-1.0, p5.crossProduct(p1, p2), epsilon);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
index 5b3f8ae..717b264 100644
--- a/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/euclidean/twod/hull/ConvexHullGenerator2DAbstractTest.java
@@ -40,7 +40,7 @@ import org.junit.Test;
/**
* Abstract base test class for 2D convex hull generators.
- *
+ *
*/
public abstract class ConvexHullGenerator2DAbstractTest {
@@ -67,7 +67,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
public void testNullArgument() {
generator.generate(null);
}
-
+
@Test
public void testEmpty() {
ConvexHull2D hull = generator.generate(Collections.<Vector2D>emptyList());
@@ -246,9 +246,9 @@ public abstract class ConvexHullGenerator2DAbstractTest {
hull = createConvexHullGenerator(true).generate(points);
checkConvexHull(points, hull, true);
-
+
points.clear();
-
+
// second case: multiple points are collinear
points.add(new Vector2D(0, -29.959696875));
points.add(new Vector2D(0, -31.621809375));
@@ -327,7 +327,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
points.add(new Vector2D(line[0], line[1]));
}
- Vector2D[] referenceHull = new Vector2D[] {
+ Vector2D[] referenceHull = new Vector2D[] {
new Vector2D(-11.0, -1.0),
new Vector2D(-10.0, -3.0),
new Vector2D( -6.0, -7.0),
@@ -364,7 +364,7 @@ public abstract class ConvexHullGenerator2DAbstractTest {
}
// ------------------------------------------------------------------------------
-
+
protected final List<Vector2D> createRandomPoints(int size) {
// create the cloud container
List<Vector2D> points = new ArrayList<Vector2D>(size);
@@ -419,13 +419,13 @@ public abstract class ConvexHullGenerator2DAbstractTest {
return false;
}
}
-
+
sign = cmp;
}
-
+
return true;
}
-
+
// verify that all points are inside the convex hull region
protected final void checkPointsInsideHullRegion(final Collection<Vector2D> points,
final ConvexHull2D hull,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
index ecad646..e6934b1 100644
--- a/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
+++ b/src/test/java/org/apache/commons/math4/geometry/spherical/twod/CircleTest.java
@@ -96,7 +96,7 @@ public class CircleTest {
Assert.assertEquals(circle.getPhase(p), circle.getPhase(samePhase), 1.0e-10);
Assert.assertEquals(0.0, circle.getPhase(circle.getXAxis()), 1.0e-10);
Assert.assertEquals(0.5 * FastMath.PI, circle.getPhase(circle.getYAxis()), 1.0e-10);
-
+
}
@Test
@@ -129,7 +129,7 @@ public class CircleTest {
Assert.assertEquals(0.0, circle.getOffset(new S2Point(Vector3D.MINUS_J)), 1.0e-10);
Assert.assertEquals(-0.5 * FastMath.PI, circle.getOffset(new S2Point(Vector3D.PLUS_K)), 1.0e-10);
Assert.assertEquals( 0.5 * FastMath.PI, circle.getOffset(new S2Point(Vector3D.MINUS_K)), 1.0e-10);
-
+
}
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java b/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java
index cd703f5..fb41169 100644
--- a/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/DiagonalMatrixTest.java
@@ -129,14 +129,14 @@ public class DiagonalMatrixTest {
Assert.assertEquals(0d, out[i][j], 0d);
}
}
- }
+ }
}
@Test
public void testAdd() {
final double[] data1 = { -1.2, 3.4, 5 };
final DiagonalMatrix m1 = new DiagonalMatrix(data1);
-
+
final double[] data2 = { 10.1, 2.3, 45 };
final DiagonalMatrix m2 = new DiagonalMatrix(data2);
@@ -157,7 +157,7 @@ public class DiagonalMatrixTest {
public void testSubtract() {
final double[] data1 = { -1.2, 3.4, 5 };
final DiagonalMatrix m1 = new DiagonalMatrix(data1);
-
+
final double[] data2 = { 10.1, 2.3, 45 };
final DiagonalMatrix m2 = new DiagonalMatrix(data2);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
index cf86a4c..fba9e90 100644
--- a/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/EigenDecompositionTest.java
@@ -335,7 +335,7 @@ public class EigenDecompositionTest {
EigenDecomposition ed;
ed = new EigenDecomposition(symmetric);
-
+
RealMatrix d = ed.getD();
RealMatrix v = ed.getV();
RealMatrix vT = ed.getVT();
@@ -401,7 +401,7 @@ public class EigenDecompositionTest {
{ 27.0, 9.0, 3.0, 1.0 },
{ 64.0, 16.0, 4.0, 1.0 } };
checkUnsymmetricMatrix(MatrixUtils.createRealMatrix(vData));
-
+
RealMatrix randMatrix = MatrixUtils.createRealMatrix(new double[][] {
{0, 1, 0, 0},
{1, 0, 2.e-7, 0},
@@ -421,7 +421,7 @@ public class EigenDecompositionTest {
};
checkUnsymmetricMatrix(MatrixUtils.createRealMatrix(randData2));
}
-
+
@Test
@Ignore
public void testRandomUnsymmetricMatrix() {
@@ -440,12 +440,12 @@ public class EigenDecompositionTest {
RealMatrix m = MatrixUtils.createRealMatrix(data);
checkUnsymmetricMatrix(m);
- }
+ }
}
/**
* Tests the porting of a bugfix in Jama-1.0.3 (from changelog):
- *
+ *
* Patched hqr2 method in Jama.EigenvalueDecomposition to avoid infinite loop;
* Thanks Frederic Devernay <fr...@m4x.org>
*/
@@ -458,7 +458,7 @@ public class EigenDecompositionTest {
{1,1,0,0,1},
{1,0,1,0,1}
};
-
+
RealMatrix m = MatrixUtils.createRealMatrix(data);
checkUnsymmetricMatrix(m);
}
@@ -484,7 +484,7 @@ public class EigenDecompositionTest {
checkUnsymmetricMatrix(m);
}
}
-
+
@Test
public void testMath848() {
double[][] data = {
@@ -507,18 +507,18 @@ public class EigenDecompositionTest {
private void checkUnsymmetricMatrix(final RealMatrix m) {
try {
EigenDecomposition ed = new EigenDecomposition(m);
-
+
RealMatrix d = ed.getD();
RealMatrix v = ed.getV();
//RealMatrix vT = ed.getVT();
RealMatrix x = m.multiply(v);
RealMatrix y = v.multiply(d);
-
+
double diffNorm = x.subtract(y).getNorm();
Assert.assertTrue("The norm of (X-Y) is too large: " + diffNorm + ", matrix=" + m.toString(),
x.subtract(y).getNorm() < 1000 * Precision.EPSILON * FastMath.max(x.getNorm(), y.getNorm()));
-
+
RealMatrix invV = new LUDecomposition(v).getSolver().getInverse();
double norm = v.multiply(d).multiply(invV).subtract(m).getNorm();
Assert.assertEquals(0.0, norm, 1.0e-10);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
index 75e3af6..310f23d 100644
--- a/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/HessenbergTransformerTest.java
@@ -167,17 +167,17 @@ public class HessenbergTransformerTest {
///////////////////////////////////////////////////////////////////////////
// Test helpers
///////////////////////////////////////////////////////////////////////////
-
+
private RealMatrix checkAEqualPHPt(RealMatrix matrix) {
HessenbergTransformer transformer = new HessenbergTransformer(matrix);
RealMatrix p = transformer.getP();
RealMatrix pT = transformer.getPT();
RealMatrix h = transformer.getH();
-
+
RealMatrix result = p.multiply(h).multiply(pT);
double norm = result.subtract(matrix).getNorm();
Assert.assertEquals(0, norm, 1.0e-10);
-
+
for (int i = 0; i < matrix.getRowDimension(); ++i) {
for (int j = 0; j < matrix.getColumnDimension(); ++j) {
if (i > j + 1) {
@@ -185,7 +185,7 @@ public class HessenbergTransformerTest {
}
}
}
-
+
return transformer.getH();
}
@@ -206,7 +206,7 @@ public class HessenbergTransformerTest {
}
}
}
-
+
private void checkMatricesValues(double[][] matrix, double[][] pRef, double[][] hRef) {
HessenbergTransformer transformer =
new HessenbergTransformer(MatrixUtils.createRealMatrix(matrix));
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java b/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java
index e22e5ff..7fbd12d 100644
--- a/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/MatrixDimensionMismatchExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link MatrixDimensionMismatchException}.
- *
+ *
*/
public class MatrixDimensionMismatchExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java b/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java
index 9d80d3a..b547cdc 100644
--- a/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/MatrixUtilsTest.java
@@ -315,8 +315,8 @@ public final class MatrixUtilsTest {
}
return d;
}
-
- @Test
+
+ @Test
public void testSolveLowerTriangularSystem(){
RealMatrix rm = new Array2DRowRealMatrix(
new double[][] { {2,0,0,0 }, { 1,1,0,0 }, { 3,3,3,0 }, { 3,3,3,4 } },
@@ -325,8 +325,8 @@ public final class MatrixUtilsTest {
MatrixUtils.solveLowerTriangularSystem(rm, b);
TestUtils.assertEquals( new double[]{1,2,-1.66666666666667, 1.0} , b.toArray() , 1.0e-12);
}
-
-
+
+
/*
* Taken from R manual http://stat.ethz.ch/R-manual/R-patched/library/base/html/backsolve.html
*/
@@ -449,7 +449,7 @@ public final class MatrixUtilsTest {
};
MatrixUtils.checkSymmetric(MatrixUtils.createRealMatrix(dataSym), Math.ulp(1d));
}
-
+
@Test(expected=NonSymmetricMatrixException.class)
public void testCheckSymmetric2() {
final double[][] dataNonSym = {
@@ -459,19 +459,19 @@ public final class MatrixUtilsTest {
};
MatrixUtils.checkSymmetric(MatrixUtils.createRealMatrix(dataNonSym), Math.ulp(1d));
}
-
+
@Test(expected=SingularMatrixException.class)
public void testInverseSingular() {
RealMatrix m = MatrixUtils.createRealMatrix(testData3x3Singular);
MatrixUtils.inverse(m);
}
-
+
@Test(expected=NonSquareMatrixException.class)
public void testInverseNonSquare() {
RealMatrix m = MatrixUtils.createRealMatrix(testData3x4);
MatrixUtils.inverse(m);
}
-
+
@Test
public void testInverseDiagonalMatrix() {
final double[] data = { 1, 2, 3 };
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java
index e501f1d..6b62df5 100644
--- a/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/QRDecompositionTest.java
@@ -281,7 +281,7 @@ public class QRDecompositionTest {
});
return m;
}
-
+
@Test(expected=SingularMatrixException.class)
public void testQRSingular() {
final RealMatrix a = MatrixUtils.createRealMatrix(new double[][] {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java b/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java
index eb91c45..6dbd956 100644
--- a/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/RRQRSolverTest.java
@@ -127,10 +127,10 @@ public class RRQRSolverTest {
{ 1, 2515 }, { 2, 422 }, { -3, 898 }
});
-
+
RRQRDecomposition decomposition = new RRQRDecomposition(MatrixUtils.createRealMatrix(testData3x3NonSingular));
DecompositionSolver solver = decomposition.getSolver();
-
+
// using RealMatrix
Assert.assertEquals(0, solver.solve(b).subtract(xRef).getNorm(), 3.0e-16 * xRef.getNorm());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java b/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java
index 42e2f2d..e1a6eb6 100644
--- a/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/RectangularCholeskyDecompositionTest.java
@@ -105,7 +105,7 @@ public class RectangularCholeskyDecompositionTest {
composeAndTest(m3, 4);
}
-
+
private void composeAndTest(RealMatrix m, int expectedRank) {
RectangularCholeskyDecomposition r = new RectangularCholeskyDecomposition(m);
Assert.assertEquals(expectedRank, r.getRank());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
index 4c645fb..e0a5611 100644
--- a/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
+++ b/src/test/java/org/apache/commons/math4/linear/SchurTransformerTest.java
@@ -74,7 +74,7 @@ public class SchurTransformerTest {
public void testPOrthogonal() {
checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testSquare5)).getP());
checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testSquare3)).getP());
- checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testRandom)).getP());
+ checkOrthogonal(new SchurTransformer(MatrixUtils.createRealMatrix(testRandom)).getP());
}
@Test
@@ -159,12 +159,12 @@ public class SchurTransformerTest {
RealMatrix p = transformer.getP();
RealMatrix t = transformer.getT();
RealMatrix pT = transformer.getPT();
-
+
RealMatrix result = p.multiply(t).multiply(pT);
double norm = result.subtract(matrix).getNorm();
Assert.assertEquals(0, norm, 1.0e-9);
-
+
return t;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java
index 06e28c9..0820fbc 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/DBSCANClustererTest.java
@@ -149,19 +149,19 @@ public class DBSCANClustererTest {
new DoublePoint(new int[] {14, 8}), // C
new DoublePoint(new int[] {7, 15}), // N - Noise, should not be present
new DoublePoint(new int[] {17, 8}), // D - single-link connected to C should not be present
-
+
};
-
+
final DBSCANClusterer<DoublePoint> clusterer = new DBSCANClusterer<DoublePoint>(3, 3);
List<Cluster<DoublePoint>> clusters = clusterer.cluster(Arrays.asList(points));
-
+
Assert.assertEquals(1, clusters.size());
-
+
final List<DoublePoint> clusterOne =
Arrays.asList(points[0], points[1], points[2], points[3], points[4], points[5], points[6], points[7]);
Assert.assertTrue(clusters.get(0).getPoints().containsAll(clusterOne));
}
-
+
@Test
public void testGetEps() {
final DBSCANClusterer<DoublePoint> transformer = new DBSCANClusterer<DoublePoint>(2.0, 5);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
index 31d4288..39ef2c5 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/KMeansPlusPlusClustererTest.java
@@ -41,7 +41,7 @@ public class KMeansPlusPlusClustererTest {
@Before
public void setUp() {
random = new JDKRandomGenerator();
- random.setSeed(1746432956321l);
+ random.setSeed(1746432956321l);
}
/**
@@ -156,7 +156,7 @@ public class KMeansPlusPlusClustererTest {
final int NUM_CLUSTERS = 2;
final int NUM_ITERATIONS = 0;
random.setSeed(RANDOM_SEED);
-
+
KMeansPlusPlusClusterer<DoublePoint> clusterer =
new KMeansPlusPlusClusterer<DoublePoint>(NUM_CLUSTERS, NUM_ITERATIONS,
new CloseDistance(), random);
@@ -171,15 +171,15 @@ public class KMeansPlusPlusClustererTest {
}
Assert.assertTrue(uniquePointIsCenter);
}
-
+
/**
* 2 variables cannot be clustered into 3 clusters. See issue MATH-436.
*/
@Test(expected=NumberIsTooSmallException.class)
public void testPerformClusterAnalysisToManyClusters() {
- KMeansPlusPlusClusterer<DoublePoint> transformer =
+ KMeansPlusPlusClusterer<DoublePoint> transformer =
new KMeansPlusPlusClusterer<DoublePoint>(3, 1, new EuclideanDistance(), random);
-
+
DoublePoint[] points = new DoublePoint[] {
new DoublePoint(new int[] {
1959, 325100
@@ -187,7 +187,7 @@ public class KMeansPlusPlusClustererTest {
1960, 373200
})
};
-
+
transformer.cluster(Arrays.asList(points));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java
index cf4ec54..d707112 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/MultiKMeansPlusPlusClustererTest.java
@@ -36,7 +36,7 @@ public class MultiKMeansPlusPlusClustererTest {
MultiKMeansPlusPlusClusterer<DoublePoint> transformer =
new MultiKMeansPlusPlusClusterer<DoublePoint>(
new KMeansPlusPlusClusterer<DoublePoint>(3, 10), 5);
-
+
DoublePoint[] points = new DoublePoint[] {
// first expected cluster
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java b/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java
index 4dde78f..0b20f8b 100644
--- a/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/clustering/evaluation/SumOfClusterVariancesTest.java
@@ -56,7 +56,7 @@ public class SumOfClusterVariancesTest {
};
final List<Cluster<DoublePoint>> clusters = new ArrayList<Cluster<DoublePoint>>();
-
+
final Cluster<DoublePoint> cluster1 = new Cluster<DoublePoint>();
for (DoublePoint p : points1) {
cluster1.addPoint(p);
@@ -73,7 +73,7 @@ public class SumOfClusterVariancesTest {
assertEquals(6.148148148, evaluator.score(clusters), 1e-6);
}
-
+
@Test
public void testOrdering() {
assertTrue(evaluator.isBetterScore(10, 20));
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java
index 7163e0d..0e34f6b 100644
--- a/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/NetworkTest.java
@@ -149,14 +149,14 @@ public class NetworkTest {
initArray).getNetwork();
final Network copy = net.copy();
-
+
final Neuron netNeuron0 = net.getNeuron(0);
final Neuron copyNeuron0 = copy.getNeuron(0);
final Neuron netNeuron1 = net.getNeuron(1);
final Neuron copyNeuron1 = copy.getNeuron(1);
Collection<Neuron> netNeighbours;
Collection<Neuron> copyNeighbours;
-
+
// Check that both networks have the same connections.
netNeighbours = net.getNeighbours(netNeuron0);
copyNeighbours = copy.getNeighbours(copyNeuron0);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java
index cc19143..9e13e35 100644
--- a/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java
+++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/OffsetFeatureInitializer.java
@@ -37,7 +37,7 @@ public class OffsetFeatureInitializer
* each call.
*
* @param orig Original initializer.
- */
+ */
public OffsetFeatureInitializer(FeatureInitializer orig) {
this.orig = orig;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java
index 0bd4d2a..dd669d5 100644
--- a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java
+++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/KohonenTrainingTaskTest.java
@@ -150,7 +150,7 @@ public class KohonenTrainingTaskTest {
for (double[] c : solver.getCoordinatesList()) {
s.append(c[0]).append(" ").append(c[1]).append(" ");
final City city = solver.getClosestCity(c[0], c[1]);
- final double[] cityCoord = city.getCoordinates();
+ final double[] cityCoord = city.getCoordinates();
s.append(cityCoord[0]).append(" ").append(cityCoord[1]).append(" ");
s.append(" # ").append(city.getName()).append("\n");
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
index f11329c..fea0f16 100644
--- a/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
+++ b/src/test/java/org/apache/commons/math4/ml/neuralnet/sofm/TravellingSalesmanSolver.java
@@ -125,7 +125,7 @@ public class TravellingSalesmanSolver {
createRandomIterator(numSamplesPerTask),
action);
}
-
+
return tasks;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java b/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java
index b4e20ed..d843ccb 100644
--- a/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/JacobianMatricesTest.java
@@ -467,7 +467,7 @@ public class JacobianMatricesTest {
} else {
dFdP[0] = cy - y[1];
dFdP[1] = y[0] - cx;
- }
+ }
}
public double[] exactY(double t) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java b/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java
index bbb2bc5..cb8f5a8 100644
--- a/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/events/EventStateTest.java
@@ -88,11 +88,11 @@ public class EventStateTest {
MaxCountExceededException, NoBracketingException {
FirstOrderDifferentialEquations equation = new FirstOrderDifferentialEquations() {
-
+
public int getDimension() {
return 1;
}
-
+
public void computeDerivatives(double t, double[] y, double[] yDot) {
yDot[0] = 1.0;
}
@@ -153,11 +153,11 @@ public class EventStateTest {
ExpandableStatefulODE equation =
new ExpandableStatefulODE(new FirstOrderDifferentialEquations() {
-
+
public int getDimension() {
return 1;
}
-
+
public void computeDerivatives(double t, double[] y, double[] yDot) {
yDot[0] = 2.0;
}
@@ -165,11 +165,11 @@ public class EventStateTest {
equation.setTime(0.0);
equation.setPrimaryState(new double[1]);
equation.addSecondaryEquations(new SecondaryEquations() {
-
+
public int getDimension() {
return 1;
}
-
+
public void computeDerivatives(double t, double[] primary,
double[] primaryDot, double[] secondary,
double[] secondaryDot) {
@@ -221,11 +221,11 @@ public class EventStateTest {
MaxCountExceededException, NoBracketingException {
FirstOrderDifferentialEquations equation = new FirstOrderDifferentialEquations() {
-
+
public int getDimension() {
return 1;
}
-
+
public void computeDerivatives(double t, double[] y, double[] yDot) {
yDot[0] = 1.0;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java b/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java
index 3a4e138..d34de40 100644
--- a/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java
+++ b/src/test/java/org/apache/commons/math4/ode/nonstiff/HighamHall54IntegratorTest.java
@@ -356,7 +356,7 @@ public class HighamHall54IntegratorTest {
FirstOrderIntegrator integ = new HighamHall54Integrator(minStep, maxStep,
vecAbsoluteTolerance,
vecRelativeTolerance);
- TestProblemHandler handler = new TestProblemHandler(pb, integ);
+ TestProblemHandler handler = new TestProblemHandler(pb, integ);
integ.addStepHandler(handler);
integ.integrate(pb,
pb.getInitialTime(), pb.getInitialState(),
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java b/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java
index 0013052..1955321 100644
--- a/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java
+++ b/src/test/java/org/apache/commons/math4/ode/sampling/StepNormalizerOutputTestBase.java
@@ -239,10 +239,10 @@ public abstract class StepNormalizerOutputTestBase
* @param bounds the step normalizer bounds setting to use
* @param expected the expected output (normalized time points)
* @param reverse whether to reverse the integration direction
- * @throws NoBracketingException
- * @throws MaxCountExceededException
- * @throws NumberIsTooSmallException
- * @throws DimensionMismatchException
+ * @throws NoBracketingException
+ * @throws MaxCountExceededException
+ * @throws NumberIsTooSmallException
+ * @throws DimensionMismatchException
*/
private void doTest(StepNormalizerMode mode, StepNormalizerBounds bounds,
double[] expected, boolean reverse)
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java
index e363214..e496e9e 100644
--- a/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/SimplePointCheckerTest.java
@@ -33,7 +33,7 @@ public class SimplePointCheckerTest {
final int max = 10;
final SimplePointChecker<PointValuePair> checker
= new SimplePointChecker<PointValuePair>(1e-1, 1e-2, max);
- Assert.assertTrue(checker.converged(max, null, null));
+ Assert.assertTrue(checker.converged(max, null, null));
Assert.assertTrue(checker.converged(max + 1, null, null));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java
index 64ff78c..5ba4aab 100644
--- a/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/SimpleValueCheckerTest.java
@@ -32,7 +32,7 @@ public class SimpleValueCheckerTest {
public void testIterationCheck() {
final int max = 10;
final SimpleValueChecker checker = new SimpleValueChecker(1e-1, 1e-2, max);
- Assert.assertTrue(checker.converged(max, null, null));
+ Assert.assertTrue(checker.converged(max, null, null));
Assert.assertTrue(checker.converged(max + 1, null, null));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java
index 5064f55..db69efd 100644
--- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/BOBYQAOptimizerTest.java
@@ -42,22 +42,22 @@ import org.junit.Test;
public class BOBYQAOptimizerTest {
static final int DIM = 13;
-
+
@Test(expected=NumberIsTooLargeException.class)
public void testInitOutOfBounds() {
double[] startPoint = point(DIM, 3);
double[][] boundaries = boundaries(DIM, -1, 2);
doTest(new Rosen(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 2000, null);
}
-
+
@Test(expected=DimensionMismatchException.class)
public void testBoundariesDimensionMismatch() {
double[] startPoint = point(DIM, 0.5);
double[][] boundaries = boundaries(DIM + 1, -1, 2);
doTest(new Rosen(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 2000, null);
}
@@ -75,7 +75,7 @@ public class BOBYQAOptimizerTest {
double[] startPoint = point(DIM, 0.1);
double[][] boundaries = null;
doTest(new Rosen(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, lowMaxEval, null);
}
@@ -85,7 +85,7 @@ public class BOBYQAOptimizerTest {
double[][] boundaries = null;
PointValuePair expected = new PointValuePair(point(DIM,1.0),0.0);
doTest(new Rosen(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 2000, expected);
}
@@ -95,12 +95,12 @@ public class BOBYQAOptimizerTest {
double[][] boundaries = null;
PointValuePair expected = new PointValuePair(point(DIM,0.0),1.0);
doTest(new MinusElli(), startPoint, boundaries,
- GoalType.MAXIMIZE,
+ GoalType.MAXIMIZE,
2e-10, 5e-6, 1000, expected);
- boundaries = boundaries(DIM,-0.3,0.3);
+ boundaries = boundaries(DIM,-0.3,0.3);
startPoint = point(DIM,0.1);
doTest(new MinusElli(), startPoint, boundaries,
- GoalType.MAXIMIZE,
+ GoalType.MAXIMIZE,
2e-10, 5e-6, 1000, expected);
}
@@ -111,7 +111,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new Elli(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 1000, expected);
}
@@ -122,7 +122,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new ElliRotated(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-12, 1e-6, 10000, expected);
}
@@ -133,7 +133,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new Cigar(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 100, expected);
}
@@ -155,7 +155,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new CigTab(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 5e-5, 100, expected);
}
@@ -166,18 +166,18 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new Sphere(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 100, expected);
}
@Test
public void testTablet() {
- double[] startPoint = point(DIM,1.0);
+ double[] startPoint = point(DIM,1.0);
double[][] boundaries = null;
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new Tablet(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 100, expected);
}
@@ -188,7 +188,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM/2,0.0),0.0);
doTest(new DiffPow(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-8, 1e-1, 21000, expected);
}
@@ -199,7 +199,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM/2,0.0),0.0);
doTest(new SsDiffPow(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-2, 1.3e-1, 50000, expected);
}
@@ -222,7 +222,7 @@ public class BOBYQAOptimizerTest {
PointValuePair expected =
new PointValuePair(point(DIM,0.0),0.0);
doTest(new Rastrigin(), startPoint, boundaries,
- GoalType.MINIMIZE,
+ GoalType.MINIMIZE,
1e-13, 1e-6, 1000, expected);
}
@@ -334,7 +334,7 @@ public class BOBYQAOptimizerTest {
new InitialGuess(startPoint),
new SimpleBounds(boundaries[0],
boundaries[1]));
-// System.out.println(func.getClass().getName() + " = "
+// System.out.println(func.getClass().getName() + " = "
// + optim.getEvaluations() + " f(");
// for (double x: result.getPoint()) System.out.print(x + " ");
// System.out.println(") = " + result.getValue());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
index b6c5622..51617d6 100644
--- a/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/nonlinear/scalar/noderiv/CMAESOptimizerTest.java
@@ -71,7 +71,7 @@ public class CMAESOptimizerTest {
GoalType.MINIMIZE, LAMBDA, true, 0, 1e-13,
1e-13, 1e-6, 100000, expected);
}
-
+
@Test(expected = DimensionMismatchException.class)
public void testBoundariesDimensionMismatch() {
double[] startPoint = point(DIM,0.5);
@@ -119,7 +119,7 @@ public class CMAESOptimizerTest {
GoalType.MINIMIZE, LAMBDA, true, 0, 1e-13,
1e-13, 1e-6, 100000, expected);
}
-
+
@Test
@Retry(3)
public void testRosen() {
@@ -150,7 +150,7 @@ public class CMAESOptimizerTest {
doTest(new MinusElli(), startPoint, insigma, boundaries,
GoalType.MAXIMIZE, LAMBDA, false, 0, 1.0-1e-13,
2e-10, 5e-6, 100000, expected);
- boundaries = boundaries(DIM,-0.3,0.3);
+ boundaries = boundaries(DIM,-0.3,0.3);
startPoint = point(DIM,0.1);
doTest(new MinusElli(), startPoint, insigma, boundaries,
GoalType.MAXIMIZE, LAMBDA, true, 0, 1.0-1e-13,
@@ -409,7 +409,7 @@ public class CMAESOptimizerTest {
};
final double[] start = { 1 };
-
+
// No bounds.
PointValuePair result = optimizer.optimize(new MaxEval(100000),
new ObjectiveFunction(fitnessFunction),
@@ -454,7 +454,7 @@ public class CMAESOptimizerTest {
Assert.assertEquals(resNoBound, resNearLo, 1e-3);
Assert.assertEquals(resNoBound, resNearHi, 1e-3);
}
-
+
/**
* @param func Function to optimize.
* @param startPoint Starting point.
@@ -477,7 +477,7 @@ public class CMAESOptimizerTest {
GoalType goal,
int lambda,
boolean isActive,
- int diagonalOnly,
+ int diagonalOnly,
double stopValue,
double fTol,
double pointTol,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java
index d5ea82a..319e0f1 100644
--- a/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/univariate/BrentOptimizerTest.java
@@ -89,7 +89,7 @@ public final class BrentOptimizerTest {
public void testBoundaries() {
final double lower = -1.0;
final double upper = +1.0;
- UnivariateFunction f = new UnivariateFunction() {
+ UnivariateFunction f = new UnivariateFunction() {
public double value(double x) {
if (x < lower) {
throw new NumberIsTooSmallException(x, lower, true);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
index 4946431..ec8ec06 100644
--- a/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/univariate/MultiStartUnivariateOptimizerTest.java
@@ -117,7 +117,7 @@ public class MultiStartUnivariateOptimizerTest {
JDKRandomGenerator g = new JDKRandomGenerator();
g.setSeed(4312000053L);
MultiStartUnivariateOptimizer optimizer = new MultiStartUnivariateOptimizer(underlying, 5, g);
-
+
try {
optimizer.optimize(new MaxEval(300),
new UnivariateObjectiveFunction(f),
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java b/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java
index 72c02b1..a515b06 100644
--- a/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java
+++ b/src/test/java/org/apache/commons/math4/optim/univariate/SimpleUnivariateValueCheckerTest.java
@@ -32,7 +32,7 @@ public class SimpleUnivariateValueCheckerTest {
public void testIterationCheck() {
final int max = 10;
final SimpleUnivariateValueChecker checker = new SimpleUnivariateValueChecker(1e-1, 1e-2, max);
- Assert.assertTrue(checker.converged(max, null, null));
+ Assert.assertTrue(checker.converged(max, null, null));
Assert.assertTrue(checker.converged(max + 1, null, null));
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java b/src/test/java/org/apache/commons/math4/primes/PrimesTest.java
index 085dfac..26bcd37 100644
--- a/src/test/java/org/apache/commons/math4/primes/PrimesTest.java
+++ b/src/test/java/org/apache/commons/math4/primes/PrimesTest.java
@@ -171,4 +171,4 @@ public class PrimesTest {
Assert.assertEquals(1, factors.size());
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java
index 282ec38..79cf97d 100644
--- a/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/AbstractRandomGeneratorTest.java
@@ -28,12 +28,12 @@ public class AbstractRandomGeneratorTest extends RandomGeneratorAbstractTest {
public AbstractRandomGeneratorTest() {
super();
}
-
+
@Override
protected RandomGenerator makeGenerator() {
RandomGenerator generator = new TestRandomGenerator();
generator.setSeed(1001);
return generator;
}
-
+
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java
index cc47304..7f43ccb 100644
--- a/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/BitsStreamGeneratorTest.java
@@ -31,14 +31,14 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest {
public BitsStreamGeneratorTest() {
super();
}
-
+
@Override
protected RandomGenerator makeGenerator() {
RandomGenerator generator = new TestBitStreamGenerator();
generator.setSeed(1000);
return generator;
}
-
+
/**
* Test BitStreamGenerator using a Random as bit source.
*/
@@ -46,7 +46,7 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest {
private static final long serialVersionUID = 1L;
private BitRandom ran = new BitRandom();
-
+
@Override
public void setSeed(int seed) {
ran.setSeed(seed);
@@ -61,15 +61,15 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest {
@Override
public void setSeed(long seed) {
ran.setSeed((int) seed);
-
+
}
-
+
@Override
protected int next(int bits) {
return ran.nextBits(bits);
- }
+ }
}
-
+
/**
* Extend Random to expose next(bits)
*/
@@ -82,5 +82,5 @@ public class BitsStreamGeneratorTest extends RandomGeneratorAbstractTest {
return next(bits);
}
}
-
+
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
index 038380c..9b2dd82 100644
--- a/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/CorrelatedRandomVectorGeneratorTest.java
@@ -151,7 +151,7 @@ public class CorrelatedRandomVectorGeneratorTest {
{0.009881156, 0.008196856, 0.019023866, 0.009210099},
{0.010499559, 0.010732709, 0.009210099, 0.019107243}
};
-
+
final double[][] covMatrix2 = new double[][]{
{0.0, 0.0, 0.0, 0.0, 0.0},
{0.0, 0.013445532, 0.010394690, 0.009881156, 0.010499559},
@@ -159,7 +159,7 @@ public class CorrelatedRandomVectorGeneratorTest {
{0.0, 0.009881156, 0.008196856, 0.019023866, 0.009210099},
{0.0, 0.010499559, 0.010732709, 0.009210099, 0.019107243}
};
-
+
final double[][] covMatrix3 = new double[][]{
{0.013445532, 0.010394690, 0.0, 0.009881156, 0.010499559},
{0.010394690, 0.023006616, 0.0, 0.008196856, 0.010732709},
@@ -167,7 +167,7 @@ public class CorrelatedRandomVectorGeneratorTest {
{0.009881156, 0.008196856, 0.0, 0.019023866, 0.009210099},
{0.010499559, 0.010732709, 0.0, 0.009210099, 0.019107243}
};
-
+
testSampler(covMatrix1, 10000, 0.001);
testSampler(covMatrix2, 10000, 0.001);
testSampler(covMatrix3, 10000, 0.001);
@@ -186,7 +186,7 @@ public class CorrelatedRandomVectorGeneratorTest {
private void testSampler(final double[][] covMatrix, int samples, double epsilon) {
CorrelatedRandomVectorGenerator sampler = createSampler(covMatrix);
-
+
StorelessCovariance cov = new StorelessCovariance(covMatrix.length);
for (int i = 0; i < samples; ++i) {
cov.increment(sampler.nextVector());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java
index cf59363..f7ed491 100644
--- a/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/HaltonSequenceGeneratorTest.java
@@ -86,7 +86,7 @@ public class HaltonSequenceGeneratorTest {
} catch (OutOfRangeException e) {
// expected
}
-
+
try {
new HaltonSequenceGenerator(41);
Assert.fail("an exception should have been thrown");
@@ -124,7 +124,7 @@ public class HaltonSequenceGeneratorTest {
double[] result = generator.skipTo(5);
Assert.assertArrayEquals(referenceValues[5], result, 1e-3);
Assert.assertEquals(6, generator.getNextIndex());
-
+
for (int i = 6; i < referenceValues.length; i++) {
result = generator.nextVector();
Assert.assertArrayEquals(referenceValues[i], result, 1e-3);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java b/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java
index b04e753..1446003 100644
--- a/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java
+++ b/src/test/java/org/apache/commons/math4/random/MersenneTwisterTest.java
@@ -27,10 +27,10 @@ public class MersenneTwisterTest extends RandomGeneratorAbstractTest {
protected RandomGenerator makeGenerator() {
return new MersenneTwister(111);
}
-
+
// TODO: Some of the tests moved up to RandomGeneratorAbstractTest tested alternative seeding / constructors
// Tests exercising these features directly should be added to this class.
-
+
@Test
public void testMakotoNishimura() {
MersenneTwister mt = new MersenneTwister(new int[] {0x123, 0x234, 0x345, 0x456});
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java b/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java
index 1218398..da7e763 100644
--- a/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/RandomAdaptorTest.java
@@ -60,13 +60,13 @@ public class RandomAdaptorTest {
*
*/
public static class ConstantGenerator implements RandomGenerator {
-
+
private final double value;
-
+
public ConstantGenerator() {
value = 0;
}
-
+
public ConstantGenerator(double value) {
this.value = value;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java b/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java
index eabbd85..fa0a462 100644
--- a/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/random/RandomGeneratorAbstractTest.java
@@ -67,7 +67,7 @@ public abstract class RandomGeneratorAbstractTest extends RandomDataGeneratorTes
public void setUp() {
generator = makeGenerator();
}
-
+
// Omit secureXxx tests, since they do not use the provided generator
@Override
public void testNextSecureLongIAE() {}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java
index 7ee4d10..e7663eb 100644
--- a/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/SobolSequenceGeneratorTest.java
@@ -55,7 +55,7 @@ public class SobolSequenceGeneratorTest {
Assert.assertEquals(i + 1, generator.getNextIndex());
}
}
-
+
@Test
public void testConstructor() {
try {
@@ -64,7 +64,7 @@ public class SobolSequenceGeneratorTest {
} catch (OutOfRangeException e) {
// expected
}
-
+
try {
new SobolSequenceGenerator(1001);
Assert.fail("an exception should have been thrown");
@@ -83,7 +83,7 @@ public class SobolSequenceGeneratorTest {
} catch (OutOfRangeException e) {
// expected
}
-
+
try {
new SobolSequenceGenerator(1001);
Assert.fail("an exception should have been thrown");
@@ -97,7 +97,7 @@ public class SobolSequenceGeneratorTest {
double[] result = generator.skipTo(5);
Assert.assertArrayEquals(referenceValues[5], result, 1e-6);
Assert.assertEquals(6, generator.getNextIndex());
-
+
for (int i = 6; i < referenceValues.length; i++) {
result = generator.nextVector();
Assert.assertArrayEquals(referenceValues[i], result, 1e-6);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
index 9ede227..f6c9f3e 100644
--- a/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/StableRandomGeneratorTest.java
@@ -28,7 +28,7 @@ import org.junit.Test;
/**
* The class <code>StableRandomGeneratorTest</code> contains tests for the class
* {@link StableRandomGenerator}
- *
+ *
*/
public class StableRandomGeneratorTest {
@@ -38,7 +38,7 @@ public class StableRandomGeneratorTest {
/**
* Run the double nextDouble() method test Due to leptokurtic property the
* acceptance range is widened.
- *
+ *
* TODO: verify that tolerance this wide is really OK
*/
@Test
@@ -131,4 +131,4 @@ public class StableRandomGeneratorTest {
Assert.assertEquals(2.0, e.getArgument());
}
}
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
index aa60e1f..453de34 100644
--- a/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
+++ b/src/test/java/org/apache/commons/math4/random/UnitSphereRandomVectorGeneratorTest.java
@@ -30,7 +30,7 @@ public class UnitSphereRandomVectorGeneratorTest {
*/
@Test
public void test2DDistribution() {
-
+
RandomGenerator rg = new JDKRandomGenerator();
rg.setSeed(17399225432l);
UnitSphereRandomVectorGenerator generator = new UnitSphereRandomVectorGenerator(2, rg);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java b/src/test/java/org/apache/commons/math4/random/Well19937aTest.java
index 170457a..97f05f4 100644
--- a/src/test/java/org/apache/commons/math4/random/Well19937aTest.java
+++ b/src/test/java/org/apache/commons/math4/random/Well19937aTest.java
@@ -22,7 +22,7 @@ import org.junit.Assert;
import org.junit.Test;
public class Well19937aTest extends RandomGeneratorAbstractTest {
-
+
@Override
public RandomGenerator makeGenerator() {
return new Well19937a(100);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java b/src/test/java/org/apache/commons/math4/random/Well19937cTest.java
index 45d188b..cfffcd1 100644
--- a/src/test/java/org/apache/commons/math4/random/Well19937cTest.java
+++ b/src/test/java/org/apache/commons/math4/random/Well19937cTest.java
@@ -22,7 +22,7 @@ import org.junit.Assert;
import org.junit.Test;
public class Well19937cTest extends RandomGeneratorAbstractTest {
-
+
@Override
public RandomGenerator makeGenerator() {
return new Well19937c(100);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java b/src/test/java/org/apache/commons/math4/random/Well44497aTest.java
index 436b64a..e6dc96f 100644
--- a/src/test/java/org/apache/commons/math4/random/Well44497aTest.java
+++ b/src/test/java/org/apache/commons/math4/random/Well44497aTest.java
@@ -22,12 +22,12 @@ import org.junit.Assert;
import org.junit.Test;
public class Well44497aTest extends RandomGeneratorAbstractTest {
-
+
@Override
public RandomGenerator makeGenerator() {
return new Well44497a(100);
}
-
+
@Test
public void testReferenceCode() {
int[] base = {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java b/src/test/java/org/apache/commons/math4/random/Well44497bTest.java
index d9e519f..7f3dee1 100644
--- a/src/test/java/org/apache/commons/math4/random/Well44497bTest.java
+++ b/src/test/java/org/apache/commons/math4/random/Well44497bTest.java
@@ -22,12 +22,12 @@ import org.junit.Assert;
import org.junit.Test;
public class Well44497bTest extends RandomGeneratorAbstractTest {
-
+
@Override
public RandomGenerator makeGenerator() {
return new Well44497b(100);
}
-
+
@Test
public void testReferenceCode() {
int[] base = {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/random/Well512aTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/random/Well512aTest.java b/src/test/java/org/apache/commons/math4/random/Well512aTest.java
index f3b106c..192d7d5 100644
--- a/src/test/java/org/apache/commons/math4/random/Well512aTest.java
+++ b/src/test/java/org/apache/commons/math4/random/Well512aTest.java
@@ -22,7 +22,7 @@ import org.junit.Assert;
import org.junit.Test;
public class Well512aTest extends RandomGeneratorAbstractTest {
-
+
@Override
public RandomGenerator makeGenerator() {
return new Well512a(101);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/special/BesselJTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/special/BesselJTest.java b/src/test/java/org/apache/commons/math4/special/BesselJTest.java
index a50ccc4..cf3bf31 100644
--- a/src/test/java/org/apache/commons/math4/special/BesselJTest.java
+++ b/src/test/java/org/apache/commons/math4/special/BesselJTest.java
@@ -36,7 +36,7 @@ public class BesselJTest {
* near.eight = 8 + seq(-.5,.5,.1)
* largexs = c(10,30,100,300,1000)
* xs = unique(sort(c(smallxs, medxs, near.eight,largexs)))
- *
+ *
* for (n in c(0:15, 30, 100)) {
* for (x in xs) {
* val = format( besselJ(x,n), digits=20 )
@@ -764,12 +764,12 @@ public class BesselJTest {
Assert.assertEquals(msg, expected, actual, tol);
}
}
-
+
@Test(expected=MathIllegalArgumentException.class)
public void testIAEBadOrder() {
BesselJ.value(-1, 1);
}
-
+
@Test(expected=MathIllegalArgumentException.class)
public void testIAEBadArgument() {
BesselJ.value(1, 100000);
[3/3] [math] Removed trailing spaces. No code change.
Posted by ps...@apache.org.
Removed trailing spaces. No code change.
Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/49bb370a
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/49bb370a
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/49bb370a
Branch: refs/heads/master
Commit: 49bb370a6c6a0d330f17a6c8eebb113103b4c878
Parents: f7ab3a7
Author: Phil Steitz <ph...@gmail.com>
Authored: Fri Nov 27 10:55:38 2015 -0700
Committer: Phil Steitz <ph...@gmail.com>
Committed: Fri Nov 27 10:55:38 2015 -0700
----------------------------------------------------------------------
.../math4/analysis/FunctionUtilsTest.java | 8 +-
.../DerivativeStructureTest.java | 16 +--
.../math4/analysis/function/GaussianTest.java | 2 +-
.../math4/analysis/function/LogisticTest.java | 8 +-
.../math4/analysis/function/SigmoidTest.java | 2 +-
.../analysis/function/StepFunctionTest.java | 8 +-
.../integration/MidPointIntegratorTest.java | 4 +-
.../commons/math4/complex/ComplexTest.java | 2 +-
.../commons/math4/complex/QuaternionTest.java | 2 +-
.../apache/commons/math4/dfp/DfpDecTest.java | 6 +-
.../apache/commons/math4/dfp/DfpMathTest.java | 122 +++++++++----------
.../distribution/BinomialDistributionTest.java | 4 +-
.../ConstantRealDistributionTest.java | 4 +-
.../EnumeratedIntegerDistributionTest.java | 2 +-
.../EnumeratedRealDistributionTest.java | 8 +-
.../distribution/GeometricDistributionTest.java | 2 +-
.../HypergeometricDistributionTest.java | 14 +--
.../distribution/LevyDistributionTest.java | 2 +-
.../MultivariateNormalDistributionTest.java | 2 +-
.../distribution/PoissonDistributionTest.java | 2 +-
.../RealDistributionAbstractTest.java | 6 +-
.../math4/distribution/TDistributionTest.java | 4 +-
.../UniformRealDistributionTest.java | 10 +-
...ormalMixtureExpectationMaximizationTest.java | 10 +-
.../DimensionMismatchExceptionTest.java | 2 +-
.../MaxCountExceededExceptionTest.java | 2 +-
.../NonMonotonicSequenceExceptionTest.java | 2 +-
.../exception/NotPositiveExceptionTest.java | 2 +-
.../NotStrictlyPositiveExceptionTest.java | 2 +-
.../NumberIsTooLargeExceptionTest.java | 2 +-
.../NumberIsTooSmallExceptionTest.java | 2 +-
.../exception/OutOfRangeExceptionTest.java | 2 +-
.../TooManyEvaluationsExceptionTest.java | 2 +-
.../math4/exception/util/ArgUtilsTest.java | 2 +-
.../exception/util/ExceptionContextTest.java | 2 +-
.../commons/math4/filter/KalmanFilterTest.java | 50 ++++----
.../math4/fitting/GaussianCurveFitterTest.java | 16 +--
.../math4/fitting/HarmonicCurveFitterTest.java | 2 +-
.../fitting/PolynomialCurveFitterTest.java | 2 +-
.../math4/fitting/SimpleCurveFitterTest.java | 2 +-
.../fitting/leastsquares/CircleProblem.java | 2 +-
.../fitting/leastsquares/CircleVectorial.java | 2 +-
.../math4/fitting/leastsquares/MinpackTest.java | 4 +-
.../math4/genetics/CycleCrossoverTest.java | 4 +-
.../math4/genetics/DummyListChromosome.java | 2 +-
.../genetics/ElitisticListPopulationTest.java | 10 +-
.../math4/genetics/ListPopulationTest.java | 26 ++--
.../math4/genetics/NPointCrossoverTest.java | 16 +--
.../math4/genetics/OrderedCrossoverTest.java | 6 +-
.../math4/genetics/UniformCrossoverTest.java | 14 +--
.../euclidean/threed/FieldVector3DTest.java | 6 +-
.../geometry/euclidean/threed/LineTest.java | 2 +-
.../euclidean/threed/PolyhedronsSetTest.java | 24 ++--
.../geometry/euclidean/threed/RotationTest.java | 2 +-
.../euclidean/threed/SphereGeneratorTest.java | 2 +-
.../threed/SphericalCoordinatesTest.java | 2 +-
.../geometry/euclidean/threed/SubLineTest.java | 2 +-
.../geometry/euclidean/threed/Vector3DTest.java | 6 +-
.../euclidean/twod/DiskGeneratorTest.java | 2 +-
.../euclidean/twod/PolygonsSetTest.java | 12 +-
.../geometry/euclidean/twod/Vector2DTest.java | 6 +-
.../hull/ConvexHullGenerator2DAbstractTest.java | 18 +--
.../geometry/spherical/twod/CircleTest.java | 4 +-
.../math4/linear/DiagonalMatrixTest.java | 6 +-
.../math4/linear/EigenDecompositionTest.java | 20 +--
.../math4/linear/HessenbergTransformerTest.java | 10 +-
.../MatrixDimensionMismatchExceptionTest.java | 2 +-
.../commons/math4/linear/MatrixUtilsTest.java | 16 +--
.../math4/linear/QRDecompositionTest.java | 2 +-
.../commons/math4/linear/RRQRSolverTest.java | 4 +-
.../RectangularCholeskyDecompositionTest.java | 2 +-
.../math4/linear/SchurTransformerTest.java | 6 +-
.../ml/clustering/DBSCANClustererTest.java | 10 +-
.../clustering/KMeansPlusPlusClustererTest.java | 12 +-
.../MultiKMeansPlusPlusClustererTest.java | 2 +-
.../evaluation/SumOfClusterVariancesTest.java | 4 +-
.../commons/math4/ml/neuralnet/NetworkTest.java | 4 +-
.../ml/neuralnet/OffsetFeatureInitializer.java | 2 +-
.../neuralnet/sofm/KohonenTrainingTaskTest.java | 2 +-
.../sofm/TravellingSalesmanSolver.java | 2 +-
.../commons/math4/ode/JacobianMatricesTest.java | 2 +-
.../math4/ode/events/EventStateTest.java | 16 +--
.../nonstiff/HighamHall54IntegratorTest.java | 2 +-
.../sampling/StepNormalizerOutputTestBase.java | 8 +-
.../math4/optim/SimplePointCheckerTest.java | 2 +-
.../math4/optim/SimpleValueCheckerTest.java | 2 +-
.../scalar/noderiv/BOBYQAOptimizerTest.java | 40 +++---
.../scalar/noderiv/CMAESOptimizerTest.java | 12 +-
.../optim/univariate/BrentOptimizerTest.java | 2 +-
.../MultiStartUnivariateOptimizerTest.java | 2 +-
.../SimpleUnivariateValueCheckerTest.java | 2 +-
.../apache/commons/math4/primes/PrimesTest.java | 2 +-
.../random/AbstractRandomGeneratorTest.java | 4 +-
.../math4/random/BitsStreamGeneratorTest.java | 16 +--
.../CorrelatedRandomVectorGeneratorTest.java | 8 +-
.../random/HaltonSequenceGeneratorTest.java | 4 +-
.../math4/random/MersenneTwisterTest.java | 4 +-
.../commons/math4/random/RandomAdaptorTest.java | 6 +-
.../random/RandomGeneratorAbstractTest.java | 2 +-
.../random/SobolSequenceGeneratorTest.java | 8 +-
.../math4/random/StableRandomGeneratorTest.java | 6 +-
.../UnitSphereRandomVectorGeneratorTest.java | 2 +-
.../commons/math4/random/Well19937aTest.java | 2 +-
.../commons/math4/random/Well19937cTest.java | 2 +-
.../commons/math4/random/Well44497aTest.java | 4 +-
.../commons/math4/random/Well44497bTest.java | 4 +-
.../commons/math4/random/Well512aTest.java | 2 +-
.../commons/math4/special/BesselJTest.java | 6 +-
.../apache/commons/math4/special/ErfTest.java | 54 ++++----
.../commons/math4/stat/StatUtilsTest.java | 16 +--
.../correlation/StorelessCovarianceTest.java | 10 +-
.../StatisticalSummaryValuesTest.java | 2 +-
.../stat/descriptive/rank/PercentileTest.java | 4 +-
.../stat/interval/AgrestiCoullIntervalTest.java | 2 +-
.../BinomialConfidenceIntervalAbstractTest.java | 4 +-
.../interval/ClopperPearsonIntervalTest.java | 2 +-
.../math4/stat/interval/IntervalUtilsTest.java | 4 +-
.../NormalApproximationIntervalTest.java | 2 +-
.../stat/interval/WilsonScoreIntervalTest.java | 2 +-
.../math4/stat/ranking/NaturalRankingTest.java | 14 +--
.../stat/regression/SimpleRegressionTest.java | 2 +-
.../commons/math4/util/ArithmeticUtilsTest.java | 32 ++---
.../commons/math4/util/CombinationsTest.java | 4 +-
.../apache/commons/math4/util/FastMathTest.java | 26 ++--
.../commons/math4/util/IncrementorTest.java | 2 +-
.../math4/util/ResizableDoubleArrayTest.java | 2 +-
126 files changed, 490 insertions(+), 490 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/FunctionUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/FunctionUtilsTest.java b/src/test/java/org/apache/commons/math4/analysis/FunctionUtilsTest.java
index ee6be54..a905dd7 100644
--- a/src/test/java/org/apache/commons/math4/analysis/FunctionUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/FunctionUtilsTest.java
@@ -358,12 +358,12 @@ public class FunctionUtilsTest {
public void testDerivativeUnivariate() {
final UnivariateDifferentiableFunction f = new UnivariateDifferentiableFunction() {
-
+
@Override
public double value(double x) {
return x * x;
}
-
+
@Override
public DerivativeStructure value(DerivativeStructure x) {
return x.multiply(x);
@@ -390,12 +390,12 @@ public class FunctionUtilsTest {
final double b = 0.5;
final double c = 0.25;
final MultivariateDifferentiableFunction mdf = new MultivariateDifferentiableFunction() {
-
+
@Override
public double value(double[] point) {
return a * point[0] * point[0] + b * point[1] * point[1] + c * point[0] * point[1];
}
-
+
@Override
public DerivativeStructure value(DerivativeStructure[] point) {
DerivativeStructure x = point[0];
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java b/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
index dc251bb..99fcdd1 100644
--- a/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/differentiation/DerivativeStructureTest.java
@@ -376,7 +376,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
FastMath.abs(epsilon * dfdxdydz));
}
-
+
}
}
}
@@ -396,17 +396,17 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
double f1 = 1 / (2 * FastMath.sqrt(x * y));
Assert.assertEquals(f1, f.getPartialDerivative(1), FastMath.abs(epsilon * f1));
if (f.getOrder() > 1) {
- double f2 = -f1 / (2 * x);
+ double f2 = -f1 / (2 * x);
Assert.assertEquals(f2, f.getPartialDerivative(2), FastMath.abs(epsilon * f2));
if (f.getOrder() > 2) {
- double f3 = (f0 + x / (2 * y * f0)) / (4 * x * x * x);
+ double f3 = (f0 + x / (2 * y * f0)) / (4 * x * x * x);
Assert.assertEquals(f3, f.getPartialDerivative(3), FastMath.abs(epsilon * f3));
}
}
}
}
}
- }
+ }
}
@Test
@@ -448,7 +448,7 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
}
}
}
- }
+ }
}
}
@@ -1103,17 +1103,17 @@ public class DerivativeStructureTest extends ExtendedFieldElementAbstractTest<De
double f1 = -x / (2 * y * y * f0);
Assert.assertEquals(f1, f.getPartialDerivative(1), FastMath.abs(epsilon * f1));
if (f.getOrder() > 1) {
- double f2 = (f0 - x / (4 * y * f0)) / (y * y);
+ double f2 = (f0 - x / (4 * y * f0)) / (y * y);
Assert.assertEquals(f2, f.getPartialDerivative(2), FastMath.abs(epsilon * f2));
if (f.getOrder() > 2) {
- double f3 = (x / (8 * y * f0) - 2 * f0) / (y * y * y);
+ double f3 = (x / (8 * y * f0) - 2 * f0) / (y * y * y);
Assert.assertEquals(f3, f.getPartialDerivative(3), FastMath.abs(epsilon * f3));
}
}
}
}
}
- }
+ }
}
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/function/GaussianTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/function/GaussianTest.java b/src/test/java/org/apache/commons/math4/analysis/function/GaussianTest.java
index c3b8574..f3efeec 100644
--- a/src/test/java/org/apache/commons/math4/analysis/function/GaussianTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/function/GaussianTest.java
@@ -81,7 +81,7 @@ public class GaussianTest {
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, 1e2)).getPartialDerivative(1), 0);
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, 1e50)).getPartialDerivative(1), 0);
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.MAX_VALUE)).getPartialDerivative(1), 0);
- Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.POSITIVE_INFINITY)).getPartialDerivative(1), 0);
+ Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.POSITIVE_INFINITY)).getPartialDerivative(1), 0);
}
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/function/LogisticTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/function/LogisticTest.java b/src/test/java/org/apache/commons/math4/analysis/function/LogisticTest.java
index 61c1384..4af1824 100644
--- a/src/test/java/org/apache/commons/math4/analysis/function/LogisticTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/function/LogisticTest.java
@@ -88,7 +88,7 @@ public class LogisticTest {
final Logistic f = new Logistic(k, 0, 1, 1, a, 1);
final Sigmoid g = new Sigmoid(a, k);
-
+
final double min = -10;
final double max = 10;
final double n = 20;
@@ -148,7 +148,7 @@ public class LogisticTest {
final Logistic.Parametric f = new Logistic.Parametric();
// Compare using the "Sigmoid" function.
final Sigmoid.Parametric g = new Sigmoid.Parametric();
-
+
final double x = 0.12345;
final double[] gf = f.gradient(x, new double[] {k, 0, 1, 1, a, 1});
final double[] gg = g.gradient(x, new double[] {a, k});
@@ -167,7 +167,7 @@ public class LogisticTest {
final double n = 3.4;
final Logistic.Parametric f = new Logistic.Parametric();
-
+
final double x = m - 1;
final double qExp1 = 2;
@@ -187,7 +187,7 @@ public class LogisticTest {
final double n = 3.4;
final Logistic.Parametric f = new Logistic.Parametric();
-
+
final double x = 0;
final double qExp1 = 2;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/function/SigmoidTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/function/SigmoidTest.java b/src/test/java/org/apache/commons/math4/analysis/function/SigmoidTest.java
index b9f458b..91b11a1 100644
--- a/src/test/java/org/apache/commons/math4/analysis/function/SigmoidTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/function/SigmoidTest.java
@@ -70,7 +70,7 @@ public class SigmoidTest {
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, 1e3)).getPartialDerivative(1), 0);
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, 1e50)).getPartialDerivative(1), 0);
Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.MAX_VALUE)).getPartialDerivative(1), 0);
- Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.POSITIVE_INFINITY)).getPartialDerivative(1), 0);
+ Assert.assertEquals(0, f.value(new DerivativeStructure(1, 1, 0, Double.POSITIVE_INFINITY)).getPartialDerivative(1), 0);
}
@Test(expected=NullArgumentException.class)
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/function/StepFunctionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/function/StepFunctionTest.java b/src/test/java/org/apache/commons/math4/analysis/function/StepFunctionTest.java
index e6e4bfc..994135c 100644
--- a/src/test/java/org/apache/commons/math4/analysis/function/StepFunctionTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/function/StepFunctionTest.java
@@ -78,7 +78,7 @@ public class StepFunctionTest {
Assert.assertEquals(51.2, f.value(30), EPS);
Assert.assertEquals(51.2, f.value(Double.POSITIVE_INFINITY), EPS);
}
-
+
@Test
public void testEndpointBehavior() {
final double[] x = {0, 1, 2, 3};
@@ -93,15 +93,15 @@ public class StepFunctionTest {
for (int i = 0; i < x.length; i++) {
Assert.assertEquals(y[i], f.value(x[i]), EPS);
if (i > 0) {
- Assert.assertEquals(y[i - 1], f.value(x[i] - 0.5), EPS);
+ Assert.assertEquals(y[i - 1], f.value(x[i] - 0.5), EPS);
} else {
- Assert.assertEquals(y[0], f.value(x[i] - 0.5), EPS);
+ Assert.assertEquals(y[0], f.value(x[i] - 0.5), EPS);
}
}
}
@Test
- public void testHeaviside() {
+ public void testHeaviside() {
final UnivariateFunction h = new StepFunction(new double[] {-1, 0},
new double[] {0, 1});
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/analysis/integration/MidPointIntegratorTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/analysis/integration/MidPointIntegratorTest.java b/src/test/java/org/apache/commons/math4/analysis/integration/MidPointIntegratorTest.java
index afd590a..4b476ce 100644
--- a/src/test/java/org/apache/commons/math4/analysis/integration/MidPointIntegratorTest.java
+++ b/src/test/java/org/apache/commons/math4/analysis/integration/MidPointIntegratorTest.java
@@ -43,7 +43,7 @@ public final class MidPointIntegratorTest {
public void testLowAccuracy() {
UnivariateFunction f = new QuinticFunction();
UnivariateIntegrator integrator = new MidPointIntegrator(0.01, 1.0e-10, 2, 4);
-
+
double min = -10;
double max = -9;
double expected = -3697001.0 / 48.0;
@@ -62,7 +62,7 @@ public final class MidPointIntegratorTest {
public void testSinFunction() {
UnivariateFunction f = new Sin();
UnivariateIntegrator integrator = new MidPointIntegrator();
-
+
double min = 0;
double max = FastMath.PI;
double expected = 2;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/complex/ComplexTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/complex/ComplexTest.java b/src/test/java/org/apache/commons/math4/complex/ComplexTest.java
index dc2e626..6694dd6 100644
--- a/src/test/java/org/apache/commons/math4/complex/ComplexTest.java
+++ b/src/test/java/org/apache/commons/math4/complex/ComplexTest.java
@@ -822,7 +822,7 @@ public class ComplexTest {
};
for(String t : props) {
System.out.println(t + "=" + System.getProperty(t));
- }
+ }
System.out.println("<<testJava()");
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/complex/QuaternionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/complex/QuaternionTest.java b/src/test/java/org/apache/commons/math4/complex/QuaternionTest.java
index 56658e3..1a7c5b4 100644
--- a/src/test/java/org/apache/commons/math4/complex/QuaternionTest.java
+++ b/src/test/java/org/apache/commons/math4/complex/QuaternionTest.java
@@ -85,7 +85,7 @@ public class QuaternionTest {
public void testWrongDimension() {
new Quaternion(new double[] { 1, 2 });
}
-
+
@Test
public final void testConjugate() {
final double q0 = 2;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/dfp/DfpDecTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/dfp/DfpDecTest.java b/src/test/java/org/apache/commons/math4/dfp/DfpDecTest.java
index ead9c9e..0d4a963 100644
--- a/src/test/java/org/apache/commons/math4/dfp/DfpDecTest.java
+++ b/src/test/java/org/apache/commons/math4/dfp/DfpDecTest.java
@@ -47,13 +47,13 @@ public class DfpDecTest {
ninf = null;
}
- // Generic test function. Takes params x and y and tests them for
+ // Generic test function. Takes params x and y and tests them for
// equality. Then checks the status flags against the flags argument.
// If the test fail, it prints the desc string
private void test(Dfp x, Dfp y, int flags, String desc) {
boolean b = x.equals(y);
- if (!x.equals(y) && !x.unequal(y)) // NaNs involved
+ if (!x.equals(y) && !x.unequal(y)) // NaNs involved
b = (x.toString().equals(y.toString()));
if (x.equals(new DfpDec(field, 0))) // distinguish +/- zero
@@ -556,7 +556,7 @@ public class DfpDecTest {
new DfpDec(field, "-0"),
DfpField.FLAG_UNDERFLOW|DfpField.FLAG_INEXACT, "Next After #12");
- test(new DfpDec(field, "1e-131092").nextAfter(ninf),
+ test(new DfpDec(field, "1e-131092").nextAfter(ninf),
new DfpDec(field, "0"),
DfpField.FLAG_UNDERFLOW|DfpField.FLAG_INEXACT, "Next After #13");
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/dfp/DfpMathTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/dfp/DfpMathTest.java b/src/test/java/org/apache/commons/math4/dfp/DfpMathTest.java
index 577cec7..a2a14ee 100644
--- a/src/test/java/org/apache/commons/math4/dfp/DfpMathTest.java
+++ b/src/test/java/org/apache/commons/math4/dfp/DfpMathTest.java
@@ -56,14 +56,14 @@ public class DfpMathTest {
qnan = null;
}
- // Generic test function. Takes params x and y and tests them for
+ // Generic test function. Takes params x and y and tests them for
// equality. Then checks the status flags against the flags argument.
// If the test fail, it prints the desc string
private void test(Dfp x, Dfp y, int flags, String desc)
{
boolean b = x.equals(y);
- if (!x.equals(y) && !x.unequal(y)) // NaNs involved
+ if (!x.equals(y) && !x.unequal(y)) // NaNs involved
b = (x.toString().equals(y.toString()));
if (x.equals(factory.newDfp("0"))) // distinguish +/- zero
@@ -78,109 +78,109 @@ public class DfpMathTest {
}
@Test
- public void testPow()
+ public void testPow()
{
// Test special cases exponent of zero
- test(DfpMath.pow(factory.newDfp("0"), factory.newDfp("0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(factory.newDfp("0"), factory.newDfp("0")),
+ factory.newDfp("1"),
0, "pow #1");
- test(DfpMath.pow(factory.newDfp("0"), factory.newDfp("-0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(factory.newDfp("0"), factory.newDfp("-0")),
+ factory.newDfp("1"),
0, "pow #2");
- test(DfpMath.pow(factory.newDfp("2"), factory.newDfp("0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(factory.newDfp("2"), factory.newDfp("0")),
+ factory.newDfp("1"),
0, "pow #3");
- test(DfpMath.pow(factory.newDfp("-2"), factory.newDfp("-0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(factory.newDfp("-2"), factory.newDfp("-0")),
+ factory.newDfp("1"),
0, "pow #4");
- test(DfpMath.pow(pinf, factory.newDfp("-0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(pinf, factory.newDfp("-0")),
+ factory.newDfp("1"),
0, "pow #5");
test(DfpMath.pow(pinf, factory.newDfp("0")),
- factory.newDfp("1"),
+ factory.newDfp("1"),
0, "pow #6");
- test(DfpMath.pow(ninf, factory.newDfp("-0")),
- factory.newDfp("1"),
+ test(DfpMath.pow(ninf, factory.newDfp("-0")),
+ factory.newDfp("1"),
0, "pow #7");
test(DfpMath.pow(ninf, factory.newDfp("0")),
- factory.newDfp("1"),
+ factory.newDfp("1"),
0, "pow #8");
test(DfpMath.pow(qnan, factory.newDfp("0")),
- factory.newDfp("1"),
+ factory.newDfp("1"),
0, "pow #8");
// exponent of one
test(DfpMath.pow(factory.newDfp("0"), factory.newDfp("1")),
- factory.newDfp("0"),
+ factory.newDfp("0"),
0, "pow #9");
- test(DfpMath.pow(factory.newDfp("-0"), factory.newDfp("1")),
- factory.newDfp("-0"),
+ test(DfpMath.pow(factory.newDfp("-0"), factory.newDfp("1")),
+ factory.newDfp("-0"),
0, "pow #10");
test(DfpMath.pow(factory.newDfp("2"), factory.newDfp("1")),
- factory.newDfp("2"),
+ factory.newDfp("2"),
0, "pow #11");
test(DfpMath.pow(factory.newDfp("-2"), factory.newDfp("1")),
- factory.newDfp("-2"),
+ factory.newDfp("-2"),
0, "pow #12");
- test(DfpMath.pow(pinf, factory.newDfp("1")),
- pinf,
+ test(DfpMath.pow(pinf, factory.newDfp("1")),
+ pinf,
0, "pow #13");
test(DfpMath.pow(ninf, factory.newDfp("1")),
- ninf,
+ ninf,
0, "pow #14");
test(DfpMath.pow(qnan, factory.newDfp("1")),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #14.1");
// exponent of NaN
test(DfpMath.pow(factory.newDfp("0"), qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #15");
- test(DfpMath.pow(factory.newDfp("-0"), qnan),
- qnan,
+ test(DfpMath.pow(factory.newDfp("-0"), qnan),
+ qnan,
DfpField.FLAG_INVALID, "pow #16");
test(DfpMath.pow(factory.newDfp("2"), qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #17");
test(DfpMath.pow(factory.newDfp("-2"), qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #18");
- test(DfpMath.pow(pinf, qnan),
- qnan,
+ test(DfpMath.pow(pinf, qnan),
+ qnan,
DfpField.FLAG_INVALID, "pow #19");
test(DfpMath.pow(ninf, qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #20");
test(DfpMath.pow(qnan, qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #21");
// radix of NaN
test(DfpMath.pow(qnan, factory.newDfp("1")),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #22");
- test(DfpMath.pow(qnan, factory.newDfp("-1")),
+ test(DfpMath.pow(qnan, factory.newDfp("-1")),
qnan,
DfpField.FLAG_INVALID, "pow #23");
@@ -189,19 +189,19 @@ public class DfpMathTest {
DfpField.FLAG_INVALID, "pow #24");
test(DfpMath.pow(qnan, ninf),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #25");
test(DfpMath.pow(qnan, qnan),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #26");
// (x > 1) ^ pinf = pinf, (x < -1) ^ pinf = pinf
test(DfpMath.pow(factory.newDfp("2"), pinf),
- pinf,
+ pinf,
0, "pow #27");
- test(DfpMath.pow(factory.newDfp("-2"), pinf),
+ test(DfpMath.pow(factory.newDfp("-2"), pinf),
pinf,
0, "pow #28");
@@ -210,15 +210,15 @@ public class DfpMathTest {
0, "pow #29");
test(DfpMath.pow(ninf, pinf),
- pinf,
+ pinf,
0, "pow #30");
// (x > 1) ^ ninf = +0, (x < -1) ^ ninf = +0
test(DfpMath.pow(factory.newDfp("2"), ninf),
- factory.getZero(),
+ factory.getZero(),
0, "pow #31");
- test(DfpMath.pow(factory.newDfp("-2"), ninf),
+ test(DfpMath.pow(factory.newDfp("-2"), ninf),
factory.getZero(),
0, "pow #32");
@@ -227,41 +227,41 @@ public class DfpMathTest {
0, "pow #33");
test(DfpMath.pow(ninf, ninf),
- factory.getZero(),
+ factory.getZero(),
0, "pow #34");
// (-1 < x < 1) ^ pinf = 0
test(DfpMath.pow(factory.newDfp("0.5"), pinf),
- factory.getZero(),
+ factory.getZero(),
0, "pow #35");
- test(DfpMath.pow(factory.newDfp("-0.5"), pinf),
+ test(DfpMath.pow(factory.newDfp("-0.5"), pinf),
factory.getZero(),
0, "pow #36");
- // (-1 < x < 1) ^ ninf = pinf
+ // (-1 < x < 1) ^ ninf = pinf
test(DfpMath.pow(factory.newDfp("0.5"), ninf),
- pinf,
+ pinf,
0, "pow #37");
- test(DfpMath.pow(factory.newDfp("-0.5"), ninf),
+ test(DfpMath.pow(factory.newDfp("-0.5"), ninf),
pinf,
0, "pow #38");
// +/- 1 ^ +/-inf = NaN
test(DfpMath.pow(factory.getOne(), pinf),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #39");
- test(DfpMath.pow(factory.getOne(), ninf),
+ test(DfpMath.pow(factory.getOne(), ninf),
qnan,
DfpField.FLAG_INVALID, "pow #40");
test(DfpMath.pow(factory.newDfp("-1"), pinf),
- qnan,
+ qnan,
DfpField.FLAG_INVALID, "pow #41");
- test(DfpMath.pow(factory.getOne().negate(), ninf),
+ test(DfpMath.pow(factory.getOne().negate(), ninf),
qnan,
DfpField.FLAG_INVALID, "pow #42");
@@ -355,7 +355,7 @@ public class DfpMathTest {
factory.newDfp("-0"),
DfpField.FLAG_INEXACT, "pow #62");
- // pinf ^ +anything = pinf
+ // pinf ^ +anything = pinf
test(DfpMath.pow(pinf, factory.newDfp("3")),
pinf,
0, "pow #63");
@@ -372,7 +372,7 @@ public class DfpMathTest {
pinf,
0, "pow #66");
- // pinf ^ -anything = +0
+ // pinf ^ -anything = +0
test(DfpMath.pow(pinf, factory.newDfp("-3")),
factory.getZero(),
@@ -445,7 +445,7 @@ public class DfpMathTest {
factory.newDfp("-0"),
DfpField.FLAG_INEXACT, "pow #82");
- // -anything ^ integer
+ // -anything ^ integer
test(DfpMath.pow(factory.newDfp("-2"), factory.newDfp("3")),
factory.newDfp("-8"),
DfpField.FLAG_INEXACT, "pow #83");
@@ -470,7 +470,7 @@ public class DfpMathTest {
// Some fractional cases.
test(DfpMath.pow(factory.newDfp("2"),factory.newDfp("1.5")),
- factory.newDfp("2.8284271247461901"),
+ factory.newDfp("2.8284271247461901"),
DfpField.FLAG_INEXACT, "pow #88");
}
@@ -546,10 +546,10 @@ public class DfpMathTest {
DfpField.FLAG_INEXACT, "sin #17");
test(DfpMath.sin(factory.newDfp("0.7")),
- factory.newDfp("0.64421768723769105367"),
+ factory.newDfp("0.64421768723769105367"),
DfpField.FLAG_INEXACT, "sin #18");
- test(DfpMath.sin(factory.newDfp("0.8")),
+ test(DfpMath.sin(factory.newDfp("0.8")),
factory.newDfp("0.71735609089952276163"),
DfpField.FLAG_INEXACT, "sin #19");
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/BinomialDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/BinomialDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/BinomialDistributionTest.java
index 660750e..27ac515 100644
--- a/src/test/java/org/apache/commons/math4/distribution/BinomialDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/BinomialDistributionTest.java
@@ -31,7 +31,7 @@ public class BinomialDistributionTest extends IntegerDistributionAbstractTest {
public BinomialDistributionTest() {
setTolerance(1e-12);
}
-
+
// -------------- Implementations for abstract methods
// -----------------------
@@ -47,7 +47,7 @@ public class BinomialDistributionTest extends IntegerDistributionAbstractTest {
return new int[] { -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
}
- /**
+ /**
* Creates the default probability density test expected values.
* Reference values are from R, version 2.15.3.
*/
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/ConstantRealDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/ConstantRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/ConstantRealDistributionTest.java
index 6a7bbe8..2d65447 100644
--- a/src/test/java/org/apache/commons/math4/distribution/ConstantRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/ConstantRealDistributionTest.java
@@ -60,7 +60,7 @@ public class ConstantRealDistributionTest extends RealDistributionAbstractTest {
public double[] makeDensityTestValues() {
return new double[] {0, 0, 1};
}
-
+
/** Override default test, verifying that inverse cum is constant */
@Override
@Test
@@ -88,6 +88,6 @@ public class ConstantRealDistributionTest extends RealDistributionAbstractTest {
for (int i = 0; i < 10; i++) {
Assert.assertEquals(0, dist.sample(), 0);
}
-
+
}
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
index cd7bb4d..2a66f95 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedIntegerDistributionTest.java
@@ -171,7 +171,7 @@ public class EnumeratedIntegerDistributionTest {
Assert.assertEquals(testDistribution.getNumericalVariance(),
sumOfSquares / n - FastMath.pow(sum / n, 2), 1e-2);
}
-
+
@Test
public void testCreateFromIntegers() {
final int[] data = new int[] {0, 1, 1, 2, 2, 2};
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
index 6b98c2d..f1cf652 100644
--- a/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/EnumeratedRealDistributionTest.java
@@ -35,7 +35,7 @@ import org.junit.Test;
/**
* Test class for {@link EnumeratedRealDistribution}.
- *
+ *
*/
public class EnumeratedRealDistributionTest {
@@ -224,11 +224,11 @@ public class EnumeratedRealDistributionTest {
// 14 18 21 28 31 33
//
// sum = 4+5+0+3+1+3 = 16
-
+
EnumeratedRealDistribution distribution = new EnumeratedRealDistribution(
new double[] { 14.0, 18.0, 21.0, 28.0, 31.0, 33.0 },
new double[] { 4.0 / 16.0, 5.0 / 16.0, 0.0 / 16.0, 3.0 / 16.0, 1.0 / 16.0, 3.0 / 16.0 });
-
+
assertEquals(14.0, distribution.inverseCumulativeProbability(0.0000), 0.0);
assertEquals(14.0, distribution.inverseCumulativeProbability(0.2500), 0.0);
assertEquals(33.0, distribution.inverseCumulativeProbability(1.0000), 0.0);
@@ -240,7 +240,7 @@ public class EnumeratedRealDistributionTest {
assertEquals(18.0, distribution.inverseCumulativeProbability(0.5625), 0.0);
assertEquals(28.0, distribution.inverseCumulativeProbability(0.7500), 0.0);
}
-
+
@Test
public void testCreateFromDoubles() {
final double[] data = new double[] {0, 1, 1, 2, 2, 2};
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/GeometricDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/GeometricDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/GeometricDistributionTest.java
index e76254f..80a034e 100644
--- a/src/test/java/org/apache/commons/math4/distribution/GeometricDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/GeometricDistributionTest.java
@@ -33,7 +33,7 @@ public class GeometricDistributionTest extends IntegerDistributionAbstractTest {
public GeometricDistributionTest() {
setTolerance(1e-12);
}
-
+
// -------------- Implementations for abstract methods --------------------
/** Creates the default discrete distribution instance to use in tests. */
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
index b9b791c..b2d11f4 100644
--- a/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/HypergeometricDistributionTest.java
@@ -41,7 +41,7 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
public HypergeometricDistributionTest() {
setTolerance(1e-12);
}
-
+
//-------------- Implementations for abstract methods -----------------------
/** Creates the default discrete distribution instance to use in tests. */
@@ -56,7 +56,7 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
return new int[] {-1, 0, 1, 2, 3, 4, 5, 10};
}
- /**
+ /**
* Creates the default probability density test expected values
* Reference values are from R, version 2.15.3.
*/
@@ -66,7 +66,7 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
0.0992063492063, 0.00396825396825, 0d};
}
- /**
+ /**
* Creates the default probability log density test expected values
* Reference values are from R, version 2.14.1.
*/
@@ -83,7 +83,7 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
return makeDensityTestPoints();
}
- /**
+ /**
* Creates the default cumulative probability density test expected values
* Reference values are from R, version 2.15.3.
*/
@@ -292,7 +292,7 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
Assert.assertEquals(dist.getNumericalMean(), 55d * 200d / 3000d, tol);
Assert.assertEquals(dist.getNumericalVariance(), ( 200d * 55d * (3000d - 200d) * (3000d - 55d) ) / ( (3000d * 3000d * 2999d) ), tol);
}
-
+
@Test
public void testMath644() {
int N = 14761461; // population
@@ -301,10 +301,10 @@ public class HypergeometricDistributionTest extends IntegerDistributionAbstractT
int k = 0;
final HypergeometricDistribution dist = new HypergeometricDistribution(N, m, n);
-
+
Assert.assertTrue(Precision.compareTo(1.0, dist.upperCumulativeProbability(k), 1) == 0);
Assert.assertTrue(Precision.compareTo(dist.cumulativeProbability(k), 0.0, 1) > 0);
-
+
// another way to calculate the upper cumulative probability
double upper = 1.0 - dist.cumulativeProbability(k) + dist.probability(k);
Assert.assertTrue(Precision.compareTo(1.0, upper, 1) == 0);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/LevyDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/LevyDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/LevyDistributionTest.java
index 59c2d7c..d0af056 100644
--- a/src/test/java/org/apache/commons/math4/distribution/LevyDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/LevyDistributionTest.java
@@ -69,7 +69,7 @@ public class LevyDistributionTest extends RealDistributionAbstractTest {
};
}
- /**
+ /**
* Creates the default logarithmic probability density test expected values.
* Reference values are from R, version 2.14.1.
*/
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
index cd4a497..41d526c 100644
--- a/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/MultivariateNormalDistributionTest.java
@@ -140,7 +140,7 @@ public class MultivariateNormalDistributionTest {
public void testUnivariateDistribution() {
final double[] mu = { -1.5 };
final double[][] sigma = { { 1 } };
-
+
final MultivariateNormalDistribution multi = new MultivariateNormalDistribution(mu, sigma);
final NormalDistribution uni = new NormalDistribution(mu[0], sigma[0][0]);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/PoissonDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/PoissonDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/PoissonDistributionTest.java
index 51d6252..a0c404c 100644
--- a/src/test/java/org/apache/commons/math4/distribution/PoissonDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/PoissonDistributionTest.java
@@ -68,7 +68,7 @@ public class PoissonDistributionTest extends IntegerDistributionAbstractTest {
0.156293451851d, 0.00529247667642d, 8.27746364655e-09};
}
- /**
+ /**
* Creates the default logarithmic probability density test expected values.
* Reference values are from R, version 2.14.1.
*/
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
index d4af05d..9fffeaf 100644
--- a/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/RealDistributionAbstractTest.java
@@ -321,7 +321,7 @@ public abstract class RealDistributionAbstractTest {
// expected
}
}
-
+
/**
* Test sampling
*/
@@ -338,7 +338,7 @@ public abstract class RealDistributionAbstractTest {
}
TestUtils.assertChiSquareAccept(expected, counts, 0.001);
}
-
+
/**
* Verify that density integrals match the distribution.
* The (filtered, sorted) cumulativeTestPoints array is used to source
@@ -377,7 +377,7 @@ public abstract class RealDistributionAbstractTest {
integrationTestPoints.get(i)), tol);
}
}
-
+
@Test
public void testDistributionClone()
throws IOException,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/TDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/TDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/TDistributionTest.java
index 0279394..992bb34 100644
--- a/src/test/java/org/apache/commons/math4/distribution/TDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/TDistributionTest.java
@@ -101,7 +101,7 @@ public class TDistributionTest extends RealDistributionAbstractTest {
new double[] {Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY});
verifyInverseCumulativeProbabilities();
}
-
+
@Test
public void testCumulativeProbablilityExtremes() {
TDistribution dist;
@@ -111,7 +111,7 @@ public class TDistributionTest extends RealDistributionAbstractTest {
dist.cumulativeProbability(Double.POSITIVE_INFINITY), Double.MIN_VALUE);
Assert.assertEquals(0,
dist.cumulativeProbability(Double.NEGATIVE_INFINITY), Double.MIN_VALUE);
- }
+ }
}
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/UniformRealDistributionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/UniformRealDistributionTest.java b/src/test/java/org/apache/commons/math4/distribution/UniformRealDistributionTest.java
index 839ae08..f09f876 100644
--- a/src/test/java/org/apache/commons/math4/distribution/UniformRealDistributionTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/UniformRealDistributionTest.java
@@ -111,15 +111,15 @@ public class UniformRealDistributionTest extends RealDistributionAbstractTest {
Assert.assertEquals(dist.getNumericalMean(), 0.375, 0);
Assert.assertEquals(dist.getNumericalVariance(), 0.2552083333333333, 0);
}
-
- /**
- * Check accuracy of analytical inverse CDF. Fails if a solver is used
- * with the default accuracy.
+
+ /**
+ * Check accuracy of analytical inverse CDF. Fails if a solver is used
+ * with the default accuracy.
*/
@Test
public void testInverseCumulativeDistribution() {
UniformRealDistribution dist = new UniformRealDistribution(0, 1e-9);
-
+
Assert.assertEquals(2.5e-10, dist.inverseCumulativeProbability(0.25), 0);
}
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java b/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
index 18291eb..cb68603 100644
--- a/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
+++ b/src/test/java/org/apache/commons/math4/distribution/fitting/MultivariateNormalMixtureExpectationMaximizationTest.java
@@ -181,10 +181,10 @@ public class MultivariateNormalMixtureExpectationMaximizationTest {
.getComponents()) {
Assert.assertEquals(correctWeights[i], component.getFirst(),
Math.ulp(1d));
-
+
final double[] means = component.getValue().getMeans();
Assert.assertTrue(Arrays.equals(correctMeans[i], means));
-
+
final RealMatrix covMat = component.getValue().getCovariances();
Assert.assertEquals(correctCovMats[i], covMat);
i++;
@@ -198,12 +198,12 @@ public class MultivariateNormalMixtureExpectationMaximizationTest {
final double[][] data = getTestSamples();
final double correctLogLikelihood = -4.292431006791994;
final double[] correctWeights = new double[] { 0.2962324189652912, 0.7037675810347089 };
-
+
final double[][] correctMeans = new double[][]{
{-1.4213112715121132, 1.6924690505757753},
{4.213612224374709, 7.975621325853645}
};
-
+
final RealMatrix[] correctCovMats = new Array2DRowRealMatrix[2];
correctCovMats[0] = new Array2DRowRealMatrix(new double[][] {
{ 1.739356907285747, -0.5867644251487614 },
@@ -212,7 +212,7 @@ public class MultivariateNormalMixtureExpectationMaximizationTest {
correctCovMats[1] = new Array2DRowRealMatrix(new double[][] {
{ 4.245384898007161, 2.5797798966382155 },
{ 2.5797798966382155, 3.9200272522448367 } });
-
+
final MultivariateNormalDistribution[] correctMVNs = new MultivariateNormalDistribution[2];
correctMVNs[0] = new MultivariateNormalDistribution(correctMeans[0], correctCovMats[0].getData());
correctMVNs[1] = new MultivariateNormalDistribution(correctMeans[1], correctCovMats[1].getData());
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/DimensionMismatchExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/DimensionMismatchExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/DimensionMismatchExceptionTest.java
index 263e28d..310c024 100644
--- a/src/test/java/org/apache/commons/math4/exception/DimensionMismatchExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/DimensionMismatchExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link DimensionMismatchException}.
- *
+ *
*/
public class DimensionMismatchExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/MaxCountExceededExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/MaxCountExceededExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/MaxCountExceededExceptionTest.java
index f0da371..9772a27 100644
--- a/src/test/java/org/apache/commons/math4/exception/MaxCountExceededExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/MaxCountExceededExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link MaxCountExceededException}.
- *
+ *
*/
public class MaxCountExceededExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/NonMonotonicSequenceExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/NonMonotonicSequenceExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/NonMonotonicSequenceExceptionTest.java
index 6c3b475..823034a 100644
--- a/src/test/java/org/apache/commons/math4/exception/NonMonotonicSequenceExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/NonMonotonicSequenceExceptionTest.java
@@ -23,7 +23,7 @@ import org.junit.Test;
/**
* Test for {@link NonMonotonicSequenceException}.
- *
+ *
*/
public class NonMonotonicSequenceExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/NotPositiveExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/NotPositiveExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/NotPositiveExceptionTest.java
index 37276cf..359b227 100644
--- a/src/test/java/org/apache/commons/math4/exception/NotPositiveExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/NotPositiveExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link NotPositiveException}.
- *
+ *
*/
public class NotPositiveExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/NotStrictlyPositiveExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/NotStrictlyPositiveExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/NotStrictlyPositiveExceptionTest.java
index 95748fc..8760d91 100644
--- a/src/test/java/org/apache/commons/math4/exception/NotStrictlyPositiveExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/NotStrictlyPositiveExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link NotStrictlyPositiveException}.
- *
+ *
*/
public class NotStrictlyPositiveExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/NumberIsTooLargeExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/NumberIsTooLargeExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/NumberIsTooLargeExceptionTest.java
index fea0233..1f3f8ce 100644
--- a/src/test/java/org/apache/commons/math4/exception/NumberIsTooLargeExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/NumberIsTooLargeExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link NumberIsTooLargeException}.
- *
+ *
*/
public class NumberIsTooLargeExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/NumberIsTooSmallExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/NumberIsTooSmallExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/NumberIsTooSmallExceptionTest.java
index 95935c0..abc7305 100644
--- a/src/test/java/org/apache/commons/math4/exception/NumberIsTooSmallExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/NumberIsTooSmallExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link NumberIsTooSmallException}.
- *
+ *
*/
public class NumberIsTooSmallExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/OutOfRangeExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/OutOfRangeExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/OutOfRangeExceptionTest.java
index a640443..7b0105b 100644
--- a/src/test/java/org/apache/commons/math4/exception/OutOfRangeExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/OutOfRangeExceptionTest.java
@@ -22,7 +22,7 @@ import org.junit.Test;
/**
* Test for {@link OutOfRangeException}.
- *
+ *
*/
public class OutOfRangeExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/TooManyEvaluationsExceptionTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/TooManyEvaluationsExceptionTest.java b/src/test/java/org/apache/commons/math4/exception/TooManyEvaluationsExceptionTest.java
index 0315f26..5dce64b 100644
--- a/src/test/java/org/apache/commons/math4/exception/TooManyEvaluationsExceptionTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/TooManyEvaluationsExceptionTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
/**
* Test for {@link TooManyEvaluationsException}.
- *
+ *
*/
public class TooManyEvaluationsExceptionTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java b/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
index bb55ac2..46ed189 100644
--- a/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/util/ArgUtilsTest.java
@@ -25,7 +25,7 @@ import org.junit.Test;
/**
* Test for {@link ArgUtils}.
- *
+ *
*/
public class ArgUtilsTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/exception/util/ExceptionContextTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/exception/util/ExceptionContextTest.java b/src/test/java/org/apache/commons/math4/exception/util/ExceptionContextTest.java
index a9489f8..e1ce45f 100644
--- a/src/test/java/org/apache/commons/math4/exception/util/ExceptionContextTest.java
+++ b/src/test/java/org/apache/commons/math4/exception/util/ExceptionContextTest.java
@@ -31,7 +31,7 @@ import org.junit.Test;
/**
* Test for {@link ExceptionContext}.
- *
+ *
*/
public class ExceptionContextTest {
@Test
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java b/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
index eeb2aa0..99d73c5 100644
--- a/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
+++ b/src/test/java/org/apache/commons/math4/filter/KalmanFilterTest.java
@@ -39,12 +39,12 @@ import org.junit.Test;
*
*/
public class KalmanFilterTest {
-
+
@Test(expected=MatrixDimensionMismatchException.class)
public void testTransitionMeasurementMatrixMismatch() {
-
+
// A and H matrix do not match in dimensions
-
+
// A = [ 1 ]
RealMatrix A = new Array2DRowRealMatrix(new double[] { 1d });
// no control input
@@ -66,9 +66,9 @@ public class KalmanFilterTest {
@Test(expected=MatrixDimensionMismatchException.class)
public void testTransitionControlMatrixMismatch() {
-
+
// A and B matrix do not match in dimensions
-
+
// A = [ 1 ]
RealMatrix A = new Array2DRowRealMatrix(new double[] { 1d });
// B = [ 1 1 ]
@@ -87,11 +87,11 @@ public class KalmanFilterTest {
new KalmanFilter(pm, mm);
Assert.fail("transition and control matrix should not be compatible");
}
-
+
@Test
public void testConstant() {
// simulates a simple process with a constant state and no control input
-
+
double constantValue = 10d;
double measurementNoise = 0.1d;
double processNoise = 1e-5d;
@@ -252,30 +252,30 @@ public class KalmanFilterTest {
* Represents an idealized Cannonball only taking into account gravity.
*/
public static class Cannonball {
-
+
private final double[] gravity = { 0, -9.81 };
-
+
private final double[] velocity;
private final double[] location;
-
+
private double timeslice;
-
+
public Cannonball(double timeslice, double angle, double initialVelocity) {
this.timeslice = timeslice;
-
+
final double angleInRadians = FastMath.toRadians(angle);
this.velocity = new double[] {
initialVelocity * FastMath.cos(angleInRadians),
initialVelocity * FastMath.sin(angleInRadians)
};
-
+
this.location = new double[] { 0, 0 };
}
-
+
public double getX() {
return location[0];
}
-
+
public double getY() {
return location[1];
}
@@ -283,18 +283,18 @@ public class KalmanFilterTest {
public double getXVelocity() {
return velocity[0];
}
-
+
public double getYVelocity() {
return velocity[1];
}
-
+
public void step() {
// break gravitational force into a smaller time slice.
double[] slicedGravity = gravity.clone();
for ( int i = 0; i < slicedGravity.length; i++ ) {
slicedGravity[i] *= timeslice;
}
-
+
// apply the acceleration to velocity.
double[] slicedVelocity = velocity.clone();
for ( int i = 0; i < velocity.length; i++ ) {
@@ -326,7 +326,7 @@ public class KalmanFilterTest {
final double angle = 45;
final Cannonball cannonball = new Cannonball(dt, angle, initialVelocity);
-
+
final double speedX = cannonball.getXVelocity();
final double speedY = cannonball.getYVelocity();
@@ -338,7 +338,7 @@ public class KalmanFilterTest {
{ 1, dt, 0, 0 },
{ 0, 1, 0, 0 },
{ 0, 0, 1, dt },
- { 0, 0, 0, 1 }
+ { 0, 0, 0, 1 }
});
// The control vector, which adds acceleration to the kinematic equations.
@@ -364,7 +364,7 @@ public class KalmanFilterTest {
{ 0, 0, 1, 0 },
{ 0, 0, 0, 0 }
});
-
+
// our guess of the initial state.
final RealVector initialState = MatrixUtils.createRealVector(new double[] { 0, speedX, 0, speedY } );
@@ -379,7 +379,7 @@ public class KalmanFilterTest {
// we assume no process noise -> zero matrix
final RealMatrix Q = MatrixUtils.createRealMatrix(4, 4);
-
+
// the measurement covariance matrix
final RealMatrix R = MatrixUtils.createRealMatrix(new double[][] {
{ var, 0, 0, 0 },
@@ -399,13 +399,13 @@ public class KalmanFilterTest {
// get the "real" cannonball position
double x = cannonball.getX();
double y = cannonball.getY();
-
+
// apply measurement noise to current cannonball position
double nx = x + dist.sample();
double ny = y + dist.sample();
cannonball.step();
-
+
filter.predict(controlVector);
// correct the filter with our measurements
filter.correct(new double[] { nx, 0, ny, 0 } );
@@ -416,7 +416,7 @@ public class KalmanFilterTest {
}
// error covariance of the x/y-position should be already very low (< 3m std dev = 9 variance)
-
+
Assert.assertTrue(Precision.compareTo(filter.getErrorCovariance()[0][0],
9, 1e-6) < 0);
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/GaussianCurveFitterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/GaussianCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/GaussianCurveFitterTest.java
index b14aceb..261bd30 100644
--- a/src/test/java/org/apache/commons/math4/fitting/GaussianCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/GaussianCurveFitterTest.java
@@ -238,7 +238,7 @@ public class GaussianCurveFitterTest {
public void testFit02() {
GaussianCurveFitter.create().fit(new WeightedObservedPoints().toList());
}
-
+
/**
* Two points is not enough observed points.
*/
@@ -250,7 +250,7 @@ public class GaussianCurveFitterTest {
{4.02804905, 664002.0}
}).toList());
}
-
+
/**
* Poor data: right of peak not symmetric with left of peak.
*/
@@ -262,8 +262,8 @@ public class GaussianCurveFitterTest {
Assert.assertEquals(233003.2967252038, parameters[0], 1e-4);
Assert.assertEquals(-10.654887521095983, parameters[1], 1e-4);
Assert.assertEquals(4.335937353196641, parameters[2], 1e-4);
- }
-
+ }
+
/**
* Poor data: long tails.
*/
@@ -276,7 +276,7 @@ public class GaussianCurveFitterTest {
Assert.assertEquals(-13.29641995105174, parameters[1], 1e-4);
Assert.assertEquals(1.7297330293549908, parameters[2], 1e-4);
}
-
+
/**
* Poor data: right of peak is missing.
*/
@@ -288,7 +288,7 @@ public class GaussianCurveFitterTest {
Assert.assertEquals(285250.66754309234, parameters[0], 1e-4);
Assert.assertEquals(-13.528375695228455, parameters[1], 1e-4);
Assert.assertEquals(1.5204344894331614, parameters[2], 1e-4);
- }
+ }
/**
* Basic with smaller dataset.
@@ -308,7 +308,7 @@ public class GaussianCurveFitterTest {
// The optimizer will try negative sigma values but "GaussianCurveFitter"
// will catch the raised exceptions and return NaN values instead.
- final double[] data = {
+ final double[] data = {
1.1143831578403364E-29,
4.95281403484594E-28,
1.1171347211930288E-26,
@@ -376,7 +376,7 @@ public class GaussianCurveFitterTest {
Assert.assertEquals(0.603770729862231, p[1], 1e-15);
Assert.assertEquals(1.0786447936766612, p[2], 1e-14);
}
-
+
/**
* Adds the specified points to specified <code>GaussianCurveFitter</code>
* instance.
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/HarmonicCurveFitterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/HarmonicCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/HarmonicCurveFitterTest.java
index d85588e..17097f5 100644
--- a/src/test/java/org/apache/commons/math4/fitting/HarmonicCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/HarmonicCurveFitterTest.java
@@ -151,7 +151,7 @@ public class HarmonicCurveFitterTest {
}
// Pass it to the fitter.
- final WeightedObservedPoints points = new WeightedObservedPoints();
+ final WeightedObservedPoints points = new WeightedObservedPoints();
for (int i = 0; i < size; ++i) {
points.add(1, xTab[i], yTab[i]);
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
index 02c5810..89ebc2b 100644
--- a/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/PolynomialCurveFitterTest.java
@@ -116,7 +116,7 @@ public class PolynomialCurveFitterTest {
for (int degree = 0; degree < 10; ++degree) {
final PolynomialFunction p = buildRandomPolynomial(degree, randomizer);
final PolynomialCurveFitter fitter = PolynomialCurveFitter.create(degree);
-
+
final WeightedObservedPoints obs = new WeightedObservedPoints();
for (int i = 0; i < 40000; ++i) {
final double x = -1.0 + i / 20000.0;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java b/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
index b581d0d..01d28b2 100644
--- a/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/SimpleCurveFitterTest.java
@@ -47,7 +47,7 @@ public class SimpleCurveFitterTest {
obs.add(x, f.value(x) + 0.1 * randomizer.nextGaussian());
}
- final ParametricUnivariateFunction function = new PolynomialFunction.Parametric();
+ final ParametricUnivariateFunction function = new PolynomialFunction.Parametric();
// Start fit from initial guesses that are far from the optimal values.
final SimpleCurveFitter fitter
= SimpleCurveFitter.create(function,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleProblem.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleProblem.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleProblem.java
index 63c817e..377726d 100644
--- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleProblem.java
+++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleProblem.java
@@ -159,7 +159,7 @@ class CircleProblem {
for (int i = 0; i < points.size(); i++) {
final int index = i * 2;
- // Partial derivative wrt x-coordinate of center.
+ // Partial derivative wrt x-coordinate of center.
jacobian[index][0] = 1;
jacobian[index + 1][0] = 0;
// Partial derivative wrt y-coordinate of center.
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleVectorial.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleVectorial.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleVectorial.java
index 3ba837b..3c88431 100644
--- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleVectorial.java
+++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/CircleVectorial.java
@@ -57,7 +57,7 @@ class CircleVectorial {
for (int i = 0; i < residuals.length; i++) {
residuals[i] = points.get(i).distance(center) - radius;
}
-
+
return residuals;
}
};
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/fitting/leastsquares/MinpackTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/fitting/leastsquares/MinpackTest.java b/src/test/java/org/apache/commons/math4/fitting/leastsquares/MinpackTest.java
index 9fc4504..98b221f 100644
--- a/src/test/java/org/apache/commons/math4/fitting/leastsquares/MinpackTest.java
+++ b/src/test/java/org/apache/commons/math4/fitting/leastsquares/MinpackTest.java
@@ -614,7 +614,7 @@ public class MinpackTest {
}
private static class LinearFullRankFunction extends MinpackFunction {
-
+
public LinearFullRankFunction(int m, int n, double x0,
double theoreticalStartCost,
double theoreticalMinCost) {
@@ -1386,7 +1386,7 @@ public class MinpackTest {
}
return f;
}
-
+
private static final double[] y = {
0.844, 0.908, 0.932, 0.936, 0.925, 0.908, 0.881, 0.850, 0.818, 0.784, 0.751,
0.718, 0.685, 0.658, 0.628, 0.603, 0.580, 0.558, 0.538, 0.522, 0.506, 0.490,
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/CycleCrossoverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/CycleCrossoverTest.java b/src/test/java/org/apache/commons/math4/genetics/CycleCrossoverTest.java
index 740091d..fd7b177 100644
--- a/src/test/java/org/apache/commons/math4/genetics/CycleCrossoverTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/CycleCrossoverTest.java
@@ -27,7 +27,7 @@ import org.junit.Assert;
import org.junit.Test;
public class CycleCrossoverTest {
-
+
@Test
public void testCrossoverExample() {
// taken from http://www.rubicite.com/Tutorials/GeneticAlgorithms/CrossoverOperators/CycleCrossoverOperator.aspx
@@ -86,7 +86,7 @@ public class CycleCrossoverTest {
final Integer[] c2 = ((DummyListChromosome) pair.getSecond()).getRepresentation().toArray(new Integer[p2.length]);
int index = 0;
- // Determine if it is in the same spot as in the first parent, if
+ // Determine if it is in the same spot as in the first parent, if
// not it comes from the second parent.
for (final Integer j : c1) {
if (!p1[index].equals(j)) {
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/DummyListChromosome.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/DummyListChromosome.java b/src/test/java/org/apache/commons/math4/genetics/DummyListChromosome.java
index 0fd1186..f4c8602 100644
--- a/src/test/java/org/apache/commons/math4/genetics/DummyListChromosome.java
+++ b/src/test/java/org/apache/commons/math4/genetics/DummyListChromosome.java
@@ -41,7 +41,7 @@ public class DummyListChromosome extends AbstractListChromosome<Integer> {
@Override
protected void checkValidity(final List<Integer> chromosomeRepresentation) throws InvalidRepresentationException {
- // Not important.
+ // Not important.
}
@Override
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/ElitisticListPopulationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/ElitisticListPopulationTest.java b/src/test/java/org/apache/commons/math4/genetics/ElitisticListPopulationTest.java
index 08dbeb3..4737b61 100644
--- a/src/test/java/org/apache/commons/math4/genetics/ElitisticListPopulationTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/ElitisticListPopulationTest.java
@@ -43,7 +43,7 @@ public class ElitisticListPopulationTest {
Assert.assertEquals(20, nextGeneration.getPopulationSize());
}
-
+
@Test
public void testSetElitismRate() {
final double rate = 0.25;
@@ -51,27 +51,27 @@ public class ElitisticListPopulationTest {
pop.setElitismRate(rate);
Assert.assertEquals(rate, pop.getElitismRate(), 1e-6);
}
-
+
@Test(expected = OutOfRangeException.class)
public void testSetElitismRateTooLow() {
final double rate = -0.25;
final ElitisticListPopulation pop = new ElitisticListPopulation(100, 0.203);
pop.setElitismRate(rate);
}
-
+
@Test(expected = OutOfRangeException.class)
public void testSetElitismRateTooHigh() {
final double rate = 1.25;
final ElitisticListPopulation pop = new ElitisticListPopulation(100, 0.203);
pop.setElitismRate(rate);
}
-
+
@Test(expected = OutOfRangeException.class)
public void testConstructorTooLow() {
final double rate = -0.25;
new ElitisticListPopulation(100, rate);
}
-
+
@Test(expected = OutOfRangeException.class)
public void testConstructorTooHigh() {
final double rate = 1.25;
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/ListPopulationTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/ListPopulationTest.java b/src/test/java/org/apache/commons/math4/genetics/ListPopulationTest.java
index 9261fe3..6fa323e 100644
--- a/src/test/java/org/apache/commons/math4/genetics/ListPopulationTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/ListPopulationTest.java
@@ -64,13 +64,13 @@ public class ListPopulationTest {
Assert.assertEquals(c3, population.getFittestChromosome());
}
-
+
@Test
public void testChromosomes() {
final ArrayList<Chromosome> chromosomes = new ArrayList<Chromosome> ();
chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
- chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
+ chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
final ListPopulation population = new ListPopulation(10) {
public Population nextGeneration() {
@@ -78,16 +78,16 @@ public class ListPopulationTest {
return null;
}
};
-
+
population.addChromosomes(chromosomes);
Assert.assertEquals(chromosomes, population.getChromosomes());
Assert.assertEquals(chromosomes.toString(), population.toString());
-
+
population.setPopulationLimit(50);
Assert.assertEquals(50, population.getPopulationLimit());
}
-
+
@Test(expected = NotPositiveException.class)
public void testSetPopulationLimit() {
final ListPopulation population = new ListPopulation(10) {
@@ -96,7 +96,7 @@ public class ListPopulationTest {
return null;
}
};
-
+
population.setPopulationLimit(-50);
}
@@ -127,7 +127,7 @@ public class ListPopulationTest {
final ArrayList<Chromosome> chromosomes = new ArrayList<Chromosome> ();
chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
- chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
+ chromosomes.add(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
new ListPopulation(chromosomes, 1) {
public Population nextGeneration() {
// not important
@@ -135,7 +135,7 @@ public class ListPopulationTest {
}
};
}
-
+
@Test(expected=NumberIsTooLargeException.class)
public void testAddTooManyChromosomes() {
final ArrayList<Chromosome> chromosomes = new ArrayList<Chromosome> ();
@@ -149,10 +149,10 @@ public class ListPopulationTest {
return null;
}
};
-
+
population.addChromosomes(chromosomes);
}
-
+
@Test(expected=NumberIsTooLargeException.class)
public void testAddTooManyChromosomesSingleCall() {
@@ -167,7 +167,7 @@ public class ListPopulationTest {
population.addChromosome(new DummyBinaryChromosome(BinaryChromosome.randomBinaryRepresentation(3)));
}
}
-
+
@Test(expected = UnsupportedOperationException.class)
public void testIterator() {
final ArrayList<Chromosome> chromosomes = new ArrayList<Chromosome>();
@@ -190,7 +190,7 @@ public class ListPopulationTest {
iter.remove();
}
}
-
+
@Test(expected=NumberIsTooSmallException.class)
public void testSetPopulationLimitTooSmall() {
final ArrayList<Chromosome> chromosomes = new ArrayList<Chromosome> ();
@@ -207,5 +207,5 @@ public class ListPopulationTest {
population.setPopulationLimit(2);
}
-
+
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/NPointCrossoverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/NPointCrossoverTest.java b/src/test/java/org/apache/commons/math4/genetics/NPointCrossoverTest.java
index 363b161..4f05d81 100644
--- a/src/test/java/org/apache/commons/math4/genetics/NPointCrossoverTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/NPointCrossoverTest.java
@@ -42,7 +42,7 @@ public class NPointCrossoverTest {
final CrossoverPolicy cp = new NPointCrossover<Integer>(1);
cp.crossover(p1c,p2c);
}
-
+
@Test(expected = NumberIsTooLargeException.class)
public void testNumberIsTooLargeException() {
final Integer[] p1 = new Integer[] {1,0,1,0,0,1,0,1,1};
@@ -54,7 +54,7 @@ public class NPointCrossoverTest {
final CrossoverPolicy cp = new NPointCrossover<Integer>(15);
cp.crossover(p1c,p2c);
}
-
+
@Test(expected = MathIllegalArgumentException.class)
public void testCrossoverInvalidFixedLengthChromosomeFirst() {
final Integer[] p1 = new Integer[] {1,0,1,0,0,1,0,1,1};
@@ -69,7 +69,7 @@ public class NPointCrossoverTest {
final CrossoverPolicy cp = new NPointCrossover<Integer>(1);
cp.crossover(p1c,p2c);
}
-
+
@Test(expected = MathIllegalArgumentException.class)
public void testCrossoverInvalidFixedLengthChromosomeSecond() {
final Integer[] p1 = new Integer[] {1,0,1,0,0,1,0,1,1};
@@ -84,7 +84,7 @@ public class NPointCrossoverTest {
final CrossoverPolicy cp = new NPointCrossover<Integer>(1);
cp.crossover(p1c,p2c);
}
-
+
@Test
public void testCrossover() {
Integer[] p1 = new Integer[] {1,0,1,0,1,0,1,0,1};
@@ -108,10 +108,10 @@ public class NPointCrossoverTest {
c2 = ((BinaryChromosome) pair.getSecond()).getRepresentation().toArray(c2);
Assert.assertEquals(order, detectCrossoverPoints(p1c, p2c, (BinaryChromosome) pair.getFirst()));
- Assert.assertEquals(order, detectCrossoverPoints(p2c, p1c, (BinaryChromosome) pair.getSecond()));
+ Assert.assertEquals(order, detectCrossoverPoints(p2c, p1c, (BinaryChromosome) pair.getSecond()));
}
}
-
+
private int detectCrossoverPoints(BinaryChromosome p1, BinaryChromosome p2, BinaryChromosome c) {
int crossovers = 0;
final int length = p1.getLength();
@@ -119,7 +119,7 @@ public class NPointCrossoverTest {
final List<Integer> p1Rep = p1.getRepresentation();
final List<Integer> p2Rep = p2.getRepresentation();
final List<Integer> cRep = c.getRepresentation();
-
+
List<Integer> rep = p1Rep;
for (int i = 0; i < length; i++) {
if (rep.get(i) != cRep.get(i)) {
@@ -127,7 +127,7 @@ public class NPointCrossoverTest {
rep = rep == p1Rep ? p2Rep : p1Rep;
}
}
-
+
return crossovers;
}
http://git-wip-us.apache.org/repos/asf/commons-math/blob/49bb370a/src/test/java/org/apache/commons/math4/genetics/OrderedCrossoverTest.java
----------------------------------------------------------------------
diff --git a/src/test/java/org/apache/commons/math4/genetics/OrderedCrossoverTest.java b/src/test/java/org/apache/commons/math4/genetics/OrderedCrossoverTest.java
index 720eb23..9379da1 100644
--- a/src/test/java/org/apache/commons/math4/genetics/OrderedCrossoverTest.java
+++ b/src/test/java/org/apache/commons/math4/genetics/OrderedCrossoverTest.java
@@ -38,13 +38,13 @@ public class OrderedCrossoverTest {
final Integer[] p2 = new Integer[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
final DummyListChromosome p1c = new DummyListChromosome(p1);
final DummyListChromosome p2c = new DummyListChromosome(p2);
-
+
final CrossoverPolicy cp = new OrderedCrossover<Integer>();
for (int i = 0; i < 20; i++) {
final Set<Integer> parentSet1 = new HashSet<Integer>(Arrays.asList(p1));
final Set<Integer> parentSet2 = new HashSet<Integer>(Arrays.asList(p2));
-
+
final ChromosomePair pair = cp.crossover(p1c, p2c);
final Integer[] c1 = ((DummyListChromosome) pair.getFirst()).getRepresentation().toArray(new Integer[p1.length]);
@@ -52,7 +52,7 @@ public class OrderedCrossoverTest {
Assert.assertNotSame(p1c, pair.getFirst());
Assert.assertNotSame(p2c, pair.getSecond());
-
+
// make sure that the children have exactly the same elements as their parents
for (int j = 0; j < c1.length; j++) {
Assert.assertTrue(parentSet1.contains(c1[j]));