pub struct SparseTransition {
pub nodes: Vec<NodeId>,
pub row_ptr: Vec<usize>,
pub col_idx: Vec<usize>,
pub values: Vec<f32>,
pub has_outgoing: Vec<bool>,
}Expand description
Row-stochastic sparse transition matrix in plain CSR form, plus the
ordered NodeId -> matrix-row mapping. Public so tests / downstream
code can inspect it.
Fields§
§nodes: Vec<NodeId>Sorted NodeId sequence: nodes[i] is row/column i.
row_ptr: Vec<usize>CSR row pointers. Length nodes.len() + 1.
col_idx: Vec<usize>CSR column indices. Length nnz.
values: Vec<f32>CSR values. Length nnz. Row-stochastic: each non-empty row
sums to 1.0. Dead rows (no out-edges) have zero values in the
CSR and are handled by teleporting their mass in ppr.
has_outgoing: Vec<bool>True for rows that had at least one out-edge. Dead rows redistribute their mass to the personalization vector each iteration.
Trait Implementations§
Source§impl Clone for SparseTransition
impl Clone for SparseTransition
Source§fn clone(&self) -> SparseTransition
fn clone(&self) -> SparseTransition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SparseTransition
impl RefUnwindSafe for SparseTransition
impl Send for SparseTransition
impl Sync for SparseTransition
impl Unpin for SparseTransition
impl UnsafeUnpin for SparseTransition
impl UnwindSafe for SparseTransition
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