Struct Field
pub struct Field {
pub size: usize,
pub values: Vec<f64>,
}Expand description
A size × size grid of scalar values at pixel centres, row-major from the
top (high y) row.
Fields§
§size: usizeValues per side.
values: Vec<f64>size * size values.
Implementations§
§impl Field
impl Field
pub fn sample(size: usize, f: impl FnMut([f64; 2]) -> f64) -> Self
pub fn sample(size: usize, f: impl FnMut([f64; 2]) -> f64) -> Self
Samples f at the pixel centres of the unit square.
pub fn row(size: usize, row: usize, f: impl FnMut([f64; 2]) -> f64) -> Vec<f64>
pub fn row(size: usize, row: usize, f: impl FnMut([f64; 2]) -> f64) -> Vec<f64>
One row of Self::sample: row 0 is the top of the image (v near
1).
pub fn argmin(&self) -> Option<[f64; 2]>
pub fn argmin(&self) -> Option<[f64; 2]>
The unit-square centre of the cell holding the lowest finite value (the first on a tie).
pub fn argmax(&self) -> Option<[f64; 2]>
pub fn argmax(&self) -> Option<[f64; 2]>
The unit-square centre of the cell holding the highest finite value (the first on a tie).
pub fn smoothed(&self, passes: usize) -> Self
pub fn smoothed(&self, passes: usize) -> Self
The field blurred passes times by the 3 × 3 binomial kernel
[1 2 1]ᵀ[1 2 1] / 16, each finite cell renormalized over its finite
neighbours inside the grid; a non-finite cell stays a gap. A
learner’s contour lines follow this copy, so they trace the
landscape’s trend instead of ringing every noisy cell; its colors
stay the raw cells.
Trait Implementations§
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnsafeUnpin for Field
impl UnwindSafe for Field
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more