PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ gidx_equals()

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

Definition at line 496 of file gserialized_gist_nd.c.

References gidx_dimensionality_check(), and gidx_is_unknown().

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

497 {
498  uint32_t i;
499 
500  POSTGIS_DEBUG(5, "entered function");
501 
502  if ( (a == NULL) && (b == NULL) ) return true;
503  if ( (a == NULL) || (b == NULL) ) return false;
504 
505  if ( gidx_is_unknown(a) && gidx_is_unknown(b) )
506  return true;
507 
508  if ( gidx_is_unknown(a) || gidx_is_unknown(b) )
509  return false;
510 
511  /* Ensure 'a' has the most dimensions. */
513 
514  /* For all shared dimensions min(a) == min(b), max(a) == max(b) */
515  for (i = 0; i < GIDX_NDIMS(b); i++)
516  {
517  if ( GIDX_GET_MIN(a,i) != GIDX_GET_MIN(b,i) )
518  return false;
519  if ( GIDX_GET_MAX(a,i) != GIDX_GET_MAX(b,i) )
520  return false;
521  }
522  /* For all unshared dimensions min(a) == 0.0, max(a) == 0.0 */
523  for (i = GIDX_NDIMS(b); i < GIDX_NDIMS(a); i++)
524  {
525  if ( GIDX_GET_MIN(a,i) != 0.0 )
526  return false;
527  if ( GIDX_GET_MAX(a,i) != 0.0 )
528  return false;
529  }
530  return true;
531 }
static void gidx_dimensionality_check(GIDX **a, GIDX **b)
unsigned int uint32_t
Definition: uthash.h:78
bool gidx_is_unknown(const GIDX *a)
Here is the call graph for this function:
Here is the caller graph for this function: