edu.stanford.math.plex
public abstract class SimplexStream extends java.lang.Object implements java.lang.Iterable<Simplex>, java.util.Iterator<Simplex>
SimplexStream
provides
the simplices of a filtered complex in lexicographic order on
persistence index and dimension. The ordering is unspecified beyond that
point, and may even vary from instance to instance. The reason that
SimplexStream has both hasNext()
and next()
methods and implements the Iterable
interface is
that the internal iteration methods are allowed to be destructive. That
is, it is possible (and in fact does happen) that
stream.next()
will remove simplices from
stream
, making it impossible to use this method to iterate
over stream
a second time. Therefore, unless you are
prepared to consume the stream, use the Iterable
interface.Modifier and Type | Class and Description |
---|---|
static class |
SimplexStream.ComparisonType |
static class |
SimplexStream.Head
A
Head provides the FO part of a FIFO queue when
attached to a Tail to which simplices have been
enqueued. |
static class |
SimplexStream.Stack
Stack is a multiway segmented stack for sorted storage
of simplices. |
static class |
SimplexStream.Tail
An instance of
Tail provides the FI part of a FIFO
queue. |
Constructor and Description |
---|
SimplexStream() |
Modifier and Type | Method and Description |
---|---|
double |
convert_filtration_index(int fi)
Convert a filtration index into a persistence parameter (i.e., double)
-- gets overloaded by some subclasses.
|
PersistenceBasisInterval.Float |
convertInterval(PersistenceBasisInterval p)
convert a PersistenceBasisInterval into Float format in a stream-specific manner.
|
PersistenceInterval.Float |
convertInterval(PersistenceInterval p)
Convert a PersistenceInterval into Float format in a stream-specific manner.
|
abstract boolean |
hasNext()
Is there a next Simplex in the stream?
|
abstract int |
maxDimension()
Max dimension of simplices in the stream.
|
abstract Simplex |
next()
Next Simplex in the stream.
|
void |
remove()
Unsupported remove() operation.
|
abstract int |
size()
How many simplices are in the stream?
|
boolean |
verify()
Check the stream as much as possible.
|
public abstract boolean hasNext()
hasNext
in interface java.util.Iterator<Simplex>
public abstract Simplex next()
next
in interface java.util.Iterator<Simplex>
public void remove()
remove
in interface java.util.Iterator<Simplex>
java.lang.UnsupportedOperationException
public abstract int size()
public abstract int maxDimension()
public PersistenceInterval.Float convertInterval(PersistenceInterval p)
p
- PersistenceInterval to convert.public PersistenceBasisInterval.Float convertInterval(PersistenceBasisInterval p)
p
- PersistenceBasisInterval to convert.public double convert_filtration_index(int fi)
fi
- Filtration index to convert.public boolean verify()