org.apache.commons.math.analysis
Class BrentSolverTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.apache.commons.math.analysis.BrentSolverTest
All Implemented Interfaces:
junit.framework.Test

public final class BrentSolverTest
extends junit.framework.TestCase

Testcase for UnivariateRealSolver. Because Brent-Dekker is guaranteed to converge in less than the default maximum iteration count due to bisection fallback, it is quite hard to debug. I include measured iteration counts plus one in order to detect regressions. On average Brent-Dekker should use 4..5 iterations for the default absolute accuracy of 10E-8 for sinus and the quintic function around zero, and 5..10 iterations for the other zeros.

Version:
$Revision: 536283 $ $Date: 2007-05-08 11:16:52 -0700 (Tue, 08 May 2007) $

Constructor Summary
BrentSolverTest(java.lang.String name)
           
 
Method Summary
static junit.framework.Test suite()
           
 void testBadEndpoints()
           
 void testInitialGuess()
           
 void testQuinticZero()
           
 void testSinZero()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BrentSolverTest

public BrentSolverTest(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

testSinZero

public void testSinZero()
                 throws org.apache.commons.math.MathException
Throws:
org.apache.commons.math.MathException

testQuinticZero

public void testQuinticZero()
                     throws org.apache.commons.math.MathException
Throws:
org.apache.commons.math.MathException

testBadEndpoints

public void testBadEndpoints()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testInitialGuess

public void testInitialGuess()
                      throws org.apache.commons.math.MathException
Throws:
org.apache.commons.math.MathException


Copyright © 2003-2008 The Apache Software Foundation. All Rights Reserved.