Exemplo n.º 1
0
 //$goals 1
 //$benchmark
 public void minimumTest(FibHeap fibHeap)
 {
     if (fibHeap != null && fibHeap.repOK())
     {
         FibHeapNode ret_val = fibHeap.minimum();
     }
 }
Exemplo n.º 2
0
 //$goals 25
 //$benchmark
 public void removeMinTest(FibHeap fibHeap)
 {
     if (fibHeap != null && fibHeap.repOK())
     {
         FibHeapNode ret_val = fibHeap.removeMin();
     }
 }
Exemplo n.º 3
0
 //$goals 5
 //$benchmark
 public void insertNodeTest(FibHeap fibHeap, FibHeapNode toInsert)
 {
     if (fibHeap != null && toInsert != null && toInsert.left == toInsert && toInsert.right == toInsert && toInsert.parent == null && toInsert.child == null && fibHeap.repOK())
     {
         FibHeapNode ret_val = fibHeap.insertNode(toInsert);
     }
 }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            // To function fast the alghoritm needs references to the nodes for the Decrease operation instead of
            // ... just keys. The generator, on the other hand, does not (nor it can) operate with references. A
            // ... decision to put the translation between references and identifiers outside of the heap was made
            // ... as in a real world application the outside code would use the references instead of identifiers for
            // ... decrease anyway.
            FibNode <int>[] NodeIndetifierResolver = null;

            FibHeap <int> fibHeap = null;
            Logger        logger  = new Logger();

            string line;

            while ((line = Console.ReadLine()) != null)
            {
                (Command command, int N, int K) = ParseCommand(line);
                switch (command)
                {
                // Create new FiboHeap and report the last one
                case Command.New:

                    fibHeap = null;
                    NodeIndetifierResolver = null;

                    logger.Flush();
                    GC.Collect();

                    NodeIndetifierResolver = new FibNode <int> [2_000_000];
Exemplo n.º 5
0
 //$goals 1
 //$benchmark
 public void minimumTest(FibHeap fibHeap)
 {
     if (fibHeap!=null && fibHeap.repOK()) {
       FibHeapNode ret_val = fibHeap.minimum();
     }
 }
Exemplo n.º 6
0
 //$goals 5
 //$benchmark
 public void insertNodeTest(FibHeap fibHeap, FibHeapNode toInsert)
 {
     if (fibHeap!=null && toInsert!=null && toInsert.left==toInsert && toInsert.right==toInsert && toInsert.parent==null &&  toInsert.child==null && fibHeap.repOK()) {
       FibHeapNode ret_val = fibHeap.insertNode(toInsert);
     }
 }
Exemplo n.º 7
0
 //$goals 25
 //$benchmark
 public void removeMinTest(FibHeap fibHeap)
 {
     if (fibHeap!=null && fibHeap.repOK()) {
       FibHeapNode ret_val = fibHeap.removeMin();
     }
 }