Class Riemann
- java.lang.Object
-
- dev.nm.analysis.integration.univariate.riemann.Riemann
-
- All Implemented Interfaces:
Integrator
public class Riemann extends Object implements Integrator
This is a wrapper class that integrates a function by using an appropriate integrator together with Romberg's method. The integral can be definite or indefinite. For an indefinite integral, it requires the specification of a substitution rule (change of variable).- See Also:
- Wikipedia: Riemann integral
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getPrecision()
Get the convergence threshold.double
integrate(UnivariateRealFunction f, double a, double b)
Integrate function f from a to b, \[ \int_a^b\! f(x)\, dx \]double
integrate(UnivariateRealFunction f, double a, double b, SubstitutionRule change)
Integrate a function, f, from a to b possibly using change of variable.
-
-
-
Method Detail
-
integrate
public double integrate(UnivariateRealFunction f, double a, double b)
Description copied from interface:Integrator
Integrate function f from a to b, \[ \int_a^b\! f(x)\, dx \]- Specified by:
integrate
in interfaceIntegrator
- Parameters:
f
- a univariate functiona
- the lower limitb
- the upper limit- Returns:
- \(\int_a^b\! f(x)\, dx\)
-
integrate
public double integrate(UnivariateRealFunction f, double a, double b, SubstitutionRule change)
Integrate a function, f, from a to b possibly using change of variable.- Parameters:
f
- a univariate functiona
- the lower limitb
- the upper limitchange
- the substitution rule;null
for a definite integral (no singularity)- Returns:
- \(\int_a^b\! f(x)\, dx\)
-
getPrecision
public double getPrecision()
Description copied from interface:Integrator
Get the convergence threshold. The usage depends on the specific integrator. For example, for anIterativeIntegrator
, the integral is considered converged if the relative error of two successive sums is less than the threshold.- Specified by:
getPrecision
in interfaceIntegrator
- Returns:
- the precision
-
-