Last change
on this file since 17287 was
16995,
checked in by gkronber, 5 years ago
|
#2520 Update plugin dependencies and references for HL.FLA for new persistence
|
File size:
439 bytes
|
Line | |
---|
1 | using System.Collections.Generic;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.Analysis.FitnessLandscape {
|
---|
5 | public static class IListExtensions {
|
---|
6 | public static void Shuffle<T>(this IList<T> list, IRandom random) {
|
---|
7 | int n = list.Count;
|
---|
8 | while (n > 1) {
|
---|
9 | n--;
|
---|
10 | int k = random.Next(n + 1);
|
---|
11 | T value = list[k];
|
---|
12 | list[k] = list[n];
|
---|
13 | list[n] = value;
|
---|
14 | }
|
---|
15 | }
|
---|
16 | }
|
---|
17 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.