Class TrapezoidalMatrixQuadrature
java.lang.Object
com.irurueta.numerical.integration.MatrixQuadrature
com.irurueta.numerical.integration.TrapezoidalMatrixQuadrature
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
FieldsModifier and TypeFieldDescriptionprivate final double
Lower limit of integration.private final double
Upper limit of integration.private final int
Number of columns of quadrature result.private final MatrixSingleDimensionFunctionEvaluatorListener
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
ConstructorsConstructorDescriptionTrapezoidalMatrixQuadrature
(double a, double b, MatrixSingleDimensionFunctionEvaluatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getA()
Gets lower limit of integration.double
getB()
Gets upper limit of integration.protected int
Gets number of columns of quadrature result.protected int
getRows()
Gets number of rows of quadrature result.com.irurueta.algebra.Matrix
getS()
Gets current value of integral.getType()
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
-
Field Details
-
a
private final double aLower limit of integration. -
b
private final double bUpper limit of integration. -
rows
private final int rowsNumber of rows of quadrature result. -
columns
private final int columnsNumber of columns of quadrature result. -
s
private final com.irurueta.algebra.Matrix sCurrent value of integral. -
listener
Listener to evaluate single dimension matrix functions at required points. -
tmpA
private final com.irurueta.algebra.Matrix tmpATemporary value storing evaluation at point "a". -
tmpB
private final com.irurueta.algebra.Matrix tmpBTemporary value storing evaluation at point "b". -
sum
private final com.irurueta.algebra.Matrix sumTemporary value storing summation of evaluations. -
tmpX
private final com.irurueta.algebra.Matrix tmpXTemporary 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
Returns the value of the integral at the nth stage of refinement.- Specified by:
next
in classMatrixQuadrature
- 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
Gets type of quadrature.- Specified by:
getType
in classMatrixQuadrature
- Returns:
- type of quadrature.
-
getRows
protected int getRows()Gets number of rows of quadrature result.- Specified by:
getRows
in classMatrixQuadrature
- Returns:
- number of rows of quadrature result.
-
getColumns
protected int getColumns()Gets number of columns of quadrature result.- Specified by:
getColumns
in classMatrixQuadrature
- Returns:
- number of columns of quadrature result.
-