Include dependency graph for _int.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
#define
WISH_F(
a,
b,
c) (double)( -(double)(((
a)-(
b))*((
a)-(
b))*((
a)-(
b)))*(
c) )
Macro Definition Documentation
◆ ALLISTRUE
◆ ARRISEMPTY
◆ ARRNELEMS
◆ ARRPTR
◆ BooleanSearchStrategy
#define BooleanSearchStrategy 20
◆ CALCGTSIZE
#define CALCGTSIZE
(
flag,
siglen
◆ CHECKARRVALID
#define CHECKARRVALID
(
x )
Value: do { \
(
errcode(ERRCODE_NULL_VALUE_NOT_ALLOWED), \
errmsg(
"array must not contain nulls"))); \
} while(0)
bool array_contains_nulls(ArrayType *array)
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
Definition at line 30 of file _int.h.
◆ CLOSE
◆ CLRBIT
◆ COMPUTESIZE
#define COMPUTESIZE
(
size )
(
HDRSIZEQT + (size) * sizeof(
ITEM) )
◆ DatumGetQueryTypeP
◆ DatumGetQueryTypePCopy
◆ END
◆ ERR
◆ G_INT_GET_NUMRANGES
#define G_INT_GET_NUMRANGES
(
)
Value:
#define G_INT_NUMRANGES_DEFAULT
#define PG_GET_OPCLASS_OPTIONS()
#define PG_HAS_OPCLASS_OPTIONS()
Definition at line 14 of file _int.h.
◆ G_INT_NUMRANGES_DEFAULT
#define G_INT_NUMRANGES_DEFAULT 100
◆ G_INT_NUMRANGES_MAX
#define G_INT_NUMRANGES_MAX
Value:
#define GISTMaxIndexKeySize
Definition at line 12 of file _int.h.
◆ GET_SIGLEN
Value:
Definition at line 65 of file _int.h.
◆ GETBIT
◆ GETBITBYTE
)
( (*((char*)(
x)) >> (
i)) & 0x01 )
◆ GETBYTE
◆ GETQUERY
#define GETQUERY
(
x )
( (
x)->
items )
◆ GETSIGN
◆ GTHDRSIZE
◆ HASH
◆ HASHVAL
◆ HDRSIZEQT
◆ ISALLTRUE
◆ LOOPBYTE
#define LOOPBYTE
(
siglen )
for (
i = 0;
i < siglen;
i++)
◆ OPEN
◆ OPR
◆ PG_GETARG_QUERYTYPE_P
◆ PG_GETARG_QUERYTYPE_P_COPY
◆ PREPAREARR
Value: do { \
bool _ascending = true; \
isort(
ARRPTR(
x), _nelems_, &_ascending); \
} while(0)
ArrayType * _int_unique(ArrayType *r)
Definition at line 49 of file _int.h.
◆ QSORT
Value: do { \
bool _ascending = (direction) ? true : false; \
isort(
ARRPTR(
a), _nelems_, &_ascending); \
} while(0)
Definition at line 180 of file _int.h.
◆ QUERYTYPEMAXITEMS
◆ SETBIT
◆ SIGLEN_DEFAULT
#define SIGLEN_DEFAULT (63 * 4)
◆ SIGLEN_MAX
◆ SIGLENBIT
◆ SORT
Value: do { \
bool _ascending = true; \
isort(
ARRPTR(
x), _nelems_, &_ascending); \
} while(0)
Definition at line 41 of file _int.h.
◆ VAL
◆ WISH_F
)
(double)( -(double)(((
a)-(
b))*((
a)-(
b))*((
a)-(
b)))*(
c) )
Typedef Documentation
◆ BITVECP
◆ ITEM
◆ QUERYTYPE
Function Documentation
◆ _int_unique()
Definition at line 313 of file _int_tool.c.
314{
316 bool ascending = true;
317
319 &ascending);
320
322}
static size_t qunique_arg(void *array, size_t elements, size_t width, int(*compare)(const void *, const void *, void *), void *arg)
References ARRNELEMS, ARRPTR, isort_cmp(), qunique_arg(), and resize_intArrayType().
Referenced by g_int_union(), inner_int_union(), intset_subtract(), intset_union_elem(), and uniq().
◆ copy_intArrayType()
◆ execconsistent()
Definition at line 307 of file _int_bool.c.
308{
310
315 &chkval, NULL, calcnot,
317}
static bool checkcondition_arr(void *checkval, ITEM *item, void *options)
static bool execute(ITEM *curitem, void *checkval, void *options, bool calcnot, bool(*chkcond)(void *checkval, ITEM *item, void *options))
References CHKVAL::arrb, CHKVAL::arre, ARRNELEMS, ARRPTR, CHECKARRVALID, checkcondition_arr(), execute(), GETQUERY, and QUERYTYPE::size.
Referenced by g_int_consistent().
◆ gensign()
int *
a,
int
len,
int
siglen
)
Definition at line 325 of file _int_tool.c.
326{
328
329 /* we assume that the sign vector is previously zeroed */
331 {
334 }
335}
#define HASH(sign, val, siglen)
References a, HASH, i, len, and sign.
◆ gin_bool_consistent()
bool gin_bool_consistent
(
QUERYTYPE *
query,
bool *
check
)
Definition at line 334 of file _int_bool.c.
335{
340
341 if (query->
size <= 0)
342 return false;
343
344 /*
345 * Set up data for checkcondition_gin. This must agree with the query
346 * extraction code in ginint4_queryextract.
347 */
350 for (
i = 0;
i < query->
size;
i++)
351 {
354 }
355
357 &gcv, NULL, true,
359}
static bool checkcondition_gin(void *checkval, ITEM *item, void *options)
References checkcondition_gin(), execute(), GinChkVal::first, GETQUERY, i, items, j, GinChkVal::mapped_check, palloc(), QUERYTYPE::size, type, and VAL.
Referenced by ginint4_consistent().
◆ inner_int_contains()
Definition at line 15 of file _int_tool.c.
16{
17 int na,
18 nb;
21 n;
22 int *da,
23 *db;
24
29
31 while (
i < na &&
j < nb)
32 {
35 else if (da[
i] == db[
j])
36 {
37 n++;
40 }
41 else
42 break; /* db[j] is not in da */
43 }
44
45 return (n == nb);
46}
References a, ARRNELEMS, ARRPTR, b, i, and j.
Referenced by _int_contains(), and g_int_consistent().
◆ inner_int_inter()
Definition at line 136 of file _int_tool.c.
137{
139 int na,
140 nb;
141 int *da,
142 *db,
143 *dr;
146 k;
147
150
157
159 while (
i < na &&
j < nb)
160 {
163 else if (da[
i] == db[
j])
164 {
165 if (k == 0 || dr[k - 1] != db[
j])
169 }
170 else
172 }
173
174 if (k == 0)
175 {
178 }
179 else
181}
void pfree(void *pointer)
References a, ARRISEMPTY, ARRNELEMS, ARRPTR, b, i, j, Min, new_intArrayType(), pfree(), and resize_intArrayType().
Referenced by _int_inter(), and g_int_picksplit().
◆ inner_int_overlap()
◆ inner_int_union()
Definition at line 79 of file _int_tool.c.
80{
82
85
92
93 if (!r)
94 {
101 *dr;
102
105
106 /* union */
108 while (
i < na &&
j < nb)
109 {
111 {
114 }
115 else if (da[
i] < db[
j])
117 else
119 }
120
125
127 }
128
131
132 return r;
133}
References _int_unique(), a, ARRISEMPTY, ARRNELEMS, ARRPTR, b, CHECKARRVALID, copy_intArrayType(), i, j, new_intArrayType(), and resize_intArrayType().
Referenced by _int_union(), g_int_penalty(), and g_int_picksplit().
◆ int_to_intset()
◆ intarray_add_elem()
◆ intarray_concat_arrays()
◆ intarray_match_first()
◆ internal_size()
int internal_size
(
int *
a,
int
len
)
◆ isort()
◆ new_intArrayType()
Definition at line 224 of file _int_tool.c.
225{
227 int nbytes;
228
229 /* if no elements, return a zero-dimensional array */
230 if (num <= 0)
231 {
234 return r;
235 }
236
238
240
243 r->
dataoffset = 0;
/* marker for no null bitmap */
247
248 return r;
249}
#define ARR_OVERHEAD_NONULLS(ndims)
ArrayType * construct_empty_array(Oid elmtype)
Assert(PointerIsAligned(start, uint64))
void * palloc0(Size size)
static void SET_VARSIZE(void *PTR, Size len)
References ARR_DIMS, ARR_ELEMTYPE, ARR_LBOUND, ARR_NDIM, ARR_OVERHEAD_NONULLS, Assert(), construct_empty_array(), ArrayType::dataoffset, palloc0(), and SET_VARSIZE().
Referenced by copy_intArrayType(), g_int_decompress(), g_int_union(), inner_int_inter(), inner_int_union(), int_to_intset(), intarray_add_elem(), intarray_concat_arrays(), intset_subtract(), and subarray().
◆ query_has_required_values()
bool query_has_required_values
(
QUERYTYPE *
query )
◆ resize_intArrayType()
Definition at line 252 of file _int_tool.c.
253{
254 int nbytes;
256
257 /* if no elements, return a zero-dimensional array */
258 if (num <= 0)
259 {
263 }
264
267
269
271
273 /* usually the array should be 1-D already, but just in case ... */
275 {
277 num = 1;
278 }
280}
#define ARR_DATA_OFFSET(a)
void * repalloc(void *pointer, Size size)
References a, ARR_DATA_OFFSET, ARR_DIMS, ARR_NDIM, ARRNELEMS, Assert(), construct_empty_array(), i, repalloc(), and SET_VARSIZE().
Referenced by _int_unique(), g_int_compress(), inner_int_inter(), inner_int_union(), intarray_del_elem(), and intset_subtract().
◆ rt__int_size()
◆ signconsistent()
int
siglen,
bool
calcnot
)