ffsvm/svm/kernel/
mod.rs

1mod linear;
2mod poly;
3mod rbf;
4mod sigmoid;
5
6pub use self::{linear::*, poly::*, rbf::*, sigmoid::*};
7use crate::sparse::{SparseMatrix, SparseVector};
8use simd_aligned::{arch::f32x8, MatSimd, Rows, VecSimd};
9
10/// Base trait for kernels
11#[doc(hidden)]
12pub trait KernelDense
13where
14    Self: Send + Sync,
15{
16    fn compute(&self, vectors: &MatSimd<f32x8, Rows>, feature: &VecSimd<f32x8>, output: &mut [f64]);
17}
18
19/// Base trait for kernels
20#[doc(hidden)]
21pub trait KernelSparse
22where
23    Self: Send + Sync,
24{
25    fn compute(&self, vectors: &SparseMatrix<f32>, feature: &SparseVector<f32>, output: &mut [f64]);
26}