Skip to main content

Param

Struct Param 

Source
pub struct Param<F, D> { /* private fields */ }
👎Deprecated: See curve_sampling::Fun instead
Expand description

Options for sampling the image of functions ℝ → ℝ². See Sampling::param.

Implementations§

Source§

impl<F, Y, D> Param<F, D>
where F: FnMut(f64) -> Y, Y: Img<D>,

Source

pub fn n(self, n: usize) -> Self

Set the maximum number of evaluations of the function to build the sampling. Panic if n < 2.

Source

pub fn viewport(self, vp: BoundingBox) -> Self

Set the zone of interest for the sampling. Segments that end up outside this box will not be refined.

Source

pub fn init<'a, I>(self, ts: I) -> Self
where I: IntoIterator<Item = &'a f64>,

Add initial values of t such that f(t) (see [Sampling :: param]) must be included into the sampling in addition to the n evaluations. Only the values between a and b are taken into account (other values are ignored).

Source

pub fn init_pt<I>(self, pts: I) -> Self
where I: IntoIterator<Item = (f64, Y)>,

Add initial points (t, f(t)) to include into the sampling in addition to the n evaluations. This allows you to use previous evaluations of f. Only the couples with first coordinate t between a and b (see [Sampling :: param]) are considered (other values are ignored).

Source§

impl<F, Y, D> Param<F, D>
where F: FnMut(f64) -> Y, Y: Img<D>,

Source

pub fn build(self) -> Sampling<D>

Return the sampling.

Auto Trait Implementations§

§

impl<F, D> Freeze for Param<F, D>
where F: Freeze,

§

impl<F, D> !RefUnwindSafe for Param<F, D>

§

impl<F, D> !Send for Param<F, D>

§

impl<F, D> !Sync for Param<F, D>

§

impl<F, D> Unpin for Param<F, D>
where F: Unpin, D: Unpin,

§

impl<F, D> !UnwindSafe for Param<F, 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.