[−][src]Struct arrayfire::RandomEngine
Random number generator engine
This is a wrapper for ArrayFire's native random number generator engine.
Sharing Across Threads
While sharing this object with other threads, there is no need to wrap this in an Arc object unless only one such object is required to exist. The reason being that ArrayFire's internal details that are pointed to by the RandoMEngine handle are appropriately reference counted in thread safe manner. However, if you need to modify RandomEngine object, then please do wrap the object using a Mutex or Read-Write lock.
Implementations
impl RandomEngine
[src]
pub fn new(rengine: RandomEngineType, seed: Option<u64>) -> Self
[src]
Create a new random engine object
Parameters
rengine
can be value of RandomEngineType enum.seed
is the initial seed value
Return Values
A object of type RandomEngine
pub fn get_type(&self) -> RandomEngineType
[src]
Get random engine type
pub fn set_type(&mut self, engine_type: RandomEngineType)
[src]
Get random engine type
pub fn set_seed(&mut self, seed: u64)
[src]
Set seed for random engine
pub fn get_seed(&self) -> u64
[src]
Get seed of the random engine
pub unsafe fn get(&self) -> af_random_engine
[src]
Returns the native FFI handle for Rust object RandomEngine
Trait Implementations
impl Clone for RandomEngine
[src]
Increment reference count of RandomEngine's native resource
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Drop for RandomEngine
[src]
Free RandomEngine's native resource
impl From<*mut c_void> for RandomEngine
[src]
Used for creating RandomEngine object from native resource id
fn from(t: af_random_engine) -> Self
[src]
impl Send for RandomEngine
[src]
Auto Trait Implementations
impl RefUnwindSafe for RandomEngine
impl !Sync for RandomEngine
impl Unpin for RandomEngine
impl UnwindSafe for RandomEngine
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,