Changeset: 9a5cd0639996 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9a5cd0639996 Modified Files: monetdb5/extras/crackers/crackers_holistic.c Branch: holindex Log Message:
Add new function that changes the weight of a specific node according to the second cost mode (w=frequency*distance). diffs (25 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 @@ -168,6 +168,21 @@ changeWeight_1(FrequencyNode* node,int N return node->weight; } +/*this function updates the weights in the list in the second experiment (2nd cost model)*/ +double +changeWeight_2(FrequencyNode* node,int N,int L1) +{ + int p; /*number of pieces in the index*/ + double Sp; /*average size of each piece*/ + double d; /*distance from optimal piece(L1)*/ + p = node->c; + 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; + /*fprintf(stderr,"W=%lf\n",node->weight);*/ + return node->weight; +} void deleteNode(FrequencyNode* head,int bat_id) _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list