pub struct BlockOrder { /* private fields */ }Expand description
Block ordering: partition variables into contiguous blocks, each compared under its own sub-ordering.
Blocks are defined by boundaries: a sorted list of split points
(exclusive upper bounds, not including n_vars). For example,
boundaries = [2] with orders = [Lex, Grevlex] on a 4-variable
polynomial means: compare variables 0–1 under Lex first; if equal,
compare variables 2–3 under Grevlex.
§Example
use ocas_poly::sparse::{BlockOrder, MonomialOrder, SubOrder};
use smallvec::smallvec;
let ord = BlockOrder::new(smallvec![2], smallvec![SubOrder::Lex, SubOrder::Grevlex]);
// First compare variables 0–1 lex, then variables 2–3 grevlex.
let a = [1, 0, 0, 0]; // x₀
let b = [0, 1, 0, 0]; // x₁
// Lex: [1,0] > [0,1], so a is "greater" (comes first in ordering)
assert_eq!(ord.cmp(&a, &b), std::cmp::Ordering::Greater);Implementations§
Trait Implementations§
Source§impl Clone for BlockOrder
impl Clone for BlockOrder
Source§fn clone(&self) -> BlockOrder
fn clone(&self) -> BlockOrder
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 BlockOrder
impl Debug for BlockOrder
impl Eq for BlockOrder
Source§impl MonomialOrder for BlockOrder
impl MonomialOrder for BlockOrder
Source§impl PartialEq for BlockOrder
impl PartialEq for BlockOrder
impl StructuralPartialEq for BlockOrder
Auto Trait Implementations§
impl Freeze for BlockOrder
impl RefUnwindSafe for BlockOrder
impl Send for BlockOrder
impl Sync for BlockOrder
impl Unpin for BlockOrder
impl UnsafeUnpin for BlockOrder
impl UnwindSafe for BlockOrder
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