PostGIS  2.5.7dev-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 871 of file gserialized_estimate.c.

872 {
873  int d = 0;
874 
875  while ( d < ndims )
876  {
877  if ( counter[d] < ibox->max[d] )
878  {
879  counter[d] += 1;
880  break;
881  }
882  counter[d] = ibox->min[d];
883  d++;
884  }
885  /* That's it, cannot increment any more! */
886  if ( d == ndims )
887  return false;
888 
889  /* Increment complete! */
890  return true;
891 }
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: