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

◆ nd_increment()

static int nd_increment ( ND_IBOX ibox,
int  ndims,
int *  counter 
)
inlinestatic

Given an n-d index array (counter), and a domain to increment it in (ibox) increment it by one, unless it's already at the max of the domain, in which case return false.

Definition at line 864 of file gserialized_estimate.c.

865{
866 int d = 0;
867
868 while ( d < ndims )
869 {
870 if ( counter[d] < ibox->max[d] )
871 {
872 counter[d] += 1;
873 break;
874 }
875 counter[d] = ibox->min[d];
876 d++;
877 }
878 /* That's it, cannot increment any more! */
879 if ( d == ndims )
880 return false;
881
882 /* Increment complete! */
883 return true;
884}
int max[ND_DIMS]
int min[ND_DIMS]

References ND_IBOX_T::max, and ND_IBOX_T::min.

Referenced by compute_gserialized_stats_mode(), estimate_join_selectivity(), and estimate_selectivity().

Here is the caller graph for this function: