MobilityDB 1.1
Data Structures | Typedefs | Functions
tnumber_spgist.c File Reference
#include "pg_general/tnumber_spgist.h"
#include <assert.h>
#include <float.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 "general/type_util.h"
#include "pg_general/meos_catalog.h"
#include "pg_general/temporal.h"
#include "pg_general/tnumber_gist.h"
Include dependency graph for tnumber_spgist.c:

Data Structures

struct  SortedTbox
 Structure to sort the temporal boxes of an inner node. More...
 
struct  TboxNode
 SP-GiST implementation of 4-dimensional quad-tree and kd-tree over temporal integers and temporal floats. More...
 

Typedefs

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

Functions

static bool after4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox be after this argument? More...
 
static bool before4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox be before this argument? More...
 
int compareDoubles (const void *a, const void *b)
 Comparator for qsort. More...
 
static bool contain4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox contain this argument? More...
 
static double distance_tbox_nodebox (const TBox *query, const TboxNode *nodebox)
 Lower bound for the distance between query and nodebox. More...
 
static uint8 get_quadrant4D (const TBox *centroid, const TBox *inBox)
 Calculate the quadrant. More...
 
static bool left4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox be left of this argument? More...
 
static bool overAfter4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox does not extend before this argument? More...
 
static bool overBefore4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox does not extend after this argument? More...
 
static bool overlap4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox overlap with this argument? More...
 
static bool overLeft4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox does not extend the right of this argument? More...
 
static bool overRight4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox does not extend the left of this argument? More...
 
static bool right4D (const TboxNode *nodebox, const TBox *query)
 Can any rectangle from nodebox be right of this argument? More...
 
PGDLLEXPORT Datum Tbox_kdtree_choose (PG_FUNCTION_ARGS)
 K-d tree choose function for time types. More...
 
PGDLLEXPORT Datum Tbox_kdtree_inner_consistent (PG_FUNCTION_ARGS)
 Kd-tree inner consistent function for temporal numbers. More...
 
PGDLLEXPORT Datum Tbox_kdtree_picksplit (PG_FUNCTION_ARGS)
 K-d tree pick-split function for time types. More...
 
static int tbox_level_cmp (TBox *centroid, TBox *query, int level)
 
PGDLLEXPORT Datum Tbox_quadtree_choose (PG_FUNCTION_ARGS)
 SP-GiST choose function for temporal numbers. More...
 
PGDLLEXPORT Datum Tbox_quadtree_inner_consistent (PG_FUNCTION_ARGS)
 Quad-tree inner consistent function for temporal numbers. More...
 
PGDLLEXPORT Datum Tbox_quadtree_picksplit (PG_FUNCTION_ARGS)
 SP-GiST pick-split function for temporal numbers. More...
 
PGDLLEXPORT Datum Tbox_spgist_config (PG_FUNCTION_ARGS)
 SP-GiST config function for temporal numbers. More...
 
static Datum tbox_spgist_inner_consistent (FunctionCallInfo fcinfo, SPGistIndexType idxtype)
 Generic SP-GiST inner consistent function for temporal numbers. More...
 
PGDLLEXPORT Datum Tbox_spgist_leaf_consistent (PG_FUNCTION_ARGS)
 SP-GiST leaf-level consistency function for temporal numbers. More...
 
static int tbox_tmax_cmp (const TBox *box1, const TBox *box2)
 Comparator of temporal boxes based on their tmax value. More...
 
static int tbox_tmin_cmp (const TBox *box1, const TBox *box2)
 Comparator of temporal boxes based on their tmin value. More...
 
static int tbox_xmax_cmp (const TBox *box1, const TBox *box2)
 Comparator of temporal boxes based on their xmax value. More...
 
static int tbox_xmin_cmp (const TBox *box1, const TBox *box2)
 Comparator of temporal boxes based on their xmin value. More...
 
TboxNodetboxnode_copy (const TboxNode *box)
 Copy a traversal value. More...
 
static void tboxnode_init (TBox *centroid, TboxNode *nodebox)
 Initialize the traversal value. More...
 
static void tboxnode_kdtree_next (const TboxNode *nodebox, const TBox *centroid, uint8 node, int level, TboxNode *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 tboxnode_quadtree_next (const TboxNode *nodebox, const TBox *centroid, uint8 quadrant, TboxNode *next_nodebox)
 Calculate the next traversal value. More...
 
PGDLLEXPORT Datum Tnumber_spgist_compress (PG_FUNCTION_ARGS)
 SP-GiST compress function for temporal numbers. More...
 
static bool tnumber_spgist_get_tbox (const ScanKeyData *scankey, TBox *result)
 Transform a query argument into a TBox. More...