pub enum SortPrimsDescriptor {
Sort {
axis: usize,
descending: bool,
stable: bool,
},
Argsort {
axis: usize,
descending: bool,
stable: bool,
},
Topk {
axis: usize,
k: usize,
largest: bool,
sorted: bool,
},
}Expand description
Descriptor for sort-family planning.
§Examples
use tenferro_prims::SortPrimsDescriptor;
let desc = SortPrimsDescriptor::Sort {
axis: 0,
descending: false,
stable: true,
};
assert!(matches!(desc, SortPrimsDescriptor::Sort { .. }));
let desc = SortPrimsDescriptor::Topk {
axis: 0,
k: 3,
largest: true,
sorted: true,
};
assert!(matches!(desc, SortPrimsDescriptor::Topk { .. }));Variants§
Sort
Sort elements along axis.
Produces both sorted values and the corresponding permutation indices.
Fields
Argsort
Compute the permutation that would sort elements along axis.
Returns only the index permutation (values output is left unmodified).
Fields
Topk
Select the top-k elements along axis.
Returns the k largest (or smallest) values and their indices.
Trait Implementations§
Source§impl Clone for SortPrimsDescriptor
impl Clone for SortPrimsDescriptor
Source§fn clone(&self) -> SortPrimsDescriptor
fn clone(&self) -> SortPrimsDescriptor
Returns a duplicate of the value. Read more
1.0.0 · 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 SortPrimsDescriptor
impl Debug for SortPrimsDescriptor
Source§impl Hash for SortPrimsDescriptor
impl Hash for SortPrimsDescriptor
Source§impl PartialEq for SortPrimsDescriptor
impl PartialEq for SortPrimsDescriptor
impl Eq for SortPrimsDescriptor
impl StructuralPartialEq for SortPrimsDescriptor
Auto Trait Implementations§
impl Freeze for SortPrimsDescriptor
impl RefUnwindSafe for SortPrimsDescriptor
impl Send for SortPrimsDescriptor
impl Sync for SortPrimsDescriptor
impl Unpin for SortPrimsDescriptor
impl UnwindSafe for SortPrimsDescriptor
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
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