Reduced row echelon form: Difference between revisions

Content added Content deleted
m (Used "<M" and "<N" in "toMatrix" instead of "a.high" and "a[0].high".)
Line 2,569: Line 2,569:
## Convert a matrix of integers to a matrix of integer fractions.
## Convert a matrix of integers to a matrix of integer fractions.


for i in 0..a.high:
for i in 0..<M:
for j in 0..a[0].high:
for j in 0..<N:
result[i][j] = a[i][j] // 1
result[i][j] = a[i][j] // 1


Line 2,717: Line 2,717:
func toMatrix[M, N: static Positive](a: array[M, array[N, int]]): Matrix[M, N] =
func toMatrix[M, N: static Positive](a: array[M, array[N, int]]): Matrix[M, N] =
## Convert a matrix of integers to a matrix of floats.
## Convert a matrix of integers to a matrix of floats.
for i in 0..a.high:
for i in 0..<M:
for j in 0..a[0].high:
for j in 0..<N:
result[i][j] = a[i][j].toFloat
result[i][j] = a[i][j].toFloat