dmatmul_csc_csc Function

public function dmatmul_csc_csc(A, B)

Arguments

Type IntentOptional Attributes Name
type(sparse_dmatrix_csc), intent(in) :: A
type(sparse_dmatrix_csc), intent(in) :: B

Return Value real


Calls

proc~~dmatmul_csc_csc~~CallsGraph proc~dmatmul_csc_csc dmatmul_csc_csc none~init~3 sparse_dmatrix_csc%init proc~dmatmul_csc_csc->none~init~3 none~insert~3 sparse_dmatrix_csc%insert proc~dmatmul_csc_csc->none~insert~3 interface~append append none~insert~3->interface~append proc~binary_search binary_search none~insert~3->proc~binary_search proc~append_d append_D interface~append->proc~append_d proc~append_i append_I interface~append->proc~append_i proc~append_z append_Z interface~append->proc~append_z proc~binary_search->proc~binary_search proc~sort_array sort_array proc~binary_search->proc~sort_array

Called by

proc~~dmatmul_csc_csc~~CalledByGraph proc~dmatmul_csc_csc dmatmul_csc_csc interface~matmul~2 matmul interface~matmul~2->proc~dmatmul_csc_csc

Source Code

  function dmatmul_csc_csc(A,B) return(AxB)
    type(sparse_dmatrix_csc), intent(in) :: A,B
    type(sparse_dmatrix_csc)             :: AxB
    integer                              :: Na(2),Nb(2)
    integer                              :: icol,j,jrow,k,krow
    real(8)                              :: aval,bval
    
    Na = A%shape(); Nb = B%shape()
    if(Na(2)/=Nb(1))stop "Matrix not matching dimension in dmatmul_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 dmatmul_csc_csc