Skip to main content

Rng

Type Alias Rng 

Source
pub type Rng = igraph_rng_t;
Expand description

An owned random number generator (igraph_rng_t).

Aliased Type§

pub struct Rng { /* private fields */ }

Implementations§

Source§

impl Rng

Source

pub fn sample_sphere_surface( &mut self, dim: usize, n: usize, radius: f64, positive: bool, ) -> Result<Vec<Vec<f64>>>

Like sample_sphere_surface, drawing from this generator (igraph_rng_sample_sphere_surface).

use igraph::prelude::*;
let mut a = Rng::new(RngType::Pcg64, 5)?;
let mut b = Rng::new(RngType::Pcg64, 5)?;
assert_eq!(a.sample_sphere_surface(4, 3, 1.0, false)?, b.sample_sphere_surface(4, 3, 1.0, false)?);
Source

pub fn sample_sphere_volume( &mut self, dim: usize, n: usize, radius: f64, positive: bool, ) -> Result<Vec<Vec<f64>>>

Like sample_sphere_volume, drawing from this generator (igraph_rng_sample_sphere_volume).

Source

pub fn sample_dirichlet( &mut self, n: usize, alpha: &[f64], ) -> Result<Vec<Vec<f64>>>

Like sample_dirichlet, drawing from this generator (igraph_rng_sample_dirichlet).