org.apache.commons.math.analysis
Class UnivariateRealSolverImpl

java.lang.Object
  extended by org.apache.commons.math.analysis.UnivariateRealSolverImpl
All Implemented Interfaces:
java.io.Serializable, UnivariateRealSolver
Direct Known Subclasses:
BisectionSolver, BrentSolver, NewtonSolver, SecantSolver

public abstract class UnivariateRealSolverImpl
extends java.lang.Object
implements UnivariateRealSolver, java.io.Serializable

Provide a default implementation for several functions useful to generic solvers.

See Also:
Serialized Form

Method Summary
 double getAbsoluteAccuracy()
          Get the actual absolute accuracy.
 double getFunctionValueAccuracy()
          Get the actual function value accuracy.
 int getIterationCount()
          Access the last iteration count.
 int getMaximalIterationCount()
          Get the upper limit for the number of iterations.
 double getRelativeAccuracy()
          Get the actual relative accuracy.
 double getResult()
          Access the last computed root.
 void resetAbsoluteAccuracy()
          Reset the absolute accuracy to the default.
 void resetFunctionValueAccuracy()
          Reset the actual function accuracy to the default.
 void resetMaximalIterationCount()
          Reset the upper limit for the number of iterations to the default.
 void resetRelativeAccuracy()
          Reset the relative accuracy to the default.
 void setAbsoluteAccuracy(double accuracy)
          Set the absolute accuracy.
 void setFunctionValueAccuracy(double accuracy)
          Set the function value accuracy.
 void setMaximalIterationCount(int count)
          Set the upper limit for the number of iterations.
 void setRelativeAccuracy(double accuracy)
          Set the relative accuracy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.analysis.UnivariateRealSolver
solve, solve
 

Method Detail

getResult

public double getResult()
Access the last computed root.

Specified by:
getResult in interface UnivariateRealSolver
Returns:
the last computed root
Throws:
java.lang.IllegalStateException - if no root has been computed

getIterationCount

public int getIterationCount()
Access the last iteration count.

Specified by:
getIterationCount in interface UnivariateRealSolver
Returns:
the last iteration count
Throws:
java.lang.IllegalStateException - if no root has been computed

setAbsoluteAccuracy

public void setAbsoluteAccuracy(double accuracy)
Set the absolute accuracy.

Specified by:
setAbsoluteAccuracy in interface UnivariateRealSolver
Parameters:
accuracy - the accuracy.
Throws:
java.lang.IllegalArgumentException - if the accuracy can't be achieved by the solver or is otherwise deemed unreasonable.

getAbsoluteAccuracy

public double getAbsoluteAccuracy()
Get the actual absolute accuracy.

Specified by:
getAbsoluteAccuracy in interface UnivariateRealSolver
Returns:
the accuracy

resetAbsoluteAccuracy

public void resetAbsoluteAccuracy()
Reset the absolute accuracy to the default.

Specified by:
resetAbsoluteAccuracy in interface UnivariateRealSolver

setMaximalIterationCount

public void setMaximalIterationCount(int count)
Set the upper limit for the number of iterations.

Specified by:
setMaximalIterationCount in interface UnivariateRealSolver
Parameters:
count - maximum number of iterations

getMaximalIterationCount

public int getMaximalIterationCount()
Get the upper limit for the number of iterations.

Specified by:
getMaximalIterationCount in interface UnivariateRealSolver
Returns:
the actual upper limit

resetMaximalIterationCount

public void resetMaximalIterationCount()
Reset the upper limit for the number of iterations to the default.

Specified by:
resetMaximalIterationCount in interface UnivariateRealSolver
See Also:
UnivariateRealSolver.setMaximalIterationCount(int)

setRelativeAccuracy

public void setRelativeAccuracy(double accuracy)
Set the relative accuracy.

Specified by:
setRelativeAccuracy in interface UnivariateRealSolver
Parameters:
accuracy - the relative accuracy.
Throws:
java.lang.IllegalArgumentException - if the accuracy can't be achieved by the solver or is otherwise deemed unreasonable.

getRelativeAccuracy

public double getRelativeAccuracy()
Get the actual relative accuracy.

Specified by:
getRelativeAccuracy in interface UnivariateRealSolver
Returns:
the accuracy

resetRelativeAccuracy

public void resetRelativeAccuracy()
Reset the relative accuracy to the default.

Specified by:
resetRelativeAccuracy in interface UnivariateRealSolver

setFunctionValueAccuracy

public void setFunctionValueAccuracy(double accuracy)
Set the function value accuracy.

Specified by:
setFunctionValueAccuracy in interface UnivariateRealSolver
Parameters:
accuracy - the accuracy.
Throws:
java.lang.IllegalArgumentException - if the accuracy can't be achieved by the solver or is otherwise deemed unreasonable.

getFunctionValueAccuracy

public double getFunctionValueAccuracy()
Get the actual function value accuracy.

Specified by:
getFunctionValueAccuracy in interface UnivariateRealSolver
Returns:
the accuracy

resetFunctionValueAccuracy

public void resetFunctionValueAccuracy()
Reset the actual function accuracy to the default.

Specified by:
resetFunctionValueAccuracy in interface UnivariateRealSolver


jHepWork 1.1 (C) Chekanov