Skip to content

praxis / mc / bernoulli


Module bernoulli

Quick Reference

ItemKindDescription
BernoulliThresholdstruct
threshold_from_probabilityfn
sample_u32fn
sample_block_philox4x32_10fn
sample_block_blueprintfn

Structs

BernoulliThreshold

rust
struct BernoulliThreshold {
    pub t: u32,
    pub full_range: bool,
}

Implementations

  • <span id="bernoullithreshold-always-false"></span>const fn always_false() -> Self

  • <span id="bernoullithreshold-always-true"></span>const fn always_true() -> Self

Trait Implementations

impl<ST> CastableFrom for BernoulliThreshold
impl Clone for BernoulliThreshold
  • <span id="bernoullithreshold-clone"></span>fn clone(&self) -> BernoulliThresholdBernoulliThreshold
impl Copy for BernoulliThreshold
impl Debug for BernoulliThreshold
  • <span id="bernoullithreshold-debug-fmt"></span>fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl Eq for BernoulliThreshold
impl Instrument for BernoulliThreshold
impl IntoEither for BernoulliThreshold
impl PartialEq for BernoulliThreshold
  • <span id="bernoullithreshold-partialeq-eq"></span>fn eq(&self, other: &BernoulliThreshold) -> boolBernoulliThreshold
impl Pointable for BernoulliThreshold
  • <span id="bernoullithreshold-pointable-const-align"></span>const ALIGN: usize

  • <span id="bernoullithreshold-pointable-type-init"></span>type Init = T

  • <span id="bernoullithreshold-pointable-init"></span>unsafe fn init(init: <T as Pointable>::Init) -> usize

  • <span id="bernoullithreshold-pointable-deref"></span>unsafe fn deref<'a>(ptr: usize) -> &'a T

  • <span id="bernoullithreshold-pointable-deref-mut"></span>unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

  • <span id="bernoullithreshold-pointable-drop"></span>unsafe fn drop(ptr: usize)

impl Read for BernoulliThreshold
impl Same for BernoulliThreshold
  • <span id="bernoullithreshold-same-type-output"></span>type Output = T
impl Scalar for BernoulliThreshold
impl StructuralPartialEq for BernoulliThreshold
impl<SS> SupersetOf for BernoulliThreshold
  • <span id="bernoullithreshold-supersetof-to-subset"></span>fn to_subset(&self) -> Option<SS>

  • <span id="bernoullithreshold-supersetof-is-in-subset"></span>fn is_in_subset(&self) -> bool

  • <span id="bernoullithreshold-supersetof-to-subset-unchecked"></span>fn to_subset_unchecked(&self) -> SS

  • <span id="bernoullithreshold-supersetof-from-subset"></span>fn from_subset(element: &SS) -> SP

impl<V> VZip for BernoulliThreshold
  • <span id="bernoullithreshold-vzip"></span>fn vzip(self) -> V
impl WithSubscriber for BernoulliThreshold

Functions

threshold_from_probability

rust
fn threshold_from_probability(p: f64) -> BernoulliThreshold

sample_u32

rust
fn sample_u32(r: u32, threshold: BernoulliThreshold) -> bool

sample_block_philox4x32_10

rust
fn sample_block_philox4x32_10(ctr: crate::mc::philox::Philox4x32Ctr, key: crate::mc::philox::Philox4x32Key, threshold: BernoulliThreshold) -> [bool; 4]

sample_block_blueprint

rust
fn sample_block_blueprint(ix: u32, iy: u32, iz: u32, t: u32, increment: u32, key: crate::mc::philox::Philox4x32Key, threshold: BernoulliThreshold) -> [bool; 4]