Struct hrbf::Hrbf [−][src]
Expand description
An HRBF potential field.
The field and its first and second derivatives can be queried at any 3D position.
Additionally this field can be reset with a different set of points and normals using one of
the fit
, fit_to_points
, offset_fit
, or offset_fit_to_points
methods. Some advanced
functionality is also exposed (see individual methods for details).
Implementations
Returns a reference to the vector of site locations used by this HRBF.
(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.
Fit the current HRBF to the sites
, with which this HRBF was built.
Normals dictate the direction of the HRBF gradient at the specified sites
.
Return a mutable reference to Self
if successful.
Fit the current HRBF to the given data.
Return a mutable reference to Self
if successful.
NOTE: Currently, points must be the same size as sites.
Fit the current HRBF to the sites
, with which this HRBF was built, offset by the given
offsets
.
The resulting HRBF field is equal to offsets
at the sites
.
and has a gradient equal to normals
.
Return a mutable reference to Self
if successful.
Fit the current HRBF to the given data.
The resulting HRBF field is equal to offsets
at the provided points
and has a gradient equal to normals
.
Return a mutable reference to Self
if successful.
NOTE: Currently, points must be the same size as sites.
(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
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.
(Advanced) Using the same notation as above,
this function returns the matrix ∇(Aⱼ(p)b)'
Sum of hess_fit_prod_block evaluated at all sites.
Trait Implementations
Auto Trait Implementations
impl<T, K> RefUnwindSafe for Hrbf<T, K> where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, K> UnwindSafe for Hrbf<T, K> where
K: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.