[][src]Struct normal_map::DiscreteMapF64

pub struct DiscreteMapF64 { /* fields omitted */ }

Discrete isize integer mapping

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

Implementations

impl DiscreteMapF64[src]

pub fn new<T>(min: T, max: T) -> Self where
    T: Into<isize> + Copy + Clone
[src]

Create a new NormalMap with a discrete isize integer range.

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

Arguments

  • min - the minimum of the range
  • max - the maximum of the range

pub fn normalize<T>(&self, value: T) -> f64 where
    T: Into<isize> + Copy + Clone
[src]

Map a discrete isize value to the normalized range [0.0, 1.0].

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

pub fn normalize_f64(&self, value: f64) -> f64[src]

Map an f64 value to the normalized range [0.0, 1.0].

pub fn normalize_array<T>(&self, in_values: &[T], out_normalized: &mut [f64]) where
    T: Into<isize> + Copy + Clone
[src]

Map an array of discrete isize values to the normalized range [0.0, 1.0].

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

Values will be processed up to the length of the shortest array.

pub fn normalize_array_f64(&self, in_values: &[f64], out_normalized: &mut [f64])[src]

Map an array of f64 values to the normalized range [0.0, 1.0].

Values will be processed up to the length of the shortest array.

pub fn denormalize<T>(&self, normalized: f64) -> T where
    T: From<isize> + Copy + Clone
[src]

Un-map a normalized value to the corresponding discrete isize value.

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

pub fn denormalize_f64(&self, normalized: f64) -> f64[src]

Un-map a normalized value to the corresponding f64 value.

pub fn denormalize_array<T>(&self, in_normalized: &[f64], out_values: &mut [T]) where
    T: From<isize> + Copy + Clone
[src]

Un-map an array of normalized values to the corresponding discrete isize value.

A supplied enum may be used as well as long as it implements From<isize> + Into<isize> + Copy + Clone.

Values will be processed up to the length of the shortest array.

pub fn denormalize_array_f64(
    &self,
    in_normalized: &[f64],
    out_values: &mut [f64]
)
[src]

Un-map an array of normalized values to the corresponding f64 value.

Values will be processed up to the length of the shortest array.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.