本文整理汇总了C++中libmaus2::autoarray::AutoArray::size方法的典型用法代码示例。如果您正苦于以下问题:C++ AutoArray::size方法的具体用法?C++ AutoArray::size怎么用?C++ AutoArray::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libmaus2::autoarray::AutoArray
的用法示例。
在下文中一共展示了AutoArray::size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeSymAccu
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > computeSymAccu() const
{
uint64_t numint = 0;
for ( uint64_t i = 0; i < index.size(); ++i )
numint += index[i].size();
::libmaus2::autoarray::AutoArray<uint64_t> preaccu(numint+1);
uint64_t outptr = 0;
for ( uint64_t i = 0; i < index.size(); ++i )
for ( uint64_t j = 0; j < index[i].size(); ++j )
preaccu[outptr++] = index[i][j].vcnt;
preaccu.prefixSums();
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > symaccu(numint);
for ( uint64_t i = 1; i < preaccu.size(); ++i )
symaccu[i-1] = std::pair<uint64_t,uint64_t>(preaccu[i-1],preaccu[i]);
#if 0
std::cerr << "presymaccu:" << std::endl;
for ( uint64_t i = 0; i < preaccu.size(); ++i )
std::cerr << preaccu[i] << std::endl;
std::cerr << "symaccu:" << std::endl;
for ( uint64_t i = 0; i < symaccu.size(); ++i )
std::cerr << "[" << i << "]=[" << symaccu[i].first << "," << symaccu[i].second << ")" << std::endl;
#endif
return symaccu;
}
示例2: set
void set(libmaus2::bambam::parallel::FragmentAlignmentBuffer::shared_ptr_type rblock)
{
block = rblock;
std::vector<std::pair<uint8_t *,uint8_t *> > V;
block->getLinearOutputFragments(V);
std::vector<size_t> const fillVector = block->getFillVector();
assert ( fillVector.size() == V.size() );
if ( V.size() > (D?D->size():0) )
{
libmaus2::autoarray::AutoArray<char const *>::shared_ptr_type T(new libmaus2::autoarray::AutoArray<char const *>(V.size(),false));
D = T;
}
if ( V.size() > (S?S->size():0) )
{
libmaus2::autoarray::AutoArray<size_t>::shared_ptr_type T(new libmaus2::autoarray::AutoArray<size_t>(V.size(),false));
S = T;
}
if ( V.size() > (L?L->size():0) )
{
libmaus2::autoarray::AutoArray<size_t>::shared_ptr_type T(new libmaus2::autoarray::AutoArray<size_t>(V.size(),false));
L = T;
}
for ( uint64_t i = 0; i < V.size(); ++i )
{
D->at(i) = reinterpret_cast<char const *>(V[i].first);
S->at(i) = V[i].second-V[i].first;
L->at(i) = fillVector.at(i);
}
numblocks = V.size();
}
示例3:
uint64_t operator[](uint64_t const i) const
{
for ( uint64_t j = 0; j < rank_dictionaries.size(); ++j )
if ( (*(rank_dictionaries[j]))[i] )
return j;
return rank_dictionaries.size();
}
示例4: serialise
void serialise(stream_type & stream) const
{
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,D.size());
for ( uint64_t i = 0; i < D.size(); ++i )
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,D[i]);
}
示例5: 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();
}
}
示例6: loadFile
static libmaus2::autoarray::AutoArray<char> loadFile(std::istream & in)
{
libmaus2::autoarray::AutoArray<char> C(1);
uint64_t p = 0;
while ( in )
{
in.read(C.begin() + p, C.size()-p);
if ( ! in.gcount() )
break;
p += in.gcount();
if ( p == C.size() )
{
libmaus2::autoarray::AutoArray<char> Cn(2*C.size(),false);
std::copy(C.begin(),C.end(),Cn.begin());
C = Cn;
}
}
libmaus2::autoarray::AutoArray<char> Cn(p,false);
std::copy(C.begin(),C.begin()+p,Cn.begin());
return Cn;
}
示例7: broadcastSend
void broadcastSend(
::libmaus2::network::Interface const & interface,
unsigned short const broadcastport,
::libmaus2::autoarray::AutoArray < ::libmaus2::network::ClientSocket::unique_ptr_type > & secondarysockets,
unsigned int const packsize = 508
) const
{
std::cerr << "Writing FI...";
for ( uint64_t i = 0; i < secondarysockets.size(); ++i )
secondarysockets[i]->writeString(FI.serialise());
std::cerr << "done.";
std::cerr << "Broadcasting designators...";
::libmaus2::network::UDPSocket::sendArrayBroadcast(interface,broadcastport,
secondarysockets,designators.get(),designators.size(),packsize);
std::cerr << "done.";
std::cerr << "Broadcasting shortpointers...";
::libmaus2::network::UDPSocket::sendArrayBroadcast(interface,broadcastport,
secondarysockets,shortpointers.get(),shortpointers.size(),packsize);
std::cerr << "done.";
std::cerr << "Broadcasting longpointers...";
::libmaus2::network::UDPSocket::sendArrayBroadcast(interface,broadcastport,
secondarysockets,longpointers.get(),longpointers.size(),packsize);
std::cerr << "done.";
std::cerr << "Broadcasting text...";
::libmaus2::network::UDPSocket::sendArrayBroadcast(interface,broadcastport,
secondarysockets,text.get(),text.size(),packsize);
std::cerr << "done.";
}
示例8: HI
/**
* constructor from hash intervals and file prefix
*
* @param rHI hash intervals
* @param fileprefix prefix for files
**/
SynchronousOutputFile8ArrayTemplate(
::libmaus2::autoarray::AutoArray< std::pair<uint64_t,uint64_t> > const & rHI,
std::string const & fileprefix
)
: HI(&rHI), buffers(HI->size()), IT(new ::libmaus2::util::IntervalTree(*HI,0,HI->size()))
{
init ( HI->size(), fileprefix );
}
示例9: serialise
void serialise(stream_type & stream) const
{
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,blocksize);
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,lastblocksize);
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,maxblockbytes);
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,blockstarts.size()-1);
for ( uint64_t i = 0; i < blockstarts.size(); ++i )
::libmaus2::util::NumberSerialisation::serialiseNumber(stream,blockstarts[i]);
}
示例10: computeSegAccu
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > computeSegAccu() const
{
::libmaus2::autoarray::AutoArray<uint64_t> preaccu(index.size()+1);
for ( uint64_t i = 0; i < index.size(); ++i )
preaccu[i] = index[i].size();
preaccu.prefixSums();
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > accu(index.size());
for ( uint64_t i = 1; i < preaccu.size(); ++i )
accu[i-1] = std::pair<uint64_t,uint64_t>(preaccu[i-1],preaccu[i]);
return accu;
}
示例11: merge
void merge(DArray const & o)
{
if ( o.D.size() != D.size() )
{
::libmaus2::exception::LibMausException se;
se.getStream() << "DArray::merge(): array sizes are not compatible." << std::endl;
se.finish();
throw se;
}
for ( uint64_t i = 0; i < D.size(); ++i )
D[i] += o.D[i];
}
示例12: computeSegmentAccu
::libmaus2::autoarray::AutoArray< std::pair<uint64_t,uint64_t> > computeSegmentAccu()
{
uint64_t const numint = index.size();
::libmaus2::autoarray::AutoArray<uint64_t> preaccu(numint+1);
uint64_t k = 0;
for ( uint64_t i = 0; i < index.size(); ++i )
preaccu[k++] = index[i].size();
preaccu.prefixSums();
::libmaus2::autoarray::AutoArray< std::pair<uint64_t,uint64_t> > accu(numint);
for ( uint64_t i = 1; i < preaccu.size(); ++i )
accu[i-1] = std::pair<uint64_t,uint64_t>(
std::pair<uint64_t,uint64_t>(preaccu[i-1],preaccu[i])
);
return accu;
}
示例13: computeBlockIntervals
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > computeBlockIntervals() const
{
uint64_t numblocks = 0;
for ( uint64_t i = 0; i < index.size(); ++i )
numblocks += index[i].size();
::libmaus2::autoarray::AutoArray < uint64_t > lblocksizes = ::libmaus2::autoarray::AutoArray < uint64_t >(numblocks+1);
uint64_t * outptr = lblocksizes.begin();
for ( uint64_t i = 0; i < blocksizes.size(); ++i )
for ( uint64_t j = 0; j < blocksizes[i].size(); ++j )
*(outptr++) = blocksizes[i][j];
lblocksizes.prefixSums();
::libmaus2::autoarray::AutoArray < std::pair<uint64_t,uint64_t> > blockintervals(numblocks);
for ( uint64_t i = 1; i < lblocksizes.size(); ++i )
blockintervals[i-1] = std::pair<uint64_t,uint64_t>(lblocksizes[i-1],lblocksizes[i]);
return blockintervals;
}
示例14: UNIQUE_PTR_MOVE
::libmaus2::util::Histogram::unique_ptr_type libmaus2::util::Utf8String::getHistogram(::libmaus2::autoarray::AutoArray<uint8_t> const & A)
{
#if defined(_OPENMP)
uint64_t const numthreads = omp_get_max_threads();
#else
uint64_t const numthreads = 1;
#endif
::libmaus2::autoarray::AutoArray<uint64_t> const partstarts = computePartStarts(A,numthreads);
uint64_t const numparts = partstarts.size()-1;
::libmaus2::util::Histogram::unique_ptr_type hist(new ::libmaus2::util::Histogram);
::libmaus2::parallel::OMPLock lock;
#if defined(_OPENMP)
#pragma omp parallel for
#endif
for ( int64_t t = 0; t < static_cast<int64_t>(numparts); ++t )
{
::libmaus2::util::Histogram::unique_ptr_type lhist(new ::libmaus2::util::Histogram);
uint64_t codelen = 0;
uint64_t const tcodelen = partstarts[t+1]-partstarts[t];
::libmaus2::util::GetObject<uint8_t const *> G(A.begin()+partstarts[t]);
while ( codelen != tcodelen )
(*lhist)(::libmaus2::util::UTF8::decodeUTF8(G,codelen));
lock.lock();
hist->merge(*lhist);
lock.unlock();
}
return UNIQUE_PTR_MOVE(hist);
}
示例15: start
void start()
{
for ( uint64_t i = 0; i < threads.size(); ++i )
threads[i]->start();
setup();
}