# HG changeset patch # User mas01cr # Date 1307032295 0 # Node ID 337e72088f76d22c8fa75114d504892d96931df0 # Parent 77f7bc99dfd6b48042af3f85adbcb5cb53bc0f09 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 diff -r 77f7bc99dfd6 -r 337e72088f76 sample.cpp --- 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]; } }