本文整理汇总了C++中libmaus::autoarray::AutoArray::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::resize方法的具体用法?C++ AutoArray::resize怎么用?C++ AutoArray::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libmaus::autoarray::AutoArray
的用法示例。
在下文中一共展示了AutoArray::resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: put
void put(libmaus::fastx::FastQReader::pattern_type const & pattern)
{
uint64_t const patlen = getFastQLength(pattern);
while ( (C.end() - pc) < static_cast<ptrdiff_t>(patlen) )
{
uint64_t const off = pc-C.begin();
uint64_t const newclen = std::max(2*C.size(),static_cast<uint64_t>(1ull));
C.resize(newclen);
pc = C.begin()+off;
}
*(pc)++ = '@';
std::copy(pattern.sid.begin(),pattern.sid.end(),pc);
pc += pattern.sid.size();
*(pc++) = '\n';
std::copy(pattern.spattern.begin(), pattern.spattern.end(),pc);
pc += pattern.spattern.size();
*(pc++) = '\n';
*(pc)++ = '+';
std::copy(pattern.plus.begin(), pattern.plus.end(),pc);
pc += pattern.plus.size();
*(pc++) = '\n';
std::copy(pattern.quality.begin(), pattern.quality.end(),pc);
pc += pattern.quality.size();
*(pc++) = '\n';
assert ( pc <= C.end() );
lnumsyms += pattern.spattern.size();
minlen = std::min(minlen,static_cast<uint64_t>(pattern.spattern.size()));
maxlen = std::max(maxlen,static_cast<uint64_t>(pattern.spattern.size()));
pathigh++;
if ( pathigh - patlow == patperblock )
internalFlush();
}
示例2: decodeBlock
/* decode next block */
bool decodeBlock()
{
/* open new file if necessary */
bool changedfile = false;
while ( fileptr < idda.data.size() && blockptr == idda.data[fileptr].numentries )
{
fileptr++;
blockptr = 0;
changedfile = true;
}
if ( fileptr == idda.data.size() )
return false;
if ( changedfile )
openNewFile();
/* align to word boundary */
GD->flush();
/* read block size */
uint64_t const blocksize = GD->decodeWord(32);
/* increase size of memory buffer if necessary */
if ( blocksize > decodebuf.size() )
decodebuf.resize(blocksize);
/* set buffer pointers */
pa = decodebuf.begin();
pc = pa;
pe = pa + blocksize;
/* decode block */
for ( uint64_t i = 0; i < blocksize; ++i )
decodebuf[i] = GD->decode();
/* increment block pointer */
blockptr++;
return true;
}