Home Online Manual
Top
Back: random
Forward: read
FastBack: Functions and system variables
FastForward: Control structures
Up: Functions
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

5.1.127 rank

Syntax:
rank ( matrix_expression ) #*rank ( matrix_expression ,1)
Type:
int
Purpose:
returns the rank of a given matrix which is filled with elements of the ground field.
The first variant uses a LU-decomposition, the second a row-echelon form.
Note:
The function works by computing the row echelon form of the matrix using the same algorithm as for ludecomp.
Example:
 
  ring s = 0, x, dp;
  matrix A[100][100];
  int i; int j; int r;
  for (i = 1; i <= 100; i++)
  {
    for (j = 1; j <= 100; j++)
    {
      A[i, j] = random(-10, 10);
    }
  }
  r = rank(A); r;
==> 100
See ludecomp.