PostGIS  3.3.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 878 of file gserialized_estimate.c.

879 {
880  int d = 0;
881 
882  while ( d < ndims )
883  {
884  if ( counter[d] < ibox->max[d] )
885  {
886  counter[d] += 1;
887  break;
888  }
889  counter[d] = ibox->min[d];
890  d++;
891  }
892  /* That's it, cannot increment any more! */
893  if ( d == ndims )
894  return false;
895 
896  /* Increment complete! */
897  return true;
898 }
int max[ND_DIMS]
int min[ND_DIMS]

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: