pub struct ColoredNoise<S: Scalar> { /* private fields */ }Expand description
Spatially colored (correlated) noise.
Noise at nearby points is correlated with correlation function: C(|x - x’|) = exp(-|x - x’| / λ)
where λ is the correlation length.
Implementations§
Source§impl<S: Scalar> ColoredNoise<S>
impl<S: Scalar> ColoredNoise<S>
Sourcepub fn new(
dx: S,
correlation_length: S,
n_points: usize,
seed: Option<u64>,
) -> Result<Self, String>
pub fn new( dx: S, correlation_length: S, n_points: usize, seed: Option<u64>, ) -> Result<Self, String>
Create colored noise generator.
§Arguments
dx- Spatial grid spacingcorrelation_length- Noise correlation lengthn_points- Number of spatial grid pointsseed- Optional random seed
Returns an error if the resulting correlation matrix is not positive definite or is ill-conditioned for the given parameters.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for ColoredNoise<S>where
S: Freeze,
impl<S> RefUnwindSafe for ColoredNoise<S>where
S: RefUnwindSafe,
impl<S> Send for ColoredNoise<S>
impl<S> Sync for ColoredNoise<S>
impl<S> Unpin for ColoredNoise<S>where
S: Unpin,
impl<S> UnsafeUnpin for ColoredNoise<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ColoredNoise<S>where
S: UnwindSafe,
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