summaryrefslogtreecommitdiff
path: root/contrib/cube/cubedata.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cube/cubedata.h')
-rw-r--r--contrib/cube/cubedata.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/cube/cubedata.h b/contrib/cube/cubedata.h
index 7eaac39640..af02464178 100644
--- a/contrib/cube/cubedata.h
+++ b/contrib/cube/cubedata.h
@@ -1,5 +1,9 @@
/* contrib/cube/cubedata.h */
+/*
+ * This limit is pretty arbitrary, but don't make it so large that you
+ * risk overflow in sizing calculations.
+ */
#define CUBE_MAX_DIM (100)
typedef struct NDBOX
@@ -29,6 +33,7 @@ typedef struct NDBOX
double x[FLEXIBLE_ARRAY_MEMBER];
} NDBOX;
+/* NDBOX access macros */
#define POINT_BIT 0x80000000
#define DIM_MASK 0x7fffffff
@@ -43,10 +48,12 @@ typedef struct NDBOX
#define POINT_SIZE(_dim) (offsetof(NDBOX, x) + sizeof(double)*(_dim))
#define CUBE_SIZE(_dim) (offsetof(NDBOX, x) + sizeof(double)*(_dim)*2)
+/* fmgr interface macros */
#define DatumGetNDBOX(x) ((NDBOX *) PG_DETOAST_DATUM(x))
#define PG_GETARG_NDBOX(x) DatumGetNDBOX(PG_GETARG_DATUM(x))
#define PG_RETURN_NDBOX(x) PG_RETURN_POINTER(x)
+/* GiST operator strategy numbers */
#define CubeKNNDistanceCoord 15 /* ~> */
#define CubeKNNDistanceTaxicab 16 /* <#> */
#define CubeKNNDistanceEuclid 17 /* <-> */