relmath-rs 0.5.0

Relation-first mathematics and scientific computing in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Shared trait for finite relations.

/// A finite relation that can report the number of stored tuples.
pub trait FiniteRelation {
    /// Returns the number of stored tuples in the relation.
    fn len(&self) -> usize;

    /// Returns `true` when the relation contains no tuples.
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
}