PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ 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 781 of file gserialized_estimate.c.

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

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

782 {
783  int d = 0;
784 
785  while ( d < ndims )
786  {
787  if ( counter[d] < ibox->max[d] )
788  {
789  counter[d] += 1;
790  break;
791  }
792  counter[d] = ibox->min[d];
793  d++;
794  }
795  /* That's it, cannot increment any more! */
796  if ( d == ndims )
797  return FALSE;
798 
799  /* Increment complete! */
800  return TRUE;
801 }
int min[ND_DIMS]
int max[ND_DIMS]
#define FALSE
Definition: dbfopen.c:168
#define TRUE
Definition: dbfopen.c:169
Here is the caller graph for this function: