Struct minnow::FloatModel
source · [−]pub struct FloatModel<F> where
F: Float, { /* private fields */ }
Implementations
sourceimpl<F> FloatModel<F> where
F: Float + Debug,
impl<F> FloatModel<F> where
F: Float + Debug,
pub fn new(range: RangeInclusive<F>, precision: i8) -> Self
Trait Implementations
sourceimpl<F: Clone> Clone for FloatModel<F> where
F: Float,
impl<F: Clone> Clone for FloatModel<F> where
F: Float,
sourcefn clone(&self) -> FloatModel<F>
fn clone(&self) -> FloatModel<F>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F> Default for FloatModel<F> where
F: Float + Debug,
impl<F> Default for FloatModel<F> where
F: Float + Debug,
sourceimpl<F> Model for FloatModel<F> where
F: Float + Debug,
impl<F> Model for FloatModel<F> where
F: Float + Debug,
type Symbol = F
type Symbol = F
The type of symbol this [Model
] describes
type ValueError = !
type ValueError = !
Invalid symbol error
sourcefn probability(
&self,
symbol: &Self::Symbol
) -> Result<Range<Self::B>, Self::ValueError>
fn probability(
&self,
symbol: &Self::Symbol
) -> Result<Range<Self::B>, Self::ValueError>
Given a symbol, return an interval representing the probability of that symbol occurring. Read more
sourcefn max_denominator(&self) -> Self::B
fn max_denominator(&self) -> Self::B
The maximum denominator used for probability ranges. See
[Model::probability
]. Read more
Auto Trait Implementations
impl<F> RefUnwindSafe for FloatModel<F> where
F: RefUnwindSafe,
impl<F> Send for FloatModel<F> where
F: Send,
impl<F> Sync for FloatModel<F> where
F: Sync,
impl<F> Unpin for FloatModel<F> where
F: Unpin,
impl<F> UnwindSafe for FloatModel<F> where
F: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Model for T where
T: Model,
impl<T> Model for T where
T: Model,
type B = <T as Model>::B
type B = <T as Model>::B
The internal representation to use for storing integers
type Symbol = <T as Model>::Symbol
type Symbol = <T as Model>::Symbol
The type of symbol this [Model
] describes
type ValueError = <T as Model>::ValueError
type ValueError = <T as Model>::ValueError
Invalid symbol error
fn probability(
&self,
symbol: &<T as Model>::Symbol
) -> Result<Range<<T as Model>::B>, <T as Model>::ValueError>
fn probability(
&self,
symbol: &<T as Model>::Symbol
) -> Result<Range<<T as Model>::B>, <T as Model>::ValueError>
Given a symbol, return an interval representing the probability of that symbol occurring. Read more
fn max_denominator(&self) -> <T as Model>::B
fn max_denominator(&self) -> <T as Model>::B
The maximum denominator used for probability ranges. See
[Model::probability
]. Read more
fn symbol(&self, value: <T as Model>::B) -> <T as Model>::Symbol
fn symbol(&self, value: <T as Model>::B) -> <T as Model>::Symbol
Given a value, return the symbol whose probability range it falls in. Read more
fn denominator(&self) -> <T as Model>::B
fn denominator(&self) -> <T as Model>::B
The denominator for probability ranges. See [Model::probability
]. Read more