Skip to main content

Halton

Struct Halton 

Source
pub struct Halton {
    pub seed: u64,
}
Expand description

Cover the space evenly instead of drawing from it evenly.

What separates it from Random is not what it looks at — both look at nothing — but what it promises. Random is uniform in expectation; this is uniform by construction, for every prefix: of the first base² trials exactly one lands in each cell of a base² grid, and no arrangement of the indices makes it otherwise. For a study handed out of a folder that is the difference between a collision being unlikely and there being no way to arrange one.

Knob d is read in base the d-th prime, which is why the promise thins out once there are many knobs: the high primes need a long prefix before they look like anything. Sobol has no such seam, at the price of a table. Its point is a function of the seed and the index.

Fields§

§seed: u64

The seed, which here permutes the digits rather than drawing them: with no scramble a Halton sequence is one fixed sequence, and two studies of the same space would search it in exactly the same order.

Implementations§

Source§

impl Halton

Source

pub fn ask( &self, space: &Space, trial: usize, _seen: &[(Point, Option<f64>)], ) -> Option<Point>

The trial-th point. It never runs out, and it never looks at what the finished trials did.

Trait Implementations§

Source§

impl Clone for Halton

Source§

fn clone(&self) -> Halton

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Halton

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<Halton> for Sampler

Source§

fn from(how: Halton) -> Self

Converts to this type from the input type.
Source§

impl Hash for Halton

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Halton

Source§

fn eq(&self, other: &Halton) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Halton

Source§

impl StructuralPartialEq for Halton

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.