public class CoLexicographic extends AbstractCollection<int[]>
Constructor and Description |
---|
CoLexicographic(int n,
int r)
Construct a colexicographic ordering or r items chosen from 0 through n − 1.
|
Modifier and Type | Method and Description |
---|---|
static String |
fromLexicographic(int n,
int r,
String lex)
Convert a lexicographic chirotope string into a colexicographic one
|
static int |
index(int... ix)
In a colexicographic ordering, what position is this index.
|
Iterator<int[]> |
iterator() |
static void |
main(String[] args)
simple test code
|
int |
size() |
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode
public CoLexicographic(int n, int r)
n
- The number of things to choose fromr
- The number of things to choose: greater than 0 and less than npublic Iterator<int[]> iterator()
iterator
in interface Iterable<int[]>
iterator
in interface Collection<int[]>
iterator
in class AbstractCollection<int[]>
public int size()
size
in interface Collection<int[]>
size
in class AbstractCollection<int[]>
public static int index(int... ix)
ix
- The increasing list of integers in an orderingpublic static void main(String[] args)
args
- n and rpublic static String fromLexicographic(int n, int r, String lex)
n
- The number of things to choose fromr
- The number of things to chooselex
- A lexicographically ordered string (one character per index)