edu.stanford.math.plex4.streams.interfaces
T - the underlying basis type of the streampublic abstract class PrimitiveStream<T extends PrimitiveBasisElement> extends java.lang.Object implements AbstractFilteredStream<T>
This class implements a filtered chain complex where the underlying type is a geometric primitive (a Simplex or a Cell). Thus the appropriate homological functions are defined by the geometric properties of the underlying type. For example, the homological dimension is given by the actual geometric dimension, and the boundary is the geometric boundary of the cell or simplex in question.
Note that this class does not actually implement a storage mechanism, but allows a user to define one via a supplied StreamStorageStructure object. In the event that the user does not supply one, it reverts to the default one.
| Modifier and Type | Field and Description |
|---|---|
protected StreamStorageStructure<T> |
storageStructure
This object implements the actual storage structure for the stream.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PrimitiveStream(java.util.Comparator<T> comparator)
This constructor construct the stream with the default storage scheme.
|
protected |
PrimitiveStream(StreamStorageStructure<T> storageStructure)
This constructor constructs the stream with the supplied StreamStorageStructure.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
constructComplex()
This abstract function performs the construction of the filtered chain complex.
|
boolean |
containsElement(T basisElement)
This function returns whether an element is contained in the stream.
|
void |
finalizeStream()
This function prepares the stream for use by a consumer, such as the
PersistentHomology class.
|
java.util.Comparator<T> |
getBasisComparator()
This function returns a comparator on the underlying basis type.
|
T[] |
getBoundary(T basisElement)
This function returns the elements in the boundary of the supplied
basisElement, without the coefficients.
|
int[] |
getBoundaryCoefficients(T basisElement)
This function returns the coefficients of the boundary of the supplied
basis element.
|
int |
getDimension(T basisElement)
This function returns the dimension of a basis element within
the chain complex.
|
int |
getFiltrationIndex(T basisElement)
This function returns the filtration index of the requested basis element.
|
int |
getMaximumFiltrationIndex()
This function gets the maximum filtration index in the complex.
|
int |
getMinimumFiltrationIndex()
This function gets the minimum filtration index in the complex.
|
int |
getSize()
This function returns the total number of elements in the stream.
|
boolean |
isFinalized()
This function checks whether the finalize() function has been called.
|
java.util.Iterator<T> |
iterator() |
boolean |
validate()
This function validates the stream to make sure that it
contains a valid filtered simplicial or cell complex.
|
boolean |
validateVerbose()
This function validates the stream to make sure that it
contains a valid filtered simplicial or cell complex.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFiltrationValue, transformprotected final StreamStorageStructure<T extends PrimitiveBasisElement> storageStructure
protected PrimitiveStream(StreamStorageStructure<T> storageStructure)
storageStructure - the StreamStorageStructure to useprotected PrimitiveStream(java.util.Comparator<T> comparator)
comparator - a Comparator which defines an ordering for the storage schemeprotected abstract void constructComplex()
public final T[] getBoundary(T basisElement)
AbstractFilteredStreamgetBoundary in interface AbstractFilteredStream<T extends PrimitiveBasisElement>basisElement - the element to get the boundary ofpublic final int[] getBoundaryCoefficients(T basisElement)
AbstractFilteredStreamgetBoundaryCoefficients in interface AbstractFilteredStream<T extends PrimitiveBasisElement>basisElement - the element to get the boundary coefficients ofpublic final int getDimension(T basisElement)
AbstractFilteredStreamgetDimension in interface AbstractFilteredStream<T extends PrimitiveBasisElement>basisElement - the element to get the dimension ofpublic final java.util.Iterator<T> iterator()
iterator in interface java.lang.Iterable<T extends PrimitiveBasisElement>public final void finalizeStream()
AbstractFilteredStreamfinalizeStream in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public final int getFiltrationIndex(T basisElement)
AbstractFilteredStreamgetFiltrationIndex in interface AbstractFilteredStream<T extends PrimitiveBasisElement>basisElement - the basis element to get the filtration index forpublic boolean containsElement(T basisElement)
AbstractFilteredStreamcontainsElement in interface AbstractFilteredStream<T extends PrimitiveBasisElement>basisElement - the basis element to be testedpublic final boolean isFinalized()
AbstractFilteredStreamisFinalized in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public final int getSize()
AbstractFilteredStreamgetSize in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public int getMaximumFiltrationIndex()
AbstractFilteredStreamgetMaximumFiltrationIndex in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public int getMinimumFiltrationIndex()
AbstractFilteredStreamgetMinimumFiltrationIndex in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public java.util.Comparator<T> getBasisComparator()
AbstractFilteredStreamgetBasisComparator in interface AbstractFilteredStream<T extends PrimitiveBasisElement>public boolean validate()
public boolean validateVerbose()