pub enum Interp<Z = f64, X = f64, Y = X> {
    Scalar(Z),
    Interp1D1(Interp1D<X, Z>),
    Interp1D2(Interp1D<Y, Z>),
    Interp2D(Interp2D<X, Y, Z, OwnedRepr<Z>>),
}
Expand description

Interpolated timing table with two, one or zero variables.

Variants§

§

Scalar(Z)

A scalar (constant) value.

§

Interp1D1(Interp1D<X, Z>)

A one-dimensional table. Value depends only on the first variable.

§

Interp1D2(Interp1D<Y, Z>)

A one-dimensional table. Value depends only on the second variable.

§

Interp2D(Interp2D<X, Y, Z, OwnedRepr<Z>>)

A two-dimensional table

Implementations§

source§

impl<Z, X, Y> Interp<Z, X, Y>

source

pub fn eval2d(&self, (x, y): (X, Y)) -> Zwhere X: Copy + Sub<Output = X> + Div + PartialOrd, Y: Copy + Sub<Output = Y> + Div<Output = <X as Div>::Output> + PartialOrd, Z: Copy + Mul<<X as Div>::Output, Output = Z> + Add<Output = Z> + Sub<Output = Z>, <X as Div>::Output: Copy + Add<Output = <X as Div>::Output> + Sub<Output = <X as Div>::Output>,

Evaluate the interpolated function at (x, y). For 1D functions y is ignored. For scalars both x and y is ignored.

source

pub fn swap_variables(self) -> Interp<Z, Y, X>where Z: Clone,

Swap the variables

source

pub fn map_values<Z2>(&self, f: impl Fn(&Z) -> Z2) -> Interp<Z2, X, Y>where X: PartialOrd + Clone, Y: PartialOrd + Clone,

source

pub fn map_x_axis<Xnew>(self, f: impl Fn(X) -> Xnew) -> Interp<Z, Xnew, Y>where Xnew: PartialOrd,

source

pub fn map_y_axis<Ynew>(self, f: impl Fn(Y) -> Ynew) -> Interp<Z, X, Ynew>where Ynew: PartialOrd,

Trait Implementations§

source§

impl<Z: Clone, X: Clone, Y: Clone> Clone for Interp<Z, X, Y>

source§

fn clone(&self) -> Interp<Z, X, Y>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Z: Debug, X: Debug, Y: Debug> Debug for Interp<Z, X, Y>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Z, X, Y> RefUnwindSafe for Interp<Z, X, Y>where X: RefUnwindSafe, Y: RefUnwindSafe, Z: RefUnwindSafe,

§

impl<Z, X, Y> Send for Interp<Z, X, Y>where X: Send, Y: Send, Z: Send,

§

impl<Z, X, Y> Sync for Interp<Z, X, Y>where X: Sync, Y: Sync, Z: Sync,

§

impl<Z, X, Y> Unpin for Interp<Z, X, Y>where X: Unpin, Y: Unpin, Z: Unpin,

§

impl<Z, X, Y> UnwindSafe for Interp<Z, X, Y>where X: UnwindSafe, Y: UnwindSafe, Z: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.