edu.stanford.math.plex
public static class SimplexStream.Stack extends SimplexStream
Stack
is a multiway segmented stack for sorted storage
of simplices.
The class SimplexStream.Stack
provides a simple,
fast, scalable implementation of SimplexStream. Instances are arrays
of segmented stacks of simplices, simplices are less than,
equivalent, or greater than one another (for the purposes of the
Persistence computations) if and only if the corresponding indices
for their segmented stacks are <, ==, or >. In addition, the next()
method drops references to the segments as soon as possible, which
means that the stack consumes progressively less memory as its
contents are processed.
Modifier and Type | Class and Description |
---|---|
protected static class |
SimplexStream.Stack.Segment |
protected static class |
SimplexStream.Stack.StackIterator
Instances provide Iterator
|
SimplexStream.ComparisonType, SimplexStream.Head, SimplexStream.Stack, SimplexStream.Tail
Modifier and Type | Field and Description |
---|---|
protected int |
dimension_bound |
protected int |
findex_bound |
protected int |
segment_length |
protected SimplexStream.Stack.Segment[] |
segments |
protected int |
segments_index |
protected int |
simplex_index |
protected int |
size |
protected static int |
STACK_SEGMENT_LENGTH |
Modifier | Constructor and Description |
---|---|
protected |
SimplexStream.Stack() |
|
SimplexStream.Stack(int max_findex,
int max_d)
Constructor for Stack.
|
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext()
Is there a next Simplex in the stream?
|
java.util.Iterator<Simplex> |
iterator()
Make a non-destructive iterator for the Stack.
|
java.util.Iterator<Simplex> |
iterator(int d)
Make a non-destructive iterator for fixed dimensional entries in the Stack.
|
int |
maxDimension()
Max dimension of simplices in the stream.
|
Simplex |
next()
Return the next Simplex in the stream.
|
Simplex |
push(Simplex s)
Push a Simplex into the stream.
|
protected int |
simplexIndex(Simplex s) |
int |
size()
How many simplices are in the stream?
|
java.lang.String |
toString() |
convert_filtration_index, convertInterval, convertInterval, remove, verify
protected static int STACK_SEGMENT_LENGTH
protected final SimplexStream.Stack.Segment[] segments
protected final int findex_bound
protected final int dimension_bound
protected final int segment_length
protected int size
protected int segments_index
protected int simplex_index
protected SimplexStream.Stack()
public SimplexStream.Stack(int max_findex, int max_d)
Make a multi-way stack that automatically sorts simplices.
max_findex
- Maximum Filtration Index we'll use.max_d
- Maximum dimension of a Simplex to be pushed.public java.lang.String toString()
toString
in class java.lang.Object
protected int simplexIndex(Simplex s)
public Simplex push(Simplex s)
Add the Simplex s to the stream so that it will be retrieved in the proper order.
s
- Simplex instance to push.public int size()
size
in class SimplexStream
public int maxDimension()
maxDimension
in class SimplexStream
public boolean hasNext()
hasNext
in interface java.util.Iterator<Simplex>
hasNext
in class SimplexStream
public Simplex next()
next
in interface java.util.Iterator<Simplex>
next
in class SimplexStream
public java.util.Iterator<Simplex> iterator()
Iterator
public java.util.Iterator<Simplex> iterator(int d)
d
- dimension of entries we want to iterate overIterator