Anonymous user
Thiele's interpolation formula: Difference between revisions
m
→{{header|D}}: change to use array operation instead of for-looping
m (→{{header|D}}: better naming) |
m (→{{header|D}}: change to use array operation instead of for-looping) |
||
Line 154:
=={{header|D}}==
{{works with|D|2.051}}
<lang d>import std.stdio, std.range, std.array, std.
alias real delegate(real) RealFun ;
Line 182:
auto xrng = array(d.range) ;
real[] yfun ;
foreach(x;
this(yfun, xrng) ;
}
Line 189:
int N = x.length;
real[][] p = new real[][] (N, N) ;
p[1][0..$-1] = (x[0..$-1] - x[1..$]) / (p[
for(int
}
return
}
|