linalg::rank -- rank of a
matrix
Introductionlinalg::rank(A) computes the rank of the
matrix A.
linalg::rank(S) computes the rank of the
matrix whose columns are the vectors in S.
Call(s)linalg::rank(A)
linalg::rank(S)
ParametersA |
- | a matrix of a domain of category Cat::Matrix |
S |
- | a list or set of column vectors of the same dimension
(a column vector is an n x 1 matrix of a domain of category
Cat::Matrix) |
Returnsa nonnegative integer
Related
Functionslinalg::det, linalg::gaussElim
DetailsA or of the vectors given in
S, respectively, must be an integral domain, i.e., a
domain of category Cat::IntegralDomain.
Example
1We define the following matrix over Z:
>> MatZ := Dom::Matrix( Dom::Integer ): A := MatZ([[1, 2, 3, 4], [-1, 0, 1, 0], [3, 5, 6, 9]])
+- -+
| 1, 2, 3, 4 |
| |
| -1, 0, 1, 0 |
| |
| 3, 5, 6, 9 |
+- -+
and compute its rank:
>> linalg::rank(A)
3
Example
2The rank of the matrix A=(s[i]), i=1..3 with s[1]=[0,1,1], s[2]=[0,1,0], s[3]=[0,0,1] is:
>> S:= { MatZ([0,1,1]), MatZ([0,1,0]), MatZ([0,0,1]) }:
linalg::rank(S)
2
Backgroundlinalg::gaussElim),
it is equal to the number of characteristic column indices.