Update of /cvsroot/monetdb/MonetDB4/src/modules/plain
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv15291/src/modules/plain

Modified Files:
        algebra.mx constant.mx 
Log Message:
because of the anti-select the BAT_select_ interface changed
added mel commands for antiuselect


Index: constant.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/modules/plain/constant.mx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- constant.mx 11 Jan 2008 10:38:54 -0000      1.6
+++ constant.mx 6 Mar 2008 08:29:21 -0000       1.7
@@ -428,7 +428,7 @@
 int 
 CMDconstIntersect(BAT **res, BAT *l, ptr val) 
 {
-       *res = BAT_select_(l, val, val, TRUE, TRUE, TRUE, TRUE);
+       *res = BAT_select_(l, val, val, TRUE, TRUE, TRUE, FALSE, TRUE);
        return (*res)?GDK_SUCCEED:GDK_FAIL;
 }
 @}

Index: algebra.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB4/src/modules/plain/algebra.mx,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- algebra.mx  8 Feb 2008 22:36:06 -0000       1.11
+++ algebra.mx  6 Mar 2008 08:29:21 -0000       1.12
@@ -119,6 +119,11 @@
                                BAT[any::1, void] = CMDuselect_;
 "Select on tail, returning only the head values.
  SEE ALSO: select(bat,low,high,l_in,h_in)."
+
+.COMMAND antiuselect ( BAT[any::1,any::2] b, any::2 low, any::2 high, bit 
l_in, bit h_in) :
+                               BAT[any::1, void] = CMDantiuselect_;
+"AntiSelect on tail, returning only the head values.
+ SEE ALSO: select(bat,low,high,l_in,h_in)."
 @- value select
 @m
 .COMMAND select ( BAT[any::1,any::2] b, any::2 value) :
@@ -131,6 +136,11 @@
                                BAT[any::1, void] = CMDuselect1;
 "Value select, but returning only the head values.
  SEE ALSO: select(bat,val)"
+
+.COMMAND antiuselect ( BAT[any::1,any::2] b, any::2 value) :
+                               BAT[any::1, void] = CMDantiuselect1;
+"Value antiselect, but returning only the head values.
+ SEE ALSO: select(bat,val)"
 @m
 .COMMAND fragment ( BAT[any::1,any::2] b,
        any::1 hlow, any::1 hhigh,
@@ -1615,6 +1625,14 @@
 }
 
 int
+CMDantiuselect1(BAT **result, BAT *b, ptr value)
+{
+       ptr v = (b->ttype == TYPE_bat) ? (ptr) &((BAT *) value)->batCacheid : 
value;
+
+       return (*result = BATantiuselect_(b, v, NULL, FALSE, FALSE)) ? 
GDK_SUCCEED : GDK_FAIL;
+}
+
+int
 CMDselect(BAT **result, BAT *b, ptr low, ptr high)
 {
        ptr l = (b->ttype == TYPE_bat) ? (ptr) &((BAT *) low )->batCacheid : 
low ;
@@ -1687,6 +1705,29 @@
 }
 
 int
+CMDantiuselect_(BAT **result, BAT *b, ptr low, ptr high, bit *l_in, bit *h_in)
+{
+       int tt = b->ttype;
+       ptr nil = ATOMnilptr(tt);
+       ptr l = (b->ttype == TYPE_bat) ? (ptr) &((BAT *) low )->batCacheid : 
low ;
+       ptr h = (b->ttype == TYPE_bat) ? (ptr) &((BAT *) high)->batCacheid : 
high;
+
+       if (b->ttype == TYPE_bat && l != h ) {
+               GDKerror("CMDantiuselect: range-selects on type BAT are not 
supported\n");
+               return GDK_FAIL;
+       }
+       if (*l_in == bit_nil && ATOMcmp(tt, l, nil)) {
+               GDKerror("CMDantiuselect: flag 'l_in' must not be NIL, unless 
boundary 'low' is NIL\n");
+               return GDK_FAIL;
+       }
+       if (*h_in == bit_nil && ATOMcmp(tt, h, nil)) {
+               GDKerror("CMDantiuselect: flag 'h_in' must not be NIL, unless 
boundary 'high' is NIL\n");
+               return GDK_FAIL;
+       }
+       return (*result = BATantiuselect_(b, l, h, *l_in, *h_in)) ? GDK_SUCCEED 
: GDK_FAIL;
+}
+
+int
 CMDfragment(BAT **result, BAT *b, ptr hlow, ptr hhigh, ptr tlow, ptr thigh)
 {
        return (*result = BATrestrict(b, hlow, hhigh, tlow, thigh)) ? 
GDK_SUCCEED : GDK_FAIL;


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to