pub trait Kernel:
Clone
+ Send
+ Sync {
// Required methods
fn compute(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64;
fn get_params(&self) -> Vec<f64>;
fn set_params(&mut self, params: &[f64]);
// Provided methods
fn compute_matrix(&self, x: &Array2<f64>) -> Array2<f64> { ... }
fn compute_cross_matrix(
&self,
x1: &Array2<f64>,
x2: &Array2<f64>,
) -> Array2<f64> { ... }
fn n_params(&self) -> usize { ... }
}Expand description
Trait for kernel functions (covariance functions)
Required Methods§
Sourcefn compute(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64
fn compute(&self, x1: &ArrayView1<'_, f64>, x2: &ArrayView1<'_, f64>) -> f64
Compute covariance between two points
Sourcefn get_params(&self) -> Vec<f64>
fn get_params(&self) -> Vec<f64>
Get kernel parameters (for optimization)
Sourcefn set_params(&mut self, params: &[f64])
fn set_params(&mut self, params: &[f64])
Set kernel parameters
Provided Methods§
Sourcefn compute_matrix(&self, x: &Array2<f64>) -> Array2<f64>
fn compute_matrix(&self, x: &Array2<f64>) -> Array2<f64>
Compute covariance matrix for a set of points
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".