本文整理汇总了C++中Extent::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Extent::end方法的具体用法?C++ Extent::end怎么用?C++ Extent::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Extent
的用法示例。
在下文中一共展示了Extent::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
void ExtentStore::add(const Extent& extent)
{
assert(extent.numPages() > 0);
// The new extent is not allowed to be inside an already existing extent
for(auto iter : extents)
if( (iter.begin().toInteger() <= extent.begin().toInteger() && extent.begin().toInteger() < iter.end().toInteger())
|| (iter.begin().toInteger() < extent.end().toInteger() && extent.end().toInteger() <= iter.end().toInteger()))
throw util::StupidUserException("extent store: overlapping extents");
// Add extent
pageCount += extent.numPages();
if(!extents.empty() && extents.back().end() == extent.begin())
extents.back() = Extent(extents.back().begin(), extent.end()); else // Merge to last extent
extents.emplace_back(extent); // Add a new extent
}
示例2: runtime_error
FftwImpl(const Extent& cextents) {
extents_ = interpret_as::column_major(cextents);
extents_complex_ = extents_;
n_ = std::accumulate(extents_.begin(),
extents_.end(),
1,
std::multiplies<std::size_t>());
if(IsComplex==false){
extents_complex_.back() = (extents_.back()/2 + 1);
}
n_complex_ = std::accumulate(extents_complex_.begin(),
extents_complex_.end(),
1,
std::multiplies<size_t>());
data_size_ = (IsInplaceReal ? 2*n_complex_ : n_) * sizeof(value_type);
if(IsInplace==false)
data_complex_size_ = n_complex_ * sizeof(ComplexType);
//size_t total_mem = getMemorySize();
size_t total_mem = 95*getMemorySize()/100; // keep some memory available, otherwise an out-of-memory killer becomes more likely
if(total_mem < 3*data_size_+data_complex_size_) { // includes host input buffers
std::stringstream ss;
ss << total_mem << "<" << 3*data_size_+data_complex_size_ << " (bytes)";
throw std::runtime_error("FFT data exceeds physical memory. "+ss.str());
}
#if GEARSHIFFT_FFTW_THREADS==1
if( traits::thread_api<TPrecision>::init_threads()==0 )
throw std::runtime_error("fftw thread initialization failed.");
traits::thread_api<TPrecision>::plan_with_threads(FftwContext::options().getNumberDevices());
#endif
if(plan_rigor_ == FFTW_WISDOM_ONLY) {
ImportWisdom<TPrecision>()();
}
}