pub struct SortValidation {
pub is_sorted: bool,
pub is_permutation: bool,
pub n: usize,
pub inversions: u64,
}Expand description
Comprehensive sort validation: check sorted + permutation + stable order.
Fields§
§is_sorted: boolWhether the result is sorted.
is_permutation: boolWhether the result is a permutation of the input.
n: usizeNumber of elements.
inversions: u64Number of inversions (0 if sorted).
Implementations§
Source§impl SortValidation
impl SortValidation
Sourcepub fn validate_f64(original: &[f64], sorted: &[f64]) -> Self
pub fn validate_f64(original: &[f64], sorted: &[f64]) -> Self
Validate a sort result for f64.
Sourcepub fn validate_u32(original: &[u32], sorted: &[u32]) -> Self
pub fn validate_u32(original: &[u32], sorted: &[u32]) -> Self
Validate a sort result for u32.
Sourcepub fn is_correct(&self) -> bool
pub fn is_correct(&self) -> bool
Returns true if the sort is fully correct.
Auto Trait Implementations§
impl Freeze for SortValidation
impl RefUnwindSafe for SortValidation
impl Send for SortValidation
impl Sync for SortValidation
impl Unpin for SortValidation
impl UnsafeUnpin for SortValidation
impl UnwindSafe for SortValidation
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> 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