#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.
Definition at line 210 of file cube.c.
References array_contains_nulls(), ARRNELEMS, ARRPTR, CUBE_MAX_DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, i, palloc0(), PG_GETARG_ARRAYTYPE_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
Definition at line 143 of file cube.c.
References array_contains_nulls(), ARRNELEMS, ARRPTR, CUBE_MAX_DIM, CUBE_SIZE, ereport, errcode(), errdetail(), errmsg(), ERROR, i, if(), palloc0(), PG_GETARG_ARRAYTYPE_P, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
Definition at line 1822 of file cube.c.
References CUBE_MAX_DIM, CUBE_SIZE, DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, 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.
Definition at line 1869 of file cube.c.
References CUBE_MAX_DIM, CUBE_SIZE, DIM, ereport, errcode(), errdetail(), errmsg(), ERROR, 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.
Definition at line 1021 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 941 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().
Definition at line 1182 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 1166 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 1128 of file cube.c.
References a, b, DIM, i, LL_COORD, Max, Min, and UR_COORD.
Referenced by cube_contained(), cube_contains(), g_cube_internal_consistent(), and g_cube_leaf_consistent().
Definition at line 1607 of file cube.c.
References DIM, ereport, errcode(), errmsg(), ERROR, IS_POINT, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and NDBOX::x.
Definition at line 1648 of file cube.c.
References DIM, ereport, errcode(), errmsg(), ERROR, IS_POINT, Max, Min, PG_GETARG_INT32, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, upper(), and NDBOX::x.
Definition at line 1558 of file cube.c.
References DIM, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_INT32.
Definition at line 1257 of file cube.c.
References a, b, DIM, distance_1D(), 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 1707 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.
Definition at line 1036 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1772 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.
Definition at line 1790 of file cube.c.
References CUBE_SIZE, palloc0(), PG_GETARG_FLOAT8, PG_RETURN_NDBOX_P, POINT_SIZE, SET_DIM, SET_POINT_BIT, SET_VARSIZE(), and NDBOX::x.
Definition at line 1111 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1081 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
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.
Definition at line 827 of file cube.c.
References a, b, cube_is_point_internal(), CUBE_SIZE, DIM, 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().
Definition at line 1523 of file cube.c.
References cube_is_point_internal(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1534 of file cube.c.
References DIM, i, IS_POINT, LL_COORD, and UR_COORD.
Referenced by cube_enlarge(), cube_inter(), cube_is_point(), cube_out(), and cube_union_v0().
Definition at line 1096 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1569 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.
Definition at line 1066 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 1051 of file cube.c.
References a, b, cube_cmp_v0(), PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, and PG_RETURN_BOOL.
Definition at line 296 of file cube.c.
References appendStringInfoChar(), appendStringInfoString(), buf, cube_is_point_internal(), DIM, float8out_internal(), i, initStringInfo(), LL_COORD, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_CSTRING, and UR_COORD.
Definition at line 1237 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 1198 of file cube.c.
References a, b, DIM, i, LL_COORD, Max, Min, and UR_COORD.
Referenced by cube_overlap(), g_cube_internal_consistent(), and g_cube_leaf_consistent().
Definition at line 356 of file cube.c.
References buf, CUBE_MAX_DIM, DIM_MASK, ereport, errcode(), errdetail(), errmsg(), ERROR, NDBOX::header, i, nitems, palloc(), PG_GETARG_POINTER, PG_RETURN_NDBOX_P, POINT_BIT, pq_getmsgfloat8(), pq_getmsgint(), SET_VARSIZE(), NDBOX::x, and x.
Definition at line 334 of file cube.c.
References buf, DIM, NDBOX::header, i, IS_POINT, nitems, PG_GETARG_NDBOX_P, PG_RETURN_BYTEA_P, pq_begintypsend(), pq_endtypsend(), pq_sendfloat8(), pq_sendint32(), and NDBOX::x.
Definition at line 903 of file cube.c.
References a, PG_FREE_IF_COPY, PG_GETARG_NDBOX_P, PG_RETURN_FLOAT8, and rt_cube_size().
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, 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.
Definition at line 812 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 752 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().
Definition at line 1586 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 1507 of file cube.c.
References a1, a2, Max, and Min.
Referenced by cube_distance(), distance_chebyshev(), and distance_taxicab().
Definition at line 1350 of file cube.c.
References a, b, DIM, distance_1D(), 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 1306 of file cube.c.
References a, b, DIM, distance_1D(), 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 739 of file cube.c.
References cube_union_v0(), and VARSIZE().
Referenced by g_cube_union().
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_POINTER, PG_GETARG_UINT16, and PG_RETURN_BOOL.
Definition at line 467 of file cube.c.
References DatumGetNDBOXP, gistentryinit, GISTENTRY::key, sort-test::key, GISTENTRY::offset, GISTENTRY::page, palloc(), PG_GETARG_POINTER, PG_RETURN_POINTER, PointerGetDatum(), and GISTENTRY::rel.
Definition at line 1402 of file cube.c.
References cube_distance(), CubeKNNDistanceChebyshev, CubeKNNDistanceCoord, CubeKNNDistanceEuclid, CubeKNNDistanceTaxicab, DatumGetFloat8(), DatumGetNDBOXP, DIM, DirectFunctionCall2, distance_chebyshev(), distance_taxicab(), elog, ereport, errcode(), errmsg(), ERROR, 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(), upper(), and NDBOX::x.
Definition at line 712 of file cube.c.
References cube_contains_v0(), cube_overlap_v0(), sort-test::key, RTContainedByStrategyNumber, RTContainsStrategyNumber, RTOldContainedByStrategyNumber, RTOldContainsStrategyNumber, RTOverlapStrategyNumber, and RTSameStrategyNumber.
Referenced by g_cube_consistent().
Definition at line 683 of file cube.c.
References cube_cmp_v0(), cube_contains_v0(), cube_overlap_v0(), sort-test::key, RTContainedByStrategyNumber, RTContainsStrategyNumber, RTOldContainedByStrategyNumber, RTOldContainsStrategyNumber, RTOverlapStrategyNumber, and RTSameStrategyNumber.
Referenced by g_cube_consistent().
Definition at line 490 of file cube.c.
References cube_union_v0(), DatumGetNDBOXP, GISTENTRY::key, PG_GETARG_POINTER, PG_RETURN_FLOAT8, and rt_cube_size().
Definition at line 515 of file cube.c.
References cube_inter(), cube_union_v0(), DatumGetNDBOXP, DirectFunctionCall2, FirstOffsetNumber, i, j, GISTENTRY::key, GistEntryVector::n, 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, GIST_SPLITVEC::spl_right, and GistEntryVector::vector.
Definition at line 665 of file cube.c.
References cube_cmp_v0(), PG_GETARG_NDBOX_P, PG_GETARG_POINTER, and PG_RETURN_NDBOX_P.
Definition at line 429 of file cube.c.
References DatumGetNDBOXP, g_cube_binary_union(), i, GISTENTRY::key, GistEntryVector::n, PG_GETARG_POINTER, PG_RETURN_POINTER, VARSIZE(), and GistEntryVector::vector.
"cube"
,
PG_VERSION
Definition at line 914 of file cube.c.
References a, DIM, i, IS_POINT, LL_COORD, and UR_COORD.
Referenced by cube_size(), g_cube_penalty(), and g_cube_picksplit().