pub struct MeasurableSet {
pub label: String,
pub lower: Vec<f64>,
pub upper: Vec<f64>,
}Expand description
A measurable set, identified by a tag and a predicate.
For numerical work, sets are represented as closed intervals (boxes) in ℝⁿ.
Fields§
§label: StringHuman-readable label for the set.
lower: Vec<f64>Lower bounds of the bounding box (one per dimension).
upper: Vec<f64>Upper bounds of the bounding box (one per dimension).
Implementations§
Source§impl MeasurableSet
impl MeasurableSet
Sourcepub fn new(label: impl Into<String>, lower: Vec<f64>, upper: Vec<f64>) -> Self
pub fn new(label: impl Into<String>, lower: Vec<f64>, upper: Vec<f64>) -> Self
Create a measurable set from lower and upper bounds.
§Panics
Panics if lower and upper have different lengths.
Sourcepub fn contains(&self, point: &[f64]) -> bool
pub fn contains(&self, point: &[f64]) -> bool
Check whether a point lies in the closed box [lower, upper].
Sourcepub fn is_null_set(&self) -> bool
pub fn is_null_set(&self) -> bool
Return true if this set is a null set (measure zero) under Lebesgue measure.
A box is a null set iff at least one dimension has lower == upper.
Trait Implementations§
Source§impl Clone for MeasurableSet
impl Clone for MeasurableSet
Source§fn clone(&self) -> MeasurableSet
fn clone(&self) -> MeasurableSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MeasurableSet
impl RefUnwindSafe for MeasurableSet
impl Send for MeasurableSet
impl Sync for MeasurableSet
impl Unpin for MeasurableSet
impl UnsafeUnpin for MeasurableSet
impl UnwindSafe for MeasurableSet
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<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.