commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l..@apache.org
Subject svn commit: r955710 - in /commons/proper/math/trunk/src/main: java/org/apache/commons/math/analysis/integration/ java/org/apache/commons/math/analysis/polynomials/ java/org/apache/commons/math/analysis/solvers/ java/org/apache/commons/math/complex/ jav...
Date Thu, 17 Jun 2010 19:07:56 GMT
Author: luc
Date: Thu Jun 17 19:07:55 2010
New Revision: 955710

URL: http://svn.apache.org/viewvc?rev=955710&view=rev
Log:
replaced forgotten calls to deprecated exception constructors

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunctionLagrangeForm.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/complex/ComplexFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/ValueServer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/LocalizedFormats.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
    commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java
    commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/LegendreGaussIntegrator.java
Thu Jun 17 19:07:55 2010
@@ -21,6 +21,7 @@ import org.apache.commons.math.FunctionE
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.MaxIterationsExceededException;
 import org.apache.commons.math.analysis.UnivariateRealFunction;
+import org.apache.commons.math.util.LocalizedFormats;
 
 /**
  * Implements the <a href="http://mathworld.wolfram.com/Legendre-GaussQuadrature.html">
@@ -145,8 +146,7 @@ public class LegendreGaussIntegrator ext
             break;
         default :
             throw MathRuntimeException.createIllegalArgumentException(
-                    "{0} points Legendre-Gauss integrator not supported, " +
-                    "number of points must be in the {1}-{2} range",
+                    LocalizedFormats.N_POINTS_GAUSS_LEGENDRE_INTEGRATOR_NOT_SUPPORTED,
                     n, 2, 5);
         }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/integration/UnivariateRealIntegratorImpl.java
Thu Jun 17 19:07:55 2010
@@ -159,7 +159,7 @@ public abstract class UnivariateRealInte
         IllegalArgumentException {
         if (lower >= upper) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    "endpoints do not specify an interval: [{0}, {1}]",
+                    LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL,
                     lower, upper);
         }
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunctionLagrangeForm.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunctionLagrangeForm.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunctionLagrangeForm.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/polynomials/PolynomialFunctionLagrangeForm.java
Thu Jun 17 19:07:55 2010
@@ -256,8 +256,9 @@ public class PolynomialFunctionLagrangeF
                 // This happens only when two abscissas are identical.
                 for (int k = 0; k < n; ++k) {
                     if ((i != k) && (x[i] == x[k])) {
-                        throw MathRuntimeException.createArithmeticException("identical abscissas
x[{0}] == x[{1}] == {2} cause division by zero",
-                                                                             i, k, x[i]);
+                        throw MathRuntimeException.createArithmeticException(
+                              LocalizedFormats.IDENTICAL_ABSCISSAS_DIVISION_BY_ZERO,
+                              i, k, x[i]);
                     }
                 }
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/analysis/solvers/UnivariateRealSolverImpl.java
Thu Jun 17 19:07:55 2010
@@ -208,7 +208,7 @@ public abstract class UnivariateRealSolv
     protected void verifyInterval(final double lower, final double upper) {
         if (lower >= upper) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    "endpoints do not specify an interval: [{0}, {1}]",
+                    LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL,
                     lower, upper);
         }
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/complex/ComplexFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/complex/ComplexFormat.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/complex/ComplexFormat.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/complex/ComplexFormat.java
Thu Jun 17 19:07:55 2010
@@ -256,7 +256,7 @@ public class ComplexFormat extends Compo
         if (parsePosition.getIndex() == 0) {
             throw MathRuntimeException.createParseException(
                     parsePosition.getErrorIndex(),
-                    "unparseable complex number: \"{0}\"", source);
+                    LocalizedFormats.UNPARSEABLE_COMPLEX_NUMBER, source);
         }
         return result;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/distribution/BetaDistributionImpl.java
Thu Jun 17 19:07:55 2010
@@ -20,6 +20,7 @@ import org.apache.commons.math.MathExcep
 import org.apache.commons.math.MathRuntimeException;
 import org.apache.commons.math.special.Gamma;
 import org.apache.commons.math.special.Beta;
+import org.apache.commons.math.util.LocalizedFormats;
 
 /**
  * Implements the Beta distribution.
@@ -145,13 +146,13 @@ public class BetaDistributionImpl
         } else if (x == 0) {
             if (alpha < 1) {
                 throw MathRuntimeException.createIllegalArgumentException(
-                        "Cannot compute beta density at 0 when alpha = {0,number}", alpha);
+                        LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA,
alpha);
             }
             return 0;
         } else if (x == 1) {
             if (beta < 1) {
                 throw MathRuntimeException.createIllegalArgumentException(
-                        "Cannot compute beta density at 1 when beta = %.3g", beta);
+                        LocalizedFormats.CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA,
beta);
             }
             return 0;
         } else {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/BigFractionFormat.java
Thu Jun 17 19:07:55 2010
@@ -195,7 +195,7 @@ public class BigFractionFormat extends A
         if (parsePosition.getIndex() == 0) {
             throw MathRuntimeException.createParseException(
                     parsePosition.getErrorIndex(),
-                    "unparseable fraction number: \"{0}\"", source);
+                    LocalizedFormats.UNPARSEABLE_FRACTION_NUMBER, source);
         }
         return result;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/fraction/FractionFormat.java
Thu Jun 17 19:07:55 2010
@@ -206,7 +206,7 @@ public class FractionFormat extends Abst
         if (parsePosition.getIndex() == 0) {
             throw MathRuntimeException.createParseException(
                     parsePosition.getErrorIndex(),
-                    "unparseable fraction number: \"{0}\"", source);
+                    LocalizedFormats.UNPARSEABLE_FRACTION_NUMBER, source);
         }
         return result;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/genetics/RandomKeyMutation.java
Thu Jun 17 19:07:55 2010
@@ -20,6 +20,7 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.math.MathRuntimeException;
+import org.apache.commons.math.util.LocalizedFormats;
 
 /**
  * Mutation operator for {@link RandomKey}s. Changes a randomly chosen element
@@ -39,7 +40,7 @@ public class RandomKeyMutation implement
     public Chromosome mutate(Chromosome original) {
         if (!(original instanceof RandomKey<?>)) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    "RandomKeyMutation works only with RandomKeys, got " +
+                    LocalizedFormats.RANDOMKEY_MUTATION_WRONG_CLASS,
                     original.getClass().getSimpleName());
         }
 

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/geometry/Vector3DFormat.java
Thu Jun 17 19:07:55 2010
@@ -260,7 +260,7 @@ public class Vector3DFormat extends Comp
         if (parsePosition.getIndex() == 0) {
             throw MathRuntimeException.createParseException(
                     parsePosition.getErrorIndex(),
-                    "unparseable 3D vector: \"{0}\"", source);
+                    LocalizedFormats.UNPARSEABLE_3D_VECTOR, source);
         }
         return result;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/BlockFieldMatrix.java
Thu Jun 17 19:07:55 2010
@@ -171,7 +171,7 @@ public class BlockFieldMatrix<T extends 
             for (int jBlock = 0; jBlock < blockColumns; ++jBlock, ++index) {
                 if (blockData[index].length != iHeight * blockWidth(jBlock)) {
                     throw MathRuntimeException.createIllegalArgumentException(
-                            "wrong array shape (block length = {0}, expected {1})",
+                            LocalizedFormats.WRONG_BLOCK_LENGTH,
                             blockData[index].length, iHeight * blockWidth(jBlock));
                 }
                 if (copyArray) {

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/linear/RealVectorFormat.java
Thu Jun 17 19:07:55 2010
@@ -265,7 +265,7 @@ public class RealVectorFormat extends Co
         if (parsePosition.getIndex() == 0) {
             throw MathRuntimeException.createParseException(
                     parsePosition.getErrorIndex(),
-                    "unparseable real vector: \"{0}\"", source);
+                    LocalizedFormats.UNPARSEABLE_REAL_VECTOR, source);
         }
         return result;
     }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/EmpiricalDistributionImpl.java
Thu Jun 17 19:07:55 2010
@@ -220,8 +220,7 @@ public class EmpiricalDistributionImpl i
                 return new ArrayDataAdapter(inputArray);
             } else {
                 throw MathRuntimeException.createIllegalArgumentException(
-                      "input data comes from unsupported datasource: {0}, " +
-                      "supported sources: {1}, {2}",
+                      LocalizedFormats.INPUT_DATA_FROM_UNSUPPORTED_DATASOURCE,
                       in.getClass().getName(),
                       BufferedReader.class.getName(), double[].class.getName());
             }

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/ValueServer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/ValueServer.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/ValueServer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/random/ValueServer.java
Thu Jun 17 19:07:55 2010
@@ -120,8 +120,7 @@ public class ValueServer {
             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})",
+                    LocalizedFormats.UNKNOWN_MODE,
                     mode,
                     "DIGEST_MODE",   DIGEST_MODE,   "REPLAY_MODE",      REPLAY_MODE,
                     "UNIFORM_MODE",  UNIFORM_MODE,  "EXPONENTIAL_MODE", EXPONENTIAL_MODE,

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/AbstractUnivariateStatistic.java
Thu Jun 17 19:07:55 2010
@@ -140,27 +140,27 @@ public abstract class AbstractUnivariate
         final int length) {
 
         if (weights == null) {
-            throw MathRuntimeException.createIllegalArgumentException("input weights array
is null");
+            throw MathRuntimeException.createIllegalArgumentException(LocalizedFormats.NULL_INPUT_ARRAY);
         }
 
         if (weights.length !=  values.length) {
             throw MathRuntimeException.createIllegalArgumentException(
-                  "Different number of weights and values");
+                  LocalizedFormats.DIMENSIONS_MISMATCH_SIMPLE, weights.length, values.length);
         }
 
         boolean containsPositiveWeight = false;
         for (int i = begin; i < begin + length; i++) {
             if (Double.isNaN(weights[i])) {
                 throw MathRuntimeException.createIllegalArgumentException(
-                        "NaN weight at index {0}", i);
+                        LocalizedFormats.NAN_ELEMENT_AT_INDEX, i);
             }
             if (Double.isInfinite(weights[i])) {
                 throw MathRuntimeException.createIllegalArgumentException(
-                        "Infinite weight at index {0}", i);
+                        LocalizedFormats.INFINITE_ARRAY_ELEMENT, weights[i], i);
             }
             if (weights[i] < 0) {
                 throw MathRuntimeException.createIllegalArgumentException(
-                      "negative weight {0} at index {1} ", weights[i], i);
+                      LocalizedFormats.NEGATIVE_ELEMENT_AT_INDEX, i, weights[i]);
             }
             if (!containsPositiveWeight && weights[i] > 0.0) {
                 containsPositiveWeight = true;
@@ -169,7 +169,7 @@ public abstract class AbstractUnivariate
 
         if (!containsPositiveWeight) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    "weight array must contain at least one non-zero value");
+                    LocalizedFormats.WEIGHT_AT_LEAST_ONE_NON_ZERO);
         }
 
         return test(values, begin, length);

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/descriptive/DescriptiveStatistics.java
Thu Jun 17 19:07:55 2010
@@ -569,8 +569,8 @@ public class DescriptiveStatistics imple
                             new Object[] {Double.valueOf(50.0d)});
         } catch (NoSuchMethodException e1) {
             throw MathRuntimeException.createIllegalArgumentException(
-                  "percentile implementation {0} does not support setQuantile",
-                  percentileImpl.getClass().getName());
+                  LocalizedFormats.PERCENTILE_IMPLEMENTATION_UNSUPPORTED_METHOD,
+                  percentileImpl.getClass().getName(), SET_QUANTILE_METHOD_NAME);
         } catch (IllegalAccessException e2) {
             throw MathRuntimeException.createIllegalArgumentException(
                   LocalizedFormats.PERCENTILE_IMPLEMENTATION_CANNOT_ACCESS_METHOD,

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/transform/FastFourierTransformer.java
Thu Jun 17 19:07:55 2010
@@ -49,10 +49,6 @@ public class FastFourierTransformer impl
     /** Serializable version identifier. */
     static final long serialVersionUID = 5138259215438106000L;
 
