pub struct NormalBuilder<T: Num + Float, D: DimTrait> { /* private fields */ }
Expand description

A builder for creating matrices filled with random values from a normal distribution.

Implementations§

source§

impl<T, D> NormalBuilder<T, D>
where T: Num, D: DimTrait,

source

pub fn new() -> Self

Creates a new NormalBuilder.

source

pub fn mean(self, mean: T) -> Self

Sets the mean of the normal distribution.

source

pub fn std_dev(self, std_dev: T) -> Self

Sets the standard deviation of the normal distribution.

source

pub fn shape(self, shape: D) -> Self

Sets the shape of the matrix.

source

pub fn seed(self, seed: u64) -> Self

Sets the seed for the random number generator.

source

pub fn from_matrix<M: MatrixBase<Dim = D>>(self, a: &M) -> Self

Sets the shape of the matrix to be the same as another matrix.

source

pub fn build(self) -> Matrix<OwnedMem<T>, D>

Builds the matrix.

Trait Implementations§

source§

impl<T: Clone + Num + Float, D: Clone + DimTrait> Clone for NormalBuilder<T, D>

source§

fn clone(&self) -> NormalBuilder<T, D>

Returns a copy 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<T: Debug + Num + Float, D: Debug + DimTrait> Debug for NormalBuilder<T, D>

source§

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

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

impl<T: Default + Num + Float, D: Default + DimTrait> Default for NormalBuilder<T, D>

source§

fn default() -> NormalBuilder<T, D>

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T, D> Freeze for NormalBuilder<T, D>
where D: Freeze, T: Freeze,

§

impl<T, D> RefUnwindSafe for NormalBuilder<T, D>

§

impl<T, D> Send for NormalBuilder<T, D>
where D: Send, T: Send,

§

impl<T, D> Sync for NormalBuilder<T, D>
where D: Sync, T: Sync,

§

impl<T, D> Unpin for NormalBuilder<T, D>
where D: Unpin, T: Unpin,

§

impl<T, D> UnwindSafe for NormalBuilder<T, D>
where D: UnwindSafe, T: UnwindSafe,

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> 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,

§

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>,

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V