bool decodeBlock() { while ( FBO.file < index.Vfn.size() && FBO.block >= index.blocksPerFile[FBO.file] ) { FBO.file++; FBO.block = 0; FBO.blockoffset = 0; // check this if we change the file format FBO.offset = 0; openFile(); } if ( FBO.file == index.Vfn.size() ) { PSGI.reset(); PISI.reset(); return false; } libmaus2::gamma::GammaDecoder< libmaus2::aio::SynchronousGenericInput<uint64_t> > GD(*PSGI); uint64_t const bs = GD.decode() + 1; B.ensureSize(bs); for ( uint64_t i = 0; i < bs; ++i ) B[i] = GD.decode(); pa = B.begin(); pc = B.begin(); pe = B.begin() + bs; FBO.block += 1; return true; }
void setup(uint64_t const rn) { n = rn; absort.ensureSize(n); bbsort.ensureSize(n); arangesort.ensureSize(n); brangesort.ensureSize(n); O.ensureSize(n); A.ensureSize(n); F.ensureSize(n); }
void process( uint8_t const * qa, uint8_t const * qe, std::pair<uint8_t const *,uint64_t> const * MA,uint64_t const MAo, libmaus2::autoarray::AutoArray<uint64_t> & E ) { E.ensureSize(MAo); for ( uint64_t i = 0; i < MAo; ++i ) { np.align(qa,qe-qa,MA[i].first,MA[i].second); E [ i ] = np.getTraceContainer().getAlignmentStatistics().getEditDistance(); } }
static void psv(iterator SUF, uint64_t const n, ::libmaus2::autoarray::AutoArray< typename std::iterator_traits<iterator>::value_type > & prev) { // allocate result array prev.ensureSize(n); // do not crash for n==0 if ( n ) prev[0] = n; for ( uint64_t r = 1; r < n; ++r ) { int64_t t = r - 1; while ( (t != n) && (SUF[t] >= SUF[r]) ) t = prev[t]; prev[r] = t; } }
static void nsv(iterator SUF, uint64_t const n, ::libmaus2::autoarray::AutoArray< typename std::iterator_traits<iterator>::value_type > & next) { // allocate result array next.ensureSize(n); // do not crash for n==0 if ( n ) { // initialize next for rank n-1 next[n-1] = n; } // compute next for the remaining ranks for ( int64_t r = static_cast<int64_t>(n)-2; r >= 0; --r ) { uint64_t t = static_cast<uint64_t>(r) + 1; while ( (t < n) && (SUF[t] >= SUF[r]) ) t = next[t]; next[r] = t; } }