pub struct MersenneTwisterConfig {
pub n: usize,
pub m: usize,
pub matrix_a: u32,
pub upper_mask: u32,
pub lower_mask: u32,
pub tempering_mask_b: u32,
pub tempering_mask_c: u32,
}
Expand description
Configuration for the Mersenne Twister algorithm.
Fields§
§n: usize
The number of elements in the array used for the Mersenne Twister algorithm. Its value is set to 624 for optimal performance.
m: usize
The number of elements to skip in the array used for the Mersenne Twister algorithm. Its value is set to 397 for optimal performance.
matrix_a: u32
A constant value used in the Mersenne Twister algorithm.
upper_mask: u32
A constant value used in the Mersenne Twister algorithm.
lower_mask: u32
A constant value used in the Mersenne Twister algorithm.
tempering_mask_b: u32
A constant value used in the Mersenne Twister algorithm.
tempering_mask_c: u32
A constant value used in the Mersenne Twister algorithm.
Implementations§
source§impl MersenneTwisterConfig
impl MersenneTwisterConfig
Implementation of the MersenneTwisterConfig
struct.
sourcepub fn new() -> MersenneTwisterConfig
pub fn new() -> MersenneTwisterConfig
Creates a new MersenneTwisterConfig
with default values.
Examples
use vrd::MersenneTwisterConfig;
let config = MersenneTwisterConfig::new();
Trait Implementations§
source§impl Clone for MersenneTwisterConfig
impl Clone for MersenneTwisterConfig
source§fn clone(&self) -> MersenneTwisterConfig
fn clone(&self) -> MersenneTwisterConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MersenneTwisterConfig
impl Debug for MersenneTwisterConfig
source§impl Default for MersenneTwisterConfig
impl Default for MersenneTwisterConfig
source§fn default() -> MersenneTwisterConfig
fn default() -> MersenneTwisterConfig
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for MersenneTwisterConfig
impl<'de> Deserialize<'de> for MersenneTwisterConfig
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<MersenneTwisterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<MersenneTwisterConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for MersenneTwisterConfig
impl Hash for MersenneTwisterConfig
source§impl Ord for MersenneTwisterConfig
impl Ord for MersenneTwisterConfig
source§fn cmp(&self, other: &MersenneTwisterConfig) -> Ordering
fn cmp(&self, other: &MersenneTwisterConfig) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for MersenneTwisterConfig
impl PartialEq for MersenneTwisterConfig
source§fn eq(&self, other: &MersenneTwisterConfig) -> bool
fn eq(&self, other: &MersenneTwisterConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for MersenneTwisterConfig
impl PartialOrd for MersenneTwisterConfig
source§fn partial_cmp(&self, other: &MersenneTwisterConfig) -> Option<Ordering>
fn partial_cmp(&self, other: &MersenneTwisterConfig) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for MersenneTwisterConfig
impl Serialize for MersenneTwisterConfig
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for MersenneTwisterConfig
impl Eq for MersenneTwisterConfig
impl StructuralEq for MersenneTwisterConfig
impl StructuralPartialEq for MersenneTwisterConfig
Auto Trait Implementations§
impl RefUnwindSafe for MersenneTwisterConfig
impl Send for MersenneTwisterConfig
impl Sync for MersenneTwisterConfig
impl Unpin for MersenneTwisterConfig
impl UnwindSafe for MersenneTwisterConfig
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
§impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromBase64 for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.