Skip to content

Commit 3eea8c5

Browse files
authored
Merge pull request #64 from jvdp1/getoutputunit
Addition of the function getoutputunit
2 parents f76bdd8 + 07f1eb0 commit 3eea8c5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/modsparse.f90

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ module modsparse
6262
procedure :: getpermutation32
6363
procedure :: getpermutation64
6464
generic,public::getpermutation => getpermutation32, getpermutation64
65+
!> @brief Gets the output unit; e.g., unit = mat%getouputunit()
66+
procedure,public::getoutputunit
6567
!> @brief Initializes the values
6668
procedure,public::initialize=>init_gen
6769
!> @brief Returns true if the matrix is sorted; else returns false
@@ -174,6 +176,11 @@ module subroutine getpermutation64(sparse,array)
174176
class(gen_sparse),intent(in)::sparse
175177
integer(kind=int64),allocatable,intent(out)::array(:)
176178
end subroutine
179+
!**GET OUTPUT UNIT
180+
pure module function getoutputunit(sparse) result(val)
181+
class(gen_sparse),intent(in)::sparse
182+
integer(kind=int32)::val
183+
end function
177184
!INITIATE GEN SPARSE
178185
module subroutine init_gen(sparse,namemat,dim1,dim2)
179186
class(gen_sparse),intent(inout)::sparse

src/modsparse_gen.f90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ module subroutine getpermutation64(sparse,array)
137137

138138
end subroutine
139139

140+
!**GET OUTPUT UNIT
141+
pure module function getoutputunit(sparse) result(val)
142+
class(gen_sparse),intent(in)::sparse
143+
integer(kind=int32)::val
144+
145+
val = sparse%unlog
146+
end function
147+
140148
!INITIATE GEN SPARSE
141149
module subroutine init_gen(sparse,namemat,dim1,dim2)
142150
class(gen_sparse),intent(inout)::sparse

0 commit comments

Comments
 (0)