Elementary Properties

The following functions yield elementary properties of matrices and may be applied to matrices of any type, including vectors.

NumberOfRows(A): Mtrx -> RngIntElt
Nrows(A): Mtrx -> RngIntElt

Given an \(m \times n\) matrix \(A\), return \(m\), the number of rows of \(A\).

NumberOfColumns(A): Mtrx -> RngIntElt
Ncols(A): Mtrx -> RngIntElt

Given an \(m \times n\) matrix \(A\), return \(n\), the number of columns of \(A\).

NumberOfNonZeroEntries(A): Mtrx -> RngIntElt
NNZEntries(A): Mtrx -> RngIntElt

Given a matrix \(A\), return the number of non-zero entries in \(A\).

Density(A): Mtrx -> FldRe

Given a matrix \(A\), return the density of \(A\) as a real number, which is the number of non-zero entries in \(A\) divided by the product of the number of rows of \(A\) and the number of columns of \(A\) (or zero if \(A\) has zero rows or columns).

BaseRing(A): Mtrx -> Rng
CoefficientRing(A): Mtrx -> Rng

Given a matrix \(A\) with entries lying in a ring \(R\), return \(R\).

ElementToSequence(A): Mtrx -> [ RngElt ]
Eltseq(A): Mtrx -> [ RngElt ]

Given a matrix \(A\) over the ring \(R\) having \(m\) rows and \(n\) columns, return the entries of \(A\), in row-major order, as a sequence of \(mn\) elements of \(R\).

RowSequence(A): Mtrx -> [ [RngElt] ]

Returns the entries of \(A\) as a sequence of rows where a row is represented as a sequence of entries of \(A\).