pub struct RBFInterpolator { /* private fields */ }Expand description
Radial Basis Function interpolator for scattered data
§Examples
use scirs2_spatial::interpolate::{RBFInterpolator, RBFKernel};
use scirs2_core::ndarray::array;
// Create sample points and values
let points = array![
[0.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
[1.0, 1.0],
];
let values = array![0.0, 1.0, 2.0, 3.0];
// Create interpolator with Gaussian kernel
let interp = RBFInterpolator::new(
&points.view(),
&values.view(),
RBFKernel::Gaussian,
Some(1.0),
None,
).expect("Operation failed");
// Interpolate at a point
let query_point = array![0.5, 0.5];
let result = interp.interpolate(&query_point.view()).expect("Operation failed");
// For this simple example, should be close to 1.5Implementations§
Source§impl RBFInterpolator
impl RBFInterpolator
Sourcepub fn new(
points: &ArrayView2<'_, f64>,
values: &ArrayView1<'_, f64>,
kernel: RBFKernel,
epsilon: Option<f64>,
polynomial: Option<bool>,
) -> SpatialResult<Self>
pub fn new( points: &ArrayView2<'_, f64>, values: &ArrayView1<'_, f64>, kernel: RBFKernel, epsilon: Option<f64>, polynomial: Option<bool>, ) -> SpatialResult<Self>
Create a new RBF interpolator
§Arguments
points- Input points with shape (n_samples, n_dims)values- Input values with shape (n_samples,)kernel- RBF kernel function to useepsilon- Shape parameter for the kernel (default depends on kernel)polynomial- Whether to include polynomial terms (default: false)
§Returns
A new RBFInterpolator
§Errors
- If points and values have different lengths
- If fewer than d+1 points are provided (where d is the dimensionality)
- If the system of equations is singular
Sourcepub fn interpolate(&self, point: &ArrayView1<'_, f64>) -> SpatialResult<f64>
pub fn interpolate(&self, point: &ArrayView1<'_, f64>) -> SpatialResult<f64>
Sourcepub fn interpolate_many(
&self,
points: &ArrayView2<'_, f64>,
) -> SpatialResult<Array1<f64>>
pub fn interpolate_many( &self, points: &ArrayView2<'_, f64>, ) -> SpatialResult<Array1<f64>>
Sourcepub fn has_polynomial(&self) -> bool
pub fn has_polynomial(&self) -> bool
Check if this interpolator includes polynomial terms
Trait Implementations§
Source§impl Clone for RBFInterpolator
impl Clone for RBFInterpolator
Source§fn clone(&self) -> RBFInterpolator
fn clone(&self) -> RBFInterpolator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RBFInterpolator
impl RefUnwindSafe for RBFInterpolator
impl Send for RBFInterpolator
impl Sync for RBFInterpolator
impl Unpin for RBFInterpolator
impl UnsafeUnpin for RBFInterpolator
impl UnwindSafe for RBFInterpolator
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.