Skip to content

Commit

Permalink
Small bug fix from SF_SPARSE missing a routine for interface
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleGiuli committed Jul 10, 2024
1 parent 91424dd commit 90e7d68
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/SF_SPARSE/SF_SPARSE_ARRAY_ALGEBRA.f90
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,30 @@ function dmatmul_csc_csc(A,B) return(AxB)
end do
end function dmatmul_csc_csc

function zmatmul_csc_csc(A,B) return(AxB)
type(sparse_zmatrix_csc), intent(in) :: A,B
type(sparse_zmatrix_csc) :: AxB
integer :: Na(2),Nb(2)
integer :: icol,j,jrow,k,krow
complex(8) :: aval,bval

Na = A%shape(); Nb = B%shape()
if(Na(2)/=Nb(1))stop "Matrix not matching dimension in zmatmul_csc_csc"
call AxB%free()
call AxB%init(Na(1),Nb(2))
do icol=1,Nb(2)
do j=1,B%col(icol)%Size
jrow=B%col(icol)%rows(j)
bval=B%col(icol)%vals(j)
do k=1,A%col(jrow)%Size
krow=A%col(jrow)%rows(k)
aval=A%col(jrow)%vals(k)
AxB%insert(aval*bval,krow,icol)
end do
end do
end do
end function zmatmul_csc_csc



function dmatmul_csc_csr_2csc(A,B) return(AxB)
Expand Down

0 comments on commit 90e7d68

Please sign in to comment.