pub struct KernelFunction {
pub kernel_type: KernelType,
}Expand description
A kernel function k: ℝ^d × ℝ^d → ℝ.
Fields§
§kernel_type: KernelTypeKernel type identifier.
Implementations§
Source§impl KernelFunction
impl KernelFunction
Sourcepub fn new(kernel_type: KernelType) -> Self
pub fn new(kernel_type: KernelType) -> Self
Create a new kernel function.
Sourcepub fn evaluate(&self, x: &[f64], y: &[f64]) -> f64
pub fn evaluate(&self, x: &[f64], y: &[f64]) -> f64
Evaluate the kernel k(x, y) where x, y are vectors in ℝ^d.
Sourcepub fn is_positive_definite(&self, points: &[Vec<f64>]) -> bool
pub fn is_positive_definite(&self, points: &[Vec<f64>]) -> bool
Check if the kernel matrix for a set of points is positive semi-definite (via Cholesky: all pivots ≥ -ε for numerical tolerance).
Auto Trait Implementations§
impl Freeze for KernelFunction
impl RefUnwindSafe for KernelFunction
impl Send for KernelFunction
impl Sync for KernelFunction
impl Unpin for KernelFunction
impl UnsafeUnpin for KernelFunction
impl UnwindSafe for KernelFunction
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