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

Throw exception if the returned (from findMax) bat_id is 0.
If the maximum weight in the list is the weight of the head 
(bat_id=0,weight=0),then all bats have a negative weight. This means that we 
have the optimal index for every bat.


diffs (21 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
@@ -103,7 +103,7 @@ findMax(FrequencyNode* head)
        bat=temp->bid;
        while(temp!=NULL)
        {
-               if(temp->weight > tmpW)
+               if(temp->weight >= tmpW)
                {
                        tmpW=temp->weight;
                        bat=temp->bid;
@@ -170,6 +170,8 @@ CRKrandomCrack(int *ret)
        FrequencyNode *fs = getFrequencyStruct('A');
 
        bid=findMax(fs);
+       if(bid==0)
+               throw(MAL, "crackers_holistic.randomCrack", "All bats reached 
the optimal index");
        b=BATdescriptor(bid);
        t=(int*)Tloc(b,BUNfirst(b));
        posl=BUNfirst(b);
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to