You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by lu...@apache.org on 2009/02/21 21:01:17 UTC
svn commit: r746578 [3/3] - in /commons/proper/math/trunk/src:
experimental/org/apache/commons/math/linear/ java/org/apache/commons/math/
java/org/apache/commons/math/analysis/integration/
java/org/apache/commons/math/analysis/minimization/ java/org/ap...
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/CostException.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/CostException.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/CostException.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/CostException.java Sat Feb 21 20:01:14 2009
@@ -39,7 +39,7 @@
* @param pattern format specifier
* @param arguments format arguments
*/
- public CostException(String pattern, Object[] arguments) {
+ public CostException(String pattern, Object ... arguments) {
super(pattern, arguments);
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DirectSearchOptimizer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DirectSearchOptimizer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DirectSearchOptimizer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/optimization/DirectSearchOptimizer.java Sat Feb 21 20:01:14 2009
@@ -270,7 +270,7 @@
} catch (DimensionMismatchException dme) {
// this should not happen
- throw new MathRuntimeException("unexpected exception caught", null, dme);
+ throw new MathRuntimeException(dme, "unexpected exception caught");
}
}
@@ -507,11 +507,9 @@
// return the found point given the lowest cost
if (minima[0] == null) {
- throw new ConvergenceException("none of the {0} start points" +
- " lead to convergence",
- new Object[] {
- Integer.toString(starts)
- });
+ throw new ConvergenceException(
+ "none of the {0} start points lead to convergence",
+ starts);
}
return minima[0];
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java Sat Feb 21 20:01:14 2009
@@ -140,7 +140,7 @@
}
if (sampleStats.getN() == 0) {
throw MathRuntimeException.createEOFException("URL {0} contains no data",
- new Object[] { url });
+ url);
}
in = new BufferedReader(new InputStreamReader(url.openStream()));
fillBinStats(in);
@@ -413,8 +413,7 @@
public double getNextValue() throws IllegalStateException {
if (!loaded) {
- throw MathRuntimeException.createIllegalStateException("distribution not loaded",
- null);
+ throw MathRuntimeException.createIllegalStateException("distribution not loaded");
}
// Start with a uniformly distributed random number in (0,1)
@@ -434,7 +433,7 @@
}
}
}
- throw new MathRuntimeException("no bin selected", null);
+ throw new MathRuntimeException("no bin selected");
}
/**
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomAdaptor.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomAdaptor.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomAdaptor.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/RandomAdaptor.java Sat Feb 21 20:01:14 2009
@@ -32,10 +32,11 @@
/** Wrapped randomGenerator instance */
private RandomGenerator randomGenerator = null;
-
+
/**
* Prevent instantiation without a generator argument
*/
+ @SuppressWarnings("unused")
private RandomAdaptor() { }
/**
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/random/ValueServer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/random/ValueServer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/random/ValueServer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/random/ValueServer.java Sat Feb 21 20:01:14 2009
@@ -106,18 +106,13 @@
case EXPONENTIAL_MODE: return getNextExponential();
case GAUSSIAN_MODE: return getNextGaussian();
case CONSTANT_MODE: return mu;
- default: throw MathRuntimeException.createIllegalStateException("unknown mode {0}, known modes: " +
- "{1} ({2}), {3} ({4}), {5} ({6}), " +
- "{7} ({8}), {9} ({10}) and {11} ({12})",
- new Object[] {
- mode,
- "DIGEST_MODE", DIGEST_MODE,
- "REPLAY_MODE", REPLAY_MODE,
- "UNIFORM_MODE", UNIFORM_MODE,
- "EXPONENTIAL_MODE", EXPONENTIAL_MODE,
- "GAUSSIAN_MODE", GAUSSIAN_MODE,
- "CONSTANT_MODE", CONSTANT_MODE
- });
+ default: throw MathRuntimeException.createIllegalStateException(
+ "unknown mode {0}, known modes: " +
+ "{1} ({2}), {3} ({4}), {5} ({6}), {7} ({8}), {9} ({10}) and {11} ({12})",
+ mode,
+ "DIGEST_MODE", DIGEST_MODE, "REPLAY_MODE", REPLAY_MODE,
+ "UNIFORM_MODE", UNIFORM_MODE, "EXPONENTIAL_MODE", EXPONENTIAL_MODE,
+ "GAUSSIAN_MODE", GAUSSIAN_MODE, "CONSTANT_MODE", CONSTANT_MODE);
}
}
@@ -306,7 +301,7 @@
private double getNextDigest() {
if ((empiricalDistribution == null) ||
(empiricalDistribution.getBinStats().size() == 0)) {
- throw MathRuntimeException.createIllegalStateException("digest not initialized", null);
+ throw MathRuntimeException.createIllegalStateException("digest not initialized");
}
return empiricalDistribution.getNextValue();
}
@@ -340,7 +335,7 @@
resetReplayFile();
if ((str = filePointer.readLine()) == null) {
throw MathRuntimeException.createEOFException("URL {0} contains no data",
- new Object[] { valuesFileURL });
+ valuesFileURL);
}
}
return Double.valueOf(str).doubleValue();
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/Covariance.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/Covariance.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/Covariance.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/Covariance.java Sat Feb 21 20:01:14 2009
@@ -199,9 +199,9 @@
}
else {
throw MathRuntimeException.createIllegalArgumentException(
- "Arrays must have the same length and both must have at " +
+ "arrays must have the same length and both must have at " +
"least two elements. xArray has size {0}, yArray has {1} elements",
- new Object[] {xArray.length, yArray.length});
+ xArray.length, yArray.length);
}
return biasCorrected ? result * ((double) length / (double)(length - 1)) : result;
}
@@ -216,8 +216,8 @@
int nCols = matrix.getColumnDimension();
if (nRows < 2 || nCols < 2) {
throw MathRuntimeException.createIllegalArgumentException(
- "Insufficient data: only {0} rows and {1} columns.",
- new Object[]{nRows, nCols});
+ "insufficient data: only {0} rows and {1} columns.",
+ nRows, nCols);
}
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/PearsonsCorrelation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/PearsonsCorrelation.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/PearsonsCorrelation.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/correlation/PearsonsCorrelation.java Sat Feb 21 20:01:14 2009
@@ -91,8 +91,7 @@
public PearsonsCorrelation(Covariance covariance) {
RealMatrix covarianceMatrix = covariance.getCovarianceMatrix();
if (covarianceMatrix == null) {
- throw MathRuntimeException.createIllegalArgumentException(
- "Covariance matrix is null", null);
+ throw MathRuntimeException.createIllegalArgumentException("covariance matrix is null");
}
nObs = covariance.getN();
correlationMatrix = covarianceToCorrelation(covarianceMatrix);
@@ -220,8 +219,8 @@
}
else {
throw MathRuntimeException.createIllegalArgumentException(
- "Invalid array dimensions. xArray has size {0}; yArray has {1} elements",
- new Object[] {xArray.length, yArray.length});
+ "invalid array dimensions. xArray has size {0}; yArray has {1} elements",
+ xArray.length, yArray.length);
}
}
@@ -263,8 +262,8 @@
int nCols = matrix.getColumnDimension();
if (nRows < 2 || nCols < 2) {
throw MathRuntimeException.createIllegalArgumentException(
- "Insufficient data: only {0} rows and {1} columns.",
- new Object[]{nRows, nCols});
+ "insufficient data: only {0} rows and {1} columns.",
+ nRows, nCols);
}
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java Sat Feb 21 20:01:14 2009
@@ -610,8 +610,9 @@
*/
private void checkEmpty() {
if (n > 0) {
- throw MathRuntimeException.createIllegalStateException("{0} values have been added before statistic is configured",
- new Object[] { n });
+ throw MathRuntimeException.createIllegalStateException(
+ "{0} values have been added before statistic is configured",
+ n);
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/SummaryStatistics.java Sat Feb 21 20:01:14 2009
@@ -610,8 +610,9 @@
*/
private void checkEmpty() {
if (n > 0) {
- throw MathRuntimeException.createIllegalStateException("{0} values have been added before statistic is configured",
- new Object[] { n });
+ throw MathRuntimeException.createIllegalStateException(
+ "{0} values have been added before statistic is configured",
+ n);
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/GeometricMean.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/GeometricMean.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/GeometricMean.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/GeometricMean.java Sat Feb 21 20:01:14 2009
@@ -186,8 +186,9 @@
*/
private void checkEmpty() {
if (getN() > 0) {
- throw MathRuntimeException.createIllegalStateException("{0} values have been added before statistic is configured",
- new Object[] { getN() });
+ throw MathRuntimeException.createIllegalStateException(
+ "{0} values have been added before statistic is configured",
+ getN());
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Kurtosis.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Kurtosis.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Kurtosis.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/stat/descriptive/moment/Kurtosis.java Sat Feb 21 20:01:14 2009
@@ -91,9 +91,8 @@
if (incMoment) {
moment.increment(d);
} else {
- throw MathRuntimeException.createIllegalStateException("statistics constructed from external " +
- "moments cannot be incremented",
- null);
+ throw MathRuntimeException.createIllegalStateException(
+ "statistics constructed from external moments cannot be incremented");
}
}
@@ -124,9 +123,8 @@
if (incMoment) {
moment.clear();
} else {
- throw MathRuntimeException.createIllegalStateException("statistics constructed from external " +
- "moments cannot be cleared",
- null);
+ throw MathRuntimeException.createIllegalStateException(
+ "statistics constructed from external moments cannot be cleared");
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastCosineTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastCosineTransformer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastCosineTransformer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastCosineTransformer.java Sat Feb 21 20:01:14 2009
@@ -224,8 +224,9 @@
int N = f.length - 1;
if (!FastFourierTransformer.isPowerOf2(N)) {
- throw MathRuntimeException.createIllegalArgumentException("{0} is not a power of 2 plus one",
- new Object[] { f.length });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "{0} is not a power of 2 plus one",
+ f.length);
}
if (N == 1) { // trivial case
F[0] = 0.5 * (f[0] + f[1]);
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastFourierTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastFourierTransformer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastFourierTransformer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastFourierTransformer.java Sat Feb 21 20:01:14 2009
@@ -431,8 +431,9 @@
throws FunctionEvaluationException, IllegalArgumentException {
if (n <= 0) {
- throw MathRuntimeException.createIllegalArgumentException("number of sample is not positive: {0}",
- new Object[] { n });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "number of sample is not positive: {0}",
+ n);
}
verifyInterval(min, max);
@@ -492,8 +493,9 @@
*/
public static void verifyDataSet(double d[]) throws IllegalArgumentException {
if (!isPowerOf2(d.length)) {
- throw MathRuntimeException.createIllegalArgumentException("{0} is not a power of 2, consider padding for fix",
- new Object[] { d.length });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "{0} is not a power of 2, consider padding for fix",
+ d.length);
}
}
@@ -505,8 +507,9 @@
*/
public static void verifyDataSet(Object o[]) throws IllegalArgumentException {
if (!isPowerOf2(o.length)) {
- throw MathRuntimeException.createIllegalArgumentException("{0} is not a power of 2, consider padding for fix",
- new Object[] { o.length });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "{0} is not a power of 2, consider padding for fix",
+ o.length);
}
}
@@ -521,8 +524,9 @@
throws IllegalArgumentException {
if (lower >= upper) {
- throw MathRuntimeException.createIllegalArgumentException("endpoints do not specify an interval: [{0}, {1}]",
- new Object[] { lower, upper });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "endpoints do not specify an interval: [{0}, {1}]",
+ lower, upper);
}
}
@@ -661,15 +665,14 @@
public Complex get(int... vector)
throws IllegalArgumentException {
if (vector == null && dimensionSize.length > 1) {
- throw MathRuntimeException.createIllegalArgumentException("some dimensions don't math: {0} != {1}",
- new Object[] { 0, dimensionSize.length });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "some dimensions don't math: {0} != {1}",
+ 0, dimensionSize.length);
}
if (vector != null && vector.length != dimensionSize.length) {
- throw MathRuntimeException.createIllegalArgumentException("some dimensions don't math: {0} != {1}",
- new Object[] {
- vector.length,
- dimensionSize.length
- });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "some dimensions don't math: {0} != {1}",
+ vector.length, dimensionSize.length);
}
Object lastDimension = multiDimensionalComplexArray;
@@ -691,17 +694,16 @@
throws IllegalArgumentException {
if (vector == null) {
if (dimensionSize.length > 1) {
- throw MathRuntimeException.createIllegalArgumentException("some dimensions don't math: {0} != {1}",
- new Object[] { 0, dimensionSize.length });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "some dimensions don't math: {0} != {1}",
+ 0, dimensionSize.length);
}
return null;
}
if (vector != null && vector.length != dimensionSize.length) {
- throw MathRuntimeException.createIllegalArgumentException("some dimensions don't math: {0} != {1}",
- new Object[] {
- vector.length,
- dimensionSize.length
- });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "some dimensions don't math: {0} != {1}",
+ vector.length,dimensionSize.length);
}
Object[] lastDimension = (Object[]) multiDimensionalComplexArray;
@@ -817,8 +819,7 @@
if (omegaCount == 0) {
throw MathRuntimeException.createIllegalStateException(
- "roots of unity have not been computed yet",
- null);
+ "roots of unity have not been computed yet");
}
return isForward;
@@ -837,8 +838,7 @@
if (n == 0) {
throw MathRuntimeException.createIllegalArgumentException(
- "cannot compute 0-th root of unity, indefinite result",
- null);
+ "cannot compute 0-th root of unity, indefinite result");
}
isForward = (n > 0);
@@ -883,13 +883,12 @@
if (omegaCount == 0) {
throw MathRuntimeException.createIllegalStateException(
- "roots of unity have not been computed yet",
- null);
+ "roots of unity have not been computed yet");
}
if ((k < 0) || (k >= omegaCount)) {
throw MathRuntimeException.createIllegalArgumentException(
"out of range root of unity index {0} (must be in [{1};{2}])",
- new Object[] { k, 0, omegaCount - 1 });
+ k, 0, omegaCount - 1);
}
return omegaReal[k];
@@ -908,13 +907,12 @@
if (omegaCount == 0) {
throw MathRuntimeException.createIllegalStateException(
- "roots of unity have not been computed yet",
- null);
+ "roots of unity have not been computed yet");
}
if ((k < 0) || (k >= omegaCount)) {
throw MathRuntimeException.createIllegalArgumentException(
"out of range root of unity index {0} (must be in [{1};{2}])",
- new Object[] { k, 0, omegaCount - 1 });
+ k, 0, omegaCount - 1);
}
return (isForward) ?
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastHadamardTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastHadamardTransformer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastHadamardTransformer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastHadamardTransformer.java Sat Feb 21 20:01:14 2009
@@ -162,8 +162,9 @@
// n has to be of the form n = 2^p !!
if (!FastFourierTransformer.isPowerOf2(n)) {
- throw MathRuntimeException.createIllegalArgumentException("{0} is not a power of 2",
- new Object[] { n });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "{0} is not a power of 2",
+ n);
}
// Instead of creating a matrix with p+1 columns and n rows
@@ -212,8 +213,9 @@
// n has to be of the form n = 2^p !!
if (!FastFourierTransformer.isPowerOf2(n)) {
- throw MathRuntimeException.createIllegalArgumentException("{0} is not a power of 2",
- new Object[] { n });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "{0} is not a power of 2",
+ n);
}
// Instead of creating a matrix with p+1 columns and n rows
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastSineTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastSineTransformer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastSineTransformer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/transform/FastSineTransformer.java Sat Feb 21 20:01:14 2009
@@ -218,8 +218,9 @@
FastFourierTransformer.verifyDataSet(f);
if (f[0] != 0.0) {
- throw MathRuntimeException.createIllegalArgumentException("first element is not 0: {0}",
- new Object[] { f[0] });
+ throw MathRuntimeException.createIllegalArgumentException(
+ "first element is not 0: {0}",
+ f[0]);
}
int N = f.length;
if (N == 1) { // trivial case
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/ContinuedFraction.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/ContinuedFraction.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/ContinuedFraction.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/ContinuedFraction.java Sat Feb 21 20:01:14 2009
@@ -155,7 +155,7 @@
// can not scale an convergent is unbounded.
throw new ConvergenceException(
"Continued fraction convergents diverged to +/- infinity for value {0}",
- new Object[] { Double.valueOf(x) });
+ x);
}
}
double r = p2 / q2;
@@ -172,7 +172,7 @@
if (n >= maxIterations) {
throw new MaxIterationsExceededException(maxIterations,
"Continued fraction convergents failed to converge for value {0}",
- new Object[] { Double.valueOf(x) });
+ x);
}
return c;
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/DefaultTransformer.java Sat Feb 21 20:01:14 2009
@@ -44,7 +44,7 @@
public double transform(Object o) throws MathException{
if (o == null) {
- throw new MathException("Conversion Exception in Transformation, Object is null", null);
+ throw new MathException("Conversion Exception in Transformation, Object is null");
}
if (o instanceof Number) {
@@ -54,8 +54,8 @@
try {
return Double.valueOf(o.toString()).doubleValue();
} catch (Exception e) {
- throw new MathException("Conversion Exception in Transformation: {0}",
- new Object[] { e.getMessage() }, e);
+ throw new MathException(e,
+ "Conversion Exception in Transformation: {0}", e.getMessage());
}
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/MathUtils.java Sat Feb 21 20:01:14 2009
@@ -20,7 +20,6 @@
import java.math.BigDecimal;
import java.util.Arrays;
-import org.apache.commons.math.MathException;
import org.apache.commons.math.MathRuntimeException;
/**
@@ -543,7 +542,7 @@
if ((u == Integer.MIN_VALUE) || (v == Integer.MIN_VALUE)) {
throw MathRuntimeException.createArithmeticException(
"overflow: gcd({0}, {1}) is 2^31",
- new Object[] { p, q });
+ p, q);
}
return (Math.abs(u) + Math.abs(v));
}
@@ -569,7 +568,7 @@
if (k == 31) {
throw MathRuntimeException.createArithmeticException(
"overflow: gcd({0}, {1}) is 2^31",
- new Object[] { p, q });
+ p, q);
}
// B2. Initialize: u and v have been divided by 2^k and at least
// one is odd.
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/OpenIntToDoubleHashMap.java Sat Feb 21 20:01:14 2009
@@ -523,11 +523,10 @@
public int key()
throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) {
- throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating",
- null);
+ throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating");
}
if (current < 0) {
- throw MathRuntimeException.createNoSuchElementException("iterator exhausted", null);
+ throw MathRuntimeException.createNoSuchElementException("iterator exhausted");
}
return keys[current];
}
@@ -541,11 +540,10 @@
public double value()
throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) {
- throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating",
- null);
+ throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating");
}
if (current < 0) {
- throw MathRuntimeException.createNoSuchElementException("iterator exhausted", null);
+ throw MathRuntimeException.createNoSuchElementException("iterator exhausted");
}
return values[current];
}
@@ -559,8 +557,7 @@
throws ConcurrentModificationException, NoSuchElementException {
if (referenceCount != count) {
- throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating",
- null);
+ throw MathRuntimeException.createConcurrentModificationException("map has been modified while iterating");
}
// advance on step
@@ -574,7 +571,7 @@
} catch (ArrayIndexOutOfBoundsException e) {
next = -2;
if (current < 0) {
- throw MathRuntimeException.createNoSuchElementException("iterator exhausted", null);
+ throw MathRuntimeException.createNoSuchElementException("iterator exhausted");
}
}
Modified: commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java (original)
+++ commons/proper/math/trunk/src/java/org/apache/commons/math/util/ResizableDoubleArray.java Sat Feb 21 20:01:14 2009
@@ -321,7 +321,7 @@
public synchronized double substituteMostRecentElement(double value) {
if (numElements < 1) {
throw MathRuntimeException.createArrayIndexOutOfBoundsException(
- "cannot substitute an element from an empty array", null);
+ "cannot substitute an element from an empty array");
}
double discarded = internalArray[startIndex + (numElements - 1)];
@@ -347,29 +347,25 @@
float expansionFactor) {
if (contractionCritera < expansionFactor) {
- String msg =
- "Contraction criteria can never be smaller than " +
- "the expansion factor. This would lead to a never " +
- "ending loop of expansion and contraction as a newly " +
- "expanded internal storage array would immediately " +
- "satisfy the criteria for contraction";
- throw new IllegalArgumentException(msg);
+ throw MathRuntimeException.createIllegalArgumentException(
+ "contraction criteria ({0}) smaller than the expansion factor ({1}). This would " +
+ "lead to a never ending loop of expansion and contraction as a newly expanded " +
+ "internal storage array would immediately satisfy the criteria for contraction",
+ contractionCritera, expansionFactor);
}
if (contractionCriteria <= 1.0) {
- String msg =
- "The contraction criteria must be a number larger " +
- "than one. If the contractionCriteria is less than or " +
- "equal to one an endless loop of contraction and " +
- "expansion would ensue as an internalArray.length " +
- "== numElements would satisfy the contraction criteria";
- throw new IllegalArgumentException(msg);
+ throw MathRuntimeException.createIllegalArgumentException(
+ "contraction criteria smaller than one ({0}). This would lead to a never ending " +
+ "loop of expansion and contraction as an internal storage array length equal " +
+ "to the number of elements would satisfy the contraction criteria.",
+ contractionCriteria);
}
if (expansionFactor <= 1.0) {
- String msg =
- "The expansion factor must be a number greater than 1.0";
- throw new IllegalArgumentException(msg);
+ throw MathRuntimeException.createIllegalArgumentException(
+ "expansion factor smaller than one ({0})",
+ contractionCriteria);
}
}
@@ -453,12 +449,13 @@
*/
private synchronized void discardExtremeElements(int i,boolean front) {
if (i > numElements) {
- String msg = "Cannot discard more elements than are" +
- "contained in this array.";
- throw new IllegalArgumentException(msg);
- } else if (i < 0) {
- String msg = "Cannot discard a negative number of elements.";
- throw new IllegalArgumentException(msg);
+ throw MathRuntimeException.createIllegalArgumentException(
+ "cannot discard {0} elements from a {1} elements array",
+ i, numElements);
+ } else if (i < 0) {
+ throw MathRuntimeException.createIllegalArgumentException(
+ "cannot discard a negative number of elements ({0})",
+ i);
} else {
// "Subtract" this number of discarded from numElements
numElements -= i;
@@ -536,13 +533,15 @@
*/
public synchronized double getElement(int index) {
if (index >= numElements) {
- throw MathRuntimeException.createArrayIndexOutOfBoundsException("the index specified: {0} is larger than the current maximal index {1}",
- new Object[] { index, numElements - 1 });
+ throw MathRuntimeException.createArrayIndexOutOfBoundsException(
+ "the index specified: {0} is larger than the current maximal index {1}",
+ index, numElements - 1);
} else if (index >= 0) {
return internalArray[startIndex + index];
} else {
- throw MathRuntimeException.createArrayIndexOutOfBoundsException("elements cannot be retrieved from a negative array index {0}",
- new Object[] { index });
+ throw MathRuntimeException.createArrayIndexOutOfBoundsException(
+ "elements cannot be retrieved from a negative array index {0}",
+ index);
}
}
@@ -666,8 +665,9 @@
*/
public synchronized void setElement(int index, double value) {
if (index < 0) {
- throw MathRuntimeException.createArrayIndexOutOfBoundsException("cannot set an element at a negative index {0}",
- new Object[] { index });
+ throw MathRuntimeException.createArrayIndexOutOfBoundsException(
+ "cannot set an element at a negative index {0}",
+ index);
}
if (index + 1 > numElements) {
numElements = index + 1;
@@ -705,7 +705,10 @@
public void setExpansionMode(int expansionMode) {
if (expansionMode != MULTIPLICATIVE_MODE &&
expansionMode != ADDITIVE_MODE) {
- throw new IllegalArgumentException("Illegal expansionMode setting.");
+ throw MathRuntimeException.createIllegalArgumentException(
+ "unsupported expansion mode {0}, supported modes are {1} ({2}) and {3} ({4})",
+ expansionMode, MULTIPLICATIVE_MODE, "MULTIPLICATIVE_MODE",
+ ADDITIVE_MODE, "ADDITIVE_MODE");
}
this.expansionMode = expansionMode;
}
@@ -722,11 +725,10 @@
synchronized(this) {
this.initialCapacity = initialCapacity;
}
- } else {
- String msg =
- "The initial capacity supplied: " + initialCapacity +
- "must be a positive integer";
- throw new IllegalArgumentException(msg);
+ } else {
+ throw MathRuntimeException.createIllegalArgumentException(
+ "initial capacity ({0}) is not positive",
+ initialCapacity);
}
}
@@ -742,9 +744,9 @@
// If index is negative thrown an error
if (i < 0) {
- String msg =
- "Number of elements must be zero or a positive " + "integer";
- throw new IllegalArgumentException(msg);
+ throw MathRuntimeException.createIllegalArgumentException(
+ "index ({0}) is not positive",
+ i);
}
// Test the new num elements, check to see if the array needs to be
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ConvergenceExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ConvergenceExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ConvergenceExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ConvergenceExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -60,7 +60,7 @@
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
- ConvergenceException ex = new ConvergenceException(pattern, arguments, cause);
+ ConvergenceException ex = new ConvergenceException(cause, pattern, arguments);
assertEquals(cause, ex.getCause());
assertEquals(pattern, ex.getPattern());
assertEquals(arguments.length, ex.getArguments().length);
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/FunctionEvaluationExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -53,7 +53,7 @@
Object[] arguments = { Double.valueOf(0.0) };
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
- FunctionEvaluationException ex = new FunctionEvaluationException(0.0, pattern, arguments, cause);
+ FunctionEvaluationException ex = new FunctionEvaluationException(cause, 0.0, pattern, arguments);
assertEquals(cause, ex.getCause());
assertEquals(pattern, ex.getPattern());
assertEquals(arguments.length, ex.getArguments().length);
@@ -67,7 +67,7 @@
public void testConstructorArgumentCause(){
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
- FunctionEvaluationException ex = new FunctionEvaluationException(0.0, cause);
+ FunctionEvaluationException ex = new FunctionEvaluationException(cause, 0.0);
assertEquals(cause, ex.getCause());
assertTrue(ex.getMessage().equals(ex.getMessage(Locale.FRENCH)));
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/MathConfigurationExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -59,7 +59,7 @@
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
- MathConfigurationException ex = new MathConfigurationException(pattern, arguments, cause);
+ MathConfigurationException ex = new MathConfigurationException(cause, pattern, arguments);
assertEquals(cause, ex.getCause());
assertEquals(pattern, ex.getPattern());
assertEquals(arguments.length, ex.getArguments().length);
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/MathExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -62,7 +62,7 @@
Object[] arguments = { Integer.valueOf(6), Integer.valueOf(4) };
String inMsg = "inner message";
Exception cause = new Exception(inMsg);
- MathException ex = new MathException(pattern, arguments, cause);
+ MathException ex = new MathException(cause, pattern, arguments);
assertEquals(cause, ex.getCause());
assertEquals(pattern, ex.getPattern());
assertEquals(arguments.length, ex.getArguments().length);
@@ -79,8 +79,8 @@
public void testPrintStackTrace() {
String outMsg = "outer message";
String inMsg = "inner message";
- MathException cause = new MathConfigurationException(inMsg, null);
- MathException ex = new MathException(outMsg, null, cause);
+ MathException cause = new MathConfigurationException(inMsg);
+ MathException ex = new MathException(cause, outMsg);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(baos);
ex.printStackTrace(ps);
@@ -104,8 +104,8 @@
public void testSerialization() {
String outMsg = "outer message";
String inMsg = "inner message";
- MathException cause = new MathConfigurationException(inMsg, null);
- MathException ex = new MathException(outMsg, null, cause);
+ MathException cause = new MathConfigurationException(inMsg);
+ MathException ex = new MathException(cause, outMsg);
MathException image = (MathException) TestUtils.serializeAndRecover(ex);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/MaxIterationsExceededExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -39,7 +39,7 @@
MaxIterationsExceededException ex =
new MaxIterationsExceededException(1000000,
"Continued fraction convergents failed to converge for value {0}",
- new Object[] { Double.valueOf(1234567) });
+ 1234567);
assertNull(ex.getCause());
assertNotNull(ex.getMessage());
assertTrue(ex.getMessage().indexOf("1,000,000") < 0);
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java Sat Feb 21 20:01:14 2009
@@ -783,7 +783,7 @@
if (!lu.isSquare() || lowerData.length != lowerData[0].length || upperData.length != upperData[0].length ||
lowerData.length != upperData.length
|| lowerData.length != lu.getRowDimension()) {
- throw new InvalidMatrixException("incorrect dimensions", null);
+ throw new InvalidMatrixException("incorrect dimensions");
}
int n = lu.getRowDimension();
for (int i = 0; i < n; i++) {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/InvalidMatrixExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -24,12 +24,9 @@
*/
public class InvalidMatrixExceptionTest extends TestCase {
- /**
- *
- */
public void testConstructorMessage(){
String msg = "message";
- InvalidMatrixException ex = new InvalidMatrixException(msg, null);
+ InvalidMatrixException ex = new InvalidMatrixException(msg);
assertEquals(msg, ex.getMessage());
}
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/MatrixIndexExceptionTest.java Sat Feb 21 20:01:14 2009
@@ -29,7 +29,7 @@
*/
public void testConstructorMessage(){
String msg = "message";
- MatrixIndexException ex = new MatrixIndexException(msg, null);
+ MatrixIndexException ex = new MatrixIndexException(msg);
assertEquals(msg, ex.getMessage());
}
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java Sat Feb 21 20:01:14 2009
@@ -964,7 +964,7 @@
if (!lu.isSquare() || lowerData.length != lowerData[0].length || upperData.length != upperData[0].length ||
lowerData.length != upperData.length
|| lowerData.length != lu.getRowDimension()) {
- throw new InvalidMatrixException("incorrect dimensions", null);
+ throw new InvalidMatrixException("incorrect dimensions");
}
int n = lu.getRowDimension();
for (int i = 0; i < n; i++) {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/CholeskySolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/CholeskySolverTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/CholeskySolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/CholeskySolverTest.java Sat Feb 21 20:01:14 2009
@@ -26,9 +26,6 @@
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.linear.RealVectorImpl;
import org.apache.commons.math.linear.RealVectorImplTest;
-import org.apache.commons.math.linear.RealVectorImplTest.RealVectorTestImpl;
-import org.apache.commons.math.linear.decomposition.CholeskyDecompositionImpl;
-import org.apache.commons.math.linear.decomposition.DecompositionSolver;
public class CholeskySolverTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/EigenSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/EigenSolverTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/EigenSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/EigenSolverTest.java Sat Feb 21 20:01:14 2009
@@ -28,9 +28,6 @@
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.linear.RealVectorImpl;
import org.apache.commons.math.linear.RealVectorImplTest;
-import org.apache.commons.math.linear.RealVectorImplTest.RealVectorTestImpl;
-import org.apache.commons.math.linear.decomposition.DecompositionSolver;
-import org.apache.commons.math.linear.decomposition.EigenDecompositionImpl;
import org.apache.commons.math.util.MathUtils;
public class EigenSolverTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/LUSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/LUSolverTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/LUSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/LUSolverTest.java Sat Feb 21 20:01:14 2009
@@ -17,18 +17,15 @@
package org.apache.commons.math.linear.decomposition;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
import org.apache.commons.math.linear.InvalidMatrixException;
import org.apache.commons.math.linear.MatrixUtils;
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.linear.RealVectorImpl;
import org.apache.commons.math.linear.RealVectorImplTest;
-import org.apache.commons.math.linear.RealVectorImplTest.RealVectorTestImpl;
-import org.apache.commons.math.linear.decomposition.DecompositionSolver;
-import org.apache.commons.math.linear.decomposition.LUDecompositionImpl;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
public class LUSolverTest extends TestCase {
private double[][] testData = {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/QRSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/QRSolverTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/QRSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/QRSolverTest.java Sat Feb 21 20:01:14 2009
@@ -19,6 +19,10 @@
import java.util.Random;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
import org.apache.commons.math.linear.DefaultRealMatrixChangingVisitor;
import org.apache.commons.math.linear.DenseRealMatrix;
import org.apache.commons.math.linear.InvalidMatrixException;
@@ -28,14 +32,6 @@
import org.apache.commons.math.linear.RealVector;
import org.apache.commons.math.linear.RealVectorImpl;
import org.apache.commons.math.linear.RealVectorImplTest;
-import org.apache.commons.math.linear.RealVectorImplTest.RealVectorTestImpl;
-import org.apache.commons.math.linear.decomposition.DecompositionSolver;
-import org.apache.commons.math.linear.decomposition.QRDecomposition;
-import org.apache.commons.math.linear.decomposition.QRDecompositionImpl;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
public class QRSolverTest extends TestCase {
double[][] testData3x3NonSingular = {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/SingularValueSolverTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/SingularValueSolverTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/SingularValueSolverTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/linear/decomposition/SingularValueSolverTest.java Sat Feb 21 20:01:14 2009
@@ -17,18 +17,15 @@
package org.apache.commons.math.linear.decomposition;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
import org.apache.commons.math.linear.InvalidMatrixException;
import org.apache.commons.math.linear.MatrixUtils;
import org.apache.commons.math.linear.RealMatrix;
import org.apache.commons.math.linear.RealVectorImpl;
import org.apache.commons.math.linear.RealVectorImplTest;
-import org.apache.commons.math.linear.RealVectorImplTest.RealVectorTestImpl;
-import org.apache.commons.math.linear.decomposition.DecompositionSolver;
-import org.apache.commons.math.linear.decomposition.SingularValueDecompositionImpl;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
public class SingularValueSolverTest extends TestCase {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/FirstOrderConverterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/FirstOrderConverterTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/FirstOrderConverterTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/FirstOrderConverterTest.java Sat Feb 21 20:01:14 2009
@@ -78,7 +78,9 @@
private static class Equations
implements SecondOrderDifferentialEquations {
- private int n;
+ private static final long serialVersionUID = -7926271579508637558L;
+
+ private int n;
private double omega2;
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/ode/nonstiff/HighamHall54IntegratorTest.java Sat Feb 21 20:01:14 2009
@@ -49,7 +49,7 @@
public void computeDerivatives(double t, double[] y, double[] dot)
throws DerivativeException {
if (t < -0.5) {
- throw new DerivativeException("{0}", new String[] { "oops" });
+ throw new DerivativeException("{0}", "oops");
} else {
throw new DerivativeException(new RuntimeException("oops"));
}
@@ -216,8 +216,7 @@
double middle = (pb.getInitialTime() + pb.getFinalTime()) / 2;
double offset = t - middle;
if (offset > 0) {
- throw new EventException("Evaluation failed for argument = {0}",
- new Object[] { Double.valueOf(t) });
+ throw new EventException("Evaluation failed for argument = {0}", t);
}
return offset;
}
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/MultiDirectionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/MultiDirectionalTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/MultiDirectionalTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/MultiDirectionalTest.java Sat Feb 21 20:01:14 2009
@@ -38,7 +38,7 @@
new CostFunction() {
public double cost(double[] x) throws CostException {
if (x[0] < 0) {
- throw new CostException("{0}", new Object[] { "oops"});
+ throw new CostException("{0}", "oops");
} else if (x[0] > 1) {
throw new CostException(new RuntimeException("oops"));
} else {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/optimization/NelderMeadTest.java Sat Feb 21 20:01:14 2009
@@ -44,7 +44,7 @@
new CostFunction() {
public double cost(double[] x) throws CostException {
if (x[0] < 0) {
- throw new CostException("{0}", new Object[] { "oops"});
+ throw new CostException("{0}", "oops");
} else if (x[0] > 1) {
throw new CostException(new RuntimeException("oops"));
} else {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/OLSMultipleLinearRegressionTest.java Sat Feb 21 20:01:14 2009
@@ -16,13 +16,13 @@
*/
package org.apache.commons.math.stat.regression;
+import static org.junit.Assert.assertEquals;
+
import org.apache.commons.math.TestUtils;
import org.apache.commons.math.linear.MatrixUtils;
import org.apache.commons.math.linear.RealMatrix;
-import org.apache.commons.math.linear.RealMatrixImpl;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
public class OLSMultipleLinearRegressionTest extends MultipleLinearRegressionAbstractTest {
Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/util/TestBean.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/util/TestBean.java?rev=746578&r1=746577&r2=746578&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/org/apache/commons/math/util/TestBean.java (original)
+++ commons/proper/math/trunk/src/test/org/apache/commons/math/util/TestBean.java Sat Feb 21 20:01:14 2009
@@ -59,7 +59,7 @@
*
*/
public Double getZ() {
- throw new MathRuntimeException("?", null);
+ throw new MathRuntimeException("?");
}
/**