drasys.or.nonlinear
Class Trapezoidal

java.lang.Object
  |
  +--drasys.or.nonlinear.Trapezoidal

public class Trapezoidal
extends java.lang.Object
implements IntegrationI, java.io.Serializable

An implementation of the trapezoidal integration algorithm.

See Also:
Serialized Form

Constructor Summary
Trapezoidal()
           
 
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
 

Constructor Detail

Trapezoidal

public Trapezoidal()
Method Detail

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