-    /** Message for out of range root index. */
-    private static final String OUT_OF_RANGE_ROOT_INDEX_MESSAGE =
-        "out of range root of unity index {0} (must be in [{1};{2}])";
-
     /** roots of unity */
     private RootsOfUnity roots = new RootsOfUnity();
 
@@ -528,7 +524,7 @@ public class FastFourierTransformer impl
 
         if (lower >= upper) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    "endpoints do not specify an interval: [{0}, {1}]",
+                    LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL,
                     lower, upper);
         }
     }
@@ -883,7 +879,7 @@ public class FastFourierTransformer impl
         }
         if ((k < 0) || (k >= omegaCount)) {
             throw MathRuntimeException.createIllegalArgumentException(
-                    OUT_OF_RANGE_ROOT_INDEX_MESSAGE, k, 0, omegaCount - 1);
+                    LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX, k, 0, omegaCount -
1);
         }
 
         return omegaReal[k];
@@ -905,7 +901,7 @@ public class FastFourierTransformer impl
         }
         if ((k < 0) || (k >= omegaCount)) {
           throw MathRuntimeException.createIllegalArgumentException(
-                  OUT_OF_RANGE_ROOT_INDEX_MESSAGE, k, 0, omegaCount - 1);
+                  LocalizedFormats.OUT_OF_RANGE_ROOT_OF_UNITY_INDEX, k, 0, omegaCount - 1);
         }
 
         return isForward ? omegaImaginaryForward[k] : omegaImaginaryInverse[k];

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/LocalizedFormats.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/LocalizedFormats.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/LocalizedFormats.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/LocalizedFormats.java
Thu Jun 17 19:07:55 2010
@@ -43,6 +43,7 @@ public enum LocalizedFormats implements 
 
     ARGUMENT_OUTSIDE_DOMAIN("Argument {0} outside domain [{1} ; {2}]"),
     ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1("array sizes should have difference 1 ({0} != {1}
+ 1)"),
+    ARRAY_SUMS_TO_ZERO("array sums to zero"),
     ASSYMETRIC_EIGEN_NOT_SUPPORTED("eigen decomposition of assymetric matrices not supported
yet"),
     AT_LEAST_ONE_COLUMN("matrix must have at least one column"),
     AT_LEAST_ONE_ROW("matrix must have at least one row"),
@@ -51,6 +52,8 @@ public enum LocalizedFormats implements 
     BINOMIAL_NEGATIVE_PARAMETER("must have n >= 0 for binomial coefficient (n,k), got
n = {0}"),
     CANNOT_CLEAR_STATISTIC_CONSTRUCTED_FROM_EXTERNAL_MOMENTS("statistics constructed from
external moments cannot be cleared"),
     CANNOT_COMPUTE_0TH_ROOT_OF_UNITY("cannot compute 0-th root of unity, indefinite result"),
+    CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA("cannot compute beta density at 0 when
alpha = {0,number}"),
+    CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA("cannot compute beta density at 1 when
beta = %.3g"),
     CANNOT_COMPUTE_NTH_ROOT_FOR_NEGATIVE_N("cannot compute nth root for null or negative
n: {0}"),
     CANNOT_CONVERT_OBJECT_TO_FRACTION("cannot convert given object to a fraction number:
{0}"),
     CANNOT_DISCARD_NEGATIVE_NUMBER_OF_ELEMENTS("cannot discard a negative number of elements
({0})"),
@@ -135,6 +138,7 @@ public enum LocalizedFormats implements 
     MAX_ITERATIONS_EXCEEDED("maximal number of iterations ({0}) exceeded"),
     MINIMAL_STEPSIZE_REACHED_DURING_INTEGRATION("minimal step size ({0,number,0.00E00}) reached,
integration needs {1,number,0.00E00}"),
     MISMATCHED_LOESS_ABSCISSA_ORDINATE_ARRAYS("Loess expects the abscissa and ordinate arrays
to be of the same size, but got {0} abscissae and {1} ordinatae"),
+    NAN_ELEMENT_AT_INDEX("element {0} is NaN"),
     NAN_VALUE_CONVERSION("cannot convert NaN value"),
     NEGATIVE_BRIGHTNESS_EXPONENT("brightness exponent should be positive or null, but got
{0}"),
     NEGATIVE_COMPLEX_MODULE("negative complex module {0}"),
@@ -203,7 +207,7 @@ public enum LocalizedFormats implements 
     NULL_FRACTION("null fraction"),
     NULL_FUNCTION("function is null"),
     NULL_IMAGINARY_FORMAT("null imaginary format"),
-    NULL_INPUT_ARRAY("input values array is null"),
+    NULL_INPUT_ARRAY("input array is null"),
     NULL_NUMERATOR("numerator is null"),
     NULL_NUMERATOR_FORMAT("numerator format can not be null"),
     NULL_OBJECT_TRANSFORMATION("Conversion Exception in Transformation, Object is null"),
@@ -227,6 +231,7 @@ public enum LocalizedFormats implements 
     POSITION_SIZE_MISMATCH_INPUT_ARRAY("position {0} and size {1} don't fit to the size of
the input array {2}"),
     POWER_NEGATIVE_PARAMETERS("cannot raise an integral value to a negative power ({0}^{1})"),
     PROPAGATION_DIRECTION_MISMATCH("propagation direction mismatch"),
+    RANDOMKEY_MUTATION_WRONG_CLASS("RandomKeyMutation works only with RandomKeys, not {0}"),
     ROOTS_OF_UNITY_NOT_COMPUTED_YET("roots of unity have not been computed yet"),
     ROTATION_MATRIX_DIMENSIONS("a {0}x{1} matrix cannot be a rotation matrix"),
     ROW_INDEX_OUT_OF_RANGE("row index {0} out of allowed range [{1}, {2}]"),
@@ -263,6 +268,7 @@ public enum LocalizedFormats implements 
     VALUES_ADDED_BEFORE_CONFIGURING_STATISTIC("{0} values have been added before statistic
is configured"),
     VECTOR_LENGTH_MISMATCH("vector length mismatch: got {0} but expected {1}"),
     VECTOR_MUST_HAVE_AT_LEAST_ONE_ELEMENT("vector must have at least one element"),
+    WEIGHT_AT_LEAST_ONE_NON_ZERO("weigth array must contain at least one non-zero value"),
     WRONG_BLOCK_LENGTH("wrong array shape (block length = {0}, expected {1})"),
     WRONG_NUMBER_OF_POINTS("{0} points are required, got only {1}"),
     ZERO_DENOMINATOR("denominator must be different from 0"),

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Thu
Jun 17 19:07:55 2010
@@ -1249,8 +1249,7 @@ public final class MathUtils {
              }
          }
          if (sum == 0) {
-             throw MathRuntimeException.createArithmeticException(
-                     "Array sums to zero");
+             throw MathRuntimeException.createArithmeticException(LocalizedFormats.ARRAY_SUMS_TO_ZERO);
          }
          for (int i = 0; i < len; i++) {
              if (Double.isNaN(values[i])) {
@@ -1412,8 +1411,7 @@ public final class MathUtils {
             break;
         default :
             throw MathRuntimeException.createIllegalArgumentException(
-                  "invalid rounding method {0}, valid methods: {1} ({2}), {3} ({4})," +
-                  " {5} ({6}), {7} ({8}), {9} ({10}), {11} ({12}), {13} ({14}), {15} ({16})",
+                  LocalizedFormats.INVALID_ROUNDING_METHOD,
                   roundingMethod,
                   "ROUND_CEILING",     BigDecimal.ROUND_CEILING,
                   "ROUND_DOWN",        BigDecimal.ROUND_DOWN,

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java
(original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/ResizableDoubleArray.java
Thu Jun 17 19:07:55 2010
@@ -346,17 +346,13 @@ public class ResizableDoubleArray implem
 
         if (contraction < expansion) {
             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",
+                    LocalizedFormats.CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR,
                     contraction, expansion);
         }
 
         if (contraction <= 1.0) {
             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.",
+                    LocalizedFormats.CONTRACTION_CRITERIA_SMALLER_THAN_ONE,
                     contraction);
         }
 

Modified: commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties?rev=955710&r1=955709&r2=955710&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties
(original)
+++ commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties
Thu Jun 17 19:07:55 2010
@@ -13,7 +13,9 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+ARGUMENT_OUTSIDE_DOMAIN = argument {0} hors domaine [{1} ; {2}]
 ARRAY_SIZES_SHOULD_HAVE_DIFFERENCE_1 = les tableaux devraient avoir une diff\u00e9rence de
taille de 1 ({0} != {1} + 1)
+ARRAY_SUMS_TO_ZERO = somme du tableau nulle
 ASSYMETRIC_EIGEN_NOT_SUPPORTED = la d\u00e9composition en valeurs/vecteurs propres de matrices

 AT_LEAST_ONE_COLUMN = une matrice doit comporter au moins une colonne
 AT_LEAST_ONE_ROW = une matrice doit comporter au moins une ligne
@@ -21,6 +23,8 @@ BINOMIAL_INVALID_PARAMETERS_ORDER = n do
 BINOMIAL_NEGATIVE_PARAMETER = n doit \u00eatre positif pour le coefficient du bin\u00f4me
(n,k), or n = {0}
 CANNOT_CLEAR_STATISTIC_CONSTRUCTED_FROM_EXTERNAL_MOMENTS = les statistiques bas\u00e9es sur
des moments externes ne peuvent pas \u00eatre remises \u00e0 z\u00e9ro
 CANNOT_COMPUTE_0TH_ROOT_OF_UNITY = impossible de calculer la racine z\u00e9roi\u00e8me de
l''unit\u00e9, 
+CANNOT_COMPUTE_BETA_DENSITY_AT_0_FOR_SOME_ALPHA = impossible de calculer la densit\u00e9
beta en 0 lorsque alpha = {0,number}
+CANNOT_COMPUTE_BETA_DENSITY_AT_1_FOR_SOME_BETA = impossible de calculer la densit\u00e9 beta
en 1 lorsque beta = %.3g
 CANNOT_COMPUTE_NTH_ROOT_FOR_NEGATIVE_N = impossible de calculer la racine ni\u00e8me pour
n n\u00e9gatif ou nul : {0}
 CANNOT_CONVERT_OBJECT_TO_FRACTION = impossible de convertir l''objet sous forme d''un nombre
rationnel : {0}
 CANNOT_DISCARD_NEGATIVE_NUMBER_OF_ELEMENTS = impossible d''enlever un nombre d''\u00e9l\u00e9ments{0}
n\u00e9gatif
@@ -39,7 +43,7 @@ CLASS_DOESNT_IMPLEMENT_COMPARABLE = la c
 CLOSEST_ORTHOGONAL_MATRIX_HAS_NEGATIVE_DETERMINANT = la matrice orthogonale la plus proche
a un d\u00e9terminant n\u00e9gatif {0}
 CONTINUED_FRACTION_INFINITY_DIVERGENCE = Divergence de fraction continue \u00e0 l''infini
pour la valeur {0}
 CONTINUED_FRACTION_NAN_DIVERGENCE = Divergence de fraction continue \u00e0 NaN pour la valeur
{0}
-CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTO = crit\u00e8re de contraction ({0}) inf\u00e9rieur
au facteur d''extension. Ceci induit une boucle infinie d''extensions/contractions car tout
tableau de stockage fra\u00eechement \u00e9tendu respecte imm\u00e9diatement le crit\u00e8re
de contraction.
+CONTRACTION_CRITERIA_SMALLER_THAN_EXPANSION_FACTOR = crit\u00e8re de contraction ({0}) inf\u00e9rieur
au facteur d''extension ({1}). Ceci induit une boucle infinie d''extensions/contractions car
tout tableau de stockage fra\u00eechement \u00e9tendu respecte imm\u00e9diatement le crit\u00e8re
de contraction.
 CONTRACTION_CRITERIA_SMALLER_THAN_ONE = crit\u00e8re de contraction inf\u00e9rieur \u00e0
un ({0}). Ceci induit une boucle infinie d''extensions/contractions car tout tableau de stockage
de longueur \u00e9gale au nombre d''\u00e9l\u00e9ments respecte le crit\u00e8re de contraction.
 CONVERGENCE_FAILED = \u00c9chec de convergence
 CUMULATIVE_PROBABILITY_RETURNED_NAN = Fonction de probabilit\u00e9 cumulative retourn\u00e9
NaN \u00e0 l''argument de {0} p = {1}
@@ -100,6 +104,7 @@ MAP_MODIFIED_WHILE_ITERATING = la table 
 MAX_EVALUATIONS_EXCEEDED = nombre maximal d''\u00e9valuations ({0}) d\u00e9pass\u00e9
 MAX_ITERATIONS_EXCEEDED = nombre maximal d''it\u00e9rations ({0}) d\u00e9pass\u00e9
 MINIMAL_STEPSIZE_REACHED_DURING_INTEGRATION = pas minimal ({0,number,0.00E00}) atteint, l''int\u00e9gration
n\u00e9cessite {1,number,0.00E00}
+NAN_ELEMENT_AT_INDEX = l''\u00e9l\u00e9ment {0} est un NaN
 NAN_VALUE_CONVERSION = les valeurs NaN ne peuvent \u00eatre converties
 NEGATIVE_BRIGHTNESS_EXPONENT = l''exposant de brillance devrait \u00eatre positif ou null,
or e = {0}
 NEGATIVE_COMPLEX_MODULE = module n\u00e9gatif ({0}) pour un nombre complexe
@@ -168,7 +173,7 @@ NULL_DENOMINATOR_FORMAT = le format du d
 NULL_FRACTION = fraction nulle
 NULL_FUNCTION = la fonction est nulle
 NULL_IMAGINARY_FORMAT = format imaginaire nul
-NULL_INPUT_ARRAY = le tableau des valeurs d''entr\u00e9es est nul
+NULL_INPUT_ARRAY = tableau d''entr\u00e9e nul
 NULL_NUMERATOR = le num\u00e9rateur est null
 NULL_NUMERATOR_FORMAT = le format du num\u00e9rateur ne doit pas \u00eatre nul
 NULL_OBJECT_TRANSFORMATION = Exception de conversion dans une transformation, l''objet est
nul
@@ -190,6 +195,7 @@ POLYNOMIAL_INTERPOLANTS_MISMATCH_SEGMENT
 POSITION_SIZE_MISMATCH_INPUT_ARRAY = la position {0} et la taille {1} sont incompatibles
avec la taille du tableau d''entr\u00e9e {2}
 POWER_NEGATIVE_PARAMETERS = impossible d''\u00e9lever une valeur enti\u00e8re 
 PROPAGATION_DIRECTION_MISMATCH = directions de propagation incoh\u00e9rentes
+RANDOMKEY_MUTATION_WRONG_CLASS = RandomKeyMutation ne fonctionne qu''avec la classe RandomKeys,
pas avec {0}
 ROOTS_OF_UNITY_NOT_COMPUTED_YET = les racines de l''unit\u00e9 n''ont pas encore \u00e9t\u00e9
calcul\u00e9es
 ROTATION_MATRIX_DIMENSIONS = une matrice {0}x{1} ne peut pas \u00eatre une matrice de rotation
 SAMPLE_SIZE_EXCEEDS_COLLECTION_SIZE = la taille de l''\u00e9chantillon ({0}) d\u00e9passe
la taille de la collection ({1})
@@ -215,11 +221,16 @@ UNABLE_TO_PERFORM_QR_DECOMPOSITION_ON_JA
 UNABLE_TO_SOLVE_SINGULAR_PROBLEM = r\u00e9solution impossible : probl\u00e8me singulier
 UNBOUNDED_SOLUTION = solution non born\u00e9e
 UNKNOWN_MODE = mode {0} inconnu, modes connus : {1} ({2}), {3} ({4}), {5} ({6}), {7} ({8}),
{9} ({10}) et {11} ({12})
+UNPARSEABLE_3D_VECTOR = vecteur 3D non analysable : "{0}"
+UNPARSEABLE_COMPLEX_NUMBER = nombre complexe non analysable : "{0}"
+UNPARSEABLE_FRACTION_NUMBER = nombre fractionnaire non analysable : "{0}"
+UNPARSEABLE_REAL_VECTOR = vecteur r\u00e9el non analysable : "{0}"
 UNSUPPORTED_EXPANSION_MODE = mode d''extension {0} no support\u00e9, les modes support\u00e9s
sont {1} ({2}) et {3} ({4})
 URL_CONTAINS_NO_DATA = l''adresse {0} ne contient aucune donn\u00e9e
 VALUES_ADDED_BEFORE_CONFIGURING_STATISTIC = {0} valeurs ont \u00e9t\u00e9 ajout\u00e9es 
 VECTOR_LENGTH_MISMATCH = taille de vecteur invalide : {0} au lieu de {1} attendue
 VECTOR_MUST_HAVE_AT_LEAST_ONE_ELEMENT = un vecteur doit comporter au moins un \u00e9l\u00e9ment
+WEIGHT_AT_LEAST_ONE_NON_ZERO = le tableau des poids doit contenir au moins une valeur non
nulle
 WRONG_BLOCK_LENGTH = forme de tableau erron\u00e9e (bloc de longueur {0} au lieu des {1}
attendus
 WRONG_NUMBER_OF_POINTS = {0} sont n\u00e9cessaires, seuls {1} ont \u00e9t\u00e9 fournis
 ZERO_DENOMINATOR = le d\u00e9nominateur doit \u00eatre diff\u00e9rent de 0



Mime
View raw message