Class TrapezoidalQuadrature

java.lang.Object
com.irurueta.numerical.integration.Quadrature
com.irurueta.numerical.integration.TrapezoidalQuadrature

public class TrapezoidalQuadrature extends Quadrature
Implementation of quadrature using trapezoidal algorithm. This implementation is suitable for non-improper integrands, which consist of functions with not known singularities that can be evaluated on all the integration interval, which must be finite.
  • Field Details

    • a

      private final double a
      Lower limit of integration.
    • b

      private final double b
      Upper limit of integration.
    • s

      private double s
      Current value of integral.
    • listener

      Listener to evaluate single dimension functions at required points.
  • Constructor Details

    • TrapezoidalQuadrature

      public TrapezoidalQuadrature(double a, double b, SingleDimensionFunctionEvaluatorListener listener)
      Constructor.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
  • Method Details

    • getA

      public double getA()
      Gets lower limit of integration.
      Returns:
      lower limit of integration.
    • getB

      public double getB()
      Gets upper limit of integration.
      Returns:
      upper limit of integration.
    • getS

      public double getS()
      Gets current value of integral.
      Returns:
      current value of integral.
    • next

      public double next() throws EvaluationException
      Returns the value of the integral at the nth stage of refinement.
      Specified by:
      next in class Quadrature
      Returns:
      the value of the integral at the nth stage of refinement.
      Throws:
      EvaluationException - Raised if something failed during the evaluation.
    • getType

      public QuadratureType getType()
      Gets type of quadrature.
      Specified by:
      getType in class Quadrature
      Returns:
      type of quadrature.