pub struct RowMatrix { /* private fields */ }Expand description
A conventional twelve-tone matrix retaining its source and label policy.
The first row is the source row (P0 by operation identity). Each matrix
row is a P form, each column is an I form, and the reverse readings are the
corresponding R and RI forms. Operations stay algebraic; edge labels are
projections through the matrix’s explicit RowLabelConvention.
Implementations§
Source§impl RowMatrix
impl RowMatrix
Sourcepub fn new(source: &ToneRow, convention: RowLabelConvention) -> Self
pub fn new(source: &ToneRow, convention: RowLabelConvention) -> Self
Constructs the matrix for source under an explicit edge-label convention.
Sourcepub const fn convention(&self) -> RowLabelConvention
pub const fn convention(&self) -> RowLabelConvention
Returns the label convention used by every edge label.
Sourcepub const fn cells(&self) -> &[[PitchClass; 12]; 12]
pub const fn cells(&self) -> &[[PitchClass; 12]; 12]
Returns all matrix pitch classes in row-major layout.
Sourcepub const fn cell(&self, coordinate: MatrixCoordinate) -> RowMatrixCell
pub const fn cell(&self, coordinate: MatrixCoordinate) -> RowMatrixCell
Returns one coordinate-bearing cell.
Sourcepub fn row(&self, row: usize) -> Option<&[PitchClass; 12]>
pub fn row(&self, row: usize) -> Option<&[PitchClass; 12]>
Returns one left-to-right matrix row, or None for an invalid index.
Sourcepub fn column(&self, column: usize) -> Option<[PitchClass; 12]>
pub fn column(&self, column: usize) -> Option<[PitchClass; 12]>
Returns one top-to-bottom matrix column, or None for an invalid index.
Sourcepub fn row_operation(&self, row: usize) -> Option<RowOperation>
pub fn row_operation(&self, row: usize) -> Option<RowOperation>
Returns the P operation read left to right on one row.
Sourcepub fn column_operation(&self, column: usize) -> Option<RowOperation>
pub fn column_operation(&self, column: usize) -> Option<RowOperation>
Returns the I operation read top to bottom on one column.
Sourcepub fn row_form(&self, row: usize) -> Option<RowForm>
pub fn row_form(&self, row: usize) -> Option<RowForm>
Reconstructs the operation-bearing P form for one matrix row.
Sourcepub fn column_form(&self, column: usize) -> Option<RowForm>
pub fn column_form(&self, column: usize) -> Option<RowForm>
Reconstructs the operation-bearing I form for one matrix column.
Sourcepub const fn edge_labels(&self) -> &RowMatrixEdgeLabels
pub const fn edge_labels(&self) -> &RowMatrixEdgeLabels
Returns all four convention-dependent edge-label collections.
Source§impl RowMatrix
impl RowMatrix
Sourcepub fn render_data(&self) -> RowMatrixData
pub fn render_data(&self) -> RowMatrixData
Projects this matrix to structured, coordinate-bearing data.
Sourcepub fn render_ascii(&self) -> String
pub fn render_ascii(&self) -> String
Renders a self-describing ASCII matrix from the structured projection.