Return-Path: Delivered-To: apmail-commons-commits-archive@locus.apache.org Received: (qmail 11768 invoked from network); 16 Aug 2007 20:37:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Aug 2007 20:37:01 -0000 Received: (qmail 66043 invoked by uid 500); 16 Aug 2007 20:36:57 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 65744 invoked by uid 500); 16 Aug 2007 20:36:57 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 65735 invoked by uid 99); 16 Aug 2007 20:36:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 13:36:57 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 20:36:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 44A851A981A; Thu, 16 Aug 2007 13:36:37 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r566833 - in /commons/proper/math/trunk: src/test/org/apache/commons/math/analysis/ src/test/org/apache/commons/math/complex/ src/test/org/apache/commons/math/fraction/ src/test/org/apache/commons/math/linear/ src/test/org/apache/commons/ma... Date: Thu, 16 Aug 2007 20:36:35 -0000 To: commits@commons.apache.org From: luc@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070816203637.44A851A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: luc Date: Thu Aug 16 13:36:33 2007 New Revision: 566833 URL: http://svn.apache.org/viewvc?view=rev&rev=566833 Log: fixed numerous warnings in test code (unused fields/results, fields only set to null) Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionLagrangeFormTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionNewtonFormTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialSplineFunctionTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/complex/ComplexUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionFormatTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/linear/BigMatrixImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/linear/RealMatrixImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/random/AbstractRandomGeneratorTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/FrequencyTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/StatUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/DescriptiveStatisticsImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/DescriptiveStatisticsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/ListUnivariateImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/MixedListUnivariateImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/StatisticalSummaryValuesTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/descriptive/SummaryStatisticsImplTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/inference/TTestTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/inference/TestUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/stat/regression/SimpleRegressionTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/util/MathUtilsTest.java commons/proper/math/trunk/src/test/org/apache/commons/math/util/TestBean.java commons/proper/math/trunk/xdocs/changes.xml Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/LaguerreSolverTest.java Thu Aug 16 13:36:33 2007 @@ -169,7 +169,7 @@ try { // bad function UnivariateRealFunction f2 = new SinFunction(); - UnivariateRealSolver solver2 = new LaguerreSolver(f2); + new LaguerreSolver(f2); fail("Expecting IllegalArgumentException - bad function"); } catch (IllegalArgumentException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionLagrangeFormTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionLagrangeFormTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionLagrangeFormTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionLagrangeFormTest.java Thu Aug 16 13:36:33 2007 @@ -126,13 +126,12 @@ * Test of parameters for the polynomial. */ public void testParameters() throws Exception { - PolynomialFunctionLagrangeForm p; try { // bad input array length double x[] = { 1.0 }; double y[] = { 2.0 }; - p = new PolynomialFunctionLagrangeForm(x, y); + new PolynomialFunctionLagrangeForm(x, y); fail("Expecting IllegalArgumentException - bad input array length"); } catch (IllegalArgumentException ex) { // expected @@ -141,7 +140,7 @@ // mismatch input arrays double x[] = { 1.0, 2.0, 3.0, 4.0 }; double y[] = { 0.0, -4.0, -24.0 }; - p = new PolynomialFunctionLagrangeForm(x, y); + new PolynomialFunctionLagrangeForm(x, y); fail("Expecting IllegalArgumentException - mismatch input arrays"); } catch (IllegalArgumentException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionNewtonFormTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionNewtonFormTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionNewtonFormTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionNewtonFormTest.java Thu Aug 16 13:36:33 2007 @@ -125,13 +125,12 @@ * Test of parameters for the polynomial. */ public void testParameters() throws Exception { - PolynomialFunctionNewtonForm p; try { // bad input array length double a[] = { 1.0 }; double c[] = { 2.0 }; - p = new PolynomialFunctionNewtonForm(a, c); + new PolynomialFunctionNewtonForm(a, c); fail("Expecting IllegalArgumentException - bad input array length"); } catch (IllegalArgumentException ex) { // expected @@ -140,7 +139,7 @@ // mismatch input arrays double a[] = { 1.0, 2.0, 3.0, 4.0 }; double c[] = { 4.0, 3.0, 2.0, 1.0 }; - p = new PolynomialFunctionNewtonForm(a, c); + new PolynomialFunctionNewtonForm(a, c); fail("Expecting IllegalArgumentException - mismatch input arrays"); } catch (IllegalArgumentException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialFunctionTest.java Thu Aug 16 13:36:33 2007 @@ -132,13 +132,13 @@ /** - * tests the firstDerivative function by comparision + * tests the firstDerivative function by comparison * *

