16 #include <utility/vector1.hh>
20 namespace frag_picker {
25 std::sort(frag_sizes.begin(),frag_sizes.end());
26 cache.resize(frag_sizes[frag_sizes.size()]);
27 for(
Size i=1;i<=frag_sizes.size();i++) {
30 cache[frag_sizes[i]] = m;
37 for(
Size i = 1; i <= i_size;i++) {
45 Size stop_i = start_i + frag_len - 1;
46 Size stop_j = start_j + frag_len - 1;
47 Real last_score = small_scores[start_i][start_j];
49 for(
Size i=1;i<frag_len;i++) {
50 last_score += small_scores[start_i+i][start_j+i];
52 frag_scores[start_i][start_j] = last_score;
53 int max_steps = std::min((
int) small_scores.size() - (
int) start_i - (
int) frag_len,
54 (
int) small_scores[1].
size() - (
int) start_j - (
int) frag_len) + 1;
56 while(cnt<=max_steps) {
59 last_score += small_scores[stop_i][stop_j] - small_scores[start_i][start_j];
62 frag_scores[start_i][start_j] = last_score;
70 for(
Size i=2;i<=small_scores.size()-frag_len+1;i++)
72 for(
Size i=2;i<=small_scores[1].size()-frag_len+1;i++)