diff --git a/src/distancematrix.rs b/src/distancematrix.rs new file mode 100644 index 0000000..ababc55 --- /dev/null +++ b/src/distancematrix.rs @@ -0,0 +1,20 @@ +//! A distance matrix is stored as a list of taxon names, together with a square +//! or triangular matrix representing all pairwise distances. + +/// The type of the matrix. Either square, lower triangular (excluding the +/// diagonal), or upper triangular (excluding the diagonal). +/// Square matrices are assumed to be symmetric, but this is not enforced nor checked. +#[derive(Debug, PartialEq, Eq)] +pub enum MatrixType { + Square, + Lower, + Upper, +} + +/// A distance matrix containing a list of taxon names and a matrix of pairwise distances. +#[derive(Debug)] +pub struct DistanceMatrix { + names: Vec, + distances: Vec>, + matrix_type: MatrixType, +} diff --git a/src/lib.rs b/src/lib.rs index 592a248..add8ba2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,7 @@ extern crate petgraph; pub mod alignment; pub mod annot; +pub mod distancematrix; pub mod genome; #[cfg(feature = "phylogeny")] pub mod phylogeny;