This will test the functions * f(x) = x^3 - 2x^2 + 6x + 3, g(x) = 3x^2 - 4x + 6 * and h(x) = 6x - 4 */ - public void testfirstDerivativeComparision() throws MathException { + public void testfirstDerivativeComparison() throws MathException { double[] f_coeff = { 3.0, 6.0, -2.0, 1.0 }; double[] g_coeff = { 6.0, -4.0, 3.0 }; double[] h_coeff = { -4.0, 6.0 }; @@ -155,9 +155,9 @@ assertEquals( f.derivative().value(-3.25), g.value(-3.25), tolerance ); // compare g' = h + assertEquals( g.derivative().value(Math.PI), h.value(Math.PI), tolerance ); + assertEquals( g.derivative().value(Math.E), h.value(Math.E), tolerance ); - - // compare f'' = h } } Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialSplineFunctionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialSplineFunctionTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialSplineFunctionTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/PolynomialSplineFunctionTest.java Thu Aug 16 13:36:33 2007 @@ -63,24 +63,21 @@ assertEquals(3, spline.getN()); try { // too few knots - spline = - new PolynomialSplineFunction(new double[] {0}, polynomials); + new PolynomialSplineFunction(new double[] {0}, polynomials); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // too many knots - spline = - new PolynomialSplineFunction(new double[] {0,1,2,3,4}, polynomials); + new PolynomialSplineFunction(new double[] {0,1,2,3,4}, polynomials); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // knots not increasing - spline = - new PolynomialSplineFunction(new double[] {0,1, 3, 2}, polynomials); + new PolynomialSplineFunction(new double[] {0,1, 3, 2}, polynomials); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImplTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImplTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImplTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverFactoryImplTest.java Thu Aug 16 13:36:33 2007 @@ -52,7 +52,7 @@ public void testNewBisectionSolverNull() { try { - UnivariateRealSolver solver = factory.newBisectionSolver(null); + factory.newBisectionSolver(null); fail(); } catch(IllegalArgumentException ex) { // success @@ -67,7 +67,7 @@ public void testNewNewtonSolverNull() { try { - UnivariateRealSolver solver = factory.newNewtonSolver(null); + factory.newNewtonSolver(null); fail(); } catch(IllegalArgumentException ex) { // success @@ -82,7 +82,7 @@ public void testNewBrentSolverNull() { try { - UnivariateRealSolver solver = factory.newBrentSolver(null); + factory.newBrentSolver(null); fail(); } catch(IllegalArgumentException ex) { // success @@ -97,7 +97,7 @@ public void testNewSecantSolverNull() { try { - UnivariateRealSolver solver = factory.newSecantSolver(null); + factory.newSecantSolver(null); fail(); } catch(IllegalArgumentException ex) { // success Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverUtilsTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverUtilsTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/analysis/UnivariateRealSolverUtilsTest.java Thu Aug 16 13:36:33 2007 @@ -40,20 +40,19 @@ public void testSolveBadParameters() throws MathException { try { // bad endpoints - double x = UnivariateRealSolverUtils.solve(sin,0.0, 4.0, 4.0); + UnivariateRealSolverUtils.solve(sin,0.0, 4.0, 4.0); } catch (IllegalArgumentException ex) { // expected } try { // bad accuracy - double x = UnivariateRealSolverUtils.solve(sin, 0.0, 4.0, 0.0); + UnivariateRealSolverUtils.solve(sin, 0.0, 4.0, 0.0); } catch (IllegalArgumentException ex) { // expected } } public void testSolveSin() throws MathException { - double x = UnivariateRealSolverUtils.solve(sin, 1.0, - 4.0); + double x = UnivariateRealSolverUtils.solve(sin, 1.0, 4.0); assertEquals(Math.PI, x, 1.0e-4); } @@ -76,8 +75,7 @@ public void testSolveNoRoot() throws MathException { try { - double x = UnivariateRealSolverUtils.solve(sin, 1.0, - 1.5); + UnivariateRealSolverUtils.solve(sin, 1.0, 1.5); fail("Expecting IllegalArgumentException "); } catch (IllegalArgumentException ex) { // expected @@ -93,8 +91,7 @@ public void testBracketCornerSolution() throws MathException { try { - double[] result = UnivariateRealSolverUtils.bracket(sin, - 1.5, 0, 2.0); + UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0); fail("Expecting ConvergenceException"); } catch (ConvergenceException ex) { // expected @@ -103,25 +100,25 @@ public void testBadParameters() throws MathException { try { // null function - double[] result = UnivariateRealSolverUtils.bracket(null, 1.5, 0, 2.0); + UnivariateRealSolverUtils.bracket(null, 1.5, 0, 2.0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // initial not between endpoints - double[] result = UnivariateRealSolverUtils.bracket(sin, 2.5, 0, 2.0); + UnivariateRealSolverUtils.bracket(sin, 2.5, 0, 2.0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // endpoints not valid - double[] result = UnivariateRealSolverUtils.bracket(sin, 1.5, 2.0, 1.0); + UnivariateRealSolverUtils.bracket(sin, 1.5, 2.0, 1.0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { // bad maximum iterations - double[] result = UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0, 0); + UnivariateRealSolverUtils.bracket(sin, 1.5, 0, 2.0, 0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/complex/ComplexUtilsTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/complex/ComplexUtilsTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/complex/ComplexUtilsTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/complex/ComplexUtilsTest.java Thu Aug 16 13:36:33 2007 @@ -39,7 +39,6 @@ private Complex infNegInf = new Complex(inf, negInf); private Complex infInf = new Complex(inf, inf); private Complex negInfNegInf = new Complex(negInf, negInf); - private Complex oneNaN = new Complex(1, nan); private Complex infNaN = new Complex(inf, nan); private Complex negInfNaN = new Complex(negInf, nan); private Complex nanInf = new Complex(nan, inf); @@ -48,11 +47,8 @@ private Complex nanZero = new Complex(nan, 0); private Complex infZero = new Complex(inf, 0); private Complex zeroInf = new Complex(0, inf); - private Complex zeroNegInf = new Complex(0, negInf); private Complex negInfZero = new Complex(negInf, 0); - private ComplexFormat fmt = new ComplexFormat(); - public void testAcos() { Complex z = new Complex(3, 4); Complex expected = new Complex(0.936812, -2.30551); @@ -78,7 +74,7 @@ public void testAcosNull() { try { - Complex z = ComplexUtils.acos(null); + ComplexUtils.acos(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -108,7 +104,7 @@ public void testAsinNull() { try { - Complex z = ComplexUtils.asin(null); + ComplexUtils.asin(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -139,7 +135,7 @@ public void testAtanNull() { try { - Complex z = ComplexUtils.atan(null); + ComplexUtils.atan(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -169,7 +165,7 @@ public void testCosNull() { try { - Complex z = ComplexUtils.cos(null); + ComplexUtils.cos(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -199,7 +195,7 @@ public void testCoshNull() { try { - Complex z = ComplexUtils.cosh(null); + ComplexUtils.cosh(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -234,7 +230,7 @@ public void testExpNull() { try { - Complex z = ComplexUtils.exp(null); + ComplexUtils.exp(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -275,7 +271,7 @@ public void testlogNull() { try { - Complex z = ComplexUtils.log(null); + ComplexUtils.log(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -318,7 +314,7 @@ public void testPolar2ComplexIllegalModulus() { try { - Complex z = ComplexUtils.polar2Complex(-1, 0); + ComplexUtils.polar2Complex(-1, 0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected @@ -405,13 +401,13 @@ public void testpowNull() { try { - Complex z = ComplexUtils.pow(null, Complex.ONE); + ComplexUtils.pow(null, Complex.ONE); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected } try { - Complex z = ComplexUtils.pow(Complex.ONE, null); + ComplexUtils.pow(Complex.ONE, null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -441,7 +437,7 @@ public void testSinNull() { try { - Complex z = ComplexUtils.sin(null); + ComplexUtils.sin(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -471,7 +467,7 @@ public void testsinhNull() { try { - Complex z = ComplexUtils.sinh(null); + ComplexUtils.sinh(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -539,7 +535,7 @@ public void testSqrtNull() { try { - Complex z = ComplexUtils.sqrt(null); + ComplexUtils.sqrt(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -558,7 +554,7 @@ public void testSqrt1zNull() { try { - Complex z = ComplexUtils.sqrt1z(null); + ComplexUtils.sqrt1z(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -593,7 +589,7 @@ public void testTanNull() { try { - Complex z = ComplexUtils.tan(null); + ComplexUtils.tan(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected @@ -627,7 +623,7 @@ public void testTanhNull() { try { - Complex z = ComplexUtils.tanh(null); + ComplexUtils.tanh(null); fail("Expecting NullPointerException"); } catch (NullPointerException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionFormatTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionFormatTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionFormatTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionFormatTest.java Thu Aug 16 13:36:33 2007 @@ -233,14 +233,14 @@ public void testParseProperInvalidMinus() { String source = "2 -2 / 3"; try { - Fraction c = properFormat.parse(source); + properFormat.parse(source); fail("invalid minus in improper fraction."); } catch (ParseException ex) { // expected } source = "2 2 / -3"; try { - Fraction c = properFormat.parse(source); + properFormat.parse(source); fail("invalid minus in improper fraction."); } catch (ParseException ex) { // expected Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/fraction/FractionTest.java Thu Aug 16 13:36:33 2007 @@ -280,7 +280,7 @@ Fraction f1 = new Fraction(3, 5); Fraction f2 = Fraction.ZERO; try { - Fraction f = f1.divide(f2); + f1.divide(f2); fail("expecting ArithmeticException"); } catch (ArithmeticException ex) {} @@ -417,7 +417,6 @@ public void testEqualsAndHashCode() { Fraction zero = new Fraction(0,1); Fraction nullFraction = null; - int zeroHash = zero.hashCode(); assertTrue( zero.equals(zero)); assertFalse(zero.equals(nullFraction)); assertFalse(zero.equals(new Double(0))); @@ -433,7 +432,7 @@ assertTrue(threeFourths.equals(Fraction.getReducedFraction(6, 8))); assertTrue(Fraction.ZERO.equals(Fraction.getReducedFraction(0, -1))); try { - Fraction f = Fraction.getReducedFraction(1, 0); + Fraction.getReducedFraction(1, 0); fail("expecting ArithmeticException"); } catch (ArithmeticException ex) { // expected 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?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- 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 Thu Aug 16 13:36:33 2007 @@ -170,38 +170,38 @@ assertClose("double, BigDecimal", m1, m3, Double.MIN_VALUE); assertClose("string, BigDecimal", m2, m3, Double.MIN_VALUE); try { - BigMatrix m4 = new BigMatrixImpl(new String[][] {{"0", "hello", "1"}}); + new BigMatrixImpl(new String[][] {{"0", "hello", "1"}}); fail("Expecting NumberFormatException"); } catch (NumberFormatException ex) { // expected } try { - BigMatrix m4 = new BigMatrixImpl(new String[][] {}); + new BigMatrixImpl(new String[][] {}); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { - BigMatrix m4 = new BigMatrixImpl(new String[][] {{},{}}); + new BigMatrixImpl(new String[][] {{},{}}); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { - BigMatrix m4 = new BigMatrixImpl(new String[][] {{"a", "b"},{"c"}}); + new BigMatrixImpl(new String[][] {{"a", "b"},{"c"}}); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { - BigMatrix m4 = new BigMatrixImpl(0, 1); + new BigMatrixImpl(0, 1); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected } try { - BigMatrix m4 = new BigMatrixImpl(1, 0); + new BigMatrixImpl(1, 0); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { // expected @@ -228,7 +228,7 @@ BigMatrixImpl m = new BigMatrixImpl(testData); BigMatrixImpl m2 = new BigMatrixImpl(testData2); try { - BigMatrixImpl mPlusMInv = (BigMatrixImpl)m.add(m2); + m.add(m2); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -250,7 +250,7 @@ assertClose("m-n = m + -n",m.subtract(m2), m2.scalarMultiply(new BigDecimal(-1d)).add(m),entryTolerance); try { - BigMatrix a = m.subtract(new BigMatrixImpl(testData2)); + m.subtract(new BigMatrixImpl(testData2)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -274,7 +274,7 @@ assertClose("identity multiply",m2.multiply(identity), m2,entryTolerance); try { - BigMatrix a = m.multiply(new BigMatrixImpl(bigSingular)); + m.multiply(new BigMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -342,26 +342,26 @@ asDouble(m.solve(asBigDecimal(testVector))), normTolerance); try { - double[] x = asDouble(m.solve(asBigDecimal(testVector2))); + asDouble(m.solve(asBigDecimal(testVector2))); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { ; } BigMatrix bs = new BigMatrixImpl(bigSingular); try { - BigMatrix a = bs.solve(bs); + bs.solve(bs); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { ; } try { - BigMatrix a = m.solve(bs); + m.solve(bs); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { ; } try { - BigMatrix a = (new BigMatrixImpl(testData2)).solve(bs); + new BigMatrixImpl(testData2).solve(bs); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -388,7 +388,7 @@ assertEquals("nonsingular R test 2",-1d,m.getDeterminant().doubleValue(),normTolerance); try { - double a = new BigMatrixImpl(testData2).getDeterminant().doubleValue(); + new BigMatrixImpl(testData2).getDeterminant().doubleValue(); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { ; @@ -401,7 +401,7 @@ assertEquals("identity trace",3d,m.getTrace().doubleValue(),entryTolerance); m = new BigMatrixImpl(testData2); try { - double x = m.getTrace().doubleValue(); + m.getTrace().doubleValue(); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -422,7 +422,7 @@ assertClose("identity operate",testVector,x,entryTolerance); m = new BigMatrixImpl(bigSingular); try { - x = asDouble(m.operate(asBigDecimal(testVector))); + asDouble(m.operate(asBigDecimal(testVector))); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -461,7 +461,7 @@ BigMatrixImpl m = new BigMatrixImpl(testData); BigMatrixImpl mInv = new BigMatrixImpl(testDataInv); BigMatrixImpl identity = new BigMatrixImpl(id); - BigMatrixImpl m2 = new BigMatrixImpl(testData2); + new BigMatrixImpl(testData2); assertClose("inverse multiply",m.preMultiply(mInv), identity,entryTolerance); assertClose("inverse multiply",mInv.preMultiply(m), @@ -471,7 +471,7 @@ assertClose("identity multiply",identity.preMultiply(mInv), mInv,entryTolerance); try { - BigMatrix a = m.preMultiply(new BigMatrixImpl(bigSingular)); + m.preMultiply(new BigMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -483,13 +483,13 @@ assertClose("get row",m.getRowAsDoubleArray(0),testDataRow1,entryTolerance); assertClose("get col",m.getColumnAsDoubleArray(2),testDataCol3,entryTolerance); try { - double[] x = m.getRowAsDoubleArray(10); + m.getRowAsDoubleArray(10); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { ; } try { - double[] x = m.getColumnAsDoubleArray(-1); + m.getColumnAsDoubleArray(-1); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { ; 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?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- 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 Thu Aug 16 13:36:33 2007 @@ -141,7 +141,7 @@ RealMatrixImpl m = new RealMatrixImpl(testData); RealMatrixImpl m2 = new RealMatrixImpl(testData2); try { - RealMatrixImpl mPlusMInv = (RealMatrixImpl)m.add(m2); + m.add(m2); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -163,7 +163,7 @@ assertClose("m-n = m + -n",m.subtract(m2), m2.scalarMultiply(-1d).add(m),entryTolerance); try { - RealMatrix a = m.subtract(new RealMatrixImpl(testData2)); + m.subtract(new RealMatrixImpl(testData2)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -187,7 +187,7 @@ assertClose("identity multiply",m2.multiply(identity), m2,entryTolerance); try { - RealMatrix a = m.multiply(new RealMatrixImpl(bigSingular)); + m.multiply(new RealMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -253,26 +253,26 @@ assertClose("inverse-operate",mInv.operate(testVector), m.solve(testVector),normTolerance); try { - double[] x = m.solve(testVector2); + m.solve(testVector2); fail("expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { ; } RealMatrix bs = new RealMatrixImpl(bigSingular); try { - RealMatrix a = bs.solve(bs); + bs.solve(bs); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { ; } try { - RealMatrix a = m.solve(bs); + m.solve(bs); fail("Expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { ; } try { - RealMatrix a = (new RealMatrixImpl(testData2)).solve(bs); + new RealMatrixImpl(testData2).solve(bs); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -299,7 +299,7 @@ assertEquals("nonsingular R test 2",-1d,m.getDeterminant(),normTolerance); try { - double a = new RealMatrixImpl(testData2).getDeterminant(); + new RealMatrixImpl(testData2).getDeterminant(); fail("Expecting InvalidMatrixException"); } catch (InvalidMatrixException ex) { ; @@ -312,7 +312,7 @@ assertEquals("identity trace",3d,m.getTrace(),entryTolerance); m = new RealMatrixImpl(testData2); try { - double x = m.getTrace(); + m.getTrace(); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -333,7 +333,7 @@ assertClose("identity operate",testVector,x,entryTolerance); m = new RealMatrixImpl(bigSingular); try { - x = m.operate(testVector); + m.operate(testVector); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -372,7 +372,6 @@ RealMatrixImpl m = new RealMatrixImpl(testData); RealMatrixImpl mInv = new RealMatrixImpl(testDataInv); RealMatrixImpl identity = new RealMatrixImpl(id); - RealMatrixImpl m2 = new RealMatrixImpl(testData2); assertClose("inverse multiply",m.preMultiply(mInv), identity,entryTolerance); assertClose("inverse multiply",mInv.preMultiply(m), @@ -382,7 +381,7 @@ assertClose("identity multiply",identity.preMultiply(mInv), mInv,entryTolerance); try { - RealMatrix a = m.preMultiply(new RealMatrixImpl(bigSingular)); + m.preMultiply(new RealMatrixImpl(bigSingular)); fail("Expecting illegalArgumentException"); } catch (IllegalArgumentException ex) { ; @@ -394,13 +393,13 @@ assertClose("get row",m.getRow(0),testDataRow1,entryTolerance); assertClose("get col",m.getColumn(2),testDataCol3,entryTolerance); try { - double[] x = m.getRow(10); + m.getRow(10); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { ; } try { - double[] x = m.getColumn(-1); + m.getColumn(-1); fail("expecting MatrixIndexException"); } catch (MatrixIndexException ex) { ; Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/AbstractRandomGeneratorTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/AbstractRandomGeneratorTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/random/AbstractRandomGeneratorTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/AbstractRandomGeneratorTest.java Thu Aug 16 13:36:33 2007 @@ -44,7 +44,7 @@ public void testNextInt() { try { - int x = testGenerator.nextInt(-1); + testGenerator.nextInt(-1); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; Modified: commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java?view=diff&rev=566833&r1=566832&r2=566833 ============================================================================== --- commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java (original) +++ commons/proper/math/trunk/src/test/org/apache/commons/math/random/RandomDataTest.java Thu Aug 16 13:36:33 2007 @@ -43,7 +43,6 @@ protected long smallSampleSize = 1000; protected double[] expected = {250,250,250,250}; protected int largeSampleSize = 10000; - private int tolerance = 50; private String[] hex = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; protected RandomDataImpl randomData = null; @@ -73,7 +72,7 @@ /** test dispersion and failure modes for nextInt() */ public void testNextInt() { try { - int x = randomData.nextInt(4,3); + randomData.nextInt(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -100,7 +99,7 @@ /** test dispersion and failure modes for nextLong() */ public void testNextLong() { try { - long x = randomData.nextLong(4,3); + randomData.nextLong(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -127,7 +126,7 @@ /** test dispersion and failure modes for nextSecureLong() */ public void testNextSecureLong() { try { - long x = randomData.nextSecureLong(4,3); + randomData.nextSecureLong(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -154,7 +153,7 @@ /** test dispersion and failure modes for nextSecureInt() */ public void testNextSecureInt() { try { - long x = randomData.nextSecureInt(4,3); + randomData.nextSecureInt(4,3); fail("IllegalArgumentException expected"); } catch (IllegalArgumentException ex) { ; @@ -186,13 +185,12 @@ */ public void testNextPoisson() { try { - long x = randomData.nextPoisson(0); + randomData.nextPoisson(0); fail("zero mean -- expecting IllegalArgumentException"); } catch (IllegalArgumentException ex) { ; } Frequency f = new Frequency(); - long v = 0; for (int i = 0; i + + Fixed numerous warnings in test code. + Use the initial guess provided by the user in BrentSolver.solve(), thus improving speed. - + Added the estimation optimization, geometry and ode package from the Mantissa library.