ScalarMath

Trait ScalarMath 

Source
pub trait ScalarMath {
    // Required methods
    fn clip(&self, min_thresh: Self, max_thresh: Self) -> Self;
    fn logsafe(&self) -> Self;
}
Expand description

Scalar operations on FloatT

Required Methods§

Source

fn clip(&self, min_thresh: Self, max_thresh: Self) -> Self

Applies a threshold value.

Restricts the value to be at least min_thresh and at most max_thresh.

Source

fn logsafe(&self) -> Self

Safe calculation for log barriers.

Returns log(s) if s > 0 -Infinity otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<T: FloatT> ScalarMath for T