public class Function.Cts2Cts.Integral extends Function.Cts2Cts2Cts
f
from 'lo' to 'hi'. The key method is
apply_nxx(n,lo,x)
.
For use by Cts2Cts.make_integral()
and hence Cts2Cts.integral()
.
The Integral is performed numerically by Simpson's rule.
If there is a closed-form, F, for the indefinite
integral use exactIntegral(F)
.Function.Native.WithInverse
Function.Cts2Cts, Function.Cts2Cts2Cts, Function.CtsD2CtsD, Function.HasInverse, 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
'f' is a synonym for 'Cts2Cts.this' and 'this'
Integral is the (definite) Integral of 'f'.
|
Constructor and Description |
---|
Integral()
|
Modifier and Type | Method and Description |
---|---|
double |
apply_nxx(int n,
double lo,
double x)
|
Function.Cts2Cts |
apply_x(double lox)
Returns a Cts→Cts which (i) will take hix &
call
apply_xx(lox,hix) , and (ii) has
the Derivative f . |
double |
apply_xx(double lox,
double hix)
Calls
apply_nxx(n,lox,hix) with a small
default value of 'n' to integrate f numerically. |
Function.Cts2Cts |
apply(Value lo)
Calls
apply_x(lo.x()) . |
apply2
public final Function.Cts2Cts f
public Function.Cts2Cts apply(Value lo)
apply_x(lo.x())
. An Integral has
roughly the type Cts→Cts→Cts.apply
in class Function.Cts2Cts2Cts
public Function.Cts2Cts apply_x(double lox)
apply_xx(lox,hix)
, and (ii) has
the Derivative f
.public double apply_xx(double lox, double hix)
apply_nxx(n,lox,hix)
with a small
default value of 'n' to integrate f
numerically.
If you want to set 'n' yourself, override apply_xx and/or
apply_nxx
.
(See exactIntegral(F)
if there
is a closed-form for the indefinite integral.)apply_xx
in class Function.Cts2Cts2Cts
public double apply_nxx(int n, double lo, double x)
f
from 'lo' to 'x' numerically in 'n' steps
using Simpson's rule, called by apply_xx
.
Note, 'n' is forced to be ≥3, and odd. See
exactIntegral
if there is a
closed-form for the indefinite integral.