#ifndef testinterp_H #define testinterp_H /* Definitions for testinterp.c */ /* Last edited on 2005-02-02 19:52:34 by stolfi */ typedef struct tap_options_t { char *funcName; /* Name of function to approximate. */ char *outName; /* Prefix for output file names. */ dg_Dim dDim; /* Dimension of domain space. */ dg_Dim fDim; /* Dimension of range space. */ dg_Degree g; /* Degree of splines. */ dg_Cont c; /* Continuity order of splines. */ int nPts; /* Number of data points. */ bool wide; /* TRUE uses a wide basis, FALSE (default) narrow. */ /* Plotting options: */ bool plot; /* TRUE to generate function and error plots. */ Plot_options_t plt; /* Plot format and style options. */ } tin_options_t; int main(int argc, char **argv); tin_options_t *tin_get_options(int argn, char **argc); dg_Node *tin_make_grid(dg_Dim d, dg_Rank maxDepth, bz_Patch *b); /* Creates a random finite dyadic grid of dimension {d} and maximum depth {maxDepth}, whose root cell has shape {b}. */ PSStream *tin_init_plot ( char *name, bool epsformat, char *paperSize, dg_Interval bbox[] ); /* Opens a Postscript plotfile with given name, plus the appropriate extension (".eps" or ".ps"), and initializes it for plotting. The scales are set so that the rectangle {bbox[0] × bbox[1]} fits snugly in the available plotting area, with equal scales. */ dg_LocusProc tin_plot2D; /* Plots a leaf item of a finte multigrid. */ bz_Patch *tin_do_extract_face(bz_Patch *b, dg_FaceIndex f); /* Extracts face {f} of the Bezier patch {b} and stores it into a newly allocated record. */ void tin_finish_plot ( PSStream *ps, bool epsformat ); /* Finalizes and closes the Postscript plotfile {f}. */ void tin_slow_plot(PSStream *ps, bz_Patch *b); void tin_slow_plot_vertex(PSStream *ps, bz_Patch *b, int steps); void tin_slow_plot_edge(PSStream *ps, bz_Patch *b, int steps); void tin_slow_plot_face(PSStream *ps, bz_Patch *b, int steps, double R, double G, double B); /* Slow and dumb plotting routines, for debugging. */ double tin_tol(double x, double y); /* Maximum box radius allowed near {p}. */ double tin_inside(double x, double y, double rad); /* TRUE if a box of radius {rad} centered at {p} intersects the desired domain. */ double tin_dsoft(double dx, double dy, double eps); /* Length of {(dx,dy)}, cooked to be at least {eps}. */ void tin_test_plot(char *name, bz_Degree g, bz_RDim n, dg_Rank treeDp, dg_Rank plotDp); /* Tests of plotting routines, with a root patch of degree {g}, a random tree of maximum depth {treeDp}, and maximum plotting split depth {plotDp}. */ #endif