edu.stanford.math.plex
public class Packed2Simplex extends Simplex
The Packed2Simplex
class implements the abstract class
Simplex
for Simplices that are points or edges by storing
the vertices as 2 packed 32-bit values in a single long int. This limits
us to H0 calculations with this representation, but this is the most
important case for Mapper use, and increased vertex sizes, and
simplicity and speed of this form make it worthwhile.
Modifier and Type | Field and Description |
---|---|
long |
bits |
protected static long |
DIM_0_MASK |
protected static int |
MAX_2_INDEX |
protected static int |
VERTEX_BIT_SZ |
Modifier | Constructor and Description |
---|---|
protected |
Packed2Simplex() |
protected |
Packed2Simplex(int v1) |
protected |
Packed2Simplex(long bits) |
Modifier and Type | Method and Description |
---|---|
protected static void |
assert_2_vertices(int[] v) |
Simplex[] |
boundaryArray()
Returns the boundary of self.
|
protected static boolean |
check_2_vertices(int[] v) |
protected int |
compareTo(Packed2Simplex s) |
int |
compareTo(Simplex s)
Implements Comparable interface.
|
Simplex |
copy()
Make a "blank" copy of the Simplex -- equivalent to getSimplex(this.vertices()).
|
int |
dimension()
Returns the dimension of self.
|
boolean |
equals(java.lang.Object obj)
Overrides Object equals.
|
int |
hashCode()
Overrides Object hashcode.
|
static Simplex |
makeEdge(int v1,
int v2) |
static Simplex |
makePoint(int v) |
static Simplex |
makeSimplex(int[] vertices) |
static Simplex |
makeSimplexPresorted(int[] vertices) |
protected int |
v1() |
protected int |
v2() |
int[] |
vertices()
Returns the indices of self as an array.
|
int[] |
vertices(int[] verts)
Returns the indices of self in the given array argument.
|
addVertex, addVertex, boundary, chain, clearChain, decrement_findex, dist_sort, findex, getSimplex, getSimplex, getSimplexPresorted, getSimplexPresorted, makeEdge, makePoint, persistence_sort, setChain, setfindex, simplex_reverse_sort, subset, subset, toString, vertex_sort
public final long bits
protected static int VERTEX_BIT_SZ
protected static int MAX_2_INDEX
protected static long DIM_0_MASK
protected Packed2Simplex()
protected Packed2Simplex(long bits)
protected Packed2Simplex(int v1)
protected int v1()
protected int v2()
protected static boolean check_2_vertices(int[] v)
protected static void assert_2_vertices(int[] v)
public int hashCode()
public boolean equals(java.lang.Object obj)
protected int compareTo(Packed2Simplex s)
public int compareTo(Simplex s)
public Simplex copy()
public int dimension()
dimension
in class Simplex
Simplex.dimension()
public int[] vertices()
vertices
in class Simplex
Simplex.vertices()
public int[] vertices(int[] verts)
vertices
in class Simplex
verts
- the int[] into which the vertices, if any, are written.Simplex.vertices()
public static Simplex makeSimplex(int[] vertices)
public static Simplex makeSimplexPresorted(int[] vertices)
public static Simplex makeEdge(int v1, int v2)
public static Simplex makePoint(int v)
public Simplex[] boundaryArray()
It is simple enough to do explicitly, and it needs to be fast.
boundaryArray
in class Simplex
Simplex.vertices()