Class TrapezoidalMatrixQuadrature

java.lang.Object
com.irurueta.numerical.integration.MatrixQuadrature
com.irurueta.numerical.integration.TrapezoidalMatrixQuadrature

public class TrapezoidalMatrixQuadrature extends MatrixQuadrature
Implementation of matrix 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

    Fields
    Modifier and Type
    Field
    Description
    private final double
    Lower limit of integration.
    private final double
    Upper limit of integration.
    private final int
    Number of columns of quadrature result.
    Listener to evaluate single dimension matrix functions at required points.
    private final int
    Number of rows of quadrature result.
    private final com.irurueta.algebra.Matrix
    Current value of integral.
    private final com.irurueta.algebra.Matrix
    Temporary value storing summation of evaluations.
    private final com.irurueta.algebra.Matrix
    Temporary value storing evaluation at point "a".
    private final com.irurueta.algebra.Matrix
    Temporary value storing evaluation at point "b".
    private final com.irurueta.algebra.Matrix
    Temporary value storing evaluation at point x.

    Fields inherited from class com.irurueta.numerical.integration.MatrixQuadrature

    n
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets lower limit of integration.
    double
    Gets upper limit of integration.
    protected int
    Gets number of columns of quadrature result.
    protected int
    Gets number of rows of quadrature result.
    com.irurueta.algebra.Matrix
    Gets current value of integral.
    Gets type of quadrature.
    void
    next(com.irurueta.algebra.Matrix result)
    Returns the value of the integral at the nth stage of refinement.

    Methods inherited from class com.irurueta.numerical.integration.MatrixQuadrature

    getN

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • a

      private final double a
      Lower limit of integration.
    • b

      private final double b
      Upper limit of integration.
    • rows

      private final int rows
      Number of rows of quadrature result.
    • columns

      private final int columns
      Number of columns of quadrature result.
    • s

      private final com.irurueta.algebra.Matrix s
      Current value of integral.
    • listener

      Listener to evaluate single dimension matrix functions at required points.
    • tmpA

      private final com.irurueta.algebra.Matrix tmpA
      Temporary value storing evaluation at point "a".
    • tmpB

      private final com.irurueta.algebra.Matrix tmpB
      Temporary value storing evaluation at point "b".
    • sum

      private final com.irurueta.algebra.Matrix sum
      Temporary value storing summation of evaluations.
    • tmpX

      private final com.irurueta.algebra.Matrix tmpX
      Temporary value storing evaluation at point x.
  • Constructor Details

    • TrapezoidalMatrixQuadrature

      public TrapezoidalMatrixQuadrature(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener) throws com.irurueta.algebra.WrongSizeException
      Constructor.
      Parameters:
      a - Lower limit of integration.
      b - Upper limit of integration.
      listener - listener to evaluate a single dimension function at required points.
      Throws:
      com.irurueta.algebra.WrongSizeException - if size notified by provided listener is invalid.
  • 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 com.irurueta.algebra.Matrix getS()
      Gets current value of integral.
      Returns:
      current vlaue of integral.
    • next

      public void next(com.irurueta.algebra.Matrix result) throws EvaluationException
      Returns the value of the integral at the nth stage of refinement.
      Specified by:
      next in class MatrixQuadrature
      Parameters:
      result - instance where the value of the integral at the nth stage of refinement will be stored.
      Throws:
      EvaluationException - Raised if something failed during the evaluation.
    • getType

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

      protected int getRows()
      Gets number of rows of quadrature result.
      Specified by:
      getRows in class MatrixQuadrature
      Returns:
      number of rows of quadrature result.
    • getColumns

      protected int getColumns()
      Gets number of columns of quadrature result.
      Specified by:
      getColumns in class MatrixQuadrature
      Returns:
      number of columns of quadrature result.