File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,9 @@ function Base.iterate(iter::LayoutIterator{<:SFDP}, state)
108
108
end
109
109
end
110
110
if any (isnan, force)
111
- # if two points are at the exact same location
112
- # use random force in any direction
111
+ # if two points are at the exact same location use random force in any direction
112
+ # copy rng from alg struct to keep initial random state intact for future invocations
113
+ # otherwise algo(g)==algo(g) might be broken
113
114
rng = copy (algo. rng)
114
115
force += randn (rng, Ftype)
115
116
end
Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ function Base.iterate(iter::LayoutIterator{<:Spring}, state)
114
114
else
115
115
# if two points are at the exact same location
116
116
# use random force in any direction
117
+ # copy rng from alg struct to keep initial random state intact for future invocations
118
+ # otherwise algo(g)==algo(g) might be broken
117
119
rng = copy (algo. rng)
118
120
force_vec += randn (rng, Ftype)
119
121
end
You can’t perform that action at this time.
0 commit comments