Class TrapezoidalQuadrature
java.lang.Object
com.irurueta.numerical.integration.Quadrature
com.irurueta.numerical.integration.TrapezoidalQuadrature
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final doubleLower limit of integration.private final doubleUpper limit of integration.private final SingleDimensionFunctionEvaluatorListenerListener to evaluate single dimension functions at required points.private doubleCurrent value of integral.Fields inherited from class com.irurueta.numerical.integration.Quadrature
n -
Constructor Summary
ConstructorsConstructorDescriptionTrapezoidalQuadrature(double a, double b, SingleDimensionFunctionEvaluatorListener listener) Constructor. -
Method Summary
Methods inherited from class com.irurueta.numerical.integration.Quadrature
getN
-
Field Details
-
a
private final double aLower limit of integration. -
b
private final double bUpper limit of integration. -
s
private double sCurrent value of integral. -
listener
Listener to evaluate single dimension functions at required points.
-
-
Constructor Details
-
TrapezoidalQuadrature
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
Returns the value of the integral at the nth stage of refinement.- Specified by:
nextin classQuadrature- Returns:
- the value of the integral at the nth stage of refinement.
- Throws:
EvaluationException- Raised if something failed during the evaluation.
-
getType
Gets type of quadrature.- Specified by:
getTypein classQuadrature- Returns:
- type of quadrature.
-