drasys.or.nonlinear
Class Simpsons
java.lang.Object
|
+--drasys.or.nonlinear.Simpsons
- Direct Known Subclasses:
- Integration
- public class Simpsons
- extends java.lang.Object
- implements IntegrationI, java.io.Serializable
An implementation of integration by Simpson's rule.
- See Also:
- Serialized Form
Method Summary |
double |
getEpsilon()
Get the relative error of the integration. |
int |
getMaxIterations()
Get the maximum number of iterations. |
double |
integrate(FunctionI function,
double lowerBound,
double upperBound)
Integrate the function argument between the lower and upper bounds using trapezoidal integration. |
void |
setEpsilon(double epsilon)
Set the relative error of the integration. |
void |
setMaxIterations(int maxIterations)
Set the maximum number of iterations. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Simpsons
public Simpsons()
setMaxIterations
public void setMaxIterations(int maxIterations)
- Set the maximum number of iterations.
- Specified by:
- setMaxIterations in interface IntegrationI
getMaxIterations
public int getMaxIterations()
- Get the maximum number of iterations.
- Specified by:
- getMaxIterations in interface IntegrationI
setEpsilon
public void setEpsilon(double epsilon)
- Set the relative error of the integration.
- Specified by:
- setEpsilon in interface IntegrationI
getEpsilon
public double getEpsilon()
- Get the relative error of the integration.
- Specified by:
- getEpsilon in interface IntegrationI
integrate
public double integrate(FunctionI function,
double lowerBound,
double upperBound)
throws AccuracyException
- Integrate the function argument between the lower and upper bounds using trapezoidal integration.
- Specified by:
- integrate in interface IntegrationI
- Throws:
- AccuracyException - if the desired accuracy can't be reached.
Copyright(C)1997-2000 by DRA Systems all rights reserved. OpsResearch.com