/* See plotnd.h. */ /* Last edited on 2011-09-15 17:59:41 by stolfilocal */ #include #include #include #include #include #include #include #include // #include // #include // #include // #include // #include // #include // #include #include #include #include void compute_nd_tent_ranges ( dg_dim_t d, /* Domain dimension. */ dg_pulse_family_t fam[], dg_pulse_t p[], double wd[], /* Widths of root cell. */ interval_t fr[] /* (Out) X-, Y-, and value ranges (rounded). */ ) { /* Get ranges of unidimensional tents and multiply them: */ fr[d] = (interval_t){{ 1.0, 1.0 }}; /* = the scalar 1.0 */ int ax; for (ax = 0; ax < d; ax++) { interval_t tr[2]; compute_1d_pulse_ranges(fam[ax].pkind, fam[ax].c, fam[ax].g, p.[ax].gsz, wd[ax], tr); fr[ax] = tr[0]; fr[d] = multiply_ranges(&(fr[d]), &(tr[1])); } } void compute_nd_common_tent_ranges ( dg_dim_t d, /* Domain dimension. */ dg_pulse_kind_t pkind[], /* Kind along each axis. */ dg_cont_t c[], /* Continuity class along each axis. */ dg_degree_t gmax[], /* Max degree along each axis. */ dg_grid_size_t gsz[], /* Number of grid cells along each axis. */ double wd[], /* Width of root cell along each axis. */ interval_t fr[] /* (Out) X-, Y-, and value ranges (integers actually). */ ) { /* Get common ranges of unidimensional tents and multiply them: */ fr[d] = (interval_t){{ 1.0, 1.0 }}; /* = scalar 1.0 */ int ax; for (ax = 0; ax < d; ax++) { interval_t vr[2] vr[0] = vr[1] = (interval_t){{ +INF, -INF }}; /* = empty */ dg_degree_t g; for (g = 0; g < gmax[ax]; g++) { interval_t tr[2]; compute_1d_common_pulse_ranges(c[ax], gsz[ax], wd[ax], tr); vr[0] = interval_join(&(vr[0]), &(tr[0])); vr[1] = interval_join(&(vr[1]), &(tr[1])); } fr[ax] = vr[0]; fr[d] = multiply_ranges(&(fr[d]), &(vr[1])); } }