PostGIS  2.5.1dev-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 865 of file gserialized_estimate.c.

References ND_IBOX_T::max, and ND_IBOX_T::min.

Referenced by compute_gserialized_stats_mode(), estimate_join_selectivity(), and estimate_selectivity().

866 {
867  int d = 0;
868 
869  while ( d < ndims )
870  {
871  if ( counter[d] < ibox->max[d] )
872  {
873  counter[d] += 1;
874  break;
875  }
876  counter[d] = ibox->min[d];
877  d++;
878  }
879  /* That's it, cannot increment any more! */
880  if ( d == ndims )
881  return false;
882 
883  /* Increment complete! */
884  return true;
885 }
int min[ND_DIMS]
int max[ND_DIMS]
Here is the caller graph for this function: