17#ifndef ROOFIT_BATCHCOMPUTE_RUNCONTEXT_H
18#define ROOFIT_BATCHCOMPUTE_RUNCONTEXT_H
22#include <unordered_map>
52 std::unordered_map<const RooAbsReal*, RooSpan<const double>>
spans;
54 std::unordered_map<const RooAbsReal*, std::vector<double>>
ownedMemory;
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
RooArgProxy is the abstract interface for RooAbsArg proxy classes.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
A simple container to hold a batch of data values.
Namespace for dispatching RooFit computations to various backends.
This struct enables passing computation data around between elements of a computation graph.
std::vector< double > logProbabilities
If evaluation should only occur in a range, the range name can be passed here.
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.
void clear()
Clear all computation results without freeing memory.
RooSpan< double > getWritableBatch(const RooAbsReal *owner)
Check if there is a writable span of data corresponding to the object passed as owner.
RunContext(RunContext &&)=default
Move a RunContext. All spans pointing to data retrieved from the original remain valid.
RunContext(const RunContext &)=delete
Deleted because copying the owned memory is expensive.
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.
RooSpan< const double > getBatch(const RooArgProxy &proxy) const
RooSpan< const double > operator[](const RooAbsReal *owner) const
Retrieve a batch of data corresponding to the element passed as owner.
RooSpan< double > makeBatch(const RooAbsReal *owner, std::size_t size)
Create a writable batch.
RunContext()
Create an empty RunContext that doesn't have access to any computation results.