本文整理汇总了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;
}
示例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");
}
示例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;
}
}
示例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;
}
示例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)
{
}
示例6: getEnd
char const* getEnd() const
{
if ( pc != C.begin() )
return pc;
else
return 0;
}
示例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);
}
示例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)));
}
示例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);
}
示例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);
}
示例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());
}
示例12: reset
void reset()
{
lnumsyms = 0;
minlen = std::numeric_limits<uint64_t>::max();
maxlen = 0;
pc = C.begin();
p = 0;
}
示例13: B
BgzfParallelRecodeDeflateBase()
: B(getBgzfMaxBlockSize(),false),
pa(B.begin()),
pc(B.begin()),
pe(B.end())
{
}
示例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);
}
示例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];
}