[−][src]Struct hrbf::HRBF
Methods
impl<T, K> HRBF<T, K> where
T: Real,
K: Kernel<T> + LocalKernel<T>,
[src]
T: Real,
K: Kernel<T> + LocalKernel<T>,
impl<T, K> HRBF<T, K> where
T: Real,
K: Kernel<T> + Default,
[src]
T: Real,
K: Kernel<T> + Default,
pub fn new(sites: Vec<Point3<T>>) -> Self
[src]
Main constructor. Assigns the degrees of freedom used by this HRBF in a form of 3D points at which the kernel will be evaluated.
pub fn with_kernel(self, kernel: KernelType<K>) -> Self
[src]
Builder that assigns a particular kernel to this HRBF.
pub fn sites(&self) -> &Vec<Point3<T>>
[src]
Returns a reference to the vector of site locations used by this HRBF.
pub fn betas(&self) -> &Vec<Vector4<T>>
[src]
Advanced. Returns a reference to the vector of 4D weight vectors, which determine the
global HRBF potential. These are the unknowns computed during fitting.
Each 4D vector has the structure [aⱼ; bⱼ]
per site j
where a
is a scalar weighing
the contribution from the kernel at site j
and b is a 3D vector weighin the contribution
from the kernel gradient at site j
to the total HRBF potential.
pub fn fit(&mut self, points: &[Point3<T>], normals: &[Vector3<T>]) -> bool
[src]
Fit the current HRBF to the given data. Return true if successful. NOTE: Currently, points must be the same size as as sites.
pub fn fit_offset(
&mut self,
points: &[Point3<T>],
offsets: &[T],
normals: &[Vector3<T>]
) -> bool
[src]
&mut self,
points: &[Point3<T>],
offsets: &[T],
normals: &[Vector3<T>]
) -> bool
Fit the current HRBF to the given data. The resulting HRBF field is equal to offsets
and has a gradient equal to normals
.
Return true if successful.
NOTE: Currently, points must be the same size as as sites.
pub fn fit_system(
&self,
points: &[Point3<T>],
potential: &[T],
normals: &[Vector3<T>]
) -> (DMatrix<T>, DVector<T>)
[src]
&self,
points: &[Point3<T>],
potential: &[T],
normals: &[Vector3<T>]
) -> (DMatrix<T>, DVector<T>)
Advanced. Returns the fitting matrix A
and corresponding right-hand-side b
.
b
is a stacked vector of 4D vectors representing the desired HRBF potential
and normal at data point i
, so A.inverse()*b
gives the betas
(or weights)
defining the HRBF potential.
pub fn eval(&self, p: Point3<T>) -> T
[src]
Evaluate the HRBF at point p
.
pub fn grad(&self, p: Point3<T>) -> Vector3<T>
[src]
Gradient of the HRBF function at point p
.
pub fn hess(&self, p: Point3<T>) -> Matrix3<T>
[src]
Compute the hessian of the HRBF function.
pub fn fit_block(&self, p: Point3<T>, j: usize) -> Matrix4<T>
[src]
Advanced. Recall that the HRBF fit is done as
∑ⱼ ⎡ 𝜙(𝑥ᵢ - 𝑥ⱼ) ∇𝜙(𝑥ᵢ - 𝑥ⱼ)'⎤ ⎡ 𝛼ⱼ⎤ = ⎡ 0 ⎤
⎣ ∇𝜙(𝑥ᵢ - 𝑥ⱼ) ∇∇𝜙(𝑥ᵢ - 𝑥ⱼ) ⎦ ⎣ 𝛽ⱼ⎦ ⎣ 𝑛ᵢ⎦
for every HRBF site i, where the sum runs over HRBF sites j where 𝜙(𝑥) = 𝜑(||𝑥||) for one of the basis kernels we define in kernel.rs If we rewrite the equation above as
∑ⱼ Aⱼ(𝑥ᵢ)bⱼ = rᵢ
this function returns the matrix Aⱼ(p).
This is the symmetric 4x4 matrix block that is used to fit the HRBF coefficients.
This is equivalent to stacking the vector from eval_block
on top of the
3x4 matrix returned by grad_block
. This function is more efficient than
evaluating eval_block
and grad_block
.
This is [g ∇g]' = [𝜙 (∇𝜙)'; ∇𝜙 ∇(∇𝜙)'] in matlab notation.
pub fn grad_fit_block_prod(
&self,
p: Point3<T>,
b: Vector4<T>,
j: usize
) -> Matrix3x4<T>
[src]
&self,
p: Point3<T>,
b: Vector4<T>,
j: usize
) -> Matrix3x4<T>
Advanced. Using the same notation as above, this function returns the matrix ∇(Aⱼ(p)b)'
pub fn hess_fit_prod(&self, p: Point3<T>, c: Vector4<T>) -> Matrix3<T>
[src]
Sum of hess_fit_prod_block evaluated at all sites.
Trait Implementations
impl<T, K> HRBFTrait<T> for HRBF<T, K> where
T: Real,
K: Kernel<T> + Default,
[src]
T: Real,
K: Kernel<T> + Default,
fn fit(&mut self, points: &[Point3<T>], normals: &[Vector3<T>]) -> bool
[src]
fn fit_offset(
&mut self,
points: &[Point3<T>],
offsets: &[T],
normals: &[Vector3<T>]
) -> bool
[src]
&mut self,
points: &[Point3<T>],
offsets: &[T],
normals: &[Vector3<T>]
) -> bool
fn fit_system(
&self,
points: &[Point3<T>],
potential: &[T],
normals: &[Vector3<T>]
) -> (DMatrix<T>, DVector<T>)
[src]
&self,
points: &[Point3<T>],
potential: &[T],
normals: &[Vector3<T>]
) -> (DMatrix<T>, DVector<T>)
fn eval(&self, p: Point3<T>) -> T
[src]
fn grad(&self, p: Point3<T>) -> Vector3<T>
[src]
fn hess(&self, p: Point3<T>) -> Matrix3<T>
[src]
impl<T, K> Default for HRBF<T, K> where
T: Real,
K: Kernel<T> + Default,
[src]
T: Real,
K: Kernel<T> + Default,
impl<T: Clone, K: Clone> Clone for HRBF<T, K> where
T: Real,
K: Kernel<T>,
[src]
T: Real,
K: Kernel<T>,
fn clone(&self) -> HRBF<T, K>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Debug, K: Debug> Debug for HRBF<T, K> where
T: Real,
K: Kernel<T>,
[src]
T: Real,
K: Kernel<T>,
Auto Trait Implementations
impl<T, K> Send for HRBF<T, K> where
K: Send,
T: Scalar,
K: Send,
T: Scalar,
impl<T, K> Unpin for HRBF<T, K> where
K: Unpin,
T: Scalar + Unpin,
K: Unpin,
T: Scalar + Unpin,
impl<T, K> Sync for HRBF<T, K> where
K: Sync,
T: Scalar,
K: Sync,
T: Scalar,
impl<T, K> UnwindSafe for HRBF<T, K> where
K: UnwindSafe,
T: Scalar + UnwindSafe,
K: UnwindSafe,
T: Scalar + UnwindSafe,
impl<T, K> RefUnwindSafe for HRBF<T, K> where
K: RefUnwindSafe,
T: RefUnwindSafe + Scalar,
K: RefUnwindSafe,
T: RefUnwindSafe + Scalar,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,