Skip to content

Commit 052958d

Browse files
committed
Implement next
1 parent c63a282 commit 052958d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

fortran/solver/src/guess.f90

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module guess_mod
2323
contains
2424
procedure :: init => guess_init
2525
procedure :: eval
26+
procedure :: next
2627
procedure :: set_solution
2728
end type guess_t
2829
public :: guess_t
@@ -147,6 +148,11 @@ subroutine eval(guess)
147148
guess%mask = library%get_mask()
148149
guess%max_length = max_length
149150
end subroutine eval
151+
subroutine next(guess)
152+
use random_mod, only: shuffle
153+
class(guess_t), intent(inout) :: guess
154+
call shuffle(guess%guess, size(guess%guess), guess%mask)
155+
end subroutine next
150156
subroutine set_solution(guess, library)
151157
class(guess_t), intent(in) :: guess
152158
type(library_t), target, intent(inout) :: library

0 commit comments

Comments
 (0)