Skip to main content

ProblemOptions

Struct ProblemOptions 

Source
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: CallbackSet

Callbacks declared on the EsmProblem (§2.5.4).

§rhs: Rhs

Whether 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: bool

Opt 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: bool

Force 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: bool

Print 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: bool

Collect 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: bool

Leave 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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ProblemOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DistributionExt for T
where T: ?Sized,

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V