public static class Function.Integral extends Function.Native3
apply_nxx(n,lo,x)
.
The Integral is done by Simpson's rule. Note that
(this(n))(lo)
is a Cts2Cts
.
Also see Cts2Cts.integral()
and Cts2Cts.make_integral()
.Function.Cts2Cts, Function.Derivative, Function.Integral, Function.Native, Function.Native2, Function.Native3
Value.Atomic, Value.Bool, Value.Char, Value.Chars, Value.Cts, Value.Defer, Value.Discrete, Value.Enum, Value.Inc_Or, Value.Int, Value.Lambda, Value.List, Value.Maybe, Value.Option, Value.Real, Value.Scannable, Value.Structured, Value.Triv, Value.Tuple
Modifier and Type | Field and Description |
---|---|
Function.Cts2Cts |
f
'This' Function.Integral is the Integral of 'f'.
|
Constructor and Description |
---|
Integral(Function f)
Construct the
Integral of Cts2Cts 'f'. |
Modifier and Type | Method and Description |
---|---|
double |
apply_nxx(int n,
double lo,
double x)
Integrate
f from 'lo' to 'x' in 'n' steps using
Simpson's rule; override it if there is a closed form. |
Function.Cts2Cts |
apply2(Value n,
Value lo)
Makes use of
apply_nxx(n,lo,x) . |
Value |
apply3(Value n,
Value lo,
Value x)
|
apply
public final Function.Cts2Cts f
public Function.Cts2Cts apply2(Value n, Value lo)
apply_nxx(n,lo,x)
.
Note, (this
(n))(lo) is a Cts2Cts the
derivative
of which is f
.
E.g., if f(z) = z say,
apply2
in class Function.Native3
public Value apply3(Value n, Value lo, Value x)
Integrate
f
from 'lo' to 'x' in 'n' steps. Method 'apply3' is what
makes Integral a Function.Native3
.
Makes use of apply_nxx(n,lo,x)
.apply3
in class Function.Native3
public double apply_nxx(int n, double lo, double x)
f
from 'lo' to 'x' in 'n' steps using
Simpson's rule; override it if there is a closed form.
'n' is forced to be ≥3, and odd.