Class NormalisedIntComponents
- java.lang.Object
-
- org.processmining.plugins.inductiveminer2.helperclasses.normalised.NormalisedIntComponents
-
public class NormalisedIntComponents extends java.lang.ObjectAssumes that the nodes are numbered [0..n].- Author:
- sander
-
-
Constructor Summary
Constructors Constructor Description NormalisedIntComponents(int numberOfNodes)NormalisedIntComponents(java.util.Collection<? extends gnu.trove.TIntCollection> partition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareInSameComponent(int normalisedA, int normalisedB)intgetComponentOf(int node)java.util.List<gnu.trove.set.TIntSet>getComponents()java.lang.Iterable<java.lang.Integer>getNodeIndicesOfComponent(int componentIndex)intgetNumberOfComponents()voidmergeComponents(int componentA, int componentB)Merge two components.voidmergeComponentsOf(int normalisedA, int normalisedB)Merge the components of the two nodes.int[]normalise()Put the components in increasing order 0...n
-
-
-
Method Detail
-
mergeComponentsOf
public void mergeComponentsOf(int normalisedA, int normalisedB)Merge the components of the two nodes. If they are in the same component, runs in O(1). If they are not, runs in O(n) (n = number of nodes).- Parameters:
normalisedA-normalisedB-
-
mergeComponents
public void mergeComponents(int componentA, int componentB)Merge two components. The second component is kept.- Parameters:
componentA-componentB-
-
areInSameComponent
public boolean areInSameComponent(int normalisedA, int normalisedB)
-
getComponentOf
public int getComponentOf(int node)
-
getNumberOfComponents
public int getNumberOfComponents()
-
getComponents
public java.util.List<gnu.trove.set.TIntSet> getComponents()
-
getNodeIndicesOfComponent
public java.lang.Iterable<java.lang.Integer> getNodeIndicesOfComponent(int componentIndex)
-
normalise
public int[] normalise()
Put the components in increasing order 0...n- Returns:
- The mapping from old component to new component.
-
-