IPODwBDD
Révision | 7eaabcbd2cd8e2c72d073b56d71f341c257b2b38 (tree) |
---|---|
l'heure | 2018-12-21 10:54:44 |
Auteur | Tatsuhiro Tsuchiya <t-tutiya@ist....> |
Commiter | Tatsuhiro Tsuchiya |
add some comments
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <classpath> |
3 | 3 | <classpathentry kind="src" path="src"/> |
4 | - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre-10.0.2"> | |
4 | + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"> | |
5 | 5 | <attributes> |
6 | 6 | <attribute name="module" value="true"/> |
7 | 7 | </attributes> |
@@ -1,9 +1,11 @@ | ||
1 | 1 | package v1; |
2 | 2 | |
3 | -class CombinationGenerator { | |
3 | +// Naive implementation of Knuth's algorithm | |
4 | +public class CombinationGenerator { | |
4 | 5 | private int c[]; |
5 | 6 | private int j; |
6 | 7 | private final int t; |
8 | + | |
7 | 9 | /** |
8 | 10 | * @param n number of things |
9 | 11 | * @param t combination size |
@@ -68,7 +70,7 @@ class CombinationGenerator { | ||
68 | 70 | return sum; |
69 | 71 | } |
70 | 72 | |
71 | - static int getCombinationID(int[] c) { | |
73 | + private static int getCombinationID(int[] c) { | |
72 | 74 | int sum = 0; |
73 | 75 | for (int i = 1; i <= c.length; i++) { |
74 | 76 | int ci = c[i-1]; |
@@ -87,6 +89,7 @@ class CombinationGenerator { | ||
87 | 89 | |
88 | 90 | static int getTotalNumber(int n, int t) { |
89 | 91 | int[] comb = new int[t]; |
92 | + // create the last combination | |
90 | 93 | for (int i = 0; i < t; i++) { |
91 | 94 | comb[i] = n - t + i; |
92 | 95 | } |
@@ -5,7 +5,7 @@ import java.util.List; | ||
5 | 5 | |
6 | 6 | import v1.Main.Randstar; |
7 | 7 | |
8 | -public class IPOGnoconst extends Generator { | |
8 | +class IPOGnoconst extends Generator { | |
9 | 9 | |
10 | 10 | protected int matrix[][]; |
11 | 11 | protected int strength; |