diff --git a/graph/graph.cpp b/graph/graph.cpp index 0b4982b189dcbefb974e41eb0282118e30a49847..04d6cd812ec3c8f0cb3610417e97b0d2a2395568 100644 --- a/graph/graph.cpp +++ b/graph/graph.cpp @@ -763,11 +763,12 @@ class TC { node_t node = tc_->node(i); for(int j = 1; j <= num_nodes_; j++) { if(node->connection_exists(j)) { - std::cout << "tc(" << i << "," << j << + std::cout << "\ttc(" << i << "," << j << ").\n"; } } } + std::cout << "\n"; } // Attributes: @@ -897,11 +898,12 @@ class SG { node_t node = sg_->node(i); for(int j = 1; j <= num_nodes_; j++) { if(node->connection_exists(j)) { - std::cout << "sg(" << i << "," << j << + std::cout << "\tsg(" << i << "," << j << ").\n"; } } } + std::cout << "\n"; } // Attributes: @@ -1980,7 +1982,7 @@ int main(int argc, str_t argv[]) str_t opts = argv[argno++]; opts++; // Skip '-' while(*opts) { - switch(*opts) { + switch(*opts++) { case 'a': // Compute all benchmarks: opt_tc = true; @@ -2243,7 +2245,8 @@ int main(int argc, str_t argv[]) if(gsize.consistent(&formula)) std::cout << " Values are consistent.\n"; else { - std::cerr << " *** SIZE VALUES DIFFER ***\n"; + std::cout << " *** VALUES DIFFER! ***\n"; + std::cerr << "Inconsistent size values detected!\n"; exit(36); } std::cout << "\n"; diff --git a/graph/run_tests b/graph/run_tests new file mode 100755 index 0000000000000000000000000000000000000000..5915c97cd283c2053e62b8c6eae70fbf64a18d7c --- /dev/null +++ b/graph/run_tests @@ -0,0 +1,18 @@ +#!/bin/bash +# This generates many small graphs and computes TC and SG. +# The output shows whether formulas for cost measures +# and real values computed from the graphs are consistent. +./graph -a k5 test_out.P +./graph -a t5 test_out.P +./graph -a c10 test_out.P +./graph -a s10_1 test_out.P +./graph -a s12_2 test_out.P +./graph -a p10 test_out.P +./graph -a m4_3 test_out.P +./graph -a b3 test_out.P +./graph -a v4 test_out.P +./graph -a y3_4 test_out.P +./graph -a w10 test_out.P +./graph -a x10 test_out.P +./graph -a d10 test_out.P +rm test_out.P