PostGIS  2.4.9dev-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 833 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().

834 {
835  int d = 0;
836 
837  while ( d < ndims )
838  {
839  if ( counter[d] < ibox->max[d] )
840  {
841  counter[d] += 1;
842  break;
843  }
844  counter[d] = ibox->min[d];
845  d++;
846  }
847  /* That's it, cannot increment any more! */
848  if ( d == ndims )
849  return FALSE;
850 
851  /* Increment complete! */
852  return TRUE;
853 }
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: