COIN-OR::LEMON - Graph Library

Changeset 1569:2a455f46f85a in lemon-0.x for test


Ignore:
Timestamp:
07/19/05 14:40:23 (19 years ago)
Author:
Alpar Juttner
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2068
Message:

Produce less messages.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/unionfind_test.cc

    r1435 r1569  
    5050  UFE U(base);
    5151
    52 //   print(U);
     52  U.insert(1);
     53  U.insert(2);
    5354
    54   cout << "Insert 1..." << endl;
    55   U.insert(1);
    56 //   print(U);
    57  
    58   cout << "Insert 2..." << endl;
    59   U.insert(2);
    60 //   print(U);
    61  
    62   cout << "Join 1 and 2..." << endl;
    6355  check(U.join(1,2),"Test failed.");
    64 //   print(U);
    6556
    66   cout << "Insert 3, 4, 5, 6, 7..." << endl;
    6757  U.insert(3);
    6858  U.insert(4);
     
    7060  U.insert(6);
    7161  U.insert(7);
    72 //   print (U);
    7362
    74   cout << "Join 1 - 4, 2 - 4 and 3 - 5 ..." << endl;
    7563  check(U.join(1,4),"Test failed.");
    7664  check(!U.join(2,4),"Test failed.");
    7765  check(U.join(3,5),"Test failed.");
    78 //   print(U);
    7966
    80   cout << "Insert 8 to the component of 5 ..." << endl;
    8167  U.insert(8,5);
    82 //   print(U);
    8368
    84   cout << "Size of the class of 4: " << U.size(4) << endl;
    8569  check(U.size(4) == 3,"Test failed.");
    86   cout << "Size of the class of 5: " << U.size(5) << endl;
    8770  check(U.size(5) == 3,"Test failed.");
    88   cout << "Size of the class of 6: " << U.size(6) << endl;
    8971  check(U.size(6) == 1,"Test failed.");
    90   cout << "Size of the class of 2: " << U.size(2) << endl;
    9172  check(U.size(2) == 3,"Test failed.");
    9273
    93   cout << "Insert 9 ..." << endl;
    9474  U.insert(9);
    95 //   print(U);
    96   cout << "Insert 10 to the component of 9 ..." << endl;
    9775  U.insert(10,9);
    98 //   print(U);
     76  check(U.join(8,10),"Test failed.");
    9977
    100   cout << "Join 8 and 10..." << endl;
    101   check(U.join(8,10),"Test failed.");
    102 //   print(U);
     78  check(U.move(9,4),"Test failed.");
     79  check(!U.move(9,2),"Test failed.");
    10380
    104   cout << "Move 9 to the class of 4 ..." << endl;
    105   check(U.move(9,4),"Test failed.");
    106 //   print(U);
     81  check(U.size(4) == 4,"Test failed.");
     82  check(U.size(9) == 4,"Test failed.");
    10783
    108   cout << "Move 9 to the class of 2 ..." << endl;
    109   check(!U.move(9,2),"Test failed.");
    110 //   print(U);
     84  check(U.move(5,6),"Test failed.");
    11185
    112   cout << "Size of the class of 4: " << U.size(4) << endl;
    113   check(U.size(4) == 4,"Test failed.");
    114   cout << "Size of the class of 9: " << U.size(9) << endl;
    115   check(U.size(9) == 4,"Test failed.");
    116  
    117   cout << "Move 5 to the class of 6 ..." << endl;
    118   check(U.move(5,6),"Test failed.");
    119 //   print(U);
    120 
    121   cout << "Size of the class of 5: " << U.size(5) << endl;
    12286  check(U.size(5) == 2,"Test failed.");
    123   cout << "Size of the class of 8: " << U.size(8) << endl;
    12487  check(U.size(8) == 3,"Test failed.");
    12588
    126   cout << "Move 7 to the class of 10 ..." << endl;
    12789  check(U.move(7,10),"Test failed.");
    128 //   print(U);
    129 
    130   cout << "Size of the class of 7: " << U.size(7) << endl;
    13190  check(U.size(7) == 4,"Test failed.");
    13291
    133   cout <<"Erase 9... " << endl;
    13492  U.erase(9);
    135 //   print(U);
     93  U.erase(1);
    13694
    137   cout <<"Erase 1... " << endl;
    138   U.erase(1);
    139 //   print(U);
    140 
    141   cout << "Size of the class of 4: " << U.size(4) << endl;
    14295  check(U.size(4) == 2,"Test failed.");
    143   cout << "Size of the class of 2: " << U.size(2) << endl;
    14496  check(U.size(2) == 2,"Test failed.");
    14597
     98  U.erase(1);
     99  U.erase(6);
     100  U.split(8);
    146101
    147   cout <<"Erase 1... " << endl;
    148   U.erase(1);
    149 //   print(U);
    150 
    151   cout <<"Erase 6... " << endl;
    152   U.erase(6);
    153 //   print(U);
    154 
    155   cout << "Split the class of 8... " << endl;
    156   U.split(8);
    157 //   print(U);
    158 
    159 
    160   cout << "Size of the class of 4: " << U.size(4) << endl;
    161102  check(U.size(4) == 2,"Test failed.");
    162   cout << "Size of the class of 3: " << U.size(3) << endl;
    163103  check(U.size(3) == 1,"Test failed.");
    164   cout << "Size of the class of 2: " << U.size(2) << endl;
    165104  check(U.size(2) == 2,"Test failed.");
    166105
    167 
    168   cout << "Join 3 - 4 and 2 - 4 ..." << endl;
    169106  check(U.join(3,4),"Test failed.");
    170107  check(!U.join(2,4),"Test failed.");
    171 //   print(U);
    172108
    173 
    174   cout << "Size of the class of 4: " << U.size(4) << endl;
    175109  check(U.size(4) == 3,"Test failed.");
    176   cout << "Size of the class of 3: " << U.size(3) << endl;
    177110  check(U.size(3) == 3,"Test failed.");
    178   cout << "Size of the class of 2: " << U.size(2) << endl;
    179111  check(U.size(2) == 3,"Test failed.");
    180112
    181   cout << "Calling makeRep(4)..." << endl;
    182113  U.makeRep(4);
    183 //   print(U);
    184   cout << "Calling makeRep(3)..." << endl;
    185114  U.makeRep(3);
    186 //   print(U);
    187   cout << "Calling makeRep(2)..." << endl;
    188115  U.makeRep(2);
    189 //   print(U);
    190116
    191   cout << "Size of the class of 4: " << U.size(4) << endl;
    192117  check(U.size(4) == 3,"Test failed.");
    193   cout << "Size of the class of 3: " << U.size(3) << endl;
    194118  check(U.size(3) == 3,"Test failed.");
    195   cout << "Size of the class of 2: " << U.size(2) << endl;
    196119  check(U.size(2) == 3,"Test failed.");
    197120
    198121
    199   cout << "eraseClass 4 ..." << endl;
    200122  U.eraseClass(4);
    201 //   print(U);
     123  U.eraseClass(7);
    202124
    203   cout << "eraseClass 7 ..." << endl;
    204   U.eraseClass(7);
    205 //   print(U);
    206 
    207   cout << "done." << endl;
    208125}
Note: See TracChangeset for help on using the changeset viewer.