pub struct TriadCensus {
pub counts: [f64; 16],
}Expand description
The triad census of a graph, see Graph::triad_census.
Holds the number of vertex triples of each of the 16 types described by
Davis and Leinhardt’s MAN labels (TriadCensus::NAMES): the digits
count Mutual, Asymmetric and Null dyads of the triple, and the
letter distinguishes Down, Up, Cyclic and Transitive
variants. Index it by position (census[3]) or by label
(census["021D"]).
Fields§
§counts: [f64; 16]The 16 counts, in the order of TriadCensus::NAMES.
Implementations§
Source§impl TriadCensus
impl TriadCensus
Sourcepub const NAMES: [&'static str; 16]
pub const NAMES: [&'static str; 16]
The MAN labels of the 16 triad types, in igraph’s order:
| idx | label | shape |
|---|---|---|
| 0 | 003 | empty |
| 1 | 012 | A→B, C |
| 2 | 102 | A↔B, C |
| 3 | 021D | A←B→C (out-star) |
| 4 | 021U | A→B←C (in-star) |
| 5 | 021C | A→B→C (directed line) |
| 6 | 111D | A↔B←C |
| 7 | 111U | A↔B→C |
| 8 | 030T | A→B←C, A→C |
| 9 | 030C | A←B←C, A→C (cycle) |
| 10 | 201 | A↔B↔C |
| 11 | 120D | A←B→C, A↔C |
| 12 | 120U | A→B←C, A↔C |
| 13 | 120C | A→B→C, A↔C |
| 14 | 210 | A→B↔C, A↔C |
| 15 | 300 | complete |
Sourcepub fn get(&self, label: &str) -> Option<f64>
pub fn get(&self, label: &str) -> Option<f64>
The count of the triad type with the given MAN label, if valid.
Trait Implementations§
Source§impl Clone for TriadCensus
impl Clone for TriadCensus
Source§fn clone(&self) -> TriadCensus
fn clone(&self) -> TriadCensus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TriadCensus
Source§impl Debug for TriadCensus
impl Debug for TriadCensus
Source§impl Index<&str> for TriadCensus
impl Index<&str> for TriadCensus
Source§impl Index<usize> for TriadCensus
impl Index<usize> for TriadCensus
Source§impl PartialEq for TriadCensus
impl PartialEq for TriadCensus
Source§fn eq(&self, other: &TriadCensus) -> bool
fn eq(&self, other: &TriadCensus) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for TriadCensus
Auto Trait Implementations§
impl Freeze for TriadCensus
impl RefUnwindSafe for TriadCensus
impl Send for TriadCensus
impl Sync for TriadCensus
impl Unpin for TriadCensus
impl UnsafeUnpin for TriadCensus
impl UnwindSafe for TriadCensus
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