pub struct GraphFilter { /* private fields */ }Expand description
Graph filter that applies spectral operations
Implementations§
Source§impl GraphFilter
impl GraphFilter
Sourcepub fn new(laplacian: ScaledLaplacian, filter: SpectralFilter) -> Self
pub fn new(laplacian: ScaledLaplacian, filter: SpectralFilter) -> Self
Create graph filter from adjacency and filter specification
Sourcepub fn from_adjacency(adj: &[f64], n: usize, filter: SpectralFilter) -> Self
pub fn from_adjacency(adj: &[f64], n: usize, filter: SpectralFilter) -> Self
Create from dense adjacency matrix
Sourcepub fn from_sparse(
edges: &[(usize, usize, f64)],
n: usize,
filter: SpectralFilter,
) -> Self
pub fn from_sparse( edges: &[(usize, usize, f64)], n: usize, filter: SpectralFilter, ) -> Self
Create from sparse edges
Sourcepub fn apply(&self, signal: &[f64]) -> Vec<f64>
pub fn apply(&self, signal: &[f64]) -> Vec<f64>
Apply filter to signal: y = h(L) * x Uses Chebyshev recurrence: O(K*m) where K is degree, m is edges
Sourcepub fn apply_n(&self, signal: &[f64], n_times: usize) -> Vec<f64>
pub fn apply_n(&self, signal: &[f64], n_times: usize) -> Vec<f64>
Apply filter multiple times (for stronger effect)
Sourcepub fn lambda_max(&self) -> f64
pub fn lambda_max(&self) -> f64
Get estimated spectral range
Trait Implementations§
Source§impl Clone for GraphFilter
impl Clone for GraphFilter
Source§fn clone(&self) -> GraphFilter
fn clone(&self) -> GraphFilter
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 GraphFilter
impl RefUnwindSafe for GraphFilter
impl Send for GraphFilter
impl Sync for GraphFilter
impl Unpin for GraphFilter
impl UnwindSafe for GraphFilter
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