[][src]Struct arrayfire::RandomEngine

pub struct RandomEngine { /* fields omitted */ }

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.


impl RandomEngine[src]

pub fn new(rengine: RandomEngineType, seed: Option<u64>) -> Self[src]

Create a new random engine object


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

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

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

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.