tmatrix3.nim 369 B

1234567891011121314151617181920
  1. discard """
  2. output: "\n"
  3. """
  4. type Matrix[M,N: static[int]] = array[M, array[N, float]]
  5. let a = [[1.0, 1.0, 1.0, 1.0],
  6. [2.0, 4.0, 8.0, 16.0],
  7. [3.0, 9.0, 27.0, 81.0],
  8. [4.0, 16.0, 64.0, 256.0]]
  9. proc `$`(m: Matrix): string =
  10. result = ""
  11. proc `*`[M,N,M2,N2](a: Matrix[M,N2]; b: Matrix[M2,N]): Matrix[M,N] =
  12. discard
  13. echo a * a