public static class OnlineSectProof.Sequence extends Object
Constructor and Description |
---|
Sequence(int length,
int base)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
base()
Base of the sequence
|
String |
cat()
Category of a sequence, i.e., a string representation of the count of
each number in the sequence.
|
int |
count(int i)
Count number of occurrences of given number in the sequence
|
boolean |
inc()
Increment vector by 1, returns false it flips from the highest
possible number to zero
|
double |
progress()
If a sequence of all zeros is considered as 0, and the highest
possible sequence (sequence of all base-1) is 1, this returns the
position of the current sequence between these two bounds.
|
int |
seq(int i)
Return number on the given position, zero is the number of the least
significant value, size()-1 is the highest one
|
void |
set(String seq)
Set the sequence from a string representation (A..0, B..1, C..2,
etc.)
|
int |
size()
Size of the sequence
|
String |
toString()
String representation (A..0, B..1, C..2, etc.) going from the least
significant value to the highest
|
public Sequence(int length, int base)
length
- size of the vectorbase
- base (e.g., 2 for a binary vector)public boolean inc()
public int base()
public int count(int i)
i
- given numberpublic int size()
public int seq(int i)
i
- given positionpublic void set(String seq)
seq
- a sequencepublic String toString()
public double progress()