|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.torstennahm.integrate.Integrator<I>
public abstract class Integrator<I>
The integrator performs integration of the integrand until a specified condition is reached. The condition may for example be that a certain error tolerance has been reached. The implementing classes use various specific algorithms for numerical integration. Unless stated otherwise, integration is always performed over the unit cube [0,1]^d with the Lesbegue measure, where d is the dimension of the function.
Many integrators use quadrature formulas consisting of coordinates and weights.
See the package de.torstennahm.integrate.quadratureformula
.
Implementor's note:
Only the abstract method integrate
needs to be implemented.
All other methods refer to this method using specific stop conditions.
In the integrate
method, subclasses should perform an
open-ended process of integration, in which
the result of the integration is continually refined. At regular times, they
should check if the integration should be continued. For this, they store the
result of the integration so far in an IntegrationResult
instance
and pass it to the stop condition's stop
method.
If true
is returned, the integration stops
and the same IntegrationResult
instance for which the
stop condition was reached is passed back as final result of the integration. This assures
that the IntegrationResult
actually fulfills the stop condition.
StopConditions
Constructor Summary | |
---|---|
Integrator()
|
Method Summary | |
---|---|
IntegrationResult |
integrate(I integrand,
StopCondition condition)
Convenience method for integration run without visualizers. |
abstract IntegrationResult |
integrate(I integrand,
StopCondition condition,
java.util.List<Visualizer> visualizers)
Performs numerical integration of the integrand until the given condition is fulfilled. |
IntegrationResult |
integrateAbsTol(I integrand,
double absoluteTolerance)
Convenience method for integration until the absolute estimated error is less than than the specified threshold. |
IntegrationResult |
integrateAbsTol(I integrand,
double absoluteTolerance,
java.util.List<Visualizer> visualizers)
Convenience method for integration with visualizers until the absolute estimated error is less than than the specified threshold. |
IntegrationResult |
integrateByPoints(I integrand,
long evals)
Convenience method for integration until the specified number of evaluations has been reached. |
IntegrationResult |
integrateByPoints(I integrand,
long evals,
java.util.List<Visualizer> visualizers)
Convenience method for integration with visualizers until the specified number of evaluations has been reached. |
IntegrationResult |
integrateRelTol(I integrand,
double relativeTolerance)
Convenience method for integration until the absolute estimated error is less than than the specified threshold. |
IntegrationResult |
integrateRelTol(I integrand,
double relativeTolerance,
java.util.List<Visualizer> visualizers)
Convenience method for integration with visualizers until the relative estimated error is less than than the specified threshold. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Integrator()
Method Detail |
---|
public abstract IntegrationResult integrate(I integrand, StopCondition condition, java.util.List<Visualizer> visualizers) throws IntegrationFailedException
integrand
- object to be integratedcondition
- stop conditionvisualizers
- list of visualizers or null
for no visualization
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrate(I integrand, StopCondition condition) throws IntegrationFailedException
integrate(I, StopCondition, null)
.
integrand
- object to be integratedcondition
- stop condition
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateByPoints(I integrand, long evals) throws IntegrationFailedException
integrate(integrand, condition, null)
with StopConditions.UntilCallsReached
as condition.
For some integrators the number of evaluations may exceed
the requested number, but it will never be less than it.
integrand
- object to be integratedevals
- number of function evaluations
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateByPoints(I integrand, long evals, java.util.List<Visualizer> visualizers) throws IntegrationFailedException
integrate(integrand, condition, null)
with StopConditions.UntilCallsReached
as condition.
For some integrators the number of evaluations may exceed
the requested number, but it will never be less than it.
integrand
- object to be integratedevals
- number of evaluations
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateAbsTol(I integrand, double absoluteTolerance) throws IntegrationFailedException
integrate(I, StopCondition)
with StopConditions.UntilAbsTol
as condition.
Performs numerical integration of the integrand until
integrand
- object to be integratedabsoluteTolerance
- absolute tolerance to be reached
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateAbsTol(I integrand, double absoluteTolerance, java.util.List<Visualizer> visualizers) throws IntegrationFailedException
integrate(I, StopCondition, List)
with StopConditions.UntilAbsTol
as condition.
Performs numerical integration of the integrand until
integrand
- object to be integratedabsoluteTolerance
- absolute tolerance to be reachedvisualizers
- list of visualizers or null
for no visualization
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateRelTol(I integrand, double relativeTolerance) throws IntegrationFailedException
integrate(I, StopCondition)
with StopConditions.UntilRelTol
as condition.
Performs numerical integration of the integrand until
integrand
- object to be integratedrelativeTolerance
- absolute tolerance to be reached
IntegrationFailedException
- if an integration error occurspublic IntegrationResult integrateRelTol(I integrand, double relativeTolerance, java.util.List<Visualizer> visualizers) throws IntegrationFailedException
integrate(I, StopCondition)
with StopConditions.UntilRelTol
as condition.
Performs numerical integration of the integrand until
integrand
- object to be integratedrelativeTolerance
- absolute tolerance to be reachedvisualizers
- list of visualizers or null
for no visualization
IntegrationFailedException
- if an integration error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |