[][src]Enum arctk::math::func::formula::Formula

pub enum Formula {
    Constant {
        c: f64,
    },
    Line {
        c: f64,
        m: f64,
    },
    Bifurcation {
        t: f64,
        under: f64,
        over: f64,
    },
    ConstantSpline {
        xs: Array1<f64>,
        ys: Array1<f64>,
    },
    LinearSpline {
        xs: Array1<f64>,
        ys: Array1<f64>,
        grads: Array1<f64>,
    },
    QuadraticSpline {
        xs: Array1<f64>,
        ys: Array1<f64>,
        grads: Array1<f64>,
        quads: Array1<f64>,
    },
}

Mathematical formulae accepting a single scalar argument.

Variants

Constant

Constant value. = c

Fields of Constant

c: f64

Constant.

Line

Line formula. = mx + c

Fields of Line

c: f64

Offset.

m: f64

Gradient.

Bifurcation

Bifurcation formula. = if x < t { under } else { over }.

Fields of Bifurcation

t: f64

Threshold value.

under: f64

Under value.

over: f64

Over value.

ConstantSpline

Constant value spline.

Fields of ConstantSpline

xs: Array1<f64>

X change points.

ys: Array1<f64>

Y values.

LinearSpline

Linear spline.

Fields of LinearSpline

xs: Array1<f64>

X change points.

ys: Array1<f64>

Y values.

grads: Array1<f64>

Gradient between points.

QuadraticSpline

Quadratic spline.

Fields of QuadraticSpline

xs: Array1<f64>

X change points.

ys: Array1<f64>

Y values.

grads: Array1<f64>

Gradient between points.

quads: Array1<f64>

Second order term between points.

Implementations

impl Formula[src]

#[must_use]pub fn new_constant_spline(xs: Array1<f64>, ys: Array1<f64>) -> Self[src]

Construct a constant spline instance.

#[must_use]pub fn new_linear_spline(
    xs: Array1<f64>,
    ys: Array1<f64>,
    grads: Array1<f64>
) -> Self
[src]

Construct a linear spline instance.

#[must_use]pub fn new_linear_spline_auto(xs: Array1<f64>, ys: Array1<f64>) -> Self[src]

Construct a linear spline instance.

#[must_use]pub fn new_quadratic_spline(
    xs: Array1<f64>,
    ys: Array1<f64>,
    grads: Array1<f64>,
    quads: Array1<f64>
) -> Self
[src]

Construct a quadratic spline instance.

#[must_use]pub fn y(&self, x: f64) -> f64[src]

Determine the corresponding output value for the given input.

Trait Implementations

impl Clone for Formula[src]

impl Debug for Formula[src]

Auto Trait Implementations

impl RefUnwindSafe for Formula

impl Send for Formula

impl Sync for Formula

impl Unpin for Formula

impl UnwindSafe for Formula

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

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

impl<T> Background for T[src]

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

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

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> Foreground for T[src]

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

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,