Changeset: d5529e4b0c0e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5529e4b0c0e
Added Files:
        monetdb5/extras/crackers/crackers_holisticsideways.c
        monetdb5/extras/crackers/crackers_holisticsideways.h
        monetdb5/extras/crackers/crackers_holisticsideways.mal
        monetdb5/extras/crackers/crackers_sidewayshol.mx
Modified Files:
        gdk/gdk_sample.c
        monetdb5/extras/crackers/60_crackers.mal
        monetdb5/extras/crackers/Makefile.ag
        monetdb5/extras/crackers/crackers.mx
        monetdb5/extras/crackers/crackers_core_unordered.mx
        monetdb5/extras/crackers/crackers_holistic.c
        monetdb5/extras/crackers/crackers_holistic.h
        monetdb5/extras/crackers/crackers_holistic.mal
        monetdb5/extras/crackers/crackers_index.mx
        monetdb5/extras/crackers/crackers_select_ops.mx
        monetdb5/extras/crackers/crackers_selecthol_ops.mx
        monetdb5/extras/crackers/crackers_selectholst_ops.mx
        monetdb5/extras/crackers/crackers_selectst_ops.mx
        monetdb5/extras/crackers/crackers_sideways.mx
Branch: holindex
Log Message:

Merged.


diffs (truncated from 4322 to 300 lines):

diff --git a/gdk/gdk_sample.c b/gdk/gdk_sample.c
--- a/gdk/gdk_sample.c
+++ b/gdk/gdk_sample.c
@@ -101,8 +101,8 @@ BATsample(BAT *b, BUN n)
                BATkey(BATmirror(bn), BATtkey(b));
                bn->H->seq = b->H->seq;
                bn->T->seq = b->T->seq;
-               bn->H->nil = b->H->nonil;
-               bn->T->nil = b->T->nonil;
+               bn->H->nil = b->H->nil;
+               bn->T->nil = b->T->nil;
                bn->H->nonil = b->H->nonil;
                bn->T->nonil = b->T->nonil;
                BATsetcount(bn, n);
diff --git a/monetdb5/extras/crackers/60_crackers.mal 
b/monetdb5/extras/crackers/60_crackers.mal
--- a/monetdb5/extras/crackers/60_crackers.mal
+++ b/monetdb5/extras/crackers/60_crackers.mal
@@ -23,3 +23,4 @@ include opt_selcrackhol;
 include opt_sidcrack;
 include crackers;
 include crackers_holistic;
