当前位置: 首页>>代码示例>>C++>>正文


C++ AutoArray::prefixSums方法代码示例

本文整理汇总了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();
			}
开发者ID:gt1,项目名称:libmaus2,代码行数:7,代码来源:DArray.hpp

示例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();
				}
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:28,代码来源:ImpWTLF.hpp

示例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();
				}
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:31,代码来源:MultiRankCacheLF.hpp

示例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();
				}
			}
开发者ID:dkj,项目名称:libmaus2,代码行数:12,代码来源:ImpWTLF.hpp


注:本文中的libmaus2::autoarray::AutoArray::prefixSums方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。