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()
AbstractFilteredStream
finalizeStream
in interface AbstractFilteredStream<Simplex>
public int getFiltrationIndex(Simplex basisElement)
AbstractFilteredStream
getFiltrationIndex
in interface AbstractFilteredStream<Simplex>
basisElement
- the basis element to get the filtration index forpublic boolean containsElement(Simplex basisElement)
AbstractFilteredStream
containsElement
in interface AbstractFilteredStream<Simplex>
basisElement
- the basis element to be testedpublic boolean isFinalized()
AbstractFilteredStream
isFinalized
in interface AbstractFilteredStream<Simplex>
public java.util.Iterator<Simplex> iterator()
iterator
in interface java.lang.Iterable<Simplex>
public double[] getPoint(int index)
AbstractObjectMetricSpace
getPoint
in interface AbstractObjectMetricSpace<double[]>
index
- the index of the point to retrievepublic int size()
AbstractIntMetricSpace
size
in interface AbstractIntMetricSpace
public double distance(int i, int j)
AbstractIntMetricSpace
distance
in interface AbstractIntMetricSpace
i
- the index of the first objectj
- the index of the second objectpublic double distance(double[] a, double[] b)
AbstractObjectMetric
distance
in interface AbstractObjectMetric<double[]>
a
- the first pointb
- the second pointpublic Simplex[] getBoundary(Simplex simplex)
AbstractFilteredStream
getBoundary
in interface AbstractFilteredStream<Simplex>
simplex
- the element to get the boundary ofpublic int[] getBoundaryCoefficients(Simplex simplex)
AbstractFilteredStream
getBoundaryCoefficients
in interface AbstractFilteredStream<Simplex>
simplex
- the element to get the boundary coefficients ofpublic int getDimension(Simplex element)
AbstractFilteredStream
getDimension
in interface AbstractFilteredStream<Simplex>
element
- the element to get the dimension ofpublic double[][] getPoints()
AbstractObjectMetricSpace
getPoints
in interface AbstractObjectMetricSpace<double[]>
public int getSize()
AbstractFilteredStream
getSize
in interface AbstractFilteredStream<Simplex>
public int getMaximumFiltrationIndex()
AbstractFilteredStream
getMaximumFiltrationIndex
in interface AbstractFilteredStream<Simplex>
public int getMinimumFiltrationIndex()
AbstractFilteredStream
getMinimumFiltrationIndex
in interface AbstractFilteredStream<Simplex>
public java.util.Comparator<Simplex> getBasisComparator()
AbstractFilteredStream
getBasisComparator
in interface AbstractFilteredStream<Simplex>
public <G> PersistenceInvariantDescriptor<Interval<java.lang.Double>,G> transform(PersistenceInvariantDescriptor<Interval<java.lang.Integer>,G> barcodeCollection)
AbstractFilteredStream
transform
in interface AbstractFilteredStream<Simplex>
barcodeCollection
- the set of filtration index barcodespublic double getFiltrationValue(Simplex basisElement)
getFiltrationValue
in interface AbstractFilteredStream<Simplex>