Skip to content

Commit 560327f

Browse files
committed
Remove unnecessary using in test code
1 parent f141e4f commit 560327f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

doc/modules/algorithm.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,18 @@ shuffle
158158
The "shuffle" subroutine depends on the :ref:`modules_random` module so that it
159159
can use the supported random number generator to randomly reorder an array.
160160

161+
Example::
162+
163+
use flc_algorithm, only : shuffle
164+
use flc_random, only : Engine
165+
implicit none
166+
integer :: i
167+
integer, dimension(8) :: iarr = (/ ((i), i = -4, 3) /)
168+
type(Engine) :: rng
169+
rng = Engine()
170+
171+
call shuffle(rng, iarr)
172+
161173
unique
162174
------
163175

test/test_algorithm.F90

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#include "fassert.h"
99

1010
module fortran_comparators
11-
use, intrinsic :: ISO_C_BINDING
1211
use flc_algorithm, only : INDEX_INT
1312
implicit none
1413
public
1514
contains
1615
function compare_ge(left, right) bind(C) &
1716
result(fresult)
17+
use, intrinsic :: ISO_C_BINDING
1818
integer(INDEX_INT), intent(in), value :: left
1919
integer(INDEX_INT), intent(in), value :: right
2020
logical(C_BOOL) :: fresult
@@ -69,7 +69,6 @@ subroutine test_sort_compare()
6969

7070
!-----------------------------------------------------------------------------!
7171
subroutine test_argsort()
72-
use, intrinsic :: ISO_C_BINDING
7372
use flc_algorithm, only : argsort, INDEX_INT
7473
implicit none
7574
integer, dimension(5) :: iarr = [ 2, 5, -2, 3, -10000]
@@ -95,7 +94,6 @@ subroutine test_argsort()
9594

9695
!-----------------------------------------------------------------------------!
9796
subroutine test_shuffle()
98-
use, intrinsic :: ISO_C_BINDING
9997
use flc_algorithm, only : shuffle
10098
use flc_random, only : Engine
10199
implicit none
@@ -112,7 +110,6 @@ subroutine test_shuffle()
112110

113111
!-----------------------------------------------------------------------------!
114112
subroutine test_binary_search()
115-
use, intrinsic :: ISO_C_BINDING
116113
use flc_algorithm, only : binary_search
117114
implicit none
118115
integer, dimension(6) :: iarr = [ -5, 1, 1, 2, 4, 9]
@@ -128,7 +125,6 @@ subroutine test_binary_search()
128125

129126
!-----------------------------------------------------------------------------!
130127
subroutine test_minmax_element()
131-
use, intrinsic :: ISO_C_BINDING
132128
use flc_algorithm, only : minmax_element, INDEX_INT
133129
implicit none
134130
integer, dimension(6) :: iarr = [ -5, 1000, -1000, 999, -1000, 1000]

0 commit comments

Comments
 (0)