PostGIS  2.1.10dev-r@@SVN_REVISION@@
static bool gidx_equals ( GIDX *  a,
GIDX *  b 
)
static

Definition at line 395 of file gserialized_gist_nd.c.

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

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

396 {
397  int i;
398 
399  POSTGIS_DEBUG(5, "entered function");
400 
401  if ( (a == NULL) && (b == NULL) ) return TRUE;
402  if ( (a == NULL) || (b == NULL) ) return FALSE;
403 
404  if ( gidx_is_unknown(a) && gidx_is_unknown(b) )
405  return TRUE;
406 
407  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
408  return FALSE;
409 
410  /* Ensure 'a' has the most dimensions. */
412 
413  /* For all shared dimensions min(a) == min(b), max(a) == max(b) */
414  for (i = 0; i < GIDX_NDIMS(b); i++)
415  {
416  if ( GIDX_GET_MIN(a,i) != GIDX_GET_MIN(b,i) )
417  return FALSE;
418  if ( GIDX_GET_MAX(a,i) != GIDX_GET_MAX(b,i) )
419  return FALSE;
420  }
421  /* For all unshared dimensions min(a) == 0.0, max(a) == 0.0 */
422  for (i = GIDX_NDIMS(b); i < GIDX_NDIMS(a); i++)
423  {
424  if ( GIDX_GET_MIN(a,i) != 0.0 )
425  return FALSE;
426  if ( GIDX_GET_MAX(a,i) != 0.0 )
427  return FALSE;
428  }
429  return TRUE;
430 }
static bool gidx_is_unknown(const GIDX *a)
static void gidx_dimensionality_check(GIDX **a, GIDX **b)
#define FALSE
Definition: dbfopen.c:169
#define TRUE
Definition: dbfopen.c:170

Here is the call graph for this function:

Here is the caller graph for this function: