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


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

本文整理汇总了C++中libmaus::autoarray::AutoArray::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::begin方法的具体用法?C++ AutoArray::begin怎么用?C++ AutoArray::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libmaus::autoarray::AutoArray的用法示例。


在下文中一共展示了AutoArray::begin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: getStart

			char const* getStart() const
			{
				if ( pc != C.begin() )
					return C.begin();
				else
					return 0;
			}
开发者ID:allenday,项目名称:libmaus,代码行数:7,代码来源:FastQBgzfWriter.hpp

示例2: nm

			MdStringComputationContext()
			: T0(256,false), T1(256,false), nm(0)
			{
				std::fill(T0.begin(),T0.end(),4);
				std::fill(T1.begin(),T1.end(),5);
				T0['A'] = T0['a'] =  T1['A'] = T1['a'] = 0;
				T0['C'] = T0['c'] =  T1['C'] = T1['c'] = 1;
				T0['G'] = T0['g'] =  T1['G'] = T1['g'] = 2;
				T0['T'] = T0['t'] =  T1['T'] = T1['t'] = 3;
				auxvec.set("MD");
				auxvec.set("NM");
			}
开发者ID:allenday,项目名称:libmaus,代码行数:12,代码来源:MdStringComputationContext.hpp

示例3: fillBuffer

			void fillBuffer()
			{
				assert ( pc == pe );
				
				if ( setpos )
				{
					// std::cerr << "Seeking to " << readpos << std::endl;
					in.seekg(readpos);
					in.clear();
				}

				if ( in.peek() >= 0 && readpos < endpos )
				{
					#if 0
					std::cerr << "Filling block, readpos " << readpos 
						<< " stream at pos " << in.tellg() 
						<< " endpos " << endpos
						<< std::endl;
					#endif
				
					uint64_t blocksize = sizeof(uint64_t) + ( bigbuf ? sizeof(uint64_t) : 0 );
					
					// size of uncompressed buffer
					uint64_t const n = 
						bigbuf ?
							::libmaus::util::NumberSerialisation::deserialiseNumber(in)
							:
							::libmaus::util::UTF8::decodeUTF8(in,blocksize)
						;

					// size of compressed data
					uint64_t const datasize = ::libmaus::util::NumberSerialisation::deserialiseNumber(in);
					// add to block size
					blocksize += datasize;
						
					if ( n > B.size() )
					{
						B = ::libmaus::autoarray::AutoArray<char>(0,false);
						B = ::libmaus::autoarray::AutoArray<char>(n,false);
					}
					
					pa = B.begin();
					pc = pa;
					pe = pa + n;

					::libmaus::aio::IStreamWrapper wrapper(in);
					::libmaus::lz::IstreamSource< ::libmaus::aio::IStreamWrapper> insource(wrapper,datasize);

					SnappyCompress::uncompress(insource,B.begin(),n);

					readpos += blocksize;
				}
			}
开发者ID:allenday,项目名称:libmaus,代码行数:53,代码来源:SnappyInputStream.hpp

示例4: getPattern

			void getPattern(pattern_type & pat, uint64_t i)
			{
				GetObject G(T.begin()+(*dict)[i - dict->FI.low]);
				C.nextid = i;
				::libmaus::fastx::CompactFastQDecoderBase::decodePattern<GetObject>(G,*H,C,pat);
				pat.patid = i;
			}
开发者ID:srl147,项目名称:libmaus,代码行数:7,代码来源:CompactFastQContainer.hpp

示例5: indexfilename

			FastQBgzfWriter(
				::std::string rindexfilename,
				uint64_t const rpatperblock,
				std::ostream & out,
				int level = Z_DEFAULT_COMPRESSION
			) : indexfilename(rindexfilename), patperblock(rpatperblock),
			    fifilename(setupTempFile(indexfilename + ".tmp.fi")), 
			    #if defined(LIBMAUS_FASTX_FASTQBGZFWRITER_PARALLEL)
			    bgzfidxfilename(setupTempFile(indexfilename + ".tmp.bgzfidx")),
			    bgzfidxcntfilename(setupTempFile(indexfilename + ".tmp.bgzfidx.cnt")),
			    bgzfidoutstr(new libmaus::aio::CheckedOutputStream(bgzfidxfilename)),
			    bgzfidxcntoutstr(new libmaus::aio::CheckedOutputStream(bgzfidxcntfilename)),
			    #endif
			    fioutstr(new libmaus::aio::CheckedOutputStream(fifilename)),
			    C(0,false), patlow(0), blockcnt(0),
			    #if defined(LIBMAUS_FASTX_FASTQBGZFWRITER_PARALLEL)
			    bgzfenc(new libmaus::lz::BgzfDeflateParallel(out,32,128,level,bgzfidoutstr.get())),
			    #else
			    bgzfenc(new libmaus::lz::BgzfDeflate<std::ostream>(out,level)),
			    #endif
			    lnumsyms(0),
			    minlen(std::numeric_limits<uint64_t>::max()),
			    maxlen(0),
			    pathigh(patlow),
			    pc(C.begin()),
			    p(0),
			    cacc(0)
			{
			}
开发者ID:allenday,项目名称:libmaus,代码行数:29,代码来源:FastQBgzfWriter.hpp

示例6: getEnd

			char const* getEnd() const
			{
				if ( pc != C.begin() )
					return pc;
				else
					return 0;
			}
开发者ID:allenday,项目名称:libmaus,代码行数:7,代码来源:FastQBgzfWriter.hpp

示例7: getElement

			void getElement(element_type & pat, uint64_t i) const
			{
				GetObject G(T.begin()+(*dict)[i - dict->FI.low]);
				::libmaus::fastx::CompactFastQContext C;
				C.nextid = i;
				::libmaus::fastx::CompactFastQDecoderBase::decodeElement<GetObject>(G,*H,C,pat);
			}
开发者ID:srl147,项目名称:libmaus,代码行数:7,代码来源:CompactFastQContainer.hpp

示例8: G

			CompactFastQContainer(::libmaus::network::SocketBase * textstr)
			: T(textstr->readMessageInBlocks<uint8_t,::libmaus::autoarray::alloc_type_cxx>()), 
			  dict(new ::libmaus::fastx::CompactFastQContainerDictionary(textstr)), H(), C()
			{
				GetObject G(T.begin());
				H = UNIQUE_PTR_MOVE(::libmaus::fastx::CompactFastQHeader::unique_ptr_type(new ::libmaus::fastx::CompactFastQHeader(G)));
			}
开发者ID:srl147,项目名称:libmaus,代码行数:7,代码来源:CompactFastQContainer.hpp

示例9: UNIQUE_PTR_MOVE

::libmaus::util::Histogram::unique_ptr_type libmaus::util::Utf8String::getHistogram(::libmaus::autoarray::AutoArray<uint8_t> const & A)
{
	#if defined(_OPENMP)
	uint64_t const numthreads = omp_get_max_threads();
	#else
	uint64_t const numthreads = 1;
	#endif
	
	::libmaus::autoarray::AutoArray<uint64_t> const partstarts = computePartStarts(A,numthreads);
	uint64_t const numparts = partstarts.size()-1;
	
	::libmaus::util::Histogram::unique_ptr_type hist(new ::libmaus::util::Histogram);
	::libmaus::parallel::OMPLock lock;
	
	#if defined(_OPENMP)
	#pragma omp parallel for
	#endif
	for ( int64_t t = 0; t < static_cast<int64_t>(numparts); ++t )
	{
		::libmaus::util::Histogram::unique_ptr_type lhist(new ::libmaus::util::Histogram);
	
		uint64_t codelen = 0;
		uint64_t const tcodelen = partstarts[t+1]-partstarts[t];
		::libmaus::util::GetObject<uint8_t const *> G(A.begin()+partstarts[t]);
		
		while ( codelen != tcodelen )
			(*lhist)(::libmaus::util::UTF8::decodeUTF8(G,codelen));
			
		lock.lock();
		hist->merge(*lhist);
		lock.unlock();
	}
	
	return UNIQUE_PTR_MOVE(hist);
}
开发者ID:allenday,项目名称:libmaus,代码行数:35,代码来源:Utf8String.cpp

示例10: fd

			LinuxStreamingPosixFdOutputStreamBuffer(std::string const & fn, int64_t const rbuffersize)
			: fd(doOpen(fn)), closefd(true), 
			  optblocksize((rbuffersize < 0) ? getOptimalIOBlockSize(fd,std::string()) : rbuffersize),
			  buffersize(optblocksize),
			  buffer(buffersize,false), prevwrite(0,0)
			{
				setp(buffer.begin(),buffer.end()-1);
			}
开发者ID:allenday,项目名称:libmaus,代码行数:8,代码来源:LinuxStreamingPosixFdOutputStreamBuffer.hpp

示例11: compress

			virtual size_t compress(char const * input, size_t inputLength, libmaus::autoarray::AutoArray<char> & output)
			{
				uint64_t compressBound = SnappyCompress::compressBound(inputLength);
				if ( output.size() < compressBound )
					output = libmaus::autoarray::AutoArray<char>(compressBound,false);
				
				return SnappyCompress::rawcompress(input,inputLength,output.begin());
			}
开发者ID:allenday,项目名称:libmaus,代码行数:8,代码来源:SnappyCompressorObject.hpp

示例12: reset

			void reset()
			{
				lnumsyms = 0;
				minlen = std::numeric_limits<uint64_t>::max();
				maxlen = 0;
				pc = C.begin();
				p = 0;
			}
开发者ID:allenday,项目名称:libmaus,代码行数:8,代码来源:FastQBgzfWriter.hpp

示例13: B

			BgzfParallelRecodeDeflateBase()
			: B(getBgzfMaxBlockSize(),false), 
			  pa(B.begin()), 
			  pc(B.begin()), 
			  pe(B.end())
			{
			
			}
开发者ID:allenday,项目名称:libmaus,代码行数:8,代码来源:BgzfParallelRecodeDeflateBase.hpp

示例14: blocksize

			GammaRLEncoder(std::string const & filename, unsigned int const ralbits, uint64_t const n, uint64_t const rblocksize, uint64_t const rbufsize = 64*1024)
			: 
			  blocksize(rblocksize),
			  COS(filename), SGO(COS,rbufsize), GE(SGO), 
			  A(blocksize), pa(A.begin()), pc(pa), pe(A.end()), 
			  cursym(0), curcnt(0), indexwritten(false), albits(ralbits)
			{
				SGO.put(n);
				SGO.put(albits);
			}
开发者ID:srl147,项目名称:libmaus,代码行数:10,代码来源:GammaRLEncoder.hpp

示例15: get

			element_type * get()
			{
				if ( ! freelistfill )
				{
					// allocate more alignment objects
					libmaus::autoarray::AutoArray<element_type *> nalloclist(
						std::max(
							static_cast<uint64_t>(1),
							static_cast<uint64_t>(2*alloclist.size())
						)
						,false
					);

					std::copy(alloclist.begin(),alloclist.end(),nalloclist.begin());
					element_type * nullp = 0;
					std::fill(nalloclist.begin()+alloclist.size(),nalloclist.end(),nullp);
					
					for ( element_type ** p = nalloclist.begin()+alloclist.size();
						p != nalloclist.end(); ++p )
						*p = new element_type;
					
					libmaus::autoarray::AutoArray<element_type *> nfreelist(
						std::max(
							static_cast<uint64_t>(1),
							static_cast<uint64_t>(2*freelist.size())
						)
						,false			
					);
					
					std::copy(freelist.begin(),freelist.end(),nfreelist.begin());
					std::fill(nfreelist.begin()+freelist.size(),nfreelist.end(),nullp);
				
					freelist = nfreelist;
					
					for ( element_type ** p = nalloclist.begin()+alloclist.size();
						p != nalloclist.end(); ++p )
						freelist[freelistfill++] = *p;			
					
					alloclist = nalloclist;
				}
				
				return freelist[--freelistfill];
			}
开发者ID:allenday,项目名称:libmaus,代码行数:43,代码来源:GrowingFreeList.hpp


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