Changeset: 42e93589861e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=42e93589861e
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/modules/mal/Tests/array04.mal
        monetdb5/modules/mal/Tests/array04.stable.out
        monetdb5/modules/mal/array.mx
Branch: sciql
Log Message:

array.mx clean-up: removed unused array.embed() / ARRAYembed()

dead code remains available in the HG attic


diffs (134 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -783,7 +783,6 @@ str ALGurangesplit(int *result, int *bid
 str ALGuselect(int *result, int *bid, ptr low, ptr high);
 str ALGuselect1(int *result, int *bid, ptr value);
 str ALGuselectInclusive(int *result, int *bid, ptr low, ptr high, bit *lin, 
bit *rin);
-str ARRAYembed(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
 str ARRAYfiller(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str ARRAYfiller_bat(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
 str ARRAYgetDimensions(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p);
diff --git a/monetdb5/modules/mal/Tests/array04.mal 
b/monetdb5/modules/mal/Tests/array04.mal
--- a/monetdb5/modules/mal/Tests/array04.mal
+++ b/monetdb5/modules/mal/Tests/array04.mal
@@ -70,12 +70,6 @@ io.print(mx, my, mv, gs, ga);
 #nv:= array.filler(nx,nil:int);
 #io.print(nx,ny,nv);
 #
-##derive the mapping from cell id in N into M
-#map:= array.embed(nx,ny,mx,my);
-#io.print(map);
-#rv:= array.replace(nv,map,mv);
-#io.print(rv);
-#
 ##now produce the tiled sum over the enlarged one
 #template:= array.map(nx,ny,t0,t1);
 #io.print(template);
diff --git a/monetdb5/modules/mal/Tests/array04.stable.out 
b/monetdb5/modules/mal/Tests/array04.stable.out
--- a/monetdb5/modules/mal/Tests/array04.stable.out
+++ b/monetdb5/modules/mal/Tests/array04.stable.out
@@ -76,11 +76,6 @@ function user.main():void;
 #ny:= array.series(-1,1,5,1,6); 
 #nv:= array.filler(nx,nil:int); 
 #io.print(nx,ny,nv); 
-##derive the mapping from cell id in N into M 
-#map:= array.embed(nx,ny,mx,my); 
-#io.print(map); 
-#rv:= array.replace(nv,map,mv); 
-#io.print(rv); 
 ##now produce the tiled sum over the enlarged one 
 #template:= array.map(nx,ny,t0,t1); 
 #io.print(template); 
diff --git a/monetdb5/modules/mal/array.mx b/monetdb5/modules/mal/array.mx
--- a/monetdb5/modules/mal/array.mx
+++ b/monetdb5/modules/mal/array.mx
@@ -171,10 +171,6 @@ command product(b:bat[:any_3,:any_1],c:b
 address ARRAYproduct
 comment "Produce an array product";
 
-pattern embed(shapes:bat[:oid,:any]...):bat[:oid,:oid]
-address ARRAYembed
-comment "Take two shapes N and M and derive a mapping between the elements 
based on the index values.
-It can be used to create an embedding of values from one array into another.";
 @- Implementation
 @h
 
@@ -209,7 +205,6 @@ array_export str ARRAYumap(Client cntxt,
 array_export str ARRAYreplace(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 array_export str ARRAYreplaceScalar(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 array_export str ARRAYtiles(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
-array_export str ARRAYembed(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr pci);
 
 @= array_defs
 array_export str ARRAYseries_@1(int *ret, @1 *start, @1 *step, @1 *stop, int 
*grp, int *series);
@@ -1056,69 +1051,4 @@ ARRAYtiles@2_@1(Client cntxt, MalBlkPtr 
 @:tilesMinMax(lng,Max,max,MAX)@
 @:tilesMinMax(flt,Max,max,MAX)@
 @:tilesMinMax(dbl,Max,max,MAX)@
-
-@-
-The compilating factor is that in general the tile enumeration is dense, while
-the tile structure can go over its boundaries. For this to control, we first
-embed the array into a slightly larger array, filled with nulls.
-@c
-str
-ARRAYembed(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
-       BAT **b, *bn = NULL, *bo;
-       int i,n = 0, error = FALSE;
-
-       (void) cntxt;
-       (void) mb;
-       if ( (pci->argc - pci->retc) % 2 != 0)
-               throw(MAL, "array.embed", "Unbalanced index arguments");
-
-       b= (BAT**) GDKzalloc(sizeof(BAT*) * pci->argc-pci->retc);
-       if( b == NULL)
-               throw(MAL, "array.embed", MAL_MALLOC_FAIL);
-
-       for ( i=pci->retc; i< pci->argc; i++){
-               if ((b[n++] = BATdescriptor(*(int*)getArgReference(stk,pci,i))) 
== NULL) {
-                       for ( n--; n>= 0; n--)
-                               BBPreleaseref(b[n]->batCacheid);
-                       GDKfree(b);
-                       throw(MAL, "array.embed", RUNTIME_OBJECT_MISSING);
-               }
-       }
-       /* type check the shapes and prepare iterators */
-       for ( i= 0; i< n/2; i++) 
-               error |= b[i]->ttype != b[i+n/2]->ttype;
-
-       if ( error ){
-               for ( n--; n>= 0; n--)
-                       BBPreleaseref(b[n]->batCacheid);
-               GDKfree(b);
-               throw(MAL, "array.embed", "Incompatible index types");
-       }
-
-       /* select the oids we need by searching all matching index vectors */
-       bn = b[0];
-       for ( i=0; i<n/2; i++){
-               bo = BATsemijoin(b[i],bn);
-               bn= BATmirror(BATsemijoin(BATmirror(bo), BATmirror(b[i+n/2])));
-               BBPreleaseref(bo->batCacheid);
-               bo = b[i+n/2];
-       }
-
-       if ( BATcount(bn) == BATcount(b[n/2]) ) {
-               bn = BATmark(bn,0);
-               BBPkeepref(bn->batCacheid);
-               *(int*) getArgReference(stk,pci,0) = bn->batCacheid;
-       } else {
-               error = TRUE;
-               BBPreleaseref(bn->batCacheid);
-       }
-
-       for ( n--; n>= 0; n--)
-               BBPreleaseref(b[n]->batCacheid);
-       GDKfree(b);
-       if( error)
-               throw(MAL,"array.embed","incomplete embedding");
-       return MAL_SUCCEED;
-}
 @}
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to