38#ifndef PROVSQL_MONTE_CARLO_SAMPLER_H
39#define PROVSQL_MONTE_CARLO_SAMPLER_H
104 const GenericCircuit &gc,
105 const std::vector<gate_t> &cmps,
127 const GenericCircuit &gc,
gate_t root,
unsigned samples);
205std::optional<std::vector<double>>
207 gate_t event_root,
unsigned n);
gate_t
Strongly-typed gate identifier.
Semiring-agnostic in-memory provenance circuit.
In-memory provenance circuit with semiring-generic evaluation.
std::vector< double > monteCarloJointDistribution(const GenericCircuit &gc, const std::vector< gate_t > &cmps, unsigned samples)
Estimate the joint distribution of cmps via Monte Carlo.
ConditionalScalarSamples monteCarloConditionalScalarSamples(const GenericCircuit &gc, gate_t root, gate_t event_root, unsigned samples)
Rejection-sample root conditioned on event_root.
std::vector< double > monteCarloScalarSamples(const GenericCircuit &gc, gate_t root, unsigned samples)
Sample a scalar sub-circuit samples times and return the draws.
double monteCarloRV(const GenericCircuit &gc, gate_t root, unsigned samples)
Run Monte Carlo on a circuit that may contain gate_rv leaves.
std::optional< std::vector< double > > try_truncated_closed_form_sample(const GenericCircuit &gc, gate_t root, gate_t event_root, unsigned n)
Try to draw n exact samples from the conditional distribution of root given event_root via closed-for...
bool circuitHasRV(const GenericCircuit &gc, gate_t root)
Walk the circuit reachable from root looking for any gate_rv.
Core types, constants, and utilities shared across ProvSQL.
Outcome of a conditional Monte Carlo sampling pass.
std::vector< double > accepted