Enum BoundaryCondition

Source
pub enum BoundaryCondition<T, D: Dimension> {
    NotAKnot,
    Natural,
    Clamped,
    Periodic,
    Individual(Array<RowBoundary<T>, D>),
}
Expand description

Boundary conditions for the whole dataset

The boundary condition is structured in three hirarchic enum’s:

the default is the NotAKnot boundary in each level

There are different possibilities for the boundary condition in each level:

§Example

In a complex case all boundaries can be set individually:


let y = array![
    [0.5, 1.0],
    [0.0, 1.5],
    [3.0, 0.5],
];
let x = array![-1.0, 0.0, 3.0];

// first data column: natural
// second data column top: NotAKnot
// second data column bottom: first derivative == 0.5
let boundaries = array![
    [
        RowBoundary::Natural,
        RowBoundary::Mixed { left: SingleBoundary::NotAKnot, right: SingleBoundary::FirstDeriv(0.5)}
    ],
];
let strat = CubicSpline::new().boundary(BoundaryCondition::Individual(boundaries));
let interpolator = Interp1DBuilder::new(y)
    .x(x)
    .strategy(strat)
    .build().unwrap();

Variants§

§

NotAKnot

Not a knot boundary. The first and second segment at a curve end are the same polynomial.

§

Natural

Natural boundary. The second derivative at the curve end is 0

§

Clamped

Clamped boundary. The first derivative at the curve end is 0

§

Periodic

Periodic spline. The interpolated functions is assumed to be periodic. The first and last element in the data must be equal.

§

Individual(Array<RowBoundary<T>, D>)

Set individual boundary conditions for each row in the data and/or individual conditions for the left and right boundary

Trait Implementations§

Source§

impl<T: Debug, D: Debug + Dimension> Debug for BoundaryCondition<T, D>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T, D: Dimension> Default for BoundaryCondition<T, D>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T: PartialEq, D: PartialEq + Dimension> PartialEq for BoundaryCondition<T, D>

Source§

fn eq(&self, other: &BoundaryCondition<T, D>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Eq, D: Eq + Dimension> Eq for BoundaryCondition<T, D>

Source§

impl<T, D: Dimension> StructuralPartialEq for BoundaryCondition<T, D>

Auto Trait Implementations§

§

impl<T, D> Freeze for BoundaryCondition<T, D>
where D: Freeze,

§

impl<T, D> RefUnwindSafe for BoundaryCondition<T, D>

§

impl<T, D> Send for BoundaryCondition<T, D>
where T: Send,

§

impl<T, D> Sync for BoundaryCondition<T, D>
where T: Sync,

§

impl<T, D> Unpin for BoundaryCondition<T, D>
where D: Unpin,

§

impl<T, D> UnwindSafe for BoundaryCondition<T, D>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.