Class MergeTree


  • public class MergeTree
    extends java.lang.Object
    Data structure to keep track of which input ValueNumbers were combined to produce which other output ValueNumbers.
    Author:
    David Hovemeyer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static boolean DEBUG  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.BitSet getInputSet​(ValueNumber output)
      Get the set of input ValueNumbers which directly contributed to the given output ValueNumber.
      java.util.BitSet getTransitiveInputSet​(ValueNumber output)
      Get the transitive set of input ValueNumbers which contributed (directly or indirectly) to the given output ValueNumber.
      java.util.BitSet getTransitiveOutputSet​(int input)  
      void mapInputToOutput​(ValueNumber input, ValueNumber output)
      Map an input ValueNumber to an output ValueNumber.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEBUG

        public static final boolean DEBUG
    • Constructor Detail

      • MergeTree

        public MergeTree​(ValueNumberFactory factory)
        Constructor.
        Parameters:
        factory - the ValueNumberFactory
    • Method Detail

      • mapInputToOutput

        public void mapInputToOutput​(ValueNumber input,
                                     ValueNumber output)
        Map an input ValueNumber to an output ValueNumber.
        Parameters:
        input - the input ValueNumber
        output - the output ValueNumber
      • getInputSet

        public java.util.BitSet getInputSet​(ValueNumber output)
        Get the set of input ValueNumbers which directly contributed to the given output ValueNumber.
        Parameters:
        output - the output ValueNumber
        Returns:
        the set of direct input ValueNumbers
      • getTransitiveInputSet

        public java.util.BitSet getTransitiveInputSet​(ValueNumber output)
        Get the transitive set of input ValueNumbers which contributed (directly or indirectly) to the given output ValueNumber.
        Parameters:
        output - the output ValueNumber
        Returns:
        the transitive set of input ValueNumbers
      • getTransitiveOutputSet

        public java.util.BitSet getTransitiveOutputSet​(int input)