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 805 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().

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