|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <math.h>#include "access/gist.h"#include "access/stratnum.h"#include "cubedata.h"#include "libpq/pqformat.h"#include "utils/array.h"#include "utils/float.h"
Go to the source code of this file.
Macros | |
| #define | ARRPTR(x) ( (double *) ARR_DATA_PTR(x) ) |
| #define | ARRNELEMS(x) ArrayGetNItems( ARR_NDIM(x), ARR_DIMS(x)) |
| Datum cube_a_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 210 of file cube.c.
References array_contains_nulls(), ARRNELEMS, ARRPTR, CUBE_MAX_DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, palloc0(), PG_GETARG_ARRAYTYPE_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
| Datum cube_a_f8_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 143 of file cube.c.
References array_contains_nulls(), ARRNELEMS, ARRPTR, CUBE_MAX_DIM, CUBE_SIZE, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, palloc0(), PG_GETARG_ARRAYTYPE_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
| Datum cube_c_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1823 of file cube.c.
References CUBE_MAX_DIM, CUBE_SIZE, DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, IS_POINT, palloc0(), PG_FREE_IF_COPY, PG_GETARG_FLOAT8, PG_GETARG_NDBOX_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), NDBOX::x, and x.
| Datum cube_c_f8_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1870 of file cube.c.
References CUBE_MAX_DIM, CUBE_SIZE, DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, IS_POINT, LL_COORD, palloc0(), PG_FREE_IF_COPY, PG_GETARG_FLOAT8, PG_GETARG_NDBOX_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), UR_COORD, and NDBOX::x.
| Datum cube_cmp | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1022 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_INT32.
Definition at line 942 of file cube.c.
References a, b, DIM, i, LL_COORD, Max, Min, and UR_COORD.
Referenced by cube_cmp(), cube_eq(), cube_ge(), cube_gt(), cube_le(), cube_lt(), cube_ne(), g_cube_leaf_consistent(), and g_cube_same().
| Datum cube_contained | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1183 of file cube.c.
References a, b, cube_contains_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_contains | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1167 of file cube.c.
References a, b, cube_contains_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1129 of file cube.c.
References a, b, DIM, fb(), i, LL_COORD, Max, Min, and UR_COORD.
Referenced by cube_contained(), cube_contains(), g_cube_internal_consistent(), and g_cube_leaf_consistent().
| Datum cube_coord | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1608 of file cube.c.
References DIM, ereport, errcode(), errmsg(), ERROR, fb(), IS_POINT, PG_GETARG_INT32, PG_GETARG_NDBOX_P, and PG_RETURN_FLOAT8.
| Datum cube_coord_llur | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1649 of file cube.c.
References DIM, ereport, errcode(), errmsg(), ERROR, fb(), IS_POINT, Max, Min, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and upper().
| Datum cube_dim | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1559 of file cube.c.
References DIM, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_INT32.
| Datum cube_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1258 of file cube.c.
References a, b, DIM, distance_1D(), fb(), i, LL_COORD, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and UR_COORD.
Referenced by g_cube_distance().
| Datum cube_enlarge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1708 of file cube.c.
References a, cube_is_point_internal(), CUBE_MAX_DIM, CUBE_SIZE, DIM, i, j, LL_COORD, palloc0(), PG_FREE_IF_COPY, PG_GETARG_FLOAT8, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), UR_COORD, and NDBOX::x.
| Datum cube_eq | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1037 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1773 of file cube.c.
References palloc0(), PG_GETARG_FLOAT8, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), NDBOX::x, and x.
| Datum cube_f8_f8 | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1791 of file cube.c.
References CUBE_SIZE, fb(), palloc0(), PG_GETARG_FLOAT8, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
| Datum cube_ge | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1112 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_gt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1082 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_in | ( | PG_FUNCTION_ARGS | ) |
Definition at line 121 of file cube.c.
References cube_scanner_finish(), cube_scanner_init(), cube_yyparse(), PG_GETARG_CSTRING, PG_RETURN_NDBOX_P, and str.
| Datum cube_inter | ( | PG_FUNCTION_ARGS | ) |
Definition at line 828 of file cube.c.
References a, b, cube_is_point_internal(), CUBE_SIZE, DIM, fb(), i, LL_COORD, Max, Min, palloc0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_NDBOX_P, POINT_SIZE, repalloc(), SET_DIM, SET_POINT_BIT, SET_VARSIZE(), UR_COORD, and NDBOX::x.
Referenced by g_cube_picksplit().
| Datum cube_is_point | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1524 of file cube.c.
References cube_is_point_internal(), fb(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1535 of file cube.c.
References DIM, fb(), i, IS_POINT, LL_COORD, and UR_COORD.
Referenced by cube_enlarge(), cube_inter(), cube_is_point(), cube_out(), and cube_union_v0().
| Datum cube_le | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1097 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_ll_coord | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1570 of file cube.c.
References DIM, LL_COORD, Min, PG_FREE_IF_COPY, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and UR_COORD.
| Datum cube_lt | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1067 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_ne | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1052 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
| Datum cube_out | ( | PG_FUNCTION_ARGS | ) |
Definition at line 296 of file cube.c.
References appendStringInfoChar(), appendStringInfoString(), buf, cube_is_point_internal(), DIM, fb(), float8out_internal(), i, initStringInfo(), LL_COORD, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_CSTRING, and UR_COORD.
| Datum cube_overlap | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1238 of file cube.c.
References a, b, cube_overlap_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1199 of file cube.c.
References a, b, DIM, fb(), i, LL_COORD, Max, Min, and UR_COORD.
Referenced by cube_overlap(), g_cube_internal_consistent(), and g_cube_leaf_consistent().
| Datum cube_recv | ( | PG_FUNCTION_ARGS | ) |
Definition at line 356 of file cube.c.
References buf, CUBE_MAX_DIM, DIM_MASK, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, nitems, palloc(), PG_GETARG_POINTER, PG_RETURN_NDBOX_P, POINT_BIT, pq_getmsgfloat8(), pq_getmsgint(), SET_VARSIZE(), and x.
| Datum cube_send | ( | PG_FUNCTION_ARGS | ) |
Definition at line 334 of file cube.c.
References buf, DIM, fb(), i, IS_POINT, nitems, PG_GETARG_NDBOX_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendfloat8(), and pq_sendint32().
| Datum cube_size | ( | PG_FUNCTION_ARGS | ) |
Definition at line 904 of file cube.c.
References a, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and rt_cube_size().
| Datum cube_subset | ( | PG_FUNCTION_ARGS | ) |
Definition at line 247 of file cube.c.
References ARR_DATA_PTR, array_contains_nulls(), ARRNELEMS, CUBE_MAX_DIM, CUBE_SIZE, DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, fb(), i, idx(), IS_POINT, palloc0(), PG_FREE_IF_COPY, PG_GETARG_ARRAYTYPE_P, PG_GETARG_NDBOX_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
| Datum cube_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 813 of file cube.c.
References a, b, cube_union_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_NDBOX_P.
Definition at line 753 of file cube.c.
References a, b, cube_is_point_internal(), CUBE_SIZE, DIM, i, LL_COORD, Max, Min, palloc0(), POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), UR_COORD, and NDBOX::x.
Referenced by cube_union(), g_cube_binary_union(), g_cube_penalty(), and g_cube_picksplit().
| Datum cube_ur_coord | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1587 of file cube.c.
References DIM, LL_COORD, Max, PG_FREE_IF_COPY, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and UR_COORD.
Definition at line 1508 of file cube.c.
References a1, a2, fb(), Max, and Min.
Referenced by cube_distance(), distance_chebyshev(), and distance_taxicab().
| Datum distance_chebyshev | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1351 of file cube.c.
References a, b, DIM, distance_1D(), fb(), i, LL_COORD, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and UR_COORD.
Referenced by g_cube_distance().
| Datum distance_taxicab | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1307 of file cube.c.
References a, b, DIM, distance_1D(), fb(), i, LL_COORD, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and UR_COORD.
Referenced by g_cube_distance().
Definition at line 740 of file cube.c.
References cube_union_v0(), fb(), and VARSIZE().
Referenced by g_cube_union().
| Datum g_cube_compress | ( | PG_FUNCTION_ARGS | ) |
| Datum g_cube_consistent | ( | PG_FUNCTION_ARGS | ) |
Definition at line 395 of file cube.c.
References DatumGetNDBOXP, g_cube_internal_consistent(), g_cube_leaf_consistent(), GIST_LEAF, GISTENTRY::key, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_GETARG_OID, PG_GETARG_POINTER, PG_GETARG_UINT16, and PG_RETURN_BOOL.
| Datum g_cube_decompress | ( | PG_FUNCTION_ARGS | ) |
Definition at line 468 of file cube.c.
References DatumGetNDBOXP, gistentryinit, GISTENTRY::key, GISTENTRY::offset, GISTENTRY::page, palloc_object, PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), and GISTENTRY::rel.
| Datum g_cube_distance | ( | PG_FUNCTION_ARGS | ) |
Definition at line 1403 of file cube.c.
References cube_distance(), CubeKNNDistanceChebyshev, CubeKNNDistanceCoord, CubeKNNDistanceEuclid, CubeKNNDistanceTaxicab, DatumGetFloat8(), DatumGetNDBOXP, DIM, DirectFunctionCall2, distance_chebyshev(), distance_taxicab(), elog, ereport, errcode(), errmsg(), ERROR, fb(), GistPageIsLeaf, IS_POINT, GISTENTRY::key, Max, Min, GISTENTRY::page, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_GETARG_POINTER, PG_GETARG_UINT16, PG_RETURN_FLOAT8, PointerGetDatum(), and upper().
| bool g_cube_internal_consistent | ( | NDBOX * | key, |
| NDBOX * | query, | ||
| StrategyNumber | strategy | ||
| ) |
Definition at line 713 of file cube.c.
References cube_contains_v0(), cube_overlap_v0(), RTContainedByStrategyNumber, RTContainsStrategyNumber, RTOldContainedByStrategyNumber, RTOldContainsStrategyNumber, RTOverlapStrategyNumber, and RTSameStrategyNumber.
Referenced by g_cube_consistent().
| bool g_cube_leaf_consistent | ( | NDBOX * | key, |
| NDBOX * | query, | ||
| StrategyNumber | strategy | ||
| ) |
Definition at line 684 of file cube.c.
References cube_cmp_v0(), cube_contains_v0(), cube_overlap_v0(), RTContainedByStrategyNumber, RTContainsStrategyNumber, RTOldContainedByStrategyNumber, RTOldContainsStrategyNumber, RTOverlapStrategyNumber, and RTSameStrategyNumber.
Referenced by g_cube_consistent().
| Datum g_cube_penalty | ( | PG_FUNCTION_ARGS | ) |
Definition at line 491 of file cube.c.
References cube_union_v0(), DatumGetNDBOXP, fb(), PG_GETARG_POINTER, PG_RETURN_FLOAT8, and rt_cube_size().
| Datum g_cube_picksplit | ( | PG_FUNCTION_ARGS | ) |
Definition at line 516 of file cube.c.
References cube_inter(), cube_union_v0(), DatumGetNDBOXP, DirectFunctionCall2, fb(), FirstOffsetNumber, i, j, OffsetNumberNext, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), rt_cube_size(), GIST_SPLITVEC::spl_ldatum, GIST_SPLITVEC::spl_left, GIST_SPLITVEC::spl_nleft, GIST_SPLITVEC::spl_nright, GIST_SPLITVEC::spl_rdatum, and GIST_SPLITVEC::spl_right.
| Datum g_cube_same | ( | PG_FUNCTION_ARGS | ) |
Definition at line 666 of file cube.c.
References cube_cmp_v0(), fb(), PG_GETARG_NDBOX_P, PG_GETARG_POINTER, and PG_RETURN_NDBOX_P.
| Datum g_cube_union | ( | PG_FUNCTION_ARGS | ) |
Definition at line 430 of file cube.c.
References DatumGetNDBOXP, fb(), g_cube_binary_union(), i, PG_GETARG_POINTER, PG_RETURN_POINTER, and VARSIZE().
| PG_FUNCTION_INFO_V1 | ( | cube_a_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_a_f8_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_c_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_c_f8_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_cmp | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_contained | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_contains | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_coord | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_coord_llur | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_dim | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_distance | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_enlarge | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_eq | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_f8_f8 | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_ge | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_gt | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_in | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_inter | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_is_point | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_le | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_ll_coord | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_lt | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_ne | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_out | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_overlap | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_recv | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_send | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_size | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_subset | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_union | ) |
| PG_FUNCTION_INFO_V1 | ( | cube_ur_coord | ) |
| PG_FUNCTION_INFO_V1 | ( | distance_chebyshev | ) |
| PG_FUNCTION_INFO_V1 | ( | distance_taxicab | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_compress | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_consistent | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_decompress | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_distance | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_penalty | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_picksplit | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_same | ) |
| PG_FUNCTION_INFO_V1 | ( | g_cube_union | ) |
| PG_MODULE_MAGIC_EXT | ( | . | name = "cube", |
| . | version = PG_VERSION |
||
| ) |
Definition at line 915 of file cube.c.
References a, DIM, fb(), i, IS_POINT, LL_COORD, and UR_COORD.
Referenced by cube_size(), g_cube_penalty(), and g_cube_picksplit().