changeset 765:337e72088f76

Fix for some sample bugs a + b ? c : d does not do what I think it does. That bug mostly masked a thorough logic error in building the table of counts of possible sequences; there was too much cumulativeness. There apparently remain problems
author mas01cr
date Thu, 02 Jun 2011 16:31:35 +0000
parents 77f7bc99dfd6
children 6a5117d68ac4
files sample.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sample.cpp	Fri Nov 26 09:58:09 2010 +0000
+++ b/sample.cpp	Thu Jun 02 16:31:35 2011 +0000
@@ -104,6 +104,7 @@
     }
   }
   /* can't happen */
+  printf("sofar: %d; total: %d; thing: %f\n", sofar, total, thing);
   return (uint32_t) -1;
 }
 
@@ -188,11 +189,11 @@
   for(uint32_t i = 0; i < adb->header->numFiles; i++) {
     uint32_t prev = i == 0 ? 0 : props[i-1];
     if(qstate->allowed_keys->find((*adb->keys)[i]) == keys_end) {
-      props[i] = prev;
+      props[i] = 0;
     } else {
       uint32_t add = (*adb->track_lengths)[i] - spec->qid.sequence_length + 1;
-      props[i] = prev + add > 0 ? add : 0;
-      total += add;
+      props[i] = add > 0 ? add : 0;
+      total += props[i];
     }
   }