pub struct DedekindCutQ {
pub numerator: i64,
pub denominator: u64,
}Expand description
A Dedekind cut representation over the rationals (using integer pairs p/q).
A Dedekind cut (L, R) partitions the rationals into a lower set L and upper set R. We represent it by the cut value as a rational number p/q.
Fields§
§numerator: i64Numerator of the cut value.
denominator: u64Denominator of the cut value (always positive).
Implementations§
Source§impl DedekindCutQ
impl DedekindCutQ
Sourcepub fn in_lower(&self, r: i64, s: u64) -> bool
pub fn in_lower(&self, r: i64, s: u64) -> bool
Check if a rational number r/s is in the lower set.
Sourcepub fn in_upper(&self, r: i64, s: u64) -> bool
pub fn in_upper(&self, r: i64, s: u64) -> bool
Check if a rational number r/s is in the upper set.
Sourcepub fn cut_cmp(&self, other: &DedekindCutQ) -> Ordering
pub fn cut_cmp(&self, other: &DedekindCutQ) -> Ordering
Compare two cuts.
Sourcepub fn mediant(&self, other: &DedekindCutQ) -> DedekindCutQ
pub fn mediant(&self, other: &DedekindCutQ) -> DedekindCutQ
Return a cut strictly between self and other.
Auto Trait Implementations§
impl Freeze for DedekindCutQ
impl RefUnwindSafe for DedekindCutQ
impl Send for DedekindCutQ
impl Sync for DedekindCutQ
impl Unpin for DedekindCutQ
impl UnsafeUnpin for DedekindCutQ
impl UnwindSafe for DedekindCutQ
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