pub struct RealProblem {
pub kinds: Vec<FloatKind>,
pub conds: Vec<RealCond>,
pub dists: Vec<RealDist>,
pub before: Vec<(RealVarId, RealVarId)>,
}Expand description
The whole real problem of one class template.
Fields§
§kinds: Vec<FloatKind>The type of each real random variable.
conds: Vec<RealCond>Conditions that must all hold.
dists: Vec<RealDist>The dist constraints, at most one per variable.
before: Vec<(RealVarId, RealVarId)>solve a before b edges between real variables.
Implementations§
Source§impl RealProblem
impl RealProblem
Sourcepub fn reads_int_vars(&self) -> bool
pub fn reads_int_vars(&self) -> bool
Whether any integral sub-expression of a condition or a dist bound
reads an integral random variable (IEEE 1800-2023 18.5.13: a real
constraint over an integral rand variable is solved after it).
Sourcepub fn has_integral_only_filter(&self) -> bool
pub fn has_integral_only_filter(&self) -> bool
Whether some top-level condition compares an integral random variable with real values and reads no real random variable: it only filters the integral draw, which rejection sampling cannot do reliably (a 32-bit variable against a real bound), so the builder refuses it by name.
Sourcepub fn with_int_vars(&self, f: impl FnMut(VarId, Ty) -> Expr) -> RealProblem
pub fn with_int_vars(&self, f: impl FnMut(VarId, Ty) -> Expr) -> RealProblem
This problem with every integral random variable v of type t that a
condition or dist bound reads replaced by f(v, t) (a state variable
holding the value the integral solve drew).
Source§impl RealProblem
impl RealProblem
Sourcepub fn check(&self) -> Result<(), String>
pub fn check(&self) -> Result<(), String>
Checks the shape rules that do not depend on a call’s state values or
rand_modes (module docs), so the builder can reject a class whose
real constraints this solver cannot handle at compile time. solve
re-checks everything it relies on, with the same messages.
Sourcepub fn validate_ir(&self) -> Result<(), IrError>
pub fn validate_ir(&self) -> Result<(), IrError>
Validates every integral expression embedded in the problem (the builder’s last line of defence against building a malformed tree).
Trait Implementations§
Source§impl Clone for RealProblem
impl Clone for RealProblem
Source§impl Debug for RealProblem
impl Debug for RealProblem
Source§impl Default for RealProblem
impl Default for RealProblem
Source§impl<'de> Deserialize<'de> for RealProblem
impl<'de> Deserialize<'de> for RealProblem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RealProblem
Source§impl PartialEq for RealProblem
impl PartialEq for RealProblem
Source§impl Serialize for RealProblem
impl Serialize for RealProblem
impl StructuralPartialEq for RealProblem
Auto Trait Implementations§
impl Freeze for RealProblem
impl RefUnwindSafe for RealProblem
impl Send for RealProblem
impl Sync for RealProblem
impl Unpin for RealProblem
impl UnsafeUnpin for RealProblem
impl UnwindSafe for RealProblem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.