org.apache.commons.math.analysis.solvers
Class MullerSolverTest

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

public final class MullerSolverTest
extends junit.framework.TestCase

Testcase for Muller solver.

Muller's method converges almost quadratically near roots, but it can be very slow in regions far away from zeros. Test runs show that for reasonably good initial values, for a default absolute accuracy of 1E-6, it generally takes 5 to 10 iterations for the solver to converge.

Tests for the exponential function illustrate the situations where Muller solver performs poorly.

Version:
$Revision: 799857 $ $Date: 2009-08-01 09:07:12 -0400 (Sat, 01 Aug 2009) $

Constructor Summary
MullerSolverTest()
           
 
Method Summary
 void testDeprecated()
          Deprecated. 
 void testDeprecated2()
          Deprecated. 
 void testExpm1Function()
          Test of solver for the exponential function.
 void testExpm1Function2()
          Test of solver for the exponential function using solve2().
 void testParameters()
          Test of parameters for the solver.
 void testQuinticFunction()
          Test of solver for the quintic function.
 void testQuinticFunction2()
          Test of solver for the quintic function using solve2().
 void testSinFunction()
          Test of solver for the sine function.
 void testSinFunction2()
          Test of solver for the sine function using solve2().
 
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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MullerSolverTest

public MullerSolverTest()
Method Detail

testDeprecated

@Deprecated
public void testDeprecated()
                    throws org.apache.commons.math.MathException
Deprecated. 

Test deprecated APIs.

Throws:
org.apache.commons.math.MathException

testDeprecated2

@Deprecated
public void testDeprecated2()
                     throws org.apache.commons.math.MathException
Deprecated. 

Test deprecated APIs.

Throws:
org.apache.commons.math.MathException

testSinFunction

public void testSinFunction()
                     throws org.apache.commons.math.MathException
Test of solver for the sine function.

Throws:
org.apache.commons.math.MathException

testSinFunction2

public void testSinFunction2()
                      throws org.apache.commons.math.MathException
Test of solver for the sine function using solve2().

Throws:
org.apache.commons.math.MathException

testQuinticFunction

public void testQuinticFunction()
                         throws org.apache.commons.math.MathException
Test of solver for the quintic function.

Throws:
org.apache.commons.math.MathException

testQuinticFunction2

public void testQuinticFunction2()
                          throws org.apache.commons.math.MathException
Test of solver for the quintic function using solve2().

Throws:
org.apache.commons.math.MathException

testExpm1Function

public void testExpm1Function()
                       throws org.apache.commons.math.MathException
Test of solver for the exponential function.

It takes 10 to 15 iterations for the last two tests to converge. In fact, if not for the bisection alternative, the solver would exceed the default maximal iteration of 100.

Throws:
org.apache.commons.math.MathException

testExpm1Function2

public void testExpm1Function2()
                        throws org.apache.commons.math.MathException
Test of solver for the exponential function using solve2().

It takes 25 to 50 iterations for the last two tests to converge.

Throws:
org.apache.commons.math.MathException

testParameters

public void testParameters()
                    throws Exception
Test of parameters for the solver.

Throws:
Exception


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.