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 doublegetPrecision()Get the convergence threshold.doubleintegrate(UnivariateRealFunction f, double a, double b)Integrate function f from a to b, \[ \int_a^b\! f(x)\, dx \]doubleintegrate(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:IntegratorIntegrate function f from a to b, \[ \int_a^b\! f(x)\, dx \]- Specified by:
integratein 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;nullfor a definite integral (no singularity)- Returns:
- \(\int_a^b\! f(x)\, dx\)
-
getPrecision
public double getPrecision()
Description copied from interface:IntegratorGet 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:
getPrecisionin interfaceIntegrator- Returns:
- the precision
-
-