Changeset: 07b0779dae0a for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07b0779dae0a
Modified Files:
monetdb5/extras/pyapi/pyapi.c
Branch: pyapi
Log Message:
Optimization for creating NumPy masked array.
diffs (21 lines):
diff --git a/monetdb5/extras/pyapi/pyapi.c b/monetdb5/extras/pyapi/pyapi.c
--- a/monetdb5/extras/pyapi/pyapi.c
+++ b/monetdb5/extras/pyapi/pyapi.c
@@ -1949,11 +1949,12 @@ wrapup:
return NULL;
}
-#define CreateNullMask(tpe) \
- for(j = 0; j < count; j++) { \
- mask_data[j] = *((tpe*)BUNtail(bi, BUNfirst(b) + j)) == tpe##_nil; \
- found_nil = found_nil || mask_data[j]; \
- }
+#define CreateNullMask(tpe) { \
+ tpe *bat_ptr = (tpe*)b->T->heap.base; \
+ for(j = 0; j < count; j++) { \
+ mask_data[j] = bat_ptr[j] == tpe##_nil; \
+ found_nil = found_nil || mask_data[j]; \
+ } }
PyObject *PyNullMask_FromBAT(BAT *b, size_t t_start, size_t t_end)
{
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list