Created
April 11, 2014 15:34
-
-
Save BitPuffin/10478279 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proc `*`*[T; R, N, C: static[int]](a: TMatrix[T, R, N], b: TMatrix[T, N, C]): TMatrix[T, R, C] {.noSideEffect.} = | |
| ## Multiplies two matrices together and returns the result. The column count | |
| ## of the first matrix must be the same as the row count of the second | |
| ## matrix. The result matrix has the same row count as the first matrix | |
| ## and the same column count as the second.: | |
| for i in low(a)..high(a): | |
| for j in low(a[i])..high(a[i]): | |
| result[i][j] = a.row(i) *. b.col(j) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment