edu.stanford.math.plex4.homology.utility
public class HomologyUtility extends java.lang.Object
Constructor and Description |
---|
HomologyUtility() |
Modifier and Type | Method and Description |
---|---|
static int[] |
appendToArray(int[] array,
int newValue)
This function appends the argument newValue to the end of the
supplied array.
|
static int |
compareIntArrays(int[] array1,
int[] array2)
This function performs a comparison of two arrays of ints.
|
static gnu.trove.TIntHashSet |
computeIntersection(gnu.trove.TIntHashSet set1,
gnu.trove.TIntHashSet set2)
This function computes the intersection between two sets of
integers.
|
static int[] |
convertIndices(int[] vertices,
int[] conversionArray) |
static Simplex |
convertIndices(Simplex simplex,
int[] conversionArray) |
static int[] |
deconvertIndices(int[] vertices,
int[] conversionArray) |
static int[] |
getDefaultBoundaryCoefficients(int length)
This function returns the standard sequence of boundary coefficients
used in simplicial homology, defined by c_i = (-1)^i.
|
static int[] |
lowerEntries(int[] array,
int k)
This function returns the first k entries of the supplied array.
|
static int[] |
removeIndex(int[] array,
int index)
This function returns a new array which contains the same entries as the
supplied array except that the element at the specified index has been
removed and the proceeding elements have been shifted down by one.
|
static int[] |
upperEntries(int[] array,
int k)
This function returns the last entries of the supplied array
starting from the index k.
|
public static int[] getDefaultBoundaryCoefficients(int length)
length
- the length of the array to getpublic static int compareIntArrays(int[] array1, int[] array2)
array1
- the first array parameterarray2
- the second array parameterpublic static int[] removeIndex(int[] array, int index)
array
- index
- public static int[] appendToArray(int[] array, int newValue)
array
- the array to append tonewValue
- the value to appendpublic static int[] lowerEntries(int[] array, int k)
array
- k
- public static int[] upperEntries(int[] array, int k)
array
- k
- public static gnu.trove.TIntHashSet computeIntersection(gnu.trove.TIntHashSet set1, gnu.trove.TIntHashSet set2)
set1
- the first setset2
- the second setpublic static int[] convertIndices(int[] vertices, int[] conversionArray)
public static int[] deconvertIndices(int[] vertices, int[] conversionArray)