edu.stanford.math.plex
public class SimplexFaceIterator extends java.lang.Object
SimplexFaceIterator
class.
A SimplexFaceIterator
instance makes an iterator that
returns all of the faces of a Simplex (specified via a Simplex or a
SimplexHandle) in a given dimension range. It also keeps track of the
sign of the last one returned, so that this can be used to compute the
boundary of a simplex.
Modifier and Type | Field and Description |
---|---|
protected int[] |
counter |
protected int[] |
current |
protected int |
k |
protected int |
N |
protected int |
signOfLast |
protected int[] |
vertices |
Modifier | Constructor and Description |
---|---|
protected |
SimplexFaceIterator() |
|
SimplexFaceIterator(int[] vertices,
int dimension)
Construct a new iterator for faces of a simplex given by an array.
|
|
SimplexFaceIterator(Simplex s,
int dimension)
Construct a new iterator for the faces specified dimension.
|
Modifier and Type | Method and Description |
---|---|
int |
getDimension()
Return the dimension of the faces generated by this iterator.
|
int |
getSignOfLast()
Return the sign of the last face -- only useful when codimension is 1.
|
boolean |
hasNext() |
int[] |
next()
Get the next face in an iteration of all faces of dimension k.
|
protected int signOfLast
protected final int k
protected final int N
protected final int[] vertices
protected final int[] counter
protected final int[] current
protected SimplexFaceIterator()
public SimplexFaceIterator(int[] vertices, int dimension)
vertices
- An int[] specifying the vertices.dimension
- Dimension of the faces we care about.public SimplexFaceIterator(Simplex s, int dimension)
s
- Simplex whose faces are of interest.dimension
- Dimension of the faces we care about (often
dimension of the simplex - 1).public boolean hasNext()
public int[] next()
public int getDimension()
public int getSignOfLast()