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

◆ histogram_axis_cells()

static int histogram_axis_cells ( int  histo_cells_target,
int  histo_ndims,
double  edge_ratio 
)
inlinestatic

Definition at line 166 of file gserialized_estimate_support.h.

167{
168 double scaled;
169 double axis_cells;
170
171 if (histo_cells_target <= 0 || histo_ndims <= 0)
172 return 1;
173
174 if (!(edge_ratio > 0.0) || !isfinite(edge_ratio))
175 return 1;
176
177 scaled = (double)histo_cells_target * (double)histo_ndims * edge_ratio;
178 if (!(scaled > 0.0) || !isfinite(scaled))
179 return 1;
180
181 axis_cells = pow(scaled, 1.0 / (double)histo_ndims);
182 if (!(axis_cells > 0.0) || !isfinite(axis_cells))
183 return 1;
184
185 if (axis_cells >= (double)INT_MAX)
186 return INT_MAX;
187
188 if (axis_cells <= 1.0)
189 return 1;
190
191 return (int)axis_cells;
192}

Referenced by compute_gserialized_stats_mode(), and histogram_axis_allocation_guards().

Here is the caller graph for this function: