cmatrix.Matrix.replace_zeros

Matrix.replace_zeros()

Utilitary function to replace the null values with 1. It is used for LU computing genericity.

Returns
Matrix

The non-zeros matrix

Examples

>>> m=rand_perm(4)
>>> print(m)
| +0.000 | +0.000 | +0.000 | +1.000 |
| +0.000 | +1.000 | +0.000 | +0.000 |
| +0.000 | +0.000 | +1.000 | +0.000 |
| +1.000 | +0.000 | +0.000 | +0.000 |
printed
>>> m.replace_zeros()
>>> print(m)
| +1.000 | +1.000 | +1.000 | +1.000 |
| +1.000 | +1.000 | +1.000 | +1.000 |
| +1.000 | +1.000 | +1.000 | +1.000 |
| +1.000 | +1.000 | +1.000 | +1.000 |
printed