+include crackers_holisticsideways;
diff --git a/monetdb5/extras/crackers/Makefile.ag 
b/monetdb5/extras/crackers/Makefile.ag
--- a/monetdb5/extras/crackers/Makefile.ag
+++ b/monetdb5/extras/crackers/Makefile.ag
@@ -39,11 +39,14 @@ lib_crackers = {
                          crackers_joinselect_ops.mx \
                          crackers_holistic.c \
                          crackers_holistic.h \
+                         crackers_holisticsideways.c \
+                         crackers_holisticsideways.h \
                          crackers_selectst_ops.mx \
                          crackers_selecthol_ops.mx \
                          crackers_selectholst_ops.mx \
                          crackers_updates.mx \
                          crackers_sideways.mx \
+                         crackers_sidewayshol.mx \
                          opt_selcrack.mx \
                          opt_selcrackst.mx \
                          opt_selcrackhol.mx \
@@ -63,7 +66,8 @@ headers_mal = {
                          opt_selcrackst.mx \
                          opt_selcrackhol.mx \
                          opt_sidcrack.mx \
-                         crackers_holistic.mal
+                         crackers_holistic.mal \
+                         crackers_holisticsideways.mal
 }
 
 headers_crackersautoload = {
diff --git a/monetdb5/extras/crackers/crackers.mx 
b/monetdb5/extras/crackers/crackers.mx
--- a/monetdb5/extras/crackers/crackers.mx
+++ b/monetdb5/extras/crackers/crackers.mx
@@ -381,6 +381,18 @@ address CRKjointhetaSelectSideways_@2
 comment "From cpair, only those BUNs qualify that satisfy the 
range-restriction on the tail.
         The result is a new [:oid,:bit] BAT that reflects the positions of 
buns in cpair. 
        For each tuple that qualifies in cpair, the respective position in the 
pivot is marked with a 1";
+
+command joinselecthol( b:bat[:oid,:@2],l:@2, h:@2, li:bit, hi:bit 
):bat[:oid,:bit]
+address CRKjoinSelectSidewayshol_@2
+comment "From cpair, only those BUNs qualify that satisfy the 
range-restriction on the tail.
+        The result is a new [:oid,:bit] BAT that reflects the positions of 
buns in cpair. 
+       For each tuple that qualifies in cpair, the respective position in the 
pivot is marked with a 1";
+
+command jointhetaselecthol( b:bat[:oid,:@2],v:@2,op:str):bat[:oid,:bit]
+address CRKjointhetaSelectSidewayshol_@2
+comment "From cpair, only those BUNs qualify that satisfy the 
range-restriction on the tail.
+        The result is a new [:oid,:bit] BAT that reflects the positions of 
buns in cpair. 
+       For each tuple that qualifies in cpair, the respective position in the 
pivot is marked with a 1";
 @
 @= Updates
 command insertionsPartiallyForget(b:bat[:any_1,:@2], c:bat[:any_1,:@2]):void
@@ -636,6 +648,134 @@ comment "add bp reference to map set of 
 command fmcreateMap(b:bat[:oid,:@1],bp:bat[:oid,:@2]):void
 address CRKcreateFullMap_@1_@2
 comment "make new map for debugging";
+
+
+
+command getMaphol( b:bat[:oid,:@1], bp:bat[:oid,:@2] ):bat[:@1,:@2]
+address getCrackerMaphol
+comment "Get a certain map";
+
+command DeleteMaphol( b:bat[:oid,:@1], bp:bat[:oid,:@2] ):void
+address DeleteCrackerMaphol
+comment "Throw away a certain map"; 
+
+command inserthol( b:bat[:oid,:@1], bp:bat[:oid,:@2], c:bat[:@1,:@2]):void
+address CRKinserthol
+comment "Keep the insertions BAT separatelly and merge in the future on demand 
with the Ripple";
+
+command printPendingInsertionshol( b:bat[:oid,:@1], bp:bat[:oid,:@2]):void
+address CRKprintPendingInsertionshol
+comment "Print the pending insertions";
+
+command extendCrackerMaphol(b:bat[:oid,:@1], bp:bat[:oid,:@2], P:lng):void
+address CRKextendCrackerMaphol
+comment "Extend the cracker map by P positions";
+
+command sizePendingInsertionshol(b:bat[:oid,:@1], bp:bat[:oid,:@2]):void
+address CRKsizePendingInsertionshol
+comment "Get the size of the pending insertions for this map";
+
+
+
+command 
hselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@1]
+address CRKhselectBoundsSidewayshol_@1_@2
+comment "Retrieve the subset head using a cracker
+        index producing preferably a BATview.";
+
+command 
tselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKtselectBoundsSidewayshol_@1_@2
+comment "Retrieve the subset tail using a cracker
+        index producing preferably a BATview.";
+
+command 
dselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit,l2:@2,h2:@2,li2:bit,hi2:bit):bat[:oid,:bit]
+address CRKdselectBoundsSidewayshol_@1_@2
+comment "Crack based on @1 and evaluate the @2 disjunctive predicate outside 
the cracked area. Return a bit vector.";
+
+
+command joinselecthol( b:bat[:oid,:@1],bp:bat[:oid,:@2], pivot:bat[:oid,:bit], 
cl:@1, ch:@1, cli:bit, chi:bit, l:@2, h:@2, li:bit, hi:bit ):bat[:oid,:bit]
+address CRKjoinSelectSidewayshol_P_@1_@2
+comment "Use the pivot. For each tuple in pivot with a 1, check if the 
respective tuple (in the same position)
+        in the tail of cpair satisfies the range restriction. If not mark the 
pivot BUN as 0.";
+
+command jointhetaselecthol( b:bat[:oid,:@1],bp:bat[:oid,:@2], 
pivot:bat[:oid,:bit], cl:@1, ch:@1, cli:bit, chi:bit, l:@2, 
op:str):bat[:oid,:bit]
+address CRKjointhetaSelectSidewayshol_P_@1_@2
+comment "Use the pivot. For each tuple in pivot with a 1, check if the 
respective tuple (in the same position)
+        in the tail of cpair satisfies the range restriction. If not mark the 
pivot BUN as 0.";
+
+command djoinselecthol( b:bat[:oid,:@1],bp:bat[:oid,:@2], 
pivot:bat[:oid,:bit], l:@2, h:@2, li:bit, hi:bit ):bat[:oid,:bit]
+address CRKdjoinSelectSidewayshol_P_@1_@2
+comment "Use the pivot. For each tuple in pivot with a 0, check if the 
respective tuple (in the same position)
+        in the tail of cpair satisfies the range restriction. If yes mark the 
pivot BUN as 1.";
+
+
+command projecthol( b:bat[:oid,:@1],bp:bat[:oid,:@2], 
l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKProjectCrackhol_@1_@2
+comment "Sync map and project the tail";
+
+command projecthol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKProjecthol_@1_@2
+comment "Sync map and project tail based on pivot";
+
+command projectHhol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@1]
+address CRKProjectHhol_@1_@2
+comment "Sync map and project head based on pivot";
+
+command positionprojecthol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],PositionPivot:bat[:oid,:oid],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKPositionProjecthol_@1_@2
+comment "Sync the cracking pair and project the tail. The pivot holds the 
positions to be projected";
+
+command markedprojecthol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKMarkedProjecthol_@1_@2
+comment "Sync the cracking pair and project the tail. The result bat has a 
marked head";
+
+command dprojecthol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit]):bat[:oid,:@2]
+address CRKdProjecthol_@1_@2
+comment "Sync the cracking pair and project the tail. Use for disjunctive 
queries that require a larger bit vector";
+
+command dprojectHhol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit]):bat[:oid,:@1]
+address CRKdProjectHhol_@1_@2
+comment "Sync the cracking pair and project the head. Use for disjunctive 
queries that require a larger bit vector";
+
+command positionprojecthol( 
b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:oid]):bat[:oid,:@2]
+address CRKdPositionProjecthol_@1_@2
+comment "Sync the cracking pair and project the tail. Use position based 
pivot";
+
+command 
pmselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit,l2:@2,h2:@2,li2:bit,hi2:bit):bat[:oid,:bit]
+address CRKselectBoundsIncrementalSidewayshol_@1_@2
+comment "Crack based on @1 and evaluate the @2 conjunctive predicate. Return a 
bit vector.";
+
+command 
pmtselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKselectBoundsTailIncrementalSidewayshol_@1_@2
+comment "Crack based on @1 and project the @2 tail .";
+
+command pmjoinselecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2], 
pivot:bat[:oid,:bit], cl:@1, ch:@1, cli:bit, chi:bit, l:@2, h:@2, li:bit, 
hi:bit ):bat[:oid,:bit]
+address CRKjoinSelectIncrementalSidewayshol_@1_@2
+comment "Use the pivot. For each tuple in pivot with a 1, check if the 
respective tuple (in the same position)
+        in the tail of cpair(collection of pieces) satisfies the range 
restriction. If not mark the pivot BUN as 0.";
+
+command 
pmprojecthol(b:bat[:oid,:@1],bp:bat[:oid,:@2],pivot:bat[:oid,:bit],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKProjectIncrementalSidewayshol_@1_@2
+comment "Sync the map and project the tail based on the pivot";
+
+command 
pmmaxTailhol(b:bat[:oid,:@1],bp:bat[:oid,:@2],l:@1,h:@1,li:bit,hi:bit):bat[:oid,:@2]
+address CRKMaxTailIncrementalSidewayshol_@1_@2
+comment "Sync/crack the map and get the max of the tail";
+
+command pmaddReferencehol(b:bat[:oid,:@1],bp:bat[:oid,:@2]):void
+address CRKaddReferencehol
+comment "add bp reference to map set of b";
+
+command pmclearReferenceshol(b:bat[:oid,:@1]):void
+address CRKclearReferenceshol
+comment "clear all references to b";
+
+command fmaddReferencehol(b:bat[:oid,:@1],bp:bat[:oid,:@2]):void
+address CRKaddReferenceFullMapshol
+comment "add bp reference to map set of b";
+
+command fmcreateMaphol(b:bat[:oid,:@1],bp:bat[:oid,:@2]):void
+address CRKcreateFullMaphol_@1_@2
+comment "make new map for debugging";
 @
 
  
@@ -667,10 +807,12 @@ comment "make new map for debugging";
 #include "crackers_selecthol_ops.h"
 #include "crackers_selectholst_ops.h"
 #include "crackers_holistic.h"
+#include "crackers_holisticsideways.h"
 #include "crackers_core_unordered.h"
 #include "crackers_AVL_tree.h"
 #include "crackers_updates.h"
 #include "crackers_sideways.h"
+#include "crackers_sidewayshol.h"
 
 #ifdef LIBCRACKERS 
 extern int maxCrackMap;
diff --git a/monetdb5/extras/crackers/crackers_core_unordered.mx 
b/monetdb5/extras/crackers/crackers_core_unordered.mx
--- a/monetdb5/extras/crackers/crackers_core_unordered.mx
+++ b/monetdb5/extras/crackers/crackers_core_unordered.mx
@@ -57,7 +57,7 @@ All Rights Reserved.
 @:@1(dbl,int,simple,,,@2)@
 @:@1(dbl,dbl,simple,,,@2)@
 @:@1(lng,lng,simple,,,@2)@
-
+@:@1(lng,int,simple,,,@2)@
 
 @:@1(date,int,atom,TYPE_,,@2)@
 @:@1(date,lng,atom,TYPE_,,@2)@
diff --git a/monetdb5/extras/crackers/crackers_holistic.c 
b/monetdb5/extras/crackers/crackers_holistic.c
--- a/monetdb5/extras/crackers/crackers_holistic.c
+++ b/monetdb5/extras/crackers/crackers_holistic.c
@@ -121,28 +121,34 @@ void
 printFrequencyStruct(FrequencyNode* head)
 {
        FrequencyNode* temp;
-       /*FILE *ofp1,*ofp2;
-       FILE *ofp3,*ofp4,*ofp5;
-       char outputFilename1[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outA.txt";
-       char outputFilename2[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outB.txt";
+       double d;
+       FILE *ofp1;
+       /*FILE *ofp2,*ofp3,*ofp4,*ofp5;*/
+       char outputFilename1[] = 
"/export/scratch2/petraki/experiments_1st_paper/experiments/strategies/distance/out.txt";
+       /*char outputFilename2[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outB.txt";
        char outputFilename3[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outC.txt";
         char outputFilename4[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outD.txt";
-       char outputFilename5[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outE.txt";
+       char outputFilename5[] = 
"/export/scratch2/petraki/experiments_1st_paper/same#tuples/new/hit_range/1st_CostModel_variation/sequential_ABCDE/outE.txt";*/
        ofp1 = fopen(outputFilename1,"a");
-       ofp2 = fopen(outputFilename2,"a");
+       /*ofp2 = fopen(outputFilename2,"a");
        ofp3 = fopen(outputFilename3,"a");
         ofp4 = fopen(outputFilename4,"a");
-        ofp5 = fopen(outputFilename5,"a");
+        ofp5 = fopen(outputFilename5,"a");*/
 
-       if (ofp1 == NULL || ofp2 == NULL) {
+       if (ofp1 == NULL) {
                fprintf(stderr, "Can't open output file!\n");
                exit(1);
-       }*/
+       }
        temp=head;
        while(temp != NULL)
        {
-               fprintf(stderr,"Bid=%d c=%d f1=%d f2=%d W=%lf  
\n",temp->bid,temp->c,temp->f1,temp->f2,temp->weight);
-               /*fprintf(ofp1,"%d\t%d\t",temp->bid,temp->c);*/
+               /*fprintf(stderr,"Bid=%d c=%d f1=%d f2=%d W=%lf  
\n",temp->bid,temp->c,temp->f1,temp->f2,temp->weight);*/
+               if(temp->weight>0)
+               {
+                       d=(100000000.0/temp->c) - 8000.0;
+                       fprintf(ofp1,"%d\t%lf\n",temp->bid,d);
+                       
+               }
                /*if(temp->bid==231 && temp->weight>0)
                        fprintf(ofp1,"%d\t%d\n",temp->bid,temp->f1);
                else if(temp->bid==232 && temp->weight>0)
@@ -156,8 +162,8 @@ printFrequencyStruct(FrequencyNode* head
                temp=temp->next;
        }
        /*fprintf(ofp,"\n");*/
-       /*fclose(ofp1);
-       fclose(ofp2);
+       fclose(ofp1);
+       /*fclose(ofp2);
        fclose(ofp3);
        fclose(ofp4);
        fclose(ofp5);*/
@@ -287,7 +293,7 @@ changeWeight_2(FrequencyNode* node,int N
                node->weight = d;
        }
 
-       fprintf(stderr,"bid=%d f1=%d f2=%d p=%d Sp=%lf d=%lf 
W=%lf\n",node->bid,node->f1,node->f2,p,Sp,d,node->weight);
+       /*fprintf(stderr,"bid=%d f1=%d f2=%d p=%d Sp=%lf d=%lf 
W=%lf\n",node->bid,node->f1,node->f2,p,Sp,d,node->weight);*/
        return node->weight;
 }
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to