rankDecompose(mat)

Decompose a matrix to linearly independent rows and columns.

matThe input matrix.
return valueAn object containing 2 matrices: rows - for independent rows, cols - for independent columns.

Any matrix can be decomposed this way. The product of them results in the original matrix.

The function retuns an object containing:
- cols: A matrix with linearly independent columns.
- rows: A matrix with linearly independent rows.

If the returned object is stored in variable a, then a.cols*a.rows == mat.