edu.stanford.math.plex4.streams.impl
public class GeometricSimplexStream extends java.lang.Object implements AbstractFilteredStream<Simplex>, AbstractObjectMetricSpace<double[]>
| Constructor and Description |
|---|
GeometricSimplexStream(AbstractFilteredStream<Simplex> stream,
AbstractObjectMetricSpace<double[]> metricSpace)
This constructor initializes the geometric complex from an abstract filtered complex and a metric space.
|
GeometricSimplexStream(AbstractFilteredStream<Simplex> stream,
double[][] points)
This constructor initializes the geometric complex from an abstract simplicial complex and double array
whose rows consist of the Euclidean coordinates of the vertices.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsElement(Simplex basisElement)
This function returns whether an element is contained in the stream.
|
double |
distance(double[] a,
double[] b)
This function returns the distance between two points.
|
double |
distance(int i,
int j)
This function returns the distance between the object at index i and the
object at index j.
|
void |
finalizeStream()
This function prepares the stream for use by a consumer, such as the
PersistentHomology class.
|
java.util.Comparator<Simplex> |
getBasisComparator()
This function returns a comparator on the underlying basis type.
|
Simplex[] |
getBoundary(Simplex simplex)
This function returns the elements in the boundary of the supplied
basisElement, without the coefficients.
|
int[] |
getBoundaryCoefficients(Simplex simplex)
This function returns the coefficients of the boundary of the supplied
basis element.
|
int |
getDimension(Simplex element)
This function returns the dimension of a basis element within
the chain complex.
|
int |
getFiltrationIndex(Simplex basisElement)
This function returns the filtration index of the requested basis element.
|
double |
getFiltrationValue(Simplex basisElement) |
int |
getMaximumFiltrationIndex()
This function gets the maximum filtration index in the complex.
|
int |
getMinimumFiltrationIndex()
This function gets the minimum filtration index in the complex.
|
double[] |
getPoint(int index)
This function returns the point at the specified index.
|
double[][] |
getPoints()
This function returns the set of points in the metric space as an array.
|
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<Simplex> |
iterator() |
int |
size()
This function returns the number of points in the metric space.
|
<G> PersistenceInvariantDescriptor<Interval<java.lang.Double>,G> |
transform(PersistenceInvariantDescriptor<Interval<java.lang.Integer>,G> barcodeCollection)
This function transforms the given collection of filtration index barcodes into filtration value barcodes.
|
public GeometricSimplexStream(AbstractFilteredStream<Simplex> stream, AbstractObjectMetricSpace<double[]> metricSpace)
stream - the abstract simplicial complexmetricSpace - the Euclidean metric space of verticespublic GeometricSimplexStream(AbstractFilteredStream<Simplex> stream, double[][] points)
stream - the abstract simplicial complexpoints - the array of pointspublic void finalizeStream()
AbstractFilteredStreamfinalizeStream in interface AbstractFilteredStream<Simplex>public int getFiltrationIndex(Simplex basisElement)
AbstractFilteredStreamgetFiltrationIndex in interface AbstractFilteredStream<Simplex>basisElement - the basis element to get the filtration index forpublic boolean containsElement(Simplex basisElement)
AbstractFilteredStreamcontainsElement in interface AbstractFilteredStream<Simplex>basisElement - the basis element to be testedpublic boolean isFinalized()
AbstractFilteredStreamisFinalized in interface AbstractFilteredStream<Simplex>public java.util.Iterator<Simplex> iterator()
iterator in interface java.lang.Iterable<Simplex>public double[] getPoint(int index)
AbstractObjectMetricSpacegetPoint in interface AbstractObjectMetricSpace<double[]>index - the index of the point to retrievepublic int size()
AbstractIntMetricSpacesize in interface AbstractIntMetricSpacepublic double distance(int i,
int j)
AbstractIntMetricSpacedistance in interface AbstractIntMetricSpacei - the index of the first objectj - the index of the second objectpublic double distance(double[] a,
double[] b)
AbstractObjectMetricdistance in interface AbstractObjectMetric<double[]>a - the first pointb - the second pointpublic Simplex[] getBoundary(Simplex simplex)
AbstractFilteredStreamgetBoundary in interface AbstractFilteredStream<Simplex>simplex - the element to get the boundary ofpublic int[] getBoundaryCoefficients(Simplex simplex)
AbstractFilteredStreamgetBoundaryCoefficients in interface AbstractFilteredStream<Simplex>simplex - the element to get the boundary coefficients ofpublic int getDimension(Simplex element)
AbstractFilteredStreamgetDimension in interface AbstractFilteredStream<Simplex>element - the element to get the dimension ofpublic double[][] getPoints()
AbstractObjectMetricSpacegetPoints in interface AbstractObjectMetricSpace<double[]>public int getSize()
AbstractFilteredStreamgetSize in interface AbstractFilteredStream<Simplex>public int getMaximumFiltrationIndex()
AbstractFilteredStreamgetMaximumFiltrationIndex in interface AbstractFilteredStream<Simplex>public int getMinimumFiltrationIndex()
AbstractFilteredStreamgetMinimumFiltrationIndex in interface AbstractFilteredStream<Simplex>public java.util.Comparator<Simplex> getBasisComparator()
AbstractFilteredStreamgetBasisComparator in interface AbstractFilteredStream<Simplex>public <G> PersistenceInvariantDescriptor<Interval<java.lang.Double>,G> transform(PersistenceInvariantDescriptor<Interval<java.lang.Integer>,G> barcodeCollection)
AbstractFilteredStreamtransform in interface AbstractFilteredStream<Simplex>barcodeCollection - the set of filtration index barcodespublic double getFiltrationValue(Simplex basisElement)
getFiltrationValue in interface AbstractFilteredStream<Simplex>