1345 GISTENTRY *origentry = (GISTENTRY*) PG_GETARG_POINTER(0);
1346 GISTENTRY *newentry = (GISTENTRY*) PG_GETARG_POINTER(1);
1347 float *result = (
float*) PG_GETARG_POINTER(2);
1348 GIDX *gbox_index_orig, *gbox_index_new;
1349 float size_union, size_orig, edge_union, edge_orig;
1351 POSTGIS_DEBUG(4,
"[GIST] 'penalty' function called");
1353 gbox_index_orig = (GIDX*)DatumGetPointer(origentry->key);
1354 gbox_index_new = (GIDX*)DatumGetPointer(newentry->key);
1357 if ( (gbox_index_orig == NULL) && (gbox_index_new == NULL) )
1359 POSTGIS_DEBUG(4,
"[GIST] both inputs NULL! returning penalty of zero");
1361 PG_RETURN_FLOAT8(*result);
1367 *result = size_union - size_orig;
1384 *result = edge_union - edge_orig;
1400 POSTGIS_DEBUGF(4,
"[GIST] union size (%.12f), original size (%.12f), penalty (%.12f)", size_union, size_orig, *result);
1402 PG_RETURN_POINTER(result);
static float gidx_union_edge(GIDX *a, GIDX *b)
static float gidx_volume(GIDX *a)
static float gidx_union_volume(GIDX *a, GIDX *b)
static float pack_float(const float value, const int realm)
static float gidx_edge(GIDX *a)