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 doubleLower limit of integration.private final doubleUpper limit of integration.private final intNumber of columns of quadrature result.private final MatrixSingleDimensionFunctionEvaluatorListenerListener to evaluate single dimension matrix functions at required points.private final intNumber of rows of quadrature result.private final com.irurueta.algebra.MatrixCurrent value of integral.private final com.irurueta.algebra.MatrixTemporary value storing summation of evaluations.private final com.irurueta.algebra.MatrixTemporary value storing evaluation at point "a".private final com.irurueta.algebra.MatrixTemporary value storing evaluation at point "b".private final com.irurueta.algebra.MatrixTemporary 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 TypeMethodDescriptiondoublegetA()Gets lower limit of integration.doublegetB()Gets upper limit of integration.protected intGets number of columns of quadrature result.protected intgetRows()Gets number of rows of quadrature result.com.irurueta.algebra.MatrixgetS()Gets current value of integral.getType()Gets type of quadrature.voidnext(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:
nextin 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:
getTypein classMatrixQuadrature- Returns:
- type of quadrature.
-
getRows
protected int getRows()Gets number of rows of quadrature result.- Specified by:
getRowsin classMatrixQuadrature- Returns:
- number of rows of quadrature result.
-
getColumns
protected int getColumns()Gets number of columns of quadrature result.- Specified by:
getColumnsin classMatrixQuadrature- Returns:
- number of columns of quadrature result.
-