PostGIS 3.7.0dev-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 748 of file gserialized_estimate.c.

749{
750 int d = 0;
751
752 while (d < ndims)
753 {
754 if (counter[d] < ibox->max[d])
755 {
756 counter[d] += 1;
757 break;
758 }
759 counter[d] = ibox->min[d];
760 d++;
761 }
762 /* That's it, cannot increment any more! */
763 if (d == ndims)
764 return false;
765
766 /* Increment complete! */
767 return true;
768}

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: