df

df
(
size_t N
size_t M
T
E = T
)
(
Vector!(M, T) delegate(
in Vector!(N, T)
)
f
,
in Vector!(N, T) p
,
E step = E.epsilon * 10
)
if (
isFloatingPoint!T &&
isFloatingPoint!E
)

Examples

1 auto func( in dvec2 p ) { return dvec3( p.x^^2, sqrt(p.y) * p.x, 3 ); }
2 
3 auto res = df( &func, dvec2(18,9), 1e-5 );
4 auto must = Matrix!(3,2,double)( 36, 0, 3, 3, 0, 0 );
5 
6 assert( eq_approx( res.asArray, must.asArray, 1e-5 ) );

Meta