pub struct WeightOrder { /* private fields */ }Expand description
Weighted ordering: compare by $\sum_i w_i \cdot e_i$ descending.
The weight vector is stored at construction time, enabling arbitrary elimination orderings that cannot be expressed as zero-sized types.
§Example
use ocas_poly::sparse::{MonomialOrder, WeightOrder};
use smallvec::smallvec;
let ord = WeightOrder::new(smallvec![2, 1]);
// [1,0] → weight 2, [0,1] → weight 1 → [1,0] is "larger"
assert_eq!(ord.cmp(&[1, 0], &[0, 1]), std::cmp::Ordering::Less);Implementations§
Trait Implementations§
Source§impl Clone for WeightOrder
impl Clone for WeightOrder
Source§fn clone(&self) -> WeightOrder
fn clone(&self) -> WeightOrder
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 moreSource§impl Debug for WeightOrder
impl Debug for WeightOrder
Source§impl Default for WeightOrder
impl Default for WeightOrder
impl Eq for WeightOrder
Source§impl MonomialOrder for WeightOrder
impl MonomialOrder for WeightOrder
Source§impl PartialEq for WeightOrder
impl PartialEq for WeightOrder
impl StructuralPartialEq for WeightOrder
Auto Trait Implementations§
impl Freeze for WeightOrder
impl RefUnwindSafe for WeightOrder
impl Send for WeightOrder
impl Sync for WeightOrder
impl Unpin for WeightOrder
impl UnsafeUnpin for WeightOrder
impl UnwindSafe for WeightOrder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more