edu.stanford.math.plex4.homology.zigzag
public class BasisTrackingUtility extends java.lang.Object
Constructor and Description |
---|
BasisTrackingUtility() |
Modifier and Type | Method and Description |
---|---|
static <X> int |
appendColumn(java.util.Map<java.lang.Integer,X> m,
X col) |
static <X extends PrimitiveBasisElement> |
computeBoundary(edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> chain,
edu.stanford.math.primitivelib.autogen.formal_sum.IntAlgebraicFreeModule<X> chainModule)
This function computes the boundary of a given chain, by linear extension.
|
static <X extends PrimitiveBasisElement> |
createNewSum(int[] coefficients,
PrimitiveBasisElement[] objects)
This function creates a new formal sum from the given set of coefficients and objects.
|
static <Y> int |
findColumnWithGivenLow(java.util.List<edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y low,
java.util.Comparator<Y> comparator)
This function finds the index of the first column such that the column's low value is the value specified.
|
static <X,Y> X |
findColumnWithGivenLow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y low,
java.util.Comparator<Y> comparator)
This function finds the index of the first column such that the column's low value is the value specified.
|
static <X,Y> X |
findFirstIndexContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y element,
java.util.Comparator<X> comparator)
This function returns the lowest index such that the given element is found in the chain at that index.
|
static <X,Y> X |
findLastIndexContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y element,
java.util.Comparator<X> comparator)
This function returns the greatest index such that the given element is found in the chain at that index.
|
static <X> int |
getAppendIndex(java.util.Map<java.lang.Integer,X> m) |
static <X,Y> java.util.List<X> |
getAscendingIndices(java.util.Map<X,Y> m,
java.util.Comparator<X> comparator) |
static <X,Y> java.util.List<X> |
getAscendingIndicesContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y element,
java.util.Comparator<X> comparator)
This function returns the set of indices such that the chains at the indices contain the given element.
|
static <X,Y> java.util.List<X> |
getAscendingIndicesWithGivenLow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y element,
java.util.Comparator<X> comparator,
java.util.Comparator<Y> comparatorY) |
static <X> int |
getPrependIndex(java.util.Map<java.lang.Integer,X> m) |
static <X,Y> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> |
getRow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
Y row) |
static <X> X |
low(edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> chain,
java.util.Comparator<X> comparator)
This function computes the operation low_A(j) as described in the paper.
|
static <X,Y> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y> |
multiply(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m,
edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> v,
edu.stanford.math.primitivelib.autogen.algebraic.IntAbstractField field)
This function performs matrix multiplication.
|
static <X,Y,Z> java.util.Map<Z,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> |
multiply(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> a,
java.util.Map<Z,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X>> b,
edu.stanford.math.primitivelib.autogen.algebraic.IntAbstractField field)
This function performs matrix-matrix multiplication.
|
static <X> int |
prependColumn(java.util.Map<java.lang.Integer,X> m,
X col) |
static <X,Y> edu.stanford.math.primitivelib.autogen.pair.ObjectObjectPair<edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X>,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> |
reduce(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> M,
edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y> column,
java.util.Comparator<Y> comparator,
edu.stanford.math.primitivelib.autogen.formal_sum.IntAlgebraicFreeModule<Y> chainModule) |
static <X> void |
writeRow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<java.lang.Integer>> m,
edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> row,
int rowIndex) |
public static <X extends PrimitiveBasisElement> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> createNewSum(int[] coefficients, PrimitiveBasisElement[] objects)
X
- coefficients
- the array of coefficientsobjects
- the array of basis elements - they must be of type Xpublic static <X> X low(edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> chain, java.util.Comparator<X> comparator)
X
- the underlying type of the basis elements in the chainchain
- the chaincomparator
- the comparator to usepublic static <X,Y> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y> multiply(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> v, edu.stanford.math.primitivelib.autogen.algebraic.IntAbstractField field)
X
- Y
- m
- the matrix as a list of columnsv
- the vectorfield
- the field over which to perform the computationspublic static <X,Y,Z> java.util.Map<Z,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> multiply(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> a, java.util.Map<Z,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X>> b, edu.stanford.math.primitivelib.autogen.algebraic.IntAbstractField field)
X
- Y
- Z
- a
- the first matrixb
- the second matrixfield
- the field over which to perform the computationspublic static <Y> int findColumnWithGivenLow(java.util.List<edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y low, java.util.Comparator<Y> comparator)
Y
- m
- the set of columns to searchlow
- the low value to search forcomparator
- the comparator which performs the comparison within type Ypublic static <X,Y> X findColumnWithGivenLow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y low, java.util.Comparator<Y> comparator)
X
- Y
- m
- the set of columns to searchlow
- the low value to search forcomparator
- the comparator which performs the comparison within type Ypublic static <X extends PrimitiveBasisElement> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> computeBoundary(edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> chain, edu.stanford.math.primitivelib.autogen.formal_sum.IntAlgebraicFreeModule<X> chainModule)
X
- chain
- the chain to compute the boundary ofchainModule
- the module that performs the computationspublic static <X,Y> X findFirstIndexContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y element, java.util.Comparator<X> comparator)
X
- Y
- m
- the set of chainselement
- the element to search forcomparator
- provides comparison for the indices of mpublic static <X,Y> X findLastIndexContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y element, java.util.Comparator<X> comparator)
X
- Y
- m
- the set of chainselement
- the element to search forcomparator
- provides comparison for the indices of mpublic static <X,Y> java.util.List<X> getAscendingIndicesContainingElement(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y element, java.util.Comparator<X> comparator)
X
- Y
- m
- the set of chainselement
- the element to search forcomparator
- provides comparison for the indices of mpublic static <X,Y> java.util.List<X> getAscendingIndicesWithGivenLow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y element, java.util.Comparator<X> comparator, java.util.Comparator<Y> comparatorY)
public static <X,Y> java.util.List<X> getAscendingIndices(java.util.Map<X,Y> m, java.util.Comparator<X> comparator)
public static <X> int getPrependIndex(java.util.Map<java.lang.Integer,X> m)
public static <X> int getAppendIndex(java.util.Map<java.lang.Integer,X> m)
public static <X> int prependColumn(java.util.Map<java.lang.Integer,X> m, X col)
public static <X> int appendColumn(java.util.Map<java.lang.Integer,X> m, X col)
public static <X> void writeRow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<java.lang.Integer>> m, edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> row, int rowIndex)
public static <X,Y> edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X> getRow(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> m, Y row)
public static <X,Y> edu.stanford.math.primitivelib.autogen.pair.ObjectObjectPair<edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<X>,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> reduce(java.util.Map<X,edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y>> M, edu.stanford.math.primitivelib.autogen.formal_sum.IntSparseFormalSum<Y> column, java.util.Comparator<Y> comparator, edu.stanford.math.primitivelib.autogen.formal_sum.IntAlgebraicFreeModule<Y> chainModule)