pub struct SimdAdjacency;Expand description
SIMD-accelerated adjacency matrix-vector product operations.
Provides optimized dense and sparse matrix-vector products that are central to many graph algorithms (PageRank, spectral methods, centrality).
Implementations§
Source§impl SimdAdjacency
impl SimdAdjacency
Sourcepub fn dense_matvec_scaled(
alpha: f64,
matrix: &Array2<f64>,
vector: &Array1<f64>,
) -> Result<Array1<f64>>
pub fn dense_matvec_scaled( alpha: f64, matrix: &Array2<f64>, vector: &Array1<f64>, ) -> Result<Array1<f64>>
Sourcepub fn sparse_csr_matvec(
row_ptr: &[usize],
col_idx: &[usize],
values: &[f64],
x: &[f64],
n_rows: usize,
) -> Result<Vec<f64>>
pub fn sparse_csr_matvec( row_ptr: &[usize], col_idx: &[usize], values: &[f64], x: &[f64], n_rows: usize, ) -> Result<Vec<f64>>
CSR-style sparse matrix-vector product using SIMD.
Computes y = A * x where A is stored in compressed sparse row format.
For each row, gathers x values at column indices and performs SIMD dot product.
§Arguments
row_ptr- Row pointer array (length n+1)col_idx- Column index arrayvalues- Non-zero values arrayx- Input vectorn_rows- Number of rows
§Returns
Result vector of length n_rows.
Sourcepub fn weighted_matvec(
matrix: &Array2<f64>,
vector: &Array1<f64>,
row_weights: &Array1<f64>,
) -> Result<Array1<f64>>
pub fn weighted_matvec( matrix: &Array2<f64>, vector: &Array1<f64>, row_weights: &Array1<f64>, ) -> Result<Array1<f64>>
Compute weighted adjacency matrix-vector product.
Like dense_matvec, but scales each row by a per-node weight
(e.g., inverse degree for normalization).
§Arguments
matrix- Adjacency matrix (n x n)vector- Input vector (length n)row_weights- Per-row weight vector (length n)
§Returns
Result vector where y[i] = row_weights[i] * sum_j(A[i,j] * x[j]).
Auto Trait Implementations§
impl Freeze for SimdAdjacency
impl RefUnwindSafe for SimdAdjacency
impl Send for SimdAdjacency
impl Sync for SimdAdjacency
impl Unpin for SimdAdjacency
impl UnsafeUnpin for SimdAdjacency
impl UnwindSafe for SimdAdjacency
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more