Changeset: 43214ed28377 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43214ed28377 Modified Files: gdk/gdk.h gdk/gdk_cand.h Branch: unlock Log Message:
Move candidate stuff to gdk_cand.h. diffs (91 lines): diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -991,29 +991,7 @@ typedef var_t stridx_t; #include "gdk_atoms.h" - -/* candidates by design are ordered oid lists, besides native oid bats - * there are - * void bats for dense oid lists, - * negative oid lists - * masked oid lists - */ - -#define CAND_NEGOID 0 -#define CAND_MSK 1 - -typedef struct { - uint64_t - type:1, - mask:1; -} ccand_t; - -#define CCAND(b) ((ccand_t*)b->tvheap->base) -#define complex_cand(b) (b->ttype == TYPE_void && b->tvheap != NULL) -#define negoid_cand(b) (b->ttype == TYPE_void && b->tvheap != NULL && CCAND(b)->type == CAND_NEGOID) -#define mask_cand(b) (b->ttype == TYPE_void && b->tvheap != NULL && CCAND(b)->type == CAND_MSK) -#define ccand_first(b) (b->tvheap->base+sizeof(ccand_t)) -#define ccand_free(b) (b->tvheap->free-sizeof(ccand_t)) +#include "gdk_cand.h" /* return the oid value at BUN position p from the (v)oid bat b * works with any TYPE_void or TYPE_oid bat */ @@ -2163,14 +2141,9 @@ gdk_export BAT *BATslice(BAT *b, BUN low gdk_export BAT *BATunique(BAT *b, BAT *s); -gdk_export BAT *BATmergecand(BAT *a, BAT *b); -gdk_export BAT *BATintersectcand(BAT *a, BAT *b); -gdk_export BAT *BATdiffcand(BAT *a, BAT *b); - gdk_export gdk_return BATfirstn(BAT **topn, BAT **gids, BAT *b, BAT *cands, BAT *grps, BUN n, bool asc, bool nilslast, bool distinct) __attribute__((__warn_unused_result__)); -#include "gdk_cand.h" #include "gdk_calc.h" /* diff --git a/gdk/gdk_cand.h b/gdk/gdk_cand.h --- a/gdk/gdk_cand.h +++ b/gdk/gdk_cand.h @@ -9,6 +9,29 @@ #ifndef _GDK_CAND_H_ #define _GDK_CAND_H_ +/* candidates by design are ordered oid lists, besides native oid bats + * there are + * void bats for dense oid lists, + * negative oid lists + * masked oid lists + */ + +#define CAND_NEGOID 0 +#define CAND_MSK 1 + +typedef struct { + uint64_t + type:1, + mask:1; +} ccand_t; + +#define CCAND(b) ((ccand_t*)(b)->tvheap->base) +#define complex_cand(b) ((b)->ttype == TYPE_void && (b)->tvheap != NULL) +#define negoid_cand(b) (complex_cand(b) && CCAND(b)->type == CAND_NEGOID) +#define mask_cand(b) (complex_cand(b) && CCAND(b)->type == CAND_MSK) +#define ccand_first(b) ((b)->tvheap->base+sizeof(ccand_t)) +#define ccand_free(b) ((b)->tvheap->free-sizeof(ccand_t)) + struct canditer { BAT *s; /* candidate BAT the iterator is based on */ union { @@ -152,4 +175,8 @@ gdk_export gdk_return BATnegcands( BAT * gdk_export gdk_return BATmaskedcands( BAT *dense_cands, BAT *masked, bool selected); gdk_export BAT *BATunmask(BAT *b); +gdk_export BAT *BATmergecand(BAT *a, BAT *b); +gdk_export BAT *BATintersectcand(BAT *a, BAT *b); +gdk_export BAT *BATdiffcand(BAT *a, BAT *b); + #endif /* _GDK_CAND_H_ */ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list