PostGIS  2.3.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 809 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().

810 {
811  int d = 0;
812 
813  while ( d < ndims )
814  {
815  if ( counter[d] < ibox->max[d] )
816  {
817  counter[d] += 1;
818  break;
819  }
820  counter[d] = ibox->min[d];
821  d++;
822  }
823  /* That's it, cannot increment any more! */
824  if ( d == ndims )
825  return FALSE;
826 
827  /* Increment complete! */
828  return TRUE;
829 }
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: