dmatmul_csc_csr_2csr Function

public function dmatmul_csc_csr_2csr(A, B)

Arguments

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

Return Value real


Calls

proc~~dmatmul_csc_csr_2csr~~CallsGraph proc~dmatmul_csc_csr_2csr dmatmul_csc_csr_2csr none~init sparse_dmatrix_csr%init proc~dmatmul_csc_csr_2csr->none~init none~insert sparse_dmatrix_csr%insert proc~dmatmul_csc_csr_2csr->none~insert interface~append append none~insert->interface~append proc~binary_search binary_search none~insert->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_csr_2csr~~CalledByGraph proc~dmatmul_csc_csr_2csr dmatmul_csc_csr_2csr interface~matmul~2 matmul interface~matmul~2->proc~dmatmul_csc_csr_2csr

Source Code

  function dmatmul_csc_csr_2csr(A,B) return(AxB)
    type(sparse_dmatrix_csc), intent(in) :: A
    type(sparse_dmatrix_csr)             :: B,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 zmatmul_csc_csc"
    call AxB%free()
    call AxB%init(Na(1),Nb(2))
    do i=1,Na(2)
       do j=1,A%col(i)%Size
          jrow=A%col(i)%rows(j)
          aval=A%col(i)%vals(j)
          do k=1,B%row(i)%Size
             kcol=B%row(i)%cols(k)
             bval=B%row(i)%vals(k)
             AxB%insert(aval*bval,jrow,kcol)
          end do
       end do
    end do
  end function dmatmul_csc_csr_2csr