FE-Project
Loading...
Searching...
No Matches
scale_sparsemat::sparsemat_matmul Interface Reference

Public Member Functions

subroutine sparsemat_matmul1 (a, b, c)
 Matrix-vector multiplication for a sparse matrix.
subroutine sparsemat_matmul1_2 (a, b1, b2, c)
 Matrix-vector multiplication for a sparse matrix with two vectors This routine computes c = A * (b1 .* b2), where .* is the element-wise multiplication.
subroutine sparsemat_matmul2 (a, b, c)
 Matrix-matrix multiplication for a sparse matrix.

Detailed Description

Definition at line 57 of file scale_sparsemat.F90.

Member Function/Subroutine Documentation

◆ sparsemat_matmul1()

subroutine scale_sparsemat::sparsemat_matmul::sparsemat_matmul1 ( type(sparsemat), intent(in) a,
real(rp), dimension(:), intent(in) b,
real(rp), dimension(a%m), intent(out) c )

Matrix-vector multiplication for a sparse matrix.

Definition at line 362 of file scale_sparsemat.F90.

363 implicit none
364
365 type(sparsemat), intent(in) :: A
366 real(RP), intent(in ) :: b(:)
367 real(RP), intent(out) :: c(A%M)
368
369 !---------------------------------------------------------------------------
370
371 !$acc routine vector
372
373 select case( a%storage_format_id )
374 case( sparsemat_storage_typeid_csr )
375 call sparsemat_matmul_csr_1( a%val, a%colIdx, a%rowPtr, b, c, &
376 a%M, a%N, a%nnz, a%rowPtrSize )
377 case( sparsemat_storage_typeid_ell )
378 call sparsemat_matmul_ell_1( a%val, a%colIdx, b, c, &
379 a%M, a%N, a%nnz, a%col_size )
380 end select
381
382 return

References scale_sparsemat::sparsemat_storage_typeid_csr, and scale_sparsemat::sparsemat_storage_typeid_ell.

◆ sparsemat_matmul1_2()

subroutine scale_sparsemat::sparsemat_matmul::sparsemat_matmul1_2 ( type(sparsemat), intent(in) a,
real(rp), dimension(:), intent(in) b1,
real(rp), dimension(:), intent(in) b2,
real(rp), dimension(a%m), intent(out) c )

Matrix-vector multiplication for a sparse matrix with two vectors This routine computes c = A * (b1 .* b2), where .* is the element-wise multiplication.

Definition at line 388 of file scale_sparsemat.F90.

389 implicit none
390
391 type(sparsemat), intent(in) :: A
392 real(RP), intent(in ) :: b1(:)
393 real(RP), intent(in ) :: b2(:)
394 real(RP), intent(out) :: c(A%M)
395
396 !---------------------------------------------------------------------------
397
398 !$acc routine vector
399
400 select case( a%storage_format_id )
401 case( sparsemat_storage_typeid_csr )
402 call sparsemat_matmul_csr_1_2( a%val, a%colIdx, a%rowPtr, b1, b2, c, &
403 a%M, a%N, a%nnz, a%rowPtrSize )
404 case( sparsemat_storage_typeid_ell )
405 call sparsemat_matmul_ell_1_2( a%val, a%colIdx, b1, b2, c, &
406 a%M, a%N, a%nnz, a%col_size )
407 end select
408
409 return

References scale_sparsemat::sparsemat_storage_typeid_csr, and scale_sparsemat::sparsemat_storage_typeid_ell.

◆ sparsemat_matmul2()

subroutine scale_sparsemat::sparsemat_matmul::sparsemat_matmul2 ( type(sparsemat), intent(in) a,
real(rp), dimension(:,:), intent(in) b,
real(rp), dimension(size(b,1),a%m), intent(out) c )

Matrix-matrix multiplication for a sparse matrix.

Definition at line 414 of file scale_sparsemat.F90.

415 implicit none
416
417 type(sparsemat), intent(in) :: A
418 real(RP), intent(in ) :: b(:,:)
419 real(RP), intent(out) :: c(size(b,1),A%M)
420
421 !---------------------------------------------------------------------------
422
423 select case( a%storage_format_id )
424 case( sparsemat_storage_typeid_csr )
425 call sparsemat_matmul_csr_2( a%val, a%colIdx, a%rowPtr, b, c, &
426 a%M, a%N, a%nnz, a%rowPtrSize, size(b,1) )
427 case( sparsemat_storage_typeid_ell )
428 call sparsemat_matmul_ell_2( a%val, a%colIdx, b, c, &
429 a%M, a%N, a%nnz, a%col_size, size(b,1) )
430 end select
431
432 return

References scale_sparsemat::sparsemat_storage_typeid_csr, and scale_sparsemat::sparsemat_storage_typeid_ell.


The documentation for this interface was generated from the following file: