1346 GISTENTRY *origentry = (GISTENTRY*) PG_GETARG_POINTER(0);
1347 GISTENTRY *newentry = (GISTENTRY*) PG_GETARG_POINTER(1);
1348 float *result = (
float*) PG_GETARG_POINTER(2);
1349 GIDX *gbox_index_orig, *gbox_index_new;
1350 float size_union, size_orig, edge_union, edge_orig;
1352 POSTGIS_DEBUG(4,
"[GIST] 'penalty' function called");
1354 gbox_index_orig = (GIDX*)DatumGetPointer(origentry->key);
1355 gbox_index_new = (GIDX*)DatumGetPointer(newentry->key);
1358 if ( (gbox_index_orig == NULL) && (gbox_index_new == NULL) )
1360 POSTGIS_DEBUG(4,
"[GIST] both inputs NULL! returning penalty of zero");
1362 PG_RETURN_FLOAT8(*result);
1368 *result = size_union - size_orig;
1385 *result = edge_union - edge_orig;
1401 POSTGIS_DEBUGF(4,
"[GIST] union size (%.12f), original size (%.12f), penalty (%.12f)", size_union, size_orig, *result);
1403 PG_RETURN_POINTER(result);
static float gidx_union_volume(GIDX *a, GIDX *b)
static float pack_float(const float value, const int realm)
static float gidx_union_edge(GIDX *a, GIDX *b)
static float gidx_volume(GIDX *a)
static float gidx_edge(GIDX *a)