PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ gidx_equals()

static bool gidx_equals ( GIDX *  a,
GIDX *  b 
)
static

Definition at line 430 of file gserialized_gist_nd.c.

References FALSE, gidx_dimensionality_check(), gidx_is_unknown(), and TRUE.

Referenced by gserialized_contains(), gserialized_gist_consistent_leaf(), gserialized_gist_picksplit(), and gserialized_gist_same().

431 {
432  int i;
433 
434  POSTGIS_DEBUG(5, "entered function");
435 
436  if ( (a == NULL) && (b == NULL) ) return TRUE;
437  if ( (a == NULL) || (b == NULL) ) return FALSE;
438 
439  if ( gidx_is_unknown(a) && gidx_is_unknown(b) )
440  return TRUE;
441 
442  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
443  return FALSE;
444 
445  /* Ensure 'a' has the most dimensions. */
447 
448  /* For all shared dimensions min(a) == min(b), max(a) == max(b) */
449  for (i = 0; i < GIDX_NDIMS(b); i++)
450  {
451  if ( GIDX_GET_MIN(a,i) != GIDX_GET_MIN(b,i) )
452  return FALSE;
453  if ( GIDX_GET_MAX(a,i) != GIDX_GET_MAX(b,i) )
454  return FALSE;
455  }
456  /* For all unshared dimensions min(a) == 0.0, max(a) == 0.0 */
457  for (i = GIDX_NDIMS(b); i < GIDX_NDIMS(a); i++)
458  {
459  if ( GIDX_GET_MIN(a,i) != 0.0 )
460  return FALSE;
461  if ( GIDX_GET_MAX(a,i) != 0.0 )
462  return FALSE;
463  }
464  return TRUE;
465 }
static bool gidx_is_unknown(const GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)
#define FALSE
Definition: dbfopen.c:168
#define TRUE
Definition: dbfopen.c:169
Here is the call graph for this function:
Here is the caller graph for this function: