Observatoire de Paris - Code Fortran  version1.0
Fonctions/Subroutines
Référence du module mod_mat

Fonctions/Subroutines

subroutine matmul (n, a, b, c)
 matrix-matrix product Plus de détails...
 

Documentation de la fonction/subroutine

◆ matmul()

subroutine mod_mat::matmul ( integer, intent(in)  n,
real(kind=kind(1.d0)), dimension(n,n), intent(in)  a,
real(kind=kind(1.d0)), dimension(n,n), intent(in)  b,
real(kind=kind(1.d0)), dimension(n,n), intent(out)  c 
)

matrix-matrix product

Paramètres
[in]ndimension
[in]amatrix
[in]bmatrix
Renvoie
c matrix with c = a*b

Définition à la ligne 11 du fichier mod_mat.f90.

11  implicit none ! on force l'initialisation de toutes les variables
12  integer, intent(in) :: n
13  real(kind=kind(1.d0)), intent(in) :: a(n,n),b(n,n)
14  real(kind=kind(1.d0)), intent(out) :: c(n,n)
15  integer :: i,j,k,ii,jj,kk
16  integer :: is
17 
18  c = 0.
19  is = 20
20  do j = 1,n,is
21  do i = 1,n,is
22  do k = 1,n,is
23  do jj = j,min(n,j+is-1)
24  do ii = i,min(n,i+is-1)
25  do kk = k,min(n,k+is-1)
26  c(ii,jj) = c(ii,jj) + a(ii,kk)*b(kk,jj)
27  end do
28  end do
29  end do
30  end do
31  end do
32  end do
33