de.torstennahm.integrate
Class StopConditions.UntilAbsTol

java.lang.Object
  extended by de.torstennahm.integrate.StopConditions.UntilAbsTol
All Implemented Interfaces:
StopCondition
Enclosing class:
StopConditions

public static class StopConditions.UntilAbsTol
extends java.lang.Object
implements StopCondition

Signals the integration should be stopped if the specified absolute tolerance has been reached. That is, this class checks whether the error estimate has an absolute value equal to or less than the given tolerance.

If the check fails, the current number of function evaluations n will be stored. The next check will only be performed when the number of function evaluations is at least n*1.5. This is an effort to mitigate stopping bias: since an integration that is stopped will not be restarted, but an integration that is not stopped will be checked for stopping again, and since the error is an estimate underlying random fluctuations, the net effect is a premature stopping, which becomes worse the more often the error is sampled.


Constructor Summary
StopConditions.UntilAbsTol(double absoluteTolerance)
          Construct the stop condition.
 
Method Summary
 java.lang.String getConditionString()
          Returns a string describing the fulfillment of the condition.
 boolean stop(IntegrationResult result)
          Returns true if the integration should be stopped because of this condition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StopConditions.UntilAbsTol

public StopConditions.UntilAbsTol(double absoluteTolerance)
Construct the stop condition.

Parameters:
absoluteTolerance - tolerance to be reached
Method Detail

stop

public boolean stop(IntegrationResult result)
Description copied from interface: StopCondition
Returns true if the integration should be stopped because of this condition.

Specified by:
stop in interface StopCondition
Parameters:
result - integration result
Returns:
true if condition is fulfilled

getConditionString

public java.lang.String getConditionString()
Description copied from interface: StopCondition
Returns a string describing the fulfillment of the condition. For example, if stopping when the error tolerance is below the requirement, the string might be "Error tolerance reached".

Specified by:
getConditionString in interface StopCondition
Returns:
string describing condition when it is fulfilled