本文整理汇总了C++中libmaus2::autoarray::AutoArray::prefixSums方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::prefixSums方法的具体用法?C++ AutoArray::prefixSums怎么用?C++ AutoArray::prefixSums使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libmaus2::autoarray::AutoArray
的用法示例。
在下文中一共展示了AutoArray::prefixSums方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: D
DArray(std::map<int64_t,uint64_t> const & M, uint64_t const bwtterm)
: D(bwtterm+1)
{
for ( std::map<int64_t,uint64_t>::const_iterator ita = M.begin(); ita != M.end(); ++ita )
D [ ita->first ] += ita->second;
D.prefixSums();
}
示例2: istr
ImpWTLF ( iterator BWT, uint64_t const rn, ::libmaus2::util::TempFileNameGenerator & rtmpgen, uint64_t const rmaxval = 0)
: n(rn)
{
if ( n )
{
uint64_t maxval = rmaxval;
for ( uint64_t i = 0; i < n; ++i )
maxval = std::max ( maxval, static_cast<uint64_t>(BWT[i]) );
uint64_t const b = ::libmaus2::math::numbits(maxval);
::libmaus2::wavelet::ImpExternalWaveletGenerator IEWG(b,rtmpgen);
for ( uint64_t i = 0; i < n; ++i )
IEWG.putSymbol(BWT[i]);
std::string const tmpfilename = rtmpgen.getFileName();
IEWG.createFinalStream(tmpfilename);
std::ifstream istr(tmpfilename.c_str(),std::ios::binary);
wt_ptr_type tW(new wt_type(istr));
W = UNIQUE_PTR_MOVE(tW);
istr.close();
remove ( tmpfilename.c_str() );
D = ::libmaus2::autoarray::AutoArray < uint64_t >((1ull<<W->getB())+1);
for ( uint64_t i = 0; i < (1ull<<W->getB()); ++i )
D [ i ] = W->rank(i,n-1);
D.prefixSums();
}
}
示例3: trank_dictionariesi
MultiRankCacheLF ( iterator BWT, uint64_t const rn, uint64_t const rmaxval = 0)
: n(rn)
{
if ( n )
{
uint64_t maxval = rmaxval;
for ( uint64_t i = 0; i < n; ++i )
maxval = std::max ( maxval, static_cast<uint64_t>(BWT[i]) );
rank_dictionaries = ::libmaus2::autoarray::AutoArray < rank_ptr_type >(maxval+1);
for ( uint64_t i = 0; i < rank_dictionaries.size(); ++i )
{
rank_ptr_type trank_dictionariesi(new rank_type(n+1));
rank_dictionaries[i] = UNIQUE_PTR_MOVE(trank_dictionariesi);
writer_type writer = rank_dictionaries[i]->getWriteContext();
for ( uint64_t j = 0; j < n; ++j )
writer.writeBit(BWT[j] == i);
// write additional bit to make rankm1 defined for n
writer.writeBit(0);
writer.flush();
}
D = ::libmaus2::autoarray::AutoArray < uint64_t >(rank_dictionaries.size()+1);
for ( uint64_t i = 0; i < rank_dictionaries.size(); ++i )
D [ i ] = rank_dictionaries[i]->rank1(n-1);
D.prefixSums();
}
}
示例4: n
ImpWTLF(std::istream & in)
: n(::libmaus2::util::NumberSerialisation::deserialiseNumber(in)),
W (new wt_type(in))
{
if ( n )
{
D = ::libmaus2::autoarray::AutoArray < uint64_t >((1ull<<W->getB())+1);
for ( uint64_t i = 0; i < (1ull<<W->getB()); ++i )
D [ i ] = W->rank(i,n-1);
D.prefixSums();
}
}