PostGIS  2.5.0dev-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 852 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().

853 {
854  int d = 0;
855 
856  while ( d < ndims )
857  {
858  if ( counter[d] < ibox->max[d] )
859  {
860  counter[d] += 1;
861  break;
862  }
863  counter[d] = ibox->min[d];
864  d++;
865  }
866  /* That's it, cannot increment any more! */
867  if ( d == ndims )
868  return false;
869 
870  /* Increment complete! */
871  return true;
872 }
int min[ND_DIMS]
int max[ND_DIMS]
Here is the caller graph for this function: