FloatRandom

Trait FloatRandom 

Source
pub trait FloatRandom {
    // Required method
    fn random() -> Self;
}
Expand description

Trait for floating-point random number generation.

Generates a Vector, RowVector, or Matrix filled with random floating-point numbers uniformly in the range [-1, 1].

§Example

use ferrix::FloatRandom;
use ferrix::Vector;

let a = Vector::<f32, 3>::random();

Required Methods§

Source

fn random() -> Self

Will generate random floating-point numbers uniformly in the range [-1, 1].

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: Float + SampleUniform, const N: usize> FloatRandom for RowVector<T, N>

Source§

impl<T: Float + SampleUniform, const N: usize> FloatRandom for Vector<T, N>

Source§

impl<T: Float + SampleUniform, const R: usize, const C: usize> FloatRandom for Matrix<T, R, C>