public class NormalisedIntComponents
extends java.lang.Object
Constructor and Description |
---|
NormalisedIntComponents(java.util.Collection<? extends gnu.trove.TIntCollection> partition) |
NormalisedIntComponents(int numberOfNodes) |
Modifier and Type | Method and Description |
---|---|
boolean |
areInSameComponent(int normalisedA,
int normalisedB) |
int |
getComponentOf(int node) |
java.util.List<gnu.trove.set.TIntSet> |
getComponents() |
java.lang.Iterable<java.lang.Integer> |
getNodeIndicesOfComponent(int componentIndex) |
int |
getNumberOfComponents() |
void |
mergeComponents(int componentA,
int componentB)
Merge two components.
|
void |
mergeComponentsOf(int normalisedA,
int normalisedB)
Merge the components of the two nodes.
|
int[] |
normalise()
Put the components in increasing order 0...n
|
public NormalisedIntComponents(int numberOfNodes)
public NormalisedIntComponents(java.util.Collection<? extends gnu.trove.TIntCollection> partition)
public void mergeComponentsOf(int normalisedA, int normalisedB)
normalisedA
- normalisedB
- public void mergeComponents(int componentA, int componentB)
componentA
- componentB
- public boolean areInSameComponent(int normalisedA, int normalisedB)
public int getComponentOf(int node)
public int getNumberOfComponents()
public java.util.List<gnu.trove.set.TIntSet> getComponents()
public java.lang.Iterable<java.lang.Integer> getNodeIndicesOfComponent(int componentIndex)
public int[] normalise()