Exemple #1
0
 //$goals 1
 //$benchmark
 public void minimumTest(FibHeap fibHeap)
 {
     if (fibHeap != null && fibHeap.repOK())
     {
         FibHeapNode ret_val = fibHeap.minimum();
     }
 }
Exemple #2
0
 //$goals 25
 //$benchmark
 public void removeMinTest(FibHeap fibHeap)
 {
     if (fibHeap != null && fibHeap.repOK())
     {
         FibHeapNode ret_val = fibHeap.removeMin();
     }
 }
Exemple #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);
     }
 }
Exemple #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];
Exemple #5
0
 //$goals 1
 //$benchmark
 public void minimumTest(FibHeap fibHeap)
 {
     if (fibHeap!=null && fibHeap.repOK()) {
       FibHeapNode ret_val = fibHeap.minimum();
     }
 }
Exemple #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);
     }
 }
Exemple #7
0
 //$goals 25
 //$benchmark
 public void removeMinTest(FibHeap fibHeap)
 {
     if (fibHeap!=null && fibHeap.repOK()) {
       FibHeapNode ret_val = fibHeap.removeMin();
     }
 }