The following functions yield elementary properties of matrices and may be applied to matrices of any type, including vectors.
Given an m x n matrix A, return m, the number of rows of A.
Given an m x n matrix A, return n, the number of columns of A.
Given a matrix A, return the number of non-zero entries in A.
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).
Given a matrix A with entries lying in a ring R, return R.
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.
Returns the entries of A as a sequence of rows where a row is represented as a sequence of entries of A.