tmatrixlib.nim 681 B

1234567891011121314151617181920212223242526272829303132
  1. discard """
  2. output: "0"
  3. """
  4. import matrix, matrixalgo
  5. import typetraits # XXX: this should be removed
  6. var m: Matrix[3, 3, int]
  7. var projectionMatrix: Matrix[4, 4, float]
  8. echo m.transposed.determinant
  9. setPerspectiveProjection projectionMatrix
  10. template ok(x) = assert x
  11. template no(x) = assert(not x)
  12. static:
  13. ok projectionMatrix is AnyTransform3D
  14. no m is AnyTransform3D
  15. type SquareStringMatrix = Matrix[5, 5, string]
  16. ok SquareStringMatrix is AnyMatrix
  17. ok SquareStringMatrix is AnySquareMatrix
  18. no SquareStringMatrix is AnyTransform3D
  19. ok Matrix[5, 10, int] is AnyMatrix
  20. no Matrix[7, 15, float] is AnySquareMatrix
  21. no Matrix[4, 4, int] is AnyTransform3D