edu.stanford.math.plex4.homology.chain_basis
public class Simplex extends java.lang.Object implements PrimitiveBasisElement
This class implements the functionality of a simplex. A simplex is an n-dimensional polytope which is the convex hull of its vertices. For our purposes, we simply represent a simplex by its vertices which are labeled by integers. For example, a 2-simplex could be [0, 5, 9].
The vertices of a simplex are specified by non-negative integers. It uses an array implementation to store the indices of the vertices of the simplex.
This class is designed to be a standard implementation of the PrimitiveBasisElement interface. It is also immutable and implements value semantics.
| Constructor and Description |
|---|
Simplex(int[] vertices)
This constructor initializes the simplex from a supplied array
of integers.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Simplex[] |
getBoundaryArray()
This function returns the boundary of the current basis element.
|
int[] |
getBoundaryCoefficients()
This function returns the coefficients of the elements of the boundary array.
|
int |
getDimension()
This function returns the dimension of the basis element.
|
int[] |
getVertices()
This function returns an array containing the vertices of the simplex.
|
int |
hashCode() |
static Simplex |
makeSimplex(int... args) |
java.lang.String |
toString() |
public Simplex(int[] vertices)
vertices - the vertices topublic static Simplex makeSimplex(int... args)
public int getDimension()
PrimitiveBasisElementgetDimension in interface PrimitiveBasisElementpublic int[] getVertices()
public Simplex[] getBoundaryArray()
PrimitiveBasisElementgetBoundaryArray in interface PrimitiveBasisElementpublic int[] getBoundaryCoefficients()
PrimitiveBasisElementgetBoundaryCoefficients in interface PrimitiveBasisElementpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object