Thiele's interpolation formula: Difference between revisions

Updated D entry
(Updated D entry)
(Updated D entry)
Line 357:
const real b, e, s;
 
auto range() const /*pure /*nothrow*/ {
return iota(b, e + s, s);
}
Line 383:
}
 
this(in real delegatefunction(real) pure nothrow f,
Domain d=Domain(0.0L, 1.55L, 0.05L))
immutable /*pure /*nothrow*/ {
auto xrng = d.range.array;
this(xrng.map!f.array, xrng);
Line 391:
 
auto rhoN(immutable(real)[] y, immutable(real)[] x)
pure /*nothrow*/ {
immutable int N = x.length;
auto p = new real[][](N, N);
Line 410:
 
void main() {
// canCan't pass sin, cos, and tan directly.
immutable tsin = immutable(Thiele)(x => x.sin);
immutable tcos = immutable(Thiele)(x => x.cos);
immutable ttan = immutable(Thiele)(x => x.tan);
 
writefln(" %d interpolating points\n", tsin.X.length);