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 | #ifndef ALGEBRA_H |
10 | #define ALGEBRA_H |
11 | |
12 | #include "gdk.h" |
13 | #include "mal_exception.h" |
14 | #include "mal_interpreter.h" |
15 | |
16 | mal_export str ALGstdev(dbl *res, const bat *bid); |
17 | mal_export str ALGstdevp(dbl *res, const bat *bid); |
18 | mal_export str ALGvariance(dbl *res, const bat *bid); |
19 | mal_export str ALGvariancep(dbl *res, const bat *bid); |
20 | |
21 | mal_export str ALGminany(ptr result, const bat *bid); |
22 | mal_export str ALGmaxany(ptr result, const bat *bid); |
23 | mal_export str ALGminany_skipnil(ptr result, const bat *bid, const bit *skipnil); |
24 | mal_export str ALGmaxany_skipnil(ptr result, const bat *bid, const bit *skipnil); |
25 | mal_export str ALGgroupby(bat *res, const bat *gids, const bat *cnts); |
26 | mal_export str ALGcard(lng *result, const bat *bid); |
27 | mal_export str ALGselect1(bat *result, const bat *bid, const void *low, const void *high, const bit *li, const bit *hi, const bit *anti); |
28 | mal_export str ALGselect2(bat *result, const bat *bid, const bat *sid, const void *low, const void *high, const bit *li, const bit *hi, const bit *anti); |
29 | mal_export str ALGselect1nil(bat *result, const bat *bid, const void *low, const void *high, const bit *li, const bit *hi, const bit *anti, const bit *unknown); |
30 | mal_export str ALGselect2nil(bat *result, const bat *bid, const bat *sid, const void *low, const void *high, const bit *li, const bit *hi, const bit *anti, const bit *unknown); |
31 | mal_export str ALGthetaselect1(bat *result, const bat *bid, const void *val, const char **op); |
32 | mal_export str ALGthetaselect2(bat *result, const bat *bid, const bat *sid, const void *val, const char **op); |
33 | |
34 | mal_export str ALGjoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
35 | mal_export str ALGjoin1(bat *r1, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
36 | mal_export str ALGleftjoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
37 | mal_export str ALGleftjoin1(bat *r1, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
38 | mal_export str ALGouterjoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
39 | mal_export str ALGsemijoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, const bat *sr, const bit *nil_matches, const lng *estimate); |
40 | mal_export str ALGthetajoin(bat *r1, bat *r2, const bat *l, const bat *r, const bat *sl, const bat *sr, const int *op, const bit *nil_matches, const lng *estimate); |
41 | mal_export str ALGbandjoin(bat *r1, bat *r2, const bat *lid, const bat *rid, const bat *slid, const bat *srid, const void *low, const void *high, const bit *li, const bit *hi, const lng *estimate); |
42 | mal_export str ALGrangejoin(bat *r1, bat *r2, const bat *lid, const bat *rlid, const bat *rhid, const bat *slid, const bat *srid, const bit *li, const bit *hi, const bit *anti, const bit *symmetric, const lng *estimate); |
43 | mal_export str ALGdifference(bat *r1, const bat *lid, const bat *rid, const bat *slid, const bat *srid, const bit *nil_matches, const bit *not_in, const lng *estimate); |
44 | mal_export str ALGintersect(bat *r1, const bat *lid, const bat *rid, const bat *slid, const bat *srid, const bit *nil_matches, const lng *estimate); |
45 | |
46 | /* legacy join functions */ |
47 | mal_export str ALGcrossproduct2(bat *l, bat *r, const bat *lid, const bat *rid); |
48 | /* end legacy join functions */ |
49 | |
50 | mal_export str ALGfirstn(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
51 | |
52 | mal_export str ALGcopy(bat *result, const bat *bid); |
53 | mal_export str ALGunique2(bat *result, const bat *bid, const bat *sid); |
54 | mal_export str ALGunique1(bat *result, const bat *bid); |
55 | mal_export str ALGprojection(bat *result, const bat *lid, const bat *rid); |
56 | |
57 | mal_export str ALGsort11(bat *result, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); |
58 | mal_export str ALGsort12(bat *result, bat *norder, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); |
59 | mal_export str ALGsort13(bat *result, bat *norder, bat *ngroup, const bat *bid, const bit *reverse, const bit *nilslast, const bit *stable); |
60 | mal_export str ALGsort21(bat *result, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); |
61 | mal_export str ALGsort22(bat *result, bat *norder, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); |
62 | mal_export str ALGsort23(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bit *reverse, const bit *nilslast, const bit *stable); |
63 | mal_export str ALGsort31(bat *result, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); |
64 | mal_export str ALGsort32(bat *result, bat *norder, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); |
65 | mal_export str ALGsort33(bat *result, bat *norder, bat *ngroup, const bat *bid, const bat *order, const bat *group, const bit *reverse, const bit *nilslast, const bit *stable); |
66 | mal_export str ALGcount_bat(lng *result, const bat *bid); |
67 | mal_export str ALGcount_nil(lng *result, const bat *bid, const bit *ignore_nils); |
68 | mal_export str ALGcount_no_nil(lng *result, const bat *bid); |
69 | mal_export str ALGcountCND_bat(lng *result, const bat *bid, const bat *cnd); |
70 | mal_export str ALGcountCND_nil(lng *result, const bat *bid, const bat *cnd, const bit *ignore_nils); |
71 | mal_export str ALGcountCND_no_nil(lng *result, const bat *bid, const bat *cnd); |
72 | mal_export str ALGslice(bat *ret, const bat *bid, const lng *start, const lng *end); |
73 | mal_export str ALGslice_int(bat *ret, const bat *bid, const int *start, const int *end); |
74 | mal_export str ALGslice_lng(bat *ret, const bat *bid, const lng *start, const lng *end); |
75 | mal_export str ALGslice_oid(bat *ret, const bat *bid, const oid *start, const oid *end); |
76 | mal_export str ALGsubslice_lng(bat *ret, const bat *bid, const lng *start, const lng *end); |
77 | mal_export str ALGfetchoid(ptr ret, const bat *bid, const oid *pos); |
78 | mal_export str ALGexist(bit *ret, const bat *bid, const void *val); |
79 | mal_export str ALGfind(oid *ret, const bat *bid, ptr val); |
80 | mal_export str ALGselectNotNil(bat *result, const bat *bid); |
81 | mal_export str ALGprojecttail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); |
82 | mal_export str ALGreuse(bat *ret, const bat *bid); |
83 | #endif |
84 | |