pub struct ProblemOptions {Show 19 fields
pub p: HashMap<String, f64>,
pub u0: HashMap<String, f64>,
pub model_name: Option<String>,
pub metaparameters: BTreeMap<String, i64>,
pub base_path: Option<PathBuf>,
pub callbacks: CallbackSet,
pub rhs: Rhs,
pub compiler: Option<Compiler>,
pub pushdown_rewrite: bool,
pub providers: HashMap<String, Box<dyn CadenceProvider>>,
pub build_providers: Vec<(String, Box<dyn PrepareProvider>)>,
pub const_arrays: HashMap<String, ArrayD<f64>>,
pub build_pipeline: bool,
pub gated_fetch_batch: Option<usize>,
pub verbose: bool,
pub progress: Option<PrepareProgressFn>,
pub inspect: bool,
pub sample_time: Option<f64>,
pub runtime_array_parameters: bool,
}Expand description
Build-time bindings for esm_problem — everything that fixes a
document rather than a run.
The per-run knobs (alg, abstol, reltol, saveat, callback,
maxiters) live on SolveOptions instead. That split is the whole point
of §2.5: construction is deterministic per document and expensive, solve
is cheap and varies.
Fields§
§p: HashMap<String, f64>Parameter bindings (canonical SciML p). Exact or bare names.
u0: HashMap<String, f64>Initial state bindings (canonical SciML u0). Exact or bare names.
model_name: Option<String>Select one model when the document holds several.
metaparameters: BTreeMap<String, i64>Metaparameter bindings closed at load (esm-spec §9.7.6 site 4).
base_path: Option<PathBuf>Base path anchoring relative {ref}s.
callbacks: CallbackSetCallbacks declared on the EsmProblem (§2.5.4).
rhs: RhsWhether to compile a right-hand side. See Rhs.
compiler: Option<Compiler>WHICH strategy builds the right-hand side (§2.5.10). None is
Compiler::Native, and native is STRICT: a rule it cannot express
is a construction error, not a quiet demotion.
Option rather than a bare Compiler so that “the caller said
nothing” and “the caller asked for native” stay distinguishable in a
ProblemOptions a test prints; they build identically.
pushdown_rewrite: boolOpt in to the automatic projection-pushdown desugar. Turning this on also turns the build pipeline on.
providers: HashMap<String, Box<dyn CadenceProvider>>Run-time data providers, keyed by the forcing VARIABLE name they feed.
CONST providers are materialized ONCE, here, at construction — the
“gated fetch” §2.5.2 puts in the build half. DISCRETE providers
contribute the refresh anchors solve segments the integration on.
build_providers: Vec<(String, Box<dyn PrepareProvider>)>Build-time array providers consumed by the pushdown / gated-fetch pipeline, keyed by provider key. Supplying any turns the build pipeline on.
const_arrays: HashMap<String, ArrayD<f64>>Constant arrays injected into the build-time evaluation scope.
build_pipeline: boolForce the deterministic build pipeline on (it is on automatically when
pushdown_rewrite, build_providers or const_arrays is set).
gated_fetch_batch: Option<usize>Split a gated provider’s pre-sliced fetch into requests of at most this many native indices along the gated axis.
verbose: boolPrint per-phase build progress lines on stdout.
progress: Option<PrepareProgressFn>Build-time progress observer. Extension seam, not stable API — a binding MAY expose its own build observability (§2.5.2).
inspect: boolCollect the array runtime’s named build-time products so
observed_field can read them back.
This is the construction-time build-observability seam that replaced
the old simulate_with_inspection / observed_field(prep, inspection, name) threading: the caller asks for observability when it builds,
and reads it back off the EsmProblem, instead of carrying a
BuildInspection through the run.
sample_time: Option<f64>Time at which CONST providers are sampled. Defaults to tspan.0.
runtime_array_parameters: boolLeave every shaped parameter that has a value and is not fed from
outside the model (no update) as a run-time input of
crate::rhs_program: an crate::SlotKind::ArrayParameter forcing
slot, seeded with that value, instead of build-time data (API_SPEC
§5.8). The value is the document’s (inline array data, or one scalar
broadcast over its grid) or the caller’s Self::const_arrays entry,
which takes precedence. The Problem itself
reads it from its forcing buffer, where construction serves that
value, so solve integrates the same numbers either way. Off by
default.
Trait Implementations§
Source§impl Debug for ProblemOptions
impl Debug for ProblemOptions
Auto Trait Implementations§
impl !RefUnwindSafe for ProblemOptions
impl !Send for ProblemOptions
impl !Sync for ProblemOptions
impl !UnwindSafe for ProblemOptions
impl Freeze for ProblemOptions
impl Unpin for ProblemOptions
impl UnsafeUnpin for ProblemOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.