Matrix multiplication: Difference between revisions
Content added Content deleted
m (→{{header|C}}: Syntax hilighting for C) |
|||
Line 365: | Line 365: | ||
=={{header|Fortran}}== |
=={{header|Fortran}}== |
||
In ISO Fortran 90 or later, use the SIZE and MATMUL intrinsic functions: |
In ISO Fortran 90 or later, use the SIZE and MATMUL intrinsic functions: |
||
real, dimension(n,m) :: a = reshape( (/ (i, i=1, n*m) /), (/ n, m /) ) |
|||
real, dimension(m,k) :: b = reshape( (/ (i, i=1, m*k) /), (/ m, k /) ) |
|||
real, dimension(size(a,1), size(b,2)) :: c ! C is an array whose first dimension (row) size is the same |
|||
! as A's first dimension size, and whose second dimension |
! as A's first dimension size, and whose second dimension |
||
! (column) size is the same as B's second dimension size. |
! (column) size is the same as B's second dimension size. |
||
c = matmul( a, b ) |
|||
=={{header|Haskell}}== |
=={{header|Haskell}}== |