pub enum PEValue {
Concrete(f64),
Boolean(bool),
Symbolic(TLExpr),
}Expand description
A value in partial evaluation — either a concrete numeric scalar, a concrete boolean, or still symbolic (cannot be reduced further with current environment).
Variants§
Concrete(f64)
A concrete floating-point scalar.
Boolean(bool)
A concrete boolean truth value.
Symbolic(TLExpr)
Still symbolic — cannot be further reduced.
Implementations§
Source§impl PEValue
impl PEValue
Sourcepub fn is_concrete(&self) -> bool
pub fn is_concrete(&self) -> bool
Returns true when the value is fully concrete (numeric or boolean).
Sourcepub fn as_f64(&self) -> Option<f64>
pub fn as_f64(&self) -> Option<f64>
Extracts the f64 if this is a PEValue::Concrete, otherwise None.
Sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Extracts the bool if this is a PEValue::Boolean, otherwise None.
A Concrete(1.0) is treated as true; Concrete(0.0) as false.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PEValue
impl RefUnwindSafe for PEValue
impl Send for PEValue
impl Sync for PEValue
impl Unpin for PEValue
impl UnsafeUnpin for PEValue
impl UnwindSafe for PEValue
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
Mutably borrows from an owned value. Read more