lsidir, (;-)) since it now seems to be dead code (correct me if I'm wrong), is there any reason to keep the "deprecated" implementation of BATsample around, or shouldn't we better clean up our code and remove the old BATsample (now BATsample_deprecated) entirely? Thanks, Stefan On Fri, Mar 16, 2012 at 12:51:52PM +0100, lsidir wrote:
Changeset: 6985c995bf66 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6985c995bf66 Modified Files: gdk/gdk.h gdk/gdk_batop.mx gdk/gdk_sample.c monetdb5/modules/mal/sample.c Branch: default Log Message:
Activating the new implementation of BATsample.
diffs (57 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -3129,7 +3129,7 @@ gdk_export int ALIGNsetH(BAT *b1, BAT *b gdk_export void PROPdestroy(PROPrec *p); gdk_export PROPrec * BATgetprop(BAT *b, int idx); gdk_export void BATsetprop(BAT *b, int idx, int type, void *v); -gdk_export BAT *BATsample(BAT *b, BUN n); +gdk_export BAT *BATsample_deprecated(BAT *b, BUN n); gdk_export BAT *BAThistogram(BAT *b); gdk_export int BATtopN(BAT *b, BUN topN); /* used in monet5/src/modules/kernel/algebra.mx */
@@ -3368,7 +3368,7 @@ gdk_export int BATcalcavg(BAT *b, dbl *a * @tab BATsample (BAT *b, n) * @end multitable */ -gdk_export BAT *BATsample1(BAT *b, BUN n); +gdk_export BAT *BATsample(BAT *b, BUN n);
/* generic n-ary multijoin beast, with defines to interpret retval */ #define MULTIJOIN_SORTED(r) ((char*) &r)[0] diff --git a/gdk/gdk_batop.mx b/gdk/gdk_batop.mx --- a/gdk/gdk_batop.mx +++ b/gdk/gdk_batop.mx @@ -1374,7 +1374,7 @@ BATtopN(BAT *b, BUN topN) * @- Random Selections */ BAT * -BATsample(BAT *b, BUN size) +BATsample_deprecated(BAT *b, BUN size) { BUN cnt, i, r = 0, n, j; BUN *choice = NULL, *dst; diff --git a/gdk/gdk_sample.c b/gdk/gdk_sample.c --- a/gdk/gdk_sample.c +++ b/gdk/gdk_sample.c @@ -47,7 +47,7 @@ */
BAT * -BATsample1(BAT *b, BUN n) +BATsample(BAT *b, BUN n) { BAT *bn; BUN cnt; diff --git a/monetdb5/modules/mal/sample.c b/monetdb5/modules/mal/sample.c --- a/monetdb5/modules/mal/sample.c +++ b/monetdb5/modules/mal/sample.c @@ -85,7 +85,7 @@ SAMPLEuniform(bat *r, bat *b, ptr s) { if ((bb = BATdescriptor(*b)) == NULL) { throw(MAL, "sample.uniform", INTERNAL_BAT_ACCESS); } - br = BATsample1(bb,*(BUN *)s); + br = BATsample(bb,*(BUN *)s); if (br == NULL) throw(MAL, "sample.uniform", OPERATION_FAILED);
_______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list
-- | Stefan.Manegold @ CWI.nl | DB Architectures (INS1) | | http://CWI.nl/~manegold/ | Science Park 123 (L321) | | Tel.: +31 (0)20 592-4212 | 1098 XG Amsterdam (NL) |