pub enum IntervalSolution {
Interval {
lower: Bound,
lower_inclusive: bool,
upper: Bound,
upper_inclusive: bool,
},
Union(Vec<IntervalSolution>),
Empty,
AllReals,
}Expand description
Represents the solution set of an inequality.
Variants§
Interval
A single interval [lower, upper] or (lower, upper) etc.
Fields
Union(Vec<IntervalSolution>)
Union of multiple intervals
Empty
Empty set (no solutions)
AllReals
All real numbers (-∞, +∞)
Implementations§
Source§impl IntervalSolution
impl IntervalSolution
Sourcepub fn greater_than(a: Expression) -> Self
pub fn greater_than(a: Expression) -> Self
Create an interval for x > a
Sourcepub fn greater_equal(a: Expression) -> Self
pub fn greater_equal(a: Expression) -> Self
Create an interval for x ≥ a
Sourcepub fn less_than(a: Expression) -> Self
pub fn less_than(a: Expression) -> Self
Create an interval for x < a
Sourcepub fn less_equal(a: Expression) -> Self
pub fn less_equal(a: Expression) -> Self
Create an interval for x ≤ a
Sourcepub fn open_interval(a: Expression, b: Expression) -> Self
pub fn open_interval(a: Expression, b: Expression) -> Self
Create an interval for a < x < b
Sourcepub fn closed_interval(a: Expression, b: Expression) -> Self
pub fn closed_interval(a: Expression, b: Expression) -> Self
Create an interval for a ≤ x ≤ b
Trait Implementations§
Source§impl Clone for IntervalSolution
impl Clone for IntervalSolution
Source§fn clone(&self) -> IntervalSolution
fn clone(&self) -> IntervalSolution
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IntervalSolution
impl Debug for IntervalSolution
Source§impl Display for IntervalSolution
impl Display for IntervalSolution
Source§impl PartialEq for IntervalSolution
impl PartialEq for IntervalSolution
impl StructuralPartialEq for IntervalSolution
Auto Trait Implementations§
impl Freeze for IntervalSolution
impl RefUnwindSafe for IntervalSolution
impl Send for IntervalSolution
impl Sync for IntervalSolution
impl Unpin for IntervalSolution
impl UnwindSafe for IntervalSolution
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.