Update of /cvsroot/monetdb/MonetDB4/src/modules/plain
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1794/src/modules/plain
Modified Files:
Makefile.ag xtables.mx
Log Message:
propagated changes of Monday Oct 22 2007 - Wednesday Oct 24 2007
from the MonetDB_4-20 branch to the development trunk
Index: Makefile.ag
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/modules/plain/Makefile.ag,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Makefile.ag 4 Oct 2007 10:35:16 -0000 1.7
+++ Makefile.ag 24 Oct 2007 07:59:15 -0000 1.8
@@ -14,7 +14,8 @@
# Portions created by CWI are Copyright (C) 1997-2007 CWI.
# All Rights Reserved.
-INCLUDES = $(MONETDB_INCS) -I../../monet \
+INCLUDES = -I../../monet \
+ $(MONETDB_INCS) \
$(Z_CFLAGS) $(BZ_CFLAGS) $(HWCOUNTERS_INCS) $(PCL_CFLAGS) \
$(PCRE_CFLAGS) $(ICONV_CFLAGS)
MTSAFE
Index: xtables.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/modules/plain/xtables.mx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xtables.mx 4 Oct 2007 10:35:27 -0000 1.5
+++ xtables.mx 24 Oct 2007 07:59:15 -0000 1.6
@@ -703,6 +703,43 @@
break;
}
[EMAIL PROTECTED]
+#define SAMPLE_SIZE 1024
+hash_t
+derive_mask( BAT *ct_map, BAT *ct_histo, BAT *b)
+{
+ size_t cnt = BATcount(b);
+ int n = bits(BATcount(ct_histo)), *N = &n;
+
+ if (BATcount(b) > (SAMPLE_SIZE<<3)) {
+ BAT *s = BATsample(b, SAMPLE_SIZE);
+ grp d,o;
+ BUN p, q;
+ BAT *histo;
+ hash_t r = 0;
+
+ o.map = ct_map->batCacheid;
+ o.histo = ct_histo->batCacheid;
+ if (CTderive(&d, &o, s) != GDK_SUCCEED) {
+ BBPunfix(s->batCacheid);
+ return GDK_FAIL;
+ }
+ BBPunfix(s->batCacheid);
+ assert (d.histo);
+ histo = BATdescriptor(d.histo);
+ BATloop(histo, p, q) {
+ /* + 4 for a average chain list of 4 */
+ r += ((dbl)cnt/SAMPLE_SIZE)/(*(int*)BUNtloc(histo,p)+4);
+ }
+ BBPunfix(d.histo);
+ grp_unfix(&d);
+ if (bits(r) > *N)
+ return (1<<bits(r))-1;
+ }
+ /* default to */
+ return (1<<*N) - 1;
+}
+
@= derive
static BAT *
[EMAIL PROTECTED]@[EMAIL PROTECTED](BAT* ct_map, BAT *ct_histo, BAT *b, BAT
*bn, map_T *m)
@@ -714,9 +751,8 @@
BUN p, q, r, cp = BUNfirst(ct_map) - 1;
mapentry_t entry, *e;
BAT *map;
- int n = bits(BATcount(ct_histo)), *N = &n;
[EMAIL PROTECTED]
- declare_mask_CUSTOM
+ hash_t mask = derive_mask(ct_map, ct_histo, b);
int custom_rng = BATcount(ct_histo); /* expected number of groups */
hash_t custom_MASK = mask;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins