PostGIS  2.4.9dev-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 FALSE, gidx_dimensionality_check(), gidx_is_unknown(), and TRUE.

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

497 {
498  int 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 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: