Skip to main content

QMatrix

Trait QMatrix 

Source
pub trait QMatrix {
    // Required methods
    fn get_q(&mut self, i: usize, len: usize) -> &[Qfloat] ;
    fn get_qd(&self) -> &[f64];
    fn swap_index(&mut self, i: usize, j: usize);
}
Expand description

Trait for Q matrix access used by the SMO solver.

Takes &mut self because get_q mutates the internal cache. The solver owns Box<dyn QMatrix> and copies row data into its own buffers to avoid lifetime issues.

Required Methods§

Source

fn get_q(&mut self, i: usize, len: usize) -> &[Qfloat]

Get column i of the Q matrix, with at least len elements.

Source

fn get_qd(&self) -> &[f64]

Get the diagonal of Q: QD[i] = Q[i][i].

Source

fn swap_index(&mut self, i: usize, j: usize)

Swap indices i and j in all internal data structures.

Implementors§

Source§

impl<'a> QMatrix for OneClassQ<'a>

Source§

impl<'a> QMatrix for SvcQ<'a>

Source§

impl<'a> QMatrix for SvrQ<'a>