edu.stanford.math.plex
public class Packed4Simplex extends Simplex
The Packed4Simplex
class implements the abstract class
Simplex
for Simplices of dimension at most 3 by storing the
vertices as 4 packed positive integer values in a pair of long
ints. This limits us to H2 calculations with this representation, but
this is the next most important case, and having a more compact
representation for this case makes it worthwhile.
Modifier and Type | Field and Description |
---|---|
long |
bits_hi |
long |
bits_lo |
protected static long |
DIM_2_MASK |
protected static int |
MAX_4_INDEX |
protected static int |
VERTEX_BIT_SZ |
Modifier | Constructor and Description |
---|---|
protected |
Packed4Simplex() |
protected |
Packed4Simplex(int v1,
int v2,
int v3) |
protected |
Packed4Simplex(long bits_lo,
long bits_hi) |
Modifier and Type | Method and Description |
---|---|
protected static void |
assert_4_vertices(int[] v) |
Simplex[] |
boundaryArray()
Returns the boundary of self.
|
protected static boolean |
check_4_vertices(int[] v) |
protected int |
compareTo(Packed4Simplex 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 |
makeSimplex(int[] vertices) |
static Simplex |
makeSimplexPresorted(int[] vertices) |
protected int |
v1() |
protected int |
v2() |
protected int |
v3() |
protected int |
v4() |
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_lo
public final long bits_hi
protected static int VERTEX_BIT_SZ
protected static int MAX_4_INDEX
protected static long DIM_2_MASK
protected Packed4Simplex()
protected Packed4Simplex(long bits_lo, long bits_hi)
protected Packed4Simplex(int v1, int v2, int v3)
protected int v1()
protected int v2()
protected int v3()
protected int v4()
protected static boolean check_4_vertices(int[] v)
protected static void assert_4_vertices(int[] v)
public int hashCode()
public boolean equals(java.lang.Object obj)
protected int compareTo(Packed4Simplex 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 Simplex[] boundaryArray()
It is simple enough to do explicitly, and it needs to be fast.
boundaryArray
in class Simplex
Simplex.vertices()