pub struct VerificationGraph {
pub node_count: usize,
pub edges: Vec<VerificationEdge>,
}Expand description
A verification graph over node_count local-state components.
Fields§
§node_count: usize§edges: Vec<VerificationEdge>Implementations§
Source§impl VerificationGraph
impl VerificationGraph
pub fn new(node_count: usize) -> Self
pub fn with_edge(self, src: usize, dst: usize, weight: f64) -> Self
pub fn add_edge(&mut self, src: usize, dst: usize, weight: f64)
Sourcepub fn smallest_nonzero_eigenvalue(&self, tol: f64) -> Result<Option<f64>>
pub fn smallest_nonzero_eigenvalue(&self, tol: f64) -> Result<Option<f64>>
Smallest non-zero eigenvalue lambda_min+(A) of the Laplacian.
Returns None when the graph is disconnected or empty of edges (the
spectral gap is then zero, so mu is not informative). Eigenvalues
within tol of zero are treated as zero.
Sourcepub fn mu(&self, tol: f64) -> Result<Option<f64>>
pub fn mu(&self, tol: f64) -> Result<Option<f64>>
The spectral energy-slope constant mu = 2 * lambda_min+(A).
Returns None for a disconnected verification graph, where the gap is
zero and mu is uninformative (a disconnected verifier component cannot
be driven to consensus by the others).
Sourcepub fn fiedler_value(&self, tol: f64) -> Result<Option<f64>>
pub fn fiedler_value(&self, tol: f64) -> Result<Option<f64>>
Algebraic connectivity (Fiedler value) — the smallest non-zero
eigenvalue; mu = 2 * fiedler.
Sourcepub fn edge_mu_sensitivity(
&self,
src: usize,
dst: usize,
weight: f64,
tol: f64,
) -> Result<f64>
pub fn edge_mu_sensitivity( &self, src: usize, dst: usize, weight: f64, tol: f64, ) -> Result<f64>
Change in mu produced by adding a candidate verifier edge.
An independent verifier that raises the spectral gap yields a positive delta; a redundant verifier that does not yields ~0. Used to distinguish independent from redundant verifiers (PSP-8 System 2).
Trait Implementations§
Source§impl Clone for VerificationGraph
impl Clone for VerificationGraph
Source§fn clone(&self) -> VerificationGraph
fn clone(&self) -> VerificationGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VerificationGraph
impl Debug for VerificationGraph
Source§impl Default for VerificationGraph
impl Default for VerificationGraph
Source§fn default() -> VerificationGraph
fn default() -> VerificationGraph
Source§impl<'de> Deserialize<'de> for VerificationGraph
impl<'de> Deserialize<'de> for VerificationGraph
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for VerificationGraph
impl PartialEq for VerificationGraph
Source§fn eq(&self, other: &VerificationGraph) -> bool
fn eq(&self, other: &VerificationGraph) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for VerificationGraph
impl Serialize for VerificationGraph
impl StructuralPartialEq for VerificationGraph
Auto Trait Implementations§
impl Freeze for VerificationGraph
impl RefUnwindSafe for VerificationGraph
impl Send for VerificationGraph
impl Sync for VerificationGraph
impl Unpin for VerificationGraph
impl UnsafeUnpin for VerificationGraph
impl UnwindSafe for VerificationGraph
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.