Changeset: 162029710bc6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=162029710bc6
Modified Files:
        monetdb5/extras/crackers/crackers_holistic.c
Branch: holindex
Log Message:

Add check for f1 in the 2nd changeWeight function.
If the frequency of queries is equal to 0, take into
consideration only the distance from the optimal index.


diffs (19 lines):

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
@@ -191,7 +191,14 @@ changeWeight_2(FrequencyNode* node,int N
        Sp =((double)N)/p;      
        d = Sp - L1;
        /*fprintf(stderr,"p=%d Sp=%lf d=%lf\n",p,Sp,d);*/
-       node->weight = (double)(node->f1) * d;
+       if (node->f1==0)
+       {
+               node->weight = d;
+       }
+       else
+       {
+               node->weight = (double)(node->f1) * d;
+       }
        /*fprintf(stderr,"W=%lf\n",node->weight);*/
        return node->weight;
 }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to