/* Routines that generate the 2d figs for the dygrid papers. */ /* Last edited on 2011-09-15 18:34:09 by stolfilocal */ #ifndef figs2d_H #define figs2d_H #include #include #include #include // #include // #include // #include // #include // #include #include void figs2d_set_negative_color ( double R, double G, double B ); void figs2d_set_zero_color ( double R, double G, double B ); void figs2d_set_positive_color ( double R, double G, double B ); /* These procedures set the RGB colors to be used for the negative end, zero point, and positive end of the color scales used for color-banding in 2D function plots. */ void figs_2d_full ( PlotOptions *o, char *tag, interval_t rootCell[], dg_rank_t max_rank ); /* Outputs several figures showing levels {0..maxRank} of the infinite 2D dyadic hierarchy with given {rootCell}. */ void figs_2d_tree ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], dg_rank_t max_rank ); /* Outputs several figures showing the finite 2D grid {G,rootCell}, and its levels {0..max_rank}. */ void fig_2d_full_level ( PlotOptions *o, char *tag, interval_t rootCell[], dg_rank_t rank ); /* Outputs a figure showing level {rank} of the infinite 2D dyadic hierarchy with given {rootCell}. */ void fig_2d_tree_leaves ( PlotOptions *o, char *tag, No *G, interval_t rootCell[] ); /* Outputs a figure showing the leaves of the given finite dyadic grid {G,rootCell}. */ void fig_2d_tree_level ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], dg_rank_t rank ); /* Outputs a figure showing level {rank} of the given finite dyadic grid {G,rootCell}. */ void fig_2d_bezier_array ( PlotOptions *o, char *tag, dg_degree_t g ); /* Outputs a figure showing the array of Bézier coefficients for a tensor polynomial of degree {g} in a rectangular cell. */ void fig_2d_bezier_constraints ( PlotOptions *o, char *tag, dg_cont_t c, dg_degree_t g ); /* Outputs a figure showing the degree-{g} and continuity-{c} constraints between four adjacent rectangular cells. */ void figs_2d_basis ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], psp_pulse_family_t fam[], bool_t superior ); /* Outputs several figures showing the basis of tensor splines with factors of families {fam[0..DIM-1]} for the grid {G,rootCell}. If {superior} is true, shows the superior (maximal-support) basis instead. */ void figs_2d_locus_tents ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], dg_locus_t E, psp_pulse_kind_t pkind, dg_cont_t c, dg_degree_t g ); /* Outputs several figures showing the tensor spline basis elements of degree-{g} and continuity-{c} associates with locus {E} in the grid {G,rootCell}. */ void figs_2d_mother_pulse_catalog ( PlotOptions *o, psp_pulse_kind_t pkind, dg_cont_t cMin, dg_cont_t cMax, dg_degree_t gOver ); /* Outputs several figures with plots of all bivariate mother tents with given kind {pkind}, some continuity {c}, and some degree {g}, on a toroidal grid with some size {gsz[0..DIM-1]}. The continuity {c} is varied between {cMin} and {cMax}. The degree {g} is varied from {gMin} to {gMin+gOver}, where {gMin} is determined by {pkind} and {c}. The grid size {gsz[0..DIM-1]} is that of level {r} of the infinite dyadic grid (see {dg_grid_size}); where {r} is increased from 0 up, until the first level where grid size along every axis is greater than the corresponding mother pulse's support size. Outputs a separate figure for each {c,g,r} combination, showing all mother tents superimposed, with fold-over. */ void figs_2d_mother_vertex_tent_set ( PlotOptions *o, char *tag, /* Tag for figure/file name. */ psp_pulse_kind_t pkind, /* Kind of basis. */ dg_cont_t c, /* Continuity order of basis element. */ dg_degree_t g, /* Degree of basis element. */ dg_grid_size_t gsz[], /* X- and Y-domain periods (number of grid intervals). */ interval_t fr[] /* X-, Y-, and function ranges of interest. */ ); /* Outputs several figures showing the graphs of the vertex-associated mother tensor spline basis of the given {pkind}, degree {g}, and continuity class {c}, with indices {0..(g-c-1)^2}. Assumes {g >= 2*c+1}, and periodic domain with period {gsz}. */ void fig_2d_loci ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], int nloc, dg_locus_t loc[] ); /* Outputs a figure showing all loci {loc[i]}, without their stars, for the dyadic grid {G,rootCell}. */ void fig_2d_locus_and_star ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], dg_locus_t E ); /* Outputs a figure showing the locus {E} and its star (hatched). for the dyadic grid {G,rootCell}. */ void fig_2d_tent ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], psp_pulse_kind_t pkind, dg_cont_t c, dg_degree_t g, dg_tent_t t ); /* Outputs a figure showing one fundamental spline (tent function) of degree {g} and continuity {c} for the dyadic grid {G,rootCell}; namely, the element specified by {t}. */ void fig_2d_sample_spline ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], psp_pulse_kind_t pkind, dg_cont_t c, dg_degree_t g, bool_t superior ); /* Outputs a figure showing a random spline of degree {g} and continuity {c} for the dyadic grid {G,rootCell}; namely, a random linear combination of the tent basis of that degree and continuity, and the specified {pkind}. If {superior} is true, uses the superior basis. */ void fig_2d_spline ( PlotOptions *o, char *tag, No *G, interval_t rootCell[], psp_pulse_kind_t pkind, dg_cont_t c, dg_degree_t g, int ntv, dg_tent_t tv[], int ncoef, double coef[], interval_t fr ); /* Outputs a figure showing a linear combination of the tents {tv} with coefficients {coef}. The tents are assumed to be of the specified {pkind}, degree {g} and continuity {c}, and be appropriate for the dyadic grid defined by {G,rootCell}. */ void fig_2d_mother_vertex_tent ( PlotOptions *o, char *tag, psp_pulse_kind_t pkind, dg_cont_t c, dg_degree_t g, psp_tent_mother_index_t tix, /* Index of tent in set. */ dg_grid_size_t gsz[], /* X- and Y-domain periods (number of grid intervals). */ interval_t fr[] /* X-, Y-, and function ranges of interest. */ ); /* Outputs a figure showing the fundamental mother spline (mother tent function) of degree {g}, continuity {c}, and index {tix}, associated to a vertex. For each axis {ax=0,1}, assumes that the grid has {gsz[ax]} cells of size 1, and that the plot interval is {fr[ax]}. The tent is folded over itself if {gsz[ax] = 1}. The nominal range of the function, for level set purposes, is assumed to be {fr[2]}. */ #endif