COIN-OR::LEMON - Graph Library

Ignore:
Timestamp:
04/28/04 22:55:18 (20 years ago)
Author:
beckerjc
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@613
Message:

Doc for the union-find structures.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/work/johanna/unionfind_test.cc

    r394 r462  
    7676  cout << "size of the class of 6: " << U.size(6) << endl;
    7777  check(U.size(6) == 1);
     78  cout << "size of the class of 2: " << U.size(2) << endl;
     79  check(U.size(2) == 3);
    7880
    7981  cout <<"erase 1: " << endl;
    8082  U.erase(1);
    8183  print(U);
     84
     85  cout << "size of the class of 4: " << U.size(4) << endl;
     86  check(U.size(4) == 2);
     87  cout << "size of the class of 2: " << U.size(2) << endl;
     88  check(U.size(2) == 2);
     89
    8290
    8391  cout <<"erase 1: " << endl;
     
    93101  print(U);
    94102
     103
     104  cout << "size of the class of 4: " << U.size(4) << endl;
     105  check(U.size(4) == 2);
     106  cout << "size of the class of 3: " << U.size(3) << endl;
     107  check(U.size(3) == 1);
     108  cout << "size of the class of 2: " << U.size(2) << endl;
     109  check(U.size(2) == 2);
     110
     111
    95112  cout << "Joining 3 - 4 and 2 - 4 ..." << endl;
    96113  check(U.join(3,4));
    97114  check(!U.join(2,4));
    98115  print(U);
     116
     117
     118  cout << "size of the class of 4: " << U.size(4) << endl;
     119  check(U.size(4) == 3);
     120  cout << "size of the class of 3: " << U.size(3) << endl;
     121  check(U.size(3) == 3);
     122  cout << "size of the class of 2: " << U.size(2) << endl;
     123  check(U.size(2) == 3);
     124
     125  cout << "makeRep(4)" << endl;
     126  U.makeRep(4);
     127  print(U);
     128  cout << "makeRep(3)" << endl;
     129  U.makeRep(3);
     130  print(U);
     131  cout << "makeRep(2)" << endl;
     132  U.makeRep(2);
     133  print(U);
     134
     135  cout << "size of the class of 4: " << U.size(4) << endl;
     136  check(U.size(4) == 3);
     137  cout << "size of the class of 3: " << U.size(3) << endl;
     138  check(U.size(3) == 3);
     139  cout << "size of the class of 2: " << U.size(2) << endl;
     140  check(U.size(2) == 3);
     141
    99142
    100143  cout << "eraseClass 4 ..." << endl;
Note: See TracChangeset for help on using the changeset viewer.