30 const double* dataBegin = &*(
_foreignData->begin()+begin);
31 const std::size_t maxSize = std::min(size,
_foreignData->size() - begin);
41 const auto& batch = item->second;
42 const std::size_t maxSize = std::min(size, batch.data.size() - (begin-batch.begin));
65 Batch& batch = item->second;
67 if (batch.
data.size() != batchSize) {
68 batch.
data.resize(batchSize);
85 for (
auto& elm : batch) {
104 os <<
indent <<
"Batch data access";
106 os <<
" not initialised." << std::endl;
112 os <<
" with " << (
_foreignData ?
"(foreign)" :
"(owned)") <<
" data:";
113 os <<
"\n" <<
indent << std::right << std::setw(8) <<
"Batch #" << std::setw(8) <<
"Start"
114 << std::setw(7) <<
"Status";
118 auto startPoint = item.first;
119 const Batch& batch = item.second;
122 << std::setw(8) << i << std::setw(8) << startPoint
123 << std::setw(7) << batch.
status <<
": {";
124 for (
unsigned int j=0; j < 5 && j < batch.
data.size(); ++j) {
125 os << batch.
data[j] <<
", ";
129 os << std::resetiosflags(std::ios::adjustfield) << std::endl;
static void indent(ostringstream &buf, int indent_level)
RooSpan< const double > findSpanInsideExistingBatch(std::size_t begin, std::size_t batchSize) const
RooSpan< const double > getBatch(std::size_t begin, std::size_t batchSize) const
void clear()
Discard all storage.
void print(std::ostream &os, const std::string &indent) const
Print to given output stream.
RooSpan< double > makeWritableBatchInit(std::size_t begin, std::size_t batchSize, double value)
Make a batch and return a span pointing to the pdf-local memory.
const std::vector< double > * _foreignData
void attachForeignStorage(const std::vector< double > &vec)
Attach a foreign storage. Batches coming from this storage will be read only.
RooSpan< double > makeWritableBatchUnInit(std::size_t begin, std::size_t batchSize)
Make a batch and return a span pointing to the pdf-local memory.
A simple container to hold a batch of data values.
std::vector< double > data