Data that has to be passed around when evaluating functions / PDFs.
Definition at line 32 of file RunContext.h.
Public Member Functions | |
RunContext () | |
RunContext (const RunContext &)=delete | |
Deleted because copying the owned memory is expensive. More... | |
RunContext (RunContext &&)=default | |
void | clear () |
Clear all computation results without freeing memory. More... | |
RooSpan< const double > | getBatch (const RooAbsReal *owner) const |
Check if there is a span of data corresponding to the object passed as owner. More... | |
RooSpan< const double > | getBatch (const RooArgProxy &proxy) const |
RooSpan< double > | getWritableBatch (const RooAbsReal *owner) |
Check if there is a writable span of data corresponding to the object passed as owner. More... | |
RooSpan< double > | makeBatch (const RooAbsReal *owner, std::size_t size) |
Create a writable batch. More... | |
RooSpan< const double > | operator[] (const RooAbsReal *owner) const |
Retrieve a batch of data corresponding to the element passed as owner . More... | |
Public Attributes | |
std::vector< double > | logProbabilities |
If evaluation should only occur in a range, the range name can be passed here. More... | |
std::unordered_map< const RooAbsReal *, std::vector< double > > | ownedMemory |
Memory owned by this struct. It is associated to nodes in the computation graph using their pointers. More... | |
const char * | rangeName {nullptr} |
std::unordered_map< const RooAbsReal *, RooSpan< const double > > | spans |
Once an object has computed its value(s), the span pointing to the results is registered here. More... | |
#include <RunContext.h>
|
inline |
Definition at line 33 of file RunContext.h.
|
delete |
Deleted because copying the owned memory is expensive.
If needed, it can be implemented, though.
spans
to new location in ownedMemory
after data have been copied!
|
default |
|
inline |
Clear all computation results without freeing memory.
Definition at line 48 of file RunContext.h.
RooSpan< const double > RooBatchCompute::RunContext::getBatch | ( | const RooAbsReal * | owner | ) | const |
Check if there is a span of data corresponding to the object passed as owner.
Definition at line 26 of file RunContext.cxx.
RooSpan<const double> RooBatchCompute::RunContext::getBatch | ( | const RooArgProxy & | proxy | ) | const |
RooSpan< double > RooBatchCompute::RunContext::getWritableBatch | ( | const RooAbsReal * | owner | ) |
Check if there is a writable span of data corresponding to the object passed as owner.
The span can be used both for reading and writing.
Definition at line 37 of file RunContext.cxx.
RooSpan< double > RooBatchCompute::RunContext::makeBatch | ( | const RooAbsReal * | owner, |
std::size_t | size | ||
) |
Create a writable batch.
If the RunContext already owns memory for the object owner
, just resize the memory. If it doesn't exist yet, allocate it.
NaN
to help detect such errors.A read-only reference to the memory will be stored in spans
.
owner | RooFit object whose value should be written into the memory. |
size | Requested size of the span. |
Definition at line 58 of file RunContext.cxx.
|
inline |
Retrieve a batch of data corresponding to the element passed as owner
.
Definition at line 43 of file RunContext.h.
std::vector<double> RooBatchCompute::RunContext::logProbabilities |
If evaluation should only occur in a range, the range name can be passed here.
Definition at line 55 of file RunContext.h.
std::unordered_map<const RooAbsReal*, std::vector<double> > RooBatchCompute::RunContext::ownedMemory |
Memory owned by this struct. It is associated to nodes in the computation graph using their pointers.
Definition at line 53 of file RunContext.h.
const char* RooBatchCompute::RunContext::rangeName {nullptr} |
Definition at line 54 of file RunContext.h.
std::unordered_map<const RooAbsReal*, RooSpan<const double> > RooBatchCompute::RunContext::spans |
Once an object has computed its value(s), the span pointing to the results is registered here.
Definition at line 51 of file RunContext.h.