1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | /* included from gdk.h */ |
10 | |
11 | gdk_export BAT *BATcalcnegate(BAT *b, BAT *s); |
12 | gdk_export BAT *BATcalcabsolute(BAT *b, BAT *s); |
13 | gdk_export BAT *BATcalcincr(BAT *b, BAT *s, bool abort_on_error); |
14 | gdk_export BAT *BATcalcdecr(BAT *b, BAT *s, bool abort_on_error); |
15 | gdk_export BAT *BATcalciszero(BAT *b, BAT *s); |
16 | gdk_export BAT *BATcalcsign(BAT *b, BAT *s); |
17 | gdk_export BAT *BATcalcisnil(BAT *b, BAT *s); |
18 | gdk_export BAT *BATcalcisnotnil(BAT *b, BAT *s); |
19 | gdk_export BAT *BATcalcnot(BAT *b, BAT *s); |
20 | gdk_export BAT *BATcalcmin(BAT *b1, BAT *b2, BAT *s); |
21 | gdk_export BAT *BATcalcmin_no_nil(BAT *b1, BAT *b2, BAT *s); |
22 | gdk_export BAT *BATcalcmincst(BAT *b, const ValRecord *v, BAT *s); |
23 | gdk_export BAT *BATcalcmincst_no_nil(BAT *b, const ValRecord *v, BAT *s); |
24 | gdk_export BAT *BATcalccstmin(const ValRecord *v, BAT *b, BAT *s); |
25 | gdk_export BAT *BATcalccstmin_no_nil(const ValRecord *v, BAT *b, BAT *s); |
26 | gdk_export BAT *BATcalcmax(BAT *b1, BAT *b2, BAT *s); |
27 | gdk_export BAT *BATcalcmax_no_nil(BAT *b1, BAT *b2, BAT *s); |
28 | gdk_export BAT *BATcalcmaxcst(BAT *b, const ValRecord *v, BAT *s); |
29 | gdk_export BAT *BATcalcmaxcst_no_nil(BAT *b, const ValRecord *v, BAT *s); |
30 | gdk_export BAT *BATcalccstmax(const ValRecord *v, BAT *b, BAT *s); |
31 | gdk_export BAT *BATcalccstmax_no_nil(const ValRecord *v, BAT *b, BAT *s); |
32 | gdk_export BAT *BATcalcadd(BAT *b1, BAT *b2, BAT *s, int tp, bool abort_on_error); |
33 | gdk_export BAT *BATcalcaddcst(BAT *b, const ValRecord *v, BAT *s, int tp, bool abort_on_error); |
34 | gdk_export BAT *BATcalccstadd(const ValRecord *v, BAT *b, BAT *s, int tp, bool abort_on_error); |
35 | gdk_export BAT *BATcalcsub(BAT *b1, BAT *b2, BAT *s, int tp, bool abort_on_error); |
36 | gdk_export BAT *BATcalcsubcst(BAT *b, const ValRecord *v, BAT *s, int tp, bool abort_on_error); |
37 | gdk_export BAT *BATcalccstsub(const ValRecord *v, BAT *b, BAT *s, int tp, bool abort_on_error); |
38 | gdk_export BAT *BATcalcmul(BAT *b1, BAT *b2, BAT *s, int tp, bool abort_on_error); |
39 | gdk_export BAT *BATcalcmulcst(BAT *b, const ValRecord *v, BAT *s, int tp, bool abort_on_error); |
40 | gdk_export BAT *BATcalccstmul(const ValRecord *v, BAT *b, BAT *s, int tp, bool abort_on_error); |
41 | gdk_export BAT *BATcalcdiv(BAT *b1, BAT *b2, BAT *s, int tp, bool abort_on_error); |
42 | gdk_export BAT *BATcalcdivcst(BAT *b, const ValRecord *v, BAT *s, int tp, bool abort_on_error); |
43 | gdk_export BAT *BATcalccstdiv(const ValRecord *v, BAT *b, BAT *s, int tp, bool abort_on_error); |
44 | gdk_export BAT *BATcalcmod(BAT *b1, BAT *b2, BAT *s, int tp, bool abort_on_error); |
45 | gdk_export BAT *BATcalcmodcst(BAT *b, const ValRecord *v, BAT *s, int tp, bool abort_on_error); |
46 | gdk_export BAT *BATcalccstmod(const ValRecord *v, BAT *b, BAT *s, int tp, bool abort_on_error); |
47 | gdk_export BAT *BATcalcxor(BAT *b1, BAT *b2, BAT *s); |
48 | gdk_export BAT *BATcalcxorcst(BAT *b, const ValRecord *v, BAT *s); |
49 | gdk_export BAT *BATcalccstxor(const ValRecord *v, BAT *b, BAT *s); |
50 | gdk_export BAT *BATcalcor(BAT *b1, BAT *b2, BAT *s); |
51 | gdk_export BAT *BATcalcorcst(BAT *b, const ValRecord *v, BAT *s); |
52 | gdk_export BAT *BATcalccstor(const ValRecord *v, BAT *b, BAT *s); |
53 | gdk_export BAT *BATcalcand(BAT *b1, BAT *b2, BAT *s); |
54 | gdk_export BAT *BATcalcandcst(BAT *b, const ValRecord *v, BAT *s); |
55 | gdk_export BAT *BATcalccstand(const ValRecord *v, BAT *b, BAT *s); |
56 | gdk_export BAT *BATcalclsh(BAT *b1, BAT *b2, BAT *s, bool abort_on_error); |
57 | gdk_export BAT *BATcalclshcst(BAT *b, const ValRecord *v, BAT *s, bool abort_on_error); |
58 | gdk_export BAT *BATcalccstlsh(const ValRecord *v, BAT *b, BAT *s, bool abort_on_error); |
59 | gdk_export BAT *BATcalcrsh(BAT *b1, BAT *b2, BAT *s, bool abort_on_error); |
60 | gdk_export BAT *BATcalcrshcst(BAT *b, const ValRecord *v, BAT *s, bool abort_on_error); |
61 | gdk_export BAT *BATcalccstrsh(const ValRecord *v, BAT *b, BAT *s, bool abort_on_error); |
62 | gdk_export BAT *BATcalclt(BAT *b1, BAT *b2, BAT *s); |
63 | gdk_export BAT *BATcalcltcst(BAT *b, const ValRecord *v, BAT *s); |
64 | gdk_export BAT *BATcalccstlt(const ValRecord *v, BAT *b, BAT *s); |
65 | gdk_export BAT *BATcalcle(BAT *b1, BAT *b2, BAT *s); |
66 | gdk_export BAT *BATcalclecst(BAT *b, const ValRecord *v, BAT *s); |
67 | gdk_export BAT *BATcalccstle(const ValRecord *v, BAT *b, BAT *s); |
68 | gdk_export BAT *BATcalcgt(BAT *b1, BAT *b2, BAT *s); |
69 | gdk_export BAT *BATcalcgtcst(BAT *b, const ValRecord *v, BAT *s); |
70 | gdk_export BAT *BATcalccstgt(const ValRecord *v, BAT *b, BAT *s); |
71 | gdk_export BAT *BATcalcge(BAT *b1, BAT *b2, BAT *s); |
72 | gdk_export BAT *BATcalcgecst(BAT *b, const ValRecord *v, BAT *s); |
73 | gdk_export BAT *BATcalccstge(const ValRecord *v, BAT *b, BAT *s); |
74 | gdk_export BAT *BATcalceq(BAT *b1, BAT *b2, BAT *s, bool nil_matches); |
75 | gdk_export BAT *BATcalceqcst(BAT *b, const ValRecord *v, BAT *s, bool nil_matches); |
76 | gdk_export BAT *BATcalccsteq(const ValRecord *v, BAT *b, BAT *s, bool nil_matches); |
77 | gdk_export BAT *BATcalcne(BAT *b1, BAT *b2, BAT *s, bool nil_matches); |
78 | gdk_export BAT *BATcalcnecst(BAT *b, const ValRecord *v, BAT *s, bool nil_matches); |
79 | gdk_export BAT *BATcalccstne(const ValRecord *v, BAT *b, BAT *s, bool nil_matches); |
80 | gdk_export BAT *BATcalccmp(BAT *b1, BAT *b2, BAT *s); |
81 | gdk_export BAT *BATcalccmpcst(BAT *b, const ValRecord *v, BAT *s); |
82 | gdk_export BAT *BATcalccstcmp(const ValRecord *v, BAT *b, BAT *s); |
83 | gdk_export BAT *BATcalcbetween(BAT *b, BAT *lo, BAT *hi, BAT *s, bool symmetric, bool linc, bool hinc, bool nils_false, bool anti); |
84 | gdk_export BAT *BATcalcbetweencstcst(BAT *b, const ValRecord *lo, const ValRecord *hi, BAT *s, bool symmetric, bool linc, bool hinc, bool nils_false, bool anti); |
85 | gdk_export BAT *BATcalcbetweenbatcst(BAT *b, BAT *lo, const ValRecord *hi, BAT *s, bool symmetric, bool linc, bool hinc, bool nils_false, bool anti); |
86 | gdk_export BAT *BATcalcbetweencstbat(BAT *b, const ValRecord *lo, BAT *hi, BAT *s, bool symmetric, bool linc, bool hinc, bool nils_false, bool anti); |
87 | gdk_export gdk_return VARcalcbetween(ValPtr ret, const ValRecord *v, const ValRecord *lo, const ValRecord *hi, bool symmetric, bool linc, bool hinc, bool nils_false, bool anti); |
88 | gdk_export BAT *BATcalcifthenelse(BAT *b, BAT *b1, BAT *b2); |
89 | gdk_export BAT *BATcalcifthenelsecst(BAT *b, BAT *b1, const ValRecord *c2); |
90 | gdk_export BAT *BATcalcifthencstelse(BAT *b, const ValRecord *c1, BAT *b2); |
91 | gdk_export BAT *BATcalcifthencstelsecst(BAT *b, const ValRecord *c1, const ValRecord *c2); |
92 | |
93 | gdk_export gdk_return VARcalcnot(ValPtr ret, const ValRecord *v); |
94 | gdk_export gdk_return VARcalcnegate(ValPtr ret, const ValRecord *v); |
95 | gdk_export gdk_return VARcalcabsolute(ValPtr ret, const ValRecord *v); |
96 | gdk_export gdk_return VARcalcincr(ValPtr ret, const ValRecord *v, bool abort_on_error); |
97 | gdk_export gdk_return VARcalcdecr(ValPtr ret, const ValRecord *v, bool abort_on_error); |
98 | gdk_export gdk_return VARcalciszero(ValPtr ret, const ValRecord *v); |
99 | gdk_export gdk_return VARcalcsign(ValPtr ret, const ValRecord *v); |
100 | gdk_export gdk_return VARcalcisnil(ValPtr ret, const ValRecord *v); |
101 | gdk_export gdk_return VARcalcisnotnil(ValPtr ret, const ValRecord *v); |
102 | gdk_export gdk_return VARcalcadd(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
103 | gdk_export gdk_return VARcalcsub(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
104 | gdk_export gdk_return VARcalcmul(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
105 | gdk_export gdk_return VARcalcdiv(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
106 | gdk_export gdk_return VARcalcmod(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
107 | gdk_export gdk_return VARcalcxor(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
108 | gdk_export gdk_return VARcalcor(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
109 | gdk_export gdk_return VARcalcand(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
110 | gdk_export gdk_return VARcalclsh(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
111 | gdk_export gdk_return VARcalcrsh(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool abort_on_error); |
112 | gdk_export gdk_return VARcalclt(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
113 | gdk_export gdk_return VARcalcgt(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
114 | gdk_export gdk_return VARcalcle(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
115 | gdk_export gdk_return VARcalcge(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
116 | gdk_export gdk_return VARcalceq(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool nil_matches); |
117 | gdk_export gdk_return VARcalcne(ValPtr ret, const ValRecord *lft, const ValRecord *rgt, bool nil_matches); |
118 | gdk_export gdk_return VARcalccmp(ValPtr ret, const ValRecord *lft, const ValRecord *rgt); |
119 | gdk_export BAT *BATconvert(BAT *b, BAT *s, int tp, bool abort_on_error); |
120 | gdk_export gdk_return VARconvert(ValPtr ret, const ValRecord *v, bool abort_on_error); |
121 | gdk_export gdk_return BATcalcavg(BAT *b, BAT *s, dbl *avg, BUN *vals, int scale); |
122 | |
123 | gdk_export BAT *BATgroupsum(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
124 | gdk_export BAT *BATgroupprod(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
125 | gdk_export gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error, int scale); |
126 | gdk_export BAT *BATgroupcount(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
127 | gdk_export BAT *BATgroupsize(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
128 | gdk_export BAT *BATgroupmin(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
129 | gdk_export BAT *BATgroupmax(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
130 | gdk_export BAT *BATgroupmedian(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
131 | gdk_export BAT *BATgroupquantile(BAT *b, BAT *g, BAT *e, BAT *s, int tp, double quantile, bool skip_nils, bool abort_on_error); |
132 | gdk_export BAT *BATgroupmedian_avg(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
133 | gdk_export BAT *BATgroupquantile_avg(BAT *b, BAT *g, BAT *e, BAT *s, int tp, double quantile, bool skip_nils, bool abort_on_error); |
134 | |
135 | /* helper function for grouped aggregates */ |
136 | gdk_export const char *BATgroupaggrinit( |
137 | BAT *b, BAT *g, BAT *e, BAT *s, |
138 | /* outputs: */ |
139 | oid *minp, oid *maxp, BUN *ngrpp, |
140 | struct canditer *ci, BUN *ncand); |
141 | |
142 | gdk_export gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, bool skip_nils, bool abort_on_error, bool nil_if_empty); |
143 | gdk_export gdk_return BATprod(void *res, int tp, BAT *b, BAT *s, bool skip_nils, bool abort_on_error, bool nil_if_empty); |
144 | gdk_export void *BATmax(BAT *b, void *aggr); |
145 | gdk_export void *BATmin(BAT *b, void *aggr); |
146 | gdk_export void *BATmax_skipnil(BAT *b, void *aggr, bit skipnil); |
147 | gdk_export void *BATmin_skipnil(BAT *b, void *aggr, bit skipnil); |
148 | |
149 | gdk_export dbl BATcalcstdev_population(dbl *avgp, BAT *b); |
150 | gdk_export dbl BATcalcstdev_sample(dbl *avgp, BAT *b); |
151 | gdk_export BAT *BATgroupstdev_sample(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
152 | gdk_export BAT *BATgroupstdev_population(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
153 | gdk_export dbl BATcalcvariance_population(dbl *avgp, BAT *b); |
154 | gdk_export dbl BATcalcvariance_sample(dbl *avgp, BAT *b); |
155 | gdk_export BAT *BATgroupvariance_sample(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
156 | gdk_export BAT *BATgroupvariance_population(BAT *b, BAT *g, BAT *e, BAT *s, int tp, bool skip_nils, bool abort_on_error); |
157 | |
158 | gdk_export BAT *BATgroupstr_group_concat(BAT *b, BAT *g, BAT *e, BAT *s, bool skip_nils, bool abort_on_error, const char *separator); |
159 | gdk_export gdk_return BATstr_group_concat(ValPtr res, BAT *b, BAT *s, bool skip_nils, bool abort_on_error, bool nil_if_empty, const char *separator); |
160 | |