commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1003355 - in /commons/proper/math/trunk/src/test/java/org/apache/commons/math: analysis/interpolation/ distribution/ optimization/ optimization/direct/ optimization/fitting/ optimization/general/
Date Fri, 01 Oct 2010 02:03:04 GMT
Author: sebb
Date: Fri Oct  1 02:03:04 2010
New Revision: 1003355

URL: http://svn.apache.org/viewvc?rev=1003355&view=rev
Log:
Unthrown Exceptions

Modified:
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/analysis/interpolation/TricubicSplineInterpolatingFunctionTest.java
Fri Oct  1 02:03:04 2010
@@ -33,7 +33,7 @@ public final class TricubicSplineInterpo
      * Test preconditions.
      */
     @Test
-    public void testPreconditions() throws MathException {
+    public void testPreconditions() throws Exception {
         double[] xval = new double[] {3, 4, 5, 6.5};
         double[] yval = new double[] {-4, -3, -1, 2.5};
         double[] zval = new double[] {-12, -8, -5.5, -3, 0, 2.5};

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/distribution/BetaDistributionTest.java
Fri Oct  1 02:03:04 2010
@@ -150,7 +150,7 @@ public class BetaDistributionTest extend
         }
     }
 
-    public void testDensity() throws MathException {
+    public void testDensity() {
         double[] x = new double[]{1e-6, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9};
         checkDensity(0.1, 0.1,
                 x, new double[]{
@@ -280,7 +280,7 @@ public class BetaDistributionTest extend
 
     }
 
-    private void checkDensity(double alpha, double beta, double[] x, double[] expected) throws
MathException {
+    private void checkDensity(double alpha, double beta, double[] x, double[] expected) {
         BetaDistribution d = new BetaDistributionImpl(alpha, beta);
         for (int i = 0; i < x.length; i++) {
             assertEquals(String.format("density at x=%.1f for alpha=%.1f, beta=%.1f", x[i],
alpha, beta), expected[i], d.density(x[i]), 1e-5);

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartDifferentiableMultivariateVectorialOptimizerTest.java
Fri Oct  1 02:03:04 2010
@@ -101,7 +101,7 @@ import org.junit.Test;
 public class MultiStartDifferentiableMultivariateVectorialOptimizerTest {
 
     @Test
-    public void testTrivial() throws FunctionEvaluationException, OptimizationException {
+    public void testTrivial() throws FunctionEvaluationException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
@@ -139,7 +139,7 @@ public class MultiStartDifferentiableMul
     }
 
     @Test(expected = ConvergenceException.class)
-    public void testNoOptimum() throws FunctionEvaluationException, OptimizationException
{
+    public void testNoOptimum() throws FunctionEvaluationException {
         DifferentiableMultivariateVectorialOptimizer underlyingOptimizer =
             new GaussNewtonOptimizer(true);
         JDKRandomGenerator g = new JDKRandomGenerator();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/MultiStartMultivariateRealOptimizerTest.java
Fri Oct  1 02:03:04 2010
@@ -20,7 +20,6 @@ package org.apache.commons.math.optimiza
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-import org.apache.commons.math.ConvergenceException;
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.optimization.direct.NelderMead;
@@ -34,7 +33,7 @@ public class MultiStartMultivariateRealO
 
   @Test
   public void testRosenbrock()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws FunctionEvaluationException {
 
     Rosenbrock rosenbrock = new Rosenbrock();
     NelderMead underlying = new NelderMead();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/direct/MultiDirectionalTest.java
Fri Oct  1 02:03:04 2010
@@ -17,11 +17,9 @@
 
 package org.apache.commons.math.optimization.direct;
 
-import org.apache.commons.math.ConvergenceException;
 import org.apache.commons.math.FunctionEvaluationException;
 import org.apache.commons.math.analysis.MultivariateRealFunction;
 import org.apache.commons.math.optimization.GoalType;
-import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.RealPointValuePair;
 import org.apache.commons.math.optimization.SimpleScalarValueChecker;
 import org.apache.commons.math.util.FastMath;
@@ -69,7 +67,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testMinimizeMaximize()
-      throws FunctionEvaluationException, ConvergenceException {
+      throws FunctionEvaluationException {
 
       // the following function has 4 local extrema:
       final double xM        = -3.841947088256863675365;
@@ -130,7 +128,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testRosenbrock()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws FunctionEvaluationException {
 
     MultivariateRealFunction rosenbrock =
       new MultivariateRealFunction() {
@@ -162,7 +160,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testPowell()
-    throws FunctionEvaluationException, ConvergenceException {
+    throws FunctionEvaluationException {
 
     MultivariateRealFunction powell =
       new MultivariateRealFunction() {
@@ -192,7 +190,7 @@ public class MultiDirectionalTest {
 
   @Test
   public void testMath283()
-      throws FunctionEvaluationException, OptimizationException {
+      throws FunctionEvaluationException {
       // fails because MultiDirectional.iterateSimplex is looping forever
       // the while(true) should be replaced with a convergence check
       MultiDirectional multiDirectional = new MultiDirectional();

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/fitting/CurveFitterTest.java
Fri Oct  1 02:03:04 2010
@@ -18,7 +18,6 @@
 package org.apache.commons.math.optimization.fitting;
 
 import org.apache.commons.math.FunctionEvaluationException;
-import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.general.LevenbergMarquardtOptimizer;
 import org.apache.commons.math.util.FastMath;
 import org.junit.Assert;
@@ -28,7 +27,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath303()
-        throws OptimizationException, FunctionEvaluationException {
+        throws FunctionEvaluationException {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -52,7 +51,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath304()
-        throws OptimizationException, FunctionEvaluationException {
+        throws FunctionEvaluationException {
 
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter fitter = new CurveFitter(optimizer);
@@ -75,7 +74,7 @@ public class CurveFitterTest {
 
     @Test
     public void testMath372()
-    throws OptimizationException, FunctionEvaluationException {
+    throws FunctionEvaluationException {
         LevenbergMarquardtOptimizer optimizer = new LevenbergMarquardtOptimizer();
         CurveFitter curveFitter = new CurveFitter(optimizer);
 

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java?rev=1003355&r1=1003354&r2=1003355&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
(original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math/optimization/general/NonLinearConjugateGradientOptimizerTest.java
Fri Oct  1 02:03:04 2010
@@ -31,7 +31,6 @@ import org.apache.commons.math.analysis.
 import org.apache.commons.math.linear.BlockRealMatrix;
 import org.apache.commons.math.linear.RealMatrix;
 import org.apache.commons.math.optimization.GoalType;
-import org.apache.commons.math.optimization.OptimizationException;
 import org.apache.commons.math.optimization.RealPointValuePair;
 import org.apache.commons.math.optimization.SimpleScalarValueChecker;
 
@@ -104,7 +103,7 @@ extends TestCase {
         super(name);
     }
 
-    public void testTrivial() throws FunctionEvaluationException, OptimizationException {
+    public void testTrivial() throws FunctionEvaluationException {
         LinearProblem problem =
             new LinearProblem(new double[][] { { 2 } }, new double[] { 3 });
         NonLinearConjugateGradientOptimizer optimizer =
@@ -117,7 +116,7 @@ extends TestCase {
         assertEquals(0.0, optimum.getValue(), 1.0e-10);
     }
 
-    public void testColumnsPermutation() throws FunctionEvaluationException, OptimizationException
{
+    public void testColumnsPermutation() throws FunctionEvaluationException {
 
         LinearProblem problem =
             new LinearProblem(new double[][] { { 1.0, -1.0 }, { 0.0, 2.0 }, { 1.0, -2.0 }
},
@@ -135,7 +134,7 @@ extends TestCase {
 
     }
 
-    public void testNoDependency() throws FunctionEvaluationException, OptimizationException
{
+    public void testNoDependency() throws FunctionEvaluationException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 2, 0, 0, 0, 0, 0 },
                 { 0, 2, 0, 0, 0, 0 },
@@ -155,7 +154,7 @@ extends TestCase {
         }
     }
 
-    public void testOneSet() throws FunctionEvaluationException, OptimizationException {
+    public void testOneSet() throws FunctionEvaluationException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1,  0, 0 },
@@ -174,7 +173,7 @@ extends TestCase {
 
     }
 
-    public void testTwoSets() throws FunctionEvaluationException, OptimizationException {
+    public void testTwoSets() throws FunctionEvaluationException {
         final double epsilon = 1.0e-7;
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  2,  1,   0,  4,       0, 0 },
@@ -213,7 +212,7 @@ extends TestCase {
 
     }
 
-    public void testNonInversible() throws FunctionEvaluationException, OptimizationException
{
+    public void testNonInversible() throws FunctionEvaluationException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 {  1, 2, -3 },
@@ -229,7 +228,7 @@ extends TestCase {
         assertTrue(optimum.getValue() > 0.5);
     }
 
-    public void testIllConditioned() throws FunctionEvaluationException, OptimizationException
{
+    public void testIllConditioned() throws FunctionEvaluationException {
         LinearProblem problem1 = new LinearProblem(new double[][] {
                 { 10.0, 7.0,  8.0,  7.0 },
                 {  7.0, 5.0,  6.0,  5.0 },
@@ -267,7 +266,7 @@ extends TestCase {
     }
 
     public void testMoreEstimatedParametersSimple()
-        throws FunctionEvaluationException, OptimizationException {
+        throws FunctionEvaluationException {
 
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 3.0, 2.0,  0.0, 0.0 },
@@ -286,7 +285,7 @@ extends TestCase {
     }
 
     public void testMoreEstimatedParametersUnsorted()
-        throws FunctionEvaluationException, OptimizationException {
+        throws FunctionEvaluationException {
         LinearProblem problem = new LinearProblem(new double[][] {
                  { 1.0, 1.0,  0.0,  0.0, 0.0,  0.0 },
                  { 0.0, 0.0,  1.0,  1.0, 1.0,  0.0 },
@@ -303,7 +302,7 @@ extends TestCase {
         assertEquals(0, optimum.getValue(), 1.0e-10);
     }
 
-    public void testRedundantEquations() throws FunctionEvaluationException, OptimizationException
{
+    public void testRedundantEquations() throws FunctionEvaluationException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -321,7 +320,7 @@ extends TestCase {
 
     }
 
-    public void testInconsistentEquations() throws FunctionEvaluationException, OptimizationException
{
+    public void testInconsistentEquations() throws FunctionEvaluationException {
         LinearProblem problem = new LinearProblem(new double[][] {
                 { 1.0,  1.0 },
                 { 1.0, -1.0 },
@@ -338,7 +337,7 @@ extends TestCase {
 
     }
 
-    public void testCircleFitting() throws FunctionEvaluationException, OptimizationException
{
+    public void testCircleFitting() throws FunctionEvaluationException {
         Circle circle = new Circle();
         circle.addPoint( 30.0,  68.0);
         circle.addPoint( 50.0,  -6.0);



Mime
View raw message