pub struct CoherenceSpace {
pub n_tokens: usize,
pub coh: Vec<Vec<bool>>,
}Expand description
A coherence space: a reflexive, symmetric binary relation (web, coh).
Fields§
§n_tokens: usizeNumber of tokens (web size).
coh: Vec<Vec<bool>>Coherence matrix: coh[i][j] = true iff i and j are coherent (or equal).
Implementations§
Source§impl CoherenceSpace
impl CoherenceSpace
Sourcepub fn flat(n: usize) -> Self
pub fn flat(n: usize) -> Self
Create the flat coherence space: all distinct tokens are incoherent.
Sourcepub fn complete(n: usize) -> Self
pub fn complete(n: usize) -> Self
Create the complete coherence space: all tokens are mutually coherent.
Sourcepub fn is_clique(&self, tokens: &[usize]) -> bool
pub fn is_clique(&self, tokens: &[usize]) -> bool
Check if a set of tokens forms a clique (mutually coherent).
Sourcepub fn is_antichain(&self, tokens: &[usize]) -> bool
pub fn is_antichain(&self, tokens: &[usize]) -> bool
Check if a set of tokens is an antichain (mutually incoherent, except self).
Sourcepub fn tensor(&self, other: &CoherenceSpace) -> CoherenceSpace
pub fn tensor(&self, other: &CoherenceSpace) -> CoherenceSpace
Tensor product: web is n1 × n2, coherent iff both components coherent.
Sourcepub fn with(&self, other: &CoherenceSpace) -> CoherenceSpace
pub fn with(&self, other: &CoherenceSpace) -> CoherenceSpace
With connective: disjoint union (tagged tokens), coherent within each component.
Trait Implementations§
Source§impl Clone for CoherenceSpace
impl Clone for CoherenceSpace
Source§fn clone(&self) -> CoherenceSpace
fn clone(&self) -> CoherenceSpace
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 CoherenceSpace
impl RefUnwindSafe for CoherenceSpace
impl Send for CoherenceSpace
impl Sync for CoherenceSpace
impl Unpin for CoherenceSpace
impl UnsafeUnpin for CoherenceSpace
impl UnwindSafe for CoherenceSpace
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