IntervalLowerUnboundedUpperBounded

Struct IntervalLowerUnboundedUpperBounded 

Source
pub struct IntervalLowerUnboundedUpperBounded<RealType: RealScalar, UpperBoundType: BoundType> { /* private fields */ }
Expand description

FINAL DOC Generic structure for intervals extending from negative infinity with finite upper bound.

The IntervalLowerUnboundedUpperBounded struct represents semi-infinite intervals that extend infinitely in the negative direction but have a finite upper bound. The upper bound can be either included (closed) or excluded (open) based on the type parameter.

§Generic Parameters

  • RealType: Must implement RealScalar for mathematical operations
  • UpperBoundType: Either Closed or Open to specify upper boundary inclusion

§Boundary Type Combinations

UpperNotationMathematical Set
Closed(-∞, b]{x : x ≤ b}
Open(-∞, b){x : x < b}

§Mathematical Properties

  • Infinite measure: μ(I) = +∞ for all variants
  • Non-compactness: Never compact (unbounded)
  • Connectedness: Always connected (no gaps)
  • Lower bound: No finite lower bound (extends from -∞)
  • Upper bound: Always has a finite upper bound

§Type Aliases

The library provides convenient type aliases:

§Use Cases

  • Capacity limits: Systems with maximum bounds but no minimum restrictions
  • “At most” constraints: x ≤ b (closed) or x < b (open)
  • Temperature limits: Physical systems with maximum safe temperatures
  • Budget constraints: Financial models with spending limits
  • Upper thresholds: Where values cannot exceed a certain limit

§Construction

use grid1d::intervals::*;

// Using type aliases (recommended)
let upper_bounded_closed = IntervalLowerUnboundedUpperClosed::new(100.0);  // (-∞, 100]
let upper_bounded_open = IntervalLowerUnboundedUpperOpen::new(100.0);      // (-∞, 100)

assert!(upper_bounded_closed.contains_point(&100.0));   // Includes upper bound
assert!(!upper_bounded_open.contains_point(&100.0));    // Excludes upper bound

Implementations§

Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source

pub fn new(upper_bound: RealType) -> Self

Build and return a new instance of IntervalLowerUnboundedUpperBounded from the upper bound of the interval.

Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source

pub fn upper_bound(&self) -> &UpperBound<RealType, UpperBoundType>

The upper bound of the interval, included in the interval.

This value represents the largest point contained in the interval. For a closed upper bound b], any point x in the interval satisfies x ≤ b. For an open upper bound b), any point x in the interval satisfies x < b.

Trait Implementations§

Source§

impl<RealType: Clone + RealScalar, UpperBoundType: Clone + BoundType> Clone for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source§

fn clone(&self) -> IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> Contains<RealType> for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where Self: GetIntervalBound<BoundType = RealType>, UpperBound<RealType, UpperBoundType>: ValueWithinBound<RealType = RealType>,

Source§

fn contains_point(&self, x: &RealType) -> bool

Tests whether a point is contained within this interval. Read more
Source§

fn contains_interval<IntervalType: IntervalTrait<RealType = RealType>>( &self, other: &IntervalType, ) -> bool

Tests whether this interval completely contains another interval. Read more
Source§

impl<RealType: Debug + RealScalar, UpperBoundType: Debug + BoundType> Debug for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source§

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

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

impl<'de, RealType, UpperBoundType: BoundType> Deserialize<'de> for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where RealType: for<'a> Deserialize<'a> + RealScalar,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<RealType: RealScalar> From<IntervalLowerUnboundedUpperBounded<RealType, Closed>> for Interval<RealType>

Source§

fn from(interval: IntervalLowerUnboundedUpperClosed<RealType>) -> Self

Converts to this type from the input type.
Source§

impl<RealType: RealScalar> From<IntervalLowerUnboundedUpperBounded<RealType, Closed>> for IntervalInfiniteLength<RealType>

Source§

fn from(interval: IntervalLowerUnboundedUpperClosed<RealType>) -> Self

Converts to this type from the input type.
Source§

impl<RealType: RealScalar> From<IntervalLowerUnboundedUpperBounded<RealType, Open>> for Interval<RealType>

Source§

fn from(interval: IntervalLowerUnboundedUpperOpen<RealType>) -> Self

Converts to this type from the input type.
Source§

impl<RealType: RealScalar> From<IntervalLowerUnboundedUpperBounded<RealType, Open>> for IntervalInfiniteLength<RealType>

Source§

fn from(interval: IntervalLowerUnboundedUpperOpen<RealType>) -> Self

Converts to this type from the input type.
Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> HasUpperBound for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source§

type UpperBoundValue = RealType

Source§

fn upper_bound_value(&self) -> &RealType

Return the upper bound of the interval. Read more
Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> IntervalOperations for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where Self: GetIntervalBound<BoundType = RealType>,

Source§

type RealType = RealType

The scalar type used for interval bounds. Read more
Source§

fn intersection<IntervalType: IntervalTrait<RealType = Self::RealType>>( &self, other: &IntervalType, ) -> Option<Interval<Self::RealType>>

Computes the intersection of this interval with another interval. Read more
Source§

fn union<IntervalType: IntervalTrait<RealType = Self::RealType>>( &self, other: &IntervalType, ) -> IntervalUnion<Self::RealType>
where Interval<Self::RealType>: From<Self> + From<IntervalType>,

Computes the union of this interval with another. Read more
Source§

impl<RealType: PartialEq + RealScalar, UpperBoundType: PartialEq + BoundType> PartialEq for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source§

fn eq( &self, other: &IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<RealType, UpperBoundType> Serialize for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where RealType: Serialize + RealScalar, UpperBoundType: Serialize + BoundType,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<RealType: Eq + RealScalar, UpperBoundType: Eq + BoundType> Eq for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> IntervalLowerUnboundedUpperBoundedTrait for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where Self: GetIntervalBound<BoundType = RealType>, UpperBound<RealType, UpperBoundType>: ValueWithinBound<RealType = RealType>,

Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> IntervalTrait for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where Self: GetIntervalBound<BoundType = RealType>, UpperBound<RealType, UpperBoundType>: ValueWithinBound<RealType = RealType>,

Source§

impl<RealType: RealScalar, UpperBoundType: BoundType> StructuralPartialEq for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>

Auto Trait Implementations§

§

impl<RealType, UpperBoundType> Freeze for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, RealType: Freeze,

§

impl<RealType, UpperBoundType> RefUnwindSafe for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, RealType: RefUnwindSafe, UpperBoundType: RefUnwindSafe,

§

impl<RealType, UpperBoundType> Send for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, UpperBoundType: Send,

§

impl<RealType, UpperBoundType> Sync for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, UpperBoundType: Sync,

§

impl<RealType, UpperBoundType> Unpin for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, RealType: Unpin, UpperBoundType: Unpin,

§

impl<RealType, UpperBoundType> UnwindSafe for IntervalLowerUnboundedUpperBounded<RealType, UpperBoundType>
where <RealType as RealScalar>::RawReal: Sized, RealType: UnwindSafe, UpperBoundType: UnwindSafe,

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,