xref: /petsc/src/mat/impls/aij/seq/crl/ftn-kernels/fmultcrl.F90 (revision f13dfd9ea68e0ddeee984e65c377a1819eab8a8a)
1!
2!
3!    Fortran kernel for sparse matrix-vector product in the AIJ/CRL format
4!
5#include <petsc/finclude/petscsys.h>
6!
7      subroutine 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 5 j=1,m
16          y(j) = acols(j,1)*x(icols(j,1))
17 5    continue
18
19      do 10,i=2,rmax
20        do 20 j=1,m
21          y(j) = y(j) + acols(j,i)*x(icols(j,i))
22 20     continue
23 10   continue
24
25      end
26