pub struct PairGenerator { /* private fields */ }Expand description
Reusable buffers and immutable configuration for indexed random pairs.
Implementations§
Source§impl PairGenerator
impl PairGenerator
Sourcepub fn new(
shape: &[usize],
method: PairingMethod,
num_pairs: usize,
rng: ResolvedRng,
) -> Result<Self, PairGenerationError>
pub fn new( shape: &[usize], method: PairingMethod, num_pairs: usize, rng: ResolvedRng, ) -> Result<Self, PairGenerationError>
Constructs an allocation-stable pair generator from explicit randomness.
Sourcepub fn refresh_at(&mut self, sweep: u64)
pub fn refresh_at(&mut self, sweep: u64)
Replaces every cached pair for an explicit scientific sweep.
Repeating this call with the same sweep reproduces the same batch exactly. No mutable RNG cursor participates in the result. All three dense caches and kernel workspaces retain their storage across sweeps.
pub fn shape(&self) -> &[usize]
pub fn rank(&self) -> usize
pub fn num_pairs(&self) -> usize
pub fn method(&self) -> PairingMethod
pub fn resolved_rng(&self) -> ResolvedRng
Sourcepub fn generated_sweep(&self) -> Option<u64>
pub fn generated_sweep(&self) -> Option<u64>
Returns the sweep represented by the current buffers, if generated.
pub fn sources(&self) -> &VectorList<isize>
Sourcepub fn displacements(&self) -> &VectorList<isize>
pub fn displacements(&self) -> &VectorList<isize>
Raw displacements. Every row satisfies target = source + displacement.
Sourcepub fn targets(&self) -> &VectorList<isize>
pub fn targets(&self) -> &VectorList<isize>
Raw target coordinates for use with boundary-aware SquareLattice accessors.
Trait Implementations§
Source§impl Clone for PairGenerator
impl Clone for PairGenerator
Source§fn clone(&self) -> PairGenerator
fn clone(&self) -> PairGenerator
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 moreAuto Trait Implementations§
impl Freeze for PairGenerator
impl RefUnwindSafe for PairGenerator
impl Send for PairGenerator
impl Sync for PairGenerator
impl Unpin for PairGenerator
impl UnsafeUnpin for PairGenerator
impl UnwindSafe for PairGenerator
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,
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