xref: /petsc/src/mat/impls/aij/seq/crl/ftn-kernels/fmultcrl.F90 (revision 0113e7197f2fe148981cb35224c0458dc22f510d)
1!
2!
3!    Fortran kernel for sparse matrix-vector product in the AIJ/CRL format
4!
5#include <petsc/finclude/petscsys.h>
6!
7subroutine FortranMultCRL(m,rmax,x,y,icols,acols)
8  implicit none
9  PetscInt m,rmax,icols(m,rmax)
10  PetscScalar x(0:m-1),y(m)
11  PetscScalar acols(m,rmax)
12
13  PetscInt    i,j
14
15  do j=1,m
16    y(j) = acols(j,1)*x(icols(j,1))
17  end do
18
19  do i=2,rmax
20    do j=1,m
21      y(j) = y(j) + acols(j,i)*x(icols(j,i))
22    end do
23  end do
24
25end subroutine FortranMultCRL
26