PostGIS  2.1.10dev-r@@SVN_REVISION@@
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 780 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().

781 {
782  int d = 0;
783 
784  while ( d < ndims )
785  {
786  if ( counter[d] < ibox->max[d] )
787  {
788  counter[d] += 1;
789  break;
790  }
791  counter[d] = ibox->min[d];
792  d++;
793  }
794  /* That's it, cannot increment any more! */
795  if ( d == ndims )
796  return FALSE;
797 
798  /* Increment complete! */
799  return TRUE;
800 }
int min[ND_DIMS]
int max[ND_DIMS]
#define FALSE
Definition: dbfopen.c:169
#define TRUE
Definition: dbfopen.c:170

Here is the caller graph for this function: