/* Enumerating the "true" zeros of a 2-argument function. */ /* Last edited on 2020-10-03 21:14:46 by jstolfi */ #ifndef zf2_flt_H #define zf2_flt_H #define _GNU_SOURCE #include #include #include typedef Float (zf2_flt_eval_func_t) (Float x, Float y); /* Type of a procedure that can be passed as the {eval} argument of {zf2_flt}, to evaluate the target function {F}. Given a point {(x,y)}, it should return the approximate value of {F(x,y)}, or NAN if that is not defined. */ typedef void (zf2_flt_report_func_t)(Float x[], Float y[], Float z[]); /* Type of a procedure that can be passed as the {report} argument of {zf2_flt}, to process a triangle where the function appears to have a zero. The vertices of the triangle are {(x[i],y[i]), and the corresponding function values are {z[i]} for {i} in {0..2}. */ void zf2_flt_grid( zf2_flt_eval_func_t *eval, zf2_flt_report_func_t *report, Interval xd, Interval yd, int nx, int ny ); /* The procedure evaluates {F} at the vertices and mid-cell points an {nx \times ny} regular cell grid, thus dividing each cell into four triangles. The {report} function is called to process each triangle. */ #endif