Commit 7d6be693 authored by Li's avatar Li Committed by Haowen Zhang
Browse files

Still use 64bit candidate sort. Further do not cache near the beginning.

parent 8806e956
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -449,7 +449,7 @@ int Index::CollectSeedHits(
      if (mm_positive_hits[mi].size() == 0) continue;
      // only the positive part may have the underflow issue
      if (heap_resort)
        std::sort(mm_positive_hits[mi].begin(), mm_positive_hits[mi].end(), CompSortHits);
        std::sort(mm_positive_hits[mi].begin(), mm_positive_hits[mi].end());
      struct mmHit nh;
      nh.mi = mi;
      nh.position = mm_positive_hits[mi][0];
@@ -495,7 +495,7 @@ int Index::CollectSeedHits(
    delete[] mm_negative_hits;
    delete[] mm_pos;
  } else {
    std::sort(positive_hits.begin(), positive_hits.end(), CompSortHits);
    std::sort(positive_hits.begin(), positive_hits.end());
    std::sort(negative_hits.begin(), negative_hits.end());
  }
  /*for (uint32_t mi = 0 ; mi < positive_hits->size() ; ++mi)
+0 −7
Original line number Diff line number Diff line
@@ -93,13 +93,6 @@ class Index {
    return key;
  }

  inline static bool CompSortHits(const uint64_t &a, const uint64_t &b) {
    if (int(a>>32) != int(b>>32))
      return a < b;
    else
      return (int)a < int(b);
  }

 protected:
  int kmer_size_;
  int window_size_;
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ if (cache[hidx].finger_print_cnt_sum <= 5)
      int shift = (int)minimizers[0].second >> 1;
      // Do not cache if it is too near the start.
      for (i = 0; i < size; ++i) 
        if ((int)pos_candidates[i].position < 0) {
        if ((int)pos_candidates[i].position < kmer_length + shift) {
          cache[hidx].offsets.resize(0);
          cache[hidx].strands.resize(0);
          cache[hidx].minimizers.resize(0);
+1 −5
Original line number Diff line number Diff line
@@ -48,11 +48,7 @@ struct mmHit {

  bool operator<(const mmHit &h) const {
    // the inversed direction is to make a min-heap
    //return position > h.position;
    if (int(position>>32) != int(h.position>>32))
    return position > h.position;
    else
      return (int)position > (int)h.position;
  }
};