pub struct DfCmMatrix {
pub name: String,
pub axes: Vec<DfCmAxis>,
pub cells: Vec<DfCmCell>,
}Expand description
The full DfCM matrix: a named set of axes and the cells that span them.
Fields§
§name: String§axes: Vec<DfCmAxis>§cells: Vec<DfCmCell>Implementations§
Source§impl DfCmMatrix
impl DfCmMatrix
Sourcepub fn new(name: impl Into<String>, axes: Vec<DfCmAxis>) -> Self
pub fn new(name: impl Into<String>, axes: Vec<DfCmAxis>) -> Self
Create an empty matrix with the given axes.
Sourcepub fn expand_cartesian(&mut self)
pub fn expand_cartesian(&mut self)
Populate cells with one DfCmCell per point in the Cartesian product
of all axis variants. Existing cells are replaced.
Sourcepub fn passing(&self) -> usize
pub fn passing(&self) -> usize
Number of evaluated cells where DfCmCell::passes is true.
A cell whose actual_standing is still Standing::Unknown has not
been evaluated yet and must not count as passing merely because its
(also-default) expected_standing happens to equal it — otherwise
unevaluated cells would trivially inflate pass_rate above the true
coverage-weighted rate.
Sourcepub fn evaluated(&self) -> usize
pub fn evaluated(&self) -> usize
Number of cells whose actual_standing is not Standing::Unknown.
Sourcepub fn pass_rate(&self) -> f64
pub fn pass_rate(&self) -> f64
Fraction of evaluated cells that pass (0.0–1.0). Returns 0.0 when none have been evaluated.
Sourcepub fn find_cell(&self, coords: &[&str]) -> Option<&DfCmCell>
pub fn find_cell(&self, coords: &[&str]) -> Option<&DfCmCell>
Find a cell by its coordinate tuple.
Sourcepub fn find_cell_mut(&mut self, coords: &[&str]) -> Option<&mut DfCmCell>
pub fn find_cell_mut(&mut self, coords: &[&str]) -> Option<&mut DfCmCell>
Find a cell mutably by its coordinate tuple.
Sourcepub fn validate(&self) -> Vec<String>
pub fn validate(&self) -> Vec<String>
Validate the matrix and return a list of human-readable error strings.
Checks:
- Every cell has the same number of coordinates as there are axes.
- No two cells share the same coordinate tuple.
- Every coordinate value at position
iis a declared variant of axisi.
Trait Implementations§
Source§impl Clone for DfCmMatrix
impl Clone for DfCmMatrix
Source§fn clone(&self) -> DfCmMatrix
fn clone(&self) -> DfCmMatrix
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more