GradientEstimation

Trait GradientEstimation 

Source
pub trait GradientEstimation<F: Float + FromPrimitive + Debug + FloatCore> {
    // Required methods
    fn gradient(
        &self,
        query: &ArrayView1<'_, F>,
    ) -> InterpolateResult<Array1<F>>;
    fn gradient_multi(
        &self,
        queries: &ArrayView2<'_, F>,
    ) -> InterpolateResult<Array2<F>>;
}
Expand description

Trait for interpolators that can compute gradients

Required Methods§

Source

fn gradient(&self, query: &ArrayView1<'_, F>) -> InterpolateResult<Array1<F>>

Computes the gradient of the interpolated function at a query point

§Arguments
  • query - The point at which to compute the gradient
§Returns

A vector of partial derivatives with respect to each coordinate

Source

fn gradient_multi( &self, queries: &ArrayView2<'_, F>, ) -> InterpolateResult<Array2<F>>

Computes the gradients of the interpolated function at multiple query points

§Arguments
  • queries - The points at which to compute gradients
§Returns

A matrix where each row is the gradient at the corresponding query point

Implementors§

Source§

impl<F: Float + FromPrimitive + Debug + ScalarOperand + 'static + for<'a> Sum<&'a F> + PartialOrd + FloatCore> GradientEstimation<F> for NaturalNeighborInterpolator<F>

Extends NaturalNeighborInterpolator with gradient estimation