matrix_rank function

Estimate rank of a given matrix