pub struct IntegerPermutation {
pub elements: Vec<usize>,
pub min: usize,
pub max: usize,
}
Fields§
§elements: Vec<usize>
§min: usize
§max: usize
Implementations§
Source§impl IntegerPermutation
impl IntegerPermutation
pub fn new(size: usize) -> Self
pub fn new_from_permutation(_permutation: Vec<u64>) -> Self
pub fn size(&self) -> usize
pub fn make_permutation<R: Rng>(&mut self, rng: &mut R)
pub fn get(&self, index: usize) -> usize
pub fn set(&mut self, index: usize, value: usize)
pub fn slice(&self, min: usize, max: usize) -> Self
pub fn inverse(&self) -> Self
pub fn is_valid(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IntegerPermutation
impl RefUnwindSafe for IntegerPermutation
impl Send for IntegerPermutation
impl Sync for IntegerPermutation
impl Unpin for IntegerPermutation
impl UnwindSafe for IntegerPermutation
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