PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ histogram_axis_allocation_guards()

static void histogram_axis_allocation_guards ( void  )
static

Definition at line 87 of file postgis/cunit/cu_tester.c.

88{
89 /* Baseline: evenly split a 10k target over two varying dimensions. */
90 CU_ASSERT_EQUAL(histogram_axis_cells(10000, 2, 0.5), 100);
91
92 /* Skewed axis ratios that collapse to tiny powers still return one cell. */
93 CU_ASSERT_EQUAL(histogram_axis_cells(10000, 2, 1e-9), 1);
94
95 /* Denormals, NaNs and negative ratios should not leak to the histogram. */
96 CU_ASSERT_EQUAL(histogram_axis_cells(10000, 2, NAN), 1);
97 CU_ASSERT_EQUAL(histogram_axis_cells(10000, 2, -0.5), 1);
98
99 /* Extremely aggressive ratios remain bounded by the square root of the budget. */
100 CU_ASSERT_EQUAL(histogram_axis_cells(INT_MAX, 2, 1.0), (int)sqrt((double)INT_MAX * 2.0));
101}
static int histogram_axis_cells(int histo_cells_target, int histo_ndims, double edge_ratio)
#define NAN
Definition lwgeodetic.h:37

References histogram_axis_cells(), and NAN.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function: