MobilityDB 1.1
Data Structures | Typedefs | Functions
tpoint_spgist.c File Reference
#include <assert.h>
#include <float.h>
#include <postgres.h>
#include <access/spgist.h>
#include <access/spgist_private.h>
#include <utils/timestamp.h>
#include <meos.h>
#include <meos_internal.h>
#include "general/set.h"
#include "point/tpoint_boxops.h"
#include "pg_general/meos_catalog.h"
#include "pg_general/temporal.h"
#include "pg_general/tnumber_spgist.h"
#include "pg_point/tpoint_gist.h"
Include dependency graph for tpoint_spgist.c:

Data Structures

struct  SortedSTbox
 Structure to sort the temporal boxes of an inner node. More...
 
struct  STboxNode
 SP-GiST implementation of 8-dimensional quad-tree over temporal points. More...
 

Typedefs

typedef struct SortedSTbox SortedSTbox
 Structure to sort the temporal boxes of an inner node. More...
 

Functions

static bool above8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be above of query? More...
 
static bool after8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be after of query? More...
 
static bool back8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be back to query? More...
 
static bool before8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be before of query? More...
 
static bool below8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be below of query? More...
 
static bool contain8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox contain query? More...
 
static bool containKD (const STboxNode *nodebox, const STBox *query, int level)
 Can any box from nodebox overlap with query? More...
 
static double distance_stbox_nodebox (const STBox *query, const STboxNode *nodebox)
 Lower bound for the distance between query and nodebox. More...
 
static bool front8D (STboxNode *nodebox, STBox *query)
 Can any box from nodebox be in front of query? More...
 
static uint8 getOctant8D (const STBox *centroid, const STBox *inBox)
 Calculate the quadrant. More...
 
static bool left8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be left of query? More...
 
static bool overAbove8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend below of query? More...
 
static bool overAfter8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the before of query? More...
 
static bool overBack8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the front of query? More...
 
static bool overBefore8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the after of query? More...
 
static bool overBelow8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend above query? More...
 
static bool overFront8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the back of query? More...
 
static bool overlap8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox overlap with query? More...
 
static bool overlapKD (const STboxNode *nodebox, const STBox *query, int level)
 Can any box from nodebox overlap with query? More...
 
static bool overLeft8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the right of query? More...
 
static bool overRight8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox does not extend the left of query? More...
 
static bool right8D (const STboxNode *nodebox, const STBox *query)
 Can any box from nodebox be right of query? More...
 
PGDLLEXPORT Datum Stbox_kdtree_choose (PG_FUNCTION_ARGS)
 K-d tree choose function for time types. More...
 
PGDLLEXPORT Datum Stbox_kdtree_inner_consistent (PG_FUNCTION_ARGS)
 Kd-tree inner consistent function for temporal numbers. More...
 
PGDLLEXPORT Datum Stbox_kdtree_picksplit (PG_FUNCTION_ARGS)
 K-d tree pick-split function for spatiotemporal boxes. More...
 
static int stbox_level_cmp (STBox *centroid, STBox *query, int level)
 
PGDLLEXPORT Datum Stbox_quadtree_choose (PG_FUNCTION_ARGS)
 SP-GiST choose function for temporal points. More...
 
PGDLLEXPORT Datum Stbox_quadtree_inner_consistent (PG_FUNCTION_ARGS)
 Quad-tree inner consistent function for temporal numbers. More...
 
PGDLLEXPORT Datum Stbox_quadtree_picksplit (PG_FUNCTION_ARGS)
 SP-GiST pick-split function for temporal points. More...
 
PGDLLEXPORT Datum Stbox_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for temporal points. More...
 
Datum stbox_spgist_inner_consistent (FunctionCallInfo fcinfo, SPGistIndexType idxtype)
 
PGDLLEXPORT Datum Stbox_spgist_leaf_consistent (PG_FUNCTION_ARGS)
 SP-GiST leaf-level consistency function for temporal points. More...
 
static int stbox_tmax_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their tmax value. More...
 
static int stbox_tmin_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their tmin value. More...
 
static int stbox_xmax_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their xmax value. More...
 
static int stbox_xmin_cmp (const STBox *box1, const STBox *box2)
 Determine which half a 4D-mapped temporal box falls into, relative to the centroid and the level number. More...
 
static int stbox_ymax_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their ymax value. More...
 
static int stbox_ymin_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their ymin value. More...
 
static int stbox_zmax_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their zmax value. More...
 
static int stbox_zmin_cmp (const STBox *box1, const STBox *box2)
 Comparator of temporal boxes based on their zmin value. More...
 
STboxNodestboxnode_copy (const STboxNode *box)
 Copy a STboxNode. More...
 
static void stboxnode_init (const STBox *centroid, STboxNode *nodebox)
 Initialize the traversal value. More...
 
static void stboxnode_kdtree_next (const STboxNode *nodebox, const STBox *centroid, uint8 node, int level, STboxNode *next_nodebox)
 Compute the next traversal value for a k-d tree given the bounding box and the centroid of the current node, the half number (0 or 1) and the level. More...
 
static void stboxnode_quadtree_next (const STboxNode *nodebox, const STBox *centroid, uint8 quadrant, STboxNode *next_nodebox)
 Calculate the next traversal value. More...
 
PGDLLEXPORT Datum Tpoint_spgist_compress (PG_FUNCTION_ARGS)
 SP-GiST compress functions for temporal points. More...
 
static bool tpoint_spgist_get_stbox (const ScanKeyData *scankey, STBox *result)
 Transform a query argument into an STBox. More...