GetSym
Returns the symmetric form of a sparse matrix.
Calling example:
CALL GetSym(CSRMatrix_::obj, CSRMatrix_::symobj, char(1)::from)
CALL GetSym(CSRMatrix_::obj, char(1)::from)
Interface
- ܀ GetSym(obj, symobj, from)
- ️܀ See example 1
- ️܀ See example 2
- ↢
INTERFACE
MODULE SUBROUTINE GetSym(obj, symObj, from)
TYPE(CSRMatrix_), INTENT(IN) :: obj
TYPE(CSRMatrix_), INTENT(INOUT) :: symObj
CHARACTER(1), INTENT(IN) :: from
END SUBROUTINE GetSym
END INTERFACE
program main
use easifemBase
implicit none
Declare variables.
TYPE(CSRMatrix_) :: csrmat, symcsrmat
CHARACTER(*), PARAMETER :: matrix_name = "./matrixMarket/small5.mtx"
REAL( DFP ), ALLOCATABLE :: dense(:,:)
INTEGER( I4B ) :: info
Import csrmatrix from matrix market.
CALL IMPORT(csrmat, matrix_name, SPARSE_FMT_COO)
CALL Display(SIZE(csrmat, 1), "csrmat = ")
CALL Display(SIZE(csrmat, 2), "csrmat = ")
CALL Display(GetNNZ(csrmat), "GetNNZ = ")
dense=csrmat
CALL Display(dense, "dense = ")
csrmat = 5
csrmat = 5
GetNNZ = 12
dense =
-------------------------------------------
19.0000 0.0000 21.0000 21.0000 0.0000
12.0000 21.0000 0.0000 0.0000 0.0000
0.0000 12.0000 16.0000 0.0000 0.0000
0.0000 0.0000 0.0000 5.0000 21.0000
12.0000 12.0000 0.0000 0.0000 18.0000
Let make symmetric method using upper part.
CALL GetSym(obj=csrmat, symobj=symcsrmat, from="U")
dense=symcsrmat
CALL Display(dense, "Sym CSR Mat=")
Sym CSR Mat=
-------------------------------------------
19.0000 0.0000 21.0000 21.0000 0.0000
0.0000 21.0000 0.0000 0.0000 0.0000
21.0000 0.0000 16.0000 0.0000 0.0000
21.0000 0.0000 0.0000 5.0000 21.0000
0.0000 0.0000 0.0000 21.0000 0.0000
end program main
program main
use easifemBase
implicit none
Declare variables.
TYPE(CSRMatrix_) :: csrmat, symcsrmat
CHARACTER(*), PARAMETER :: matrix_name = "./matrixMarket/small5.mtx"
REAL( DFP ), ALLOCATABLE :: dense(:,:)
INTEGER( I4B ) :: info
Import csrmatrix from matrix market.
CALL IMPORT(csrmat, matrix_name, SPARSE_FMT_COO)
CALL Display(SIZE(csrmat, 1), "csrmat = ")
CALL Display(SIZE(csrmat, 2), "csrmat = ")
CALL Display(GetNNZ(csrmat), "GetNNZ = ")
dense=csrmat
CALL Display(dense, "dense = ")
csrmat = 5
csrmat = 5
GetNNZ = 12
dense =
-------------------------------------------
19.0000 0.0000 21.0000 21.0000 0.0000
12.0000 21.0000 0.0000 0.0000 0.0000
0.0000 12.0000 16.0000 0.0000 0.0000
0.0000 0.0000 0.0000 5.0000 21.0000
12.0000 12.0000 0.0000 0.0000 18.0000
Let make symmetric method using upper part.
CALL GetSym(obj=csrmat, symobj=symcsrmat, from="L")
dense=symcsrmat
CALL Display(dense, "Sym CSR Mat=")
Sym CSR Mat=
-------------------------------------------
19.0000 12.0000 0.0000 0.0000 12.0000
12.0000 21.0000 12.0000 0.0000 12.0000
0.0000 12.0000 16.0000 0.0000 0.0000
0.0000 0.0000 0.0000 5.0000 0.0000
12.0000 12.0000 0.0000 0.0000 18.0000
end program main
- ܀ GetSym(obj, from)
- ️܀ See example 1
- ↢
INTERFACE
MODULE SUBROUTINE GetSym(obj, from)
TYPE(CSRMatrix_), INTENT(INOUT) :: obj
CHARACTER(1), INTENT(IN) :: from
END SUBROUTINE GetSym
END INTERFACE