pub struct RBFImplicit {
pub centers: Vec<[f64; 3]>,
pub weights: Vec<f64>,
}Expand description
Radial Basis Function (RBF) implicit surface.
The surface is defined as f(p) = Σᵢ wᵢ φ(|p − cᵢ|) where φ is a thin-plate spline kernel φ(r) = r² log(r + ε).
Use RBFImplicit::fit to compute weights from a set of point samples
with target values, then RBFImplicit::eval to query the surface.
Fields§
§centers: Vec<[f64; 3]>RBF centre positions.
weights: Vec<f64>Weights for each centre (computed by fit).
Implementations§
Source§impl RBFImplicit
impl RBFImplicit
Sourcepub fn new(centers: Vec<[f64; 3]>) -> Self
pub fn new(centers: Vec<[f64; 3]>) -> Self
Create a new RBFImplicit with given centres and zero weights.
Sourcepub fn fit(
&mut self,
pts: &[[f64; 3]],
targets: &[f64],
tol: f64,
max_iter: usize,
)
pub fn fit( &mut self, pts: &[[f64; 3]], targets: &[f64], tol: f64, max_iter: usize, )
Fit weights from sample points pts and target values targets.
Solves the symmetric RBF system Φ w = t using the conjugate gradient
method (up to max_iter iterations, tolerance tol).
§Panics
Panics if pts.len() != targets.len() or pts.len() != centers.len().
Trait Implementations§
Source§impl Clone for RBFImplicit
impl Clone for RBFImplicit
Source§fn clone(&self) -> RBFImplicit
fn clone(&self) -> RBFImplicit
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 RBFImplicit
impl RefUnwindSafe for RBFImplicit
impl Send for RBFImplicit
impl Sync for RBFImplicit
impl Unpin for RBFImplicit
impl UnsafeUnpin for RBFImplicit
impl UnwindSafe for RBFImplicit
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<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.