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) -> RowMatrix
pub fn new(source: &ToneRow, convention: RowLabelConvention) -> RowMatrix
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.
Trait Implementations§
impl Eq for RowMatrix
impl StructuralPartialEq for RowMatrix
Auto Trait Implementations§
impl Freeze for RowMatrix
impl RefUnwindSafe for RowMatrix
impl Send for RowMatrix
impl Sync for RowMatrix
impl Unpin for RowMatrix
impl UnsafeUnpin for RowMatrix
impl UnwindSafe for RowMatrix
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more