home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / yacl-012.zip / basedemo / set / settest.cxx < prev    next >
C/C++ Source or Header  |  1994-10-14  |  1KB  |  41 lines

  1.  
  2.  
  3. #include "base/base.h"
  4. #include <iostream.h>
  5.  
  6. void test1 ()
  7. {
  8.     CL_IntegerSet mySet (17, 21);
  9.     mySet += CL_IntegerSet (35, 39);
  10.     mySet += CL_IntegerSet (26, 29);
  11.  
  12.     cout << "IntegerSet mySet is " << mySet << endl;
  13.     cout << "Rank of 13 is " << mySet.RankOf (13) << endl;
  14.     cout << "Rank of 17 is " << mySet.RankOf (17) << endl;
  15.     cout << "Rank of 21 is " << mySet.RankOf (21) << endl;
  16.     cout << "Rank of 25 is " << mySet.RankOf (25) << endl;
  17.     cout << "Rank of 35 is " << mySet.RankOf (35) << endl;
  18. }
  19.  
  20. void test2 ()
  21. {
  22.     CL_BitSet mySet (17, 21);
  23.     mySet += CL_BitSet (35, 39);
  24.     mySet += CL_BitSet (26, 29);
  25.  
  26.     cout << "BitSet mySet is " << mySet << endl;
  27.     cout << "Rank of 13 is " << mySet.RankOf (13) << endl;
  28.     cout << "Rank of 17 is " << mySet.RankOf (17) << endl;
  29.     cout << "Rank of 21 is " << mySet.RankOf (21) << endl;
  30.     cout << "Rank of 25 is " << mySet.RankOf (25) << endl;
  31.     cout << "Rank of 35 is " << mySet.RankOf (35) << endl;
  32. }
  33.  
  34.  
  35. main ()
  36. {
  37.     test1();
  38.     test2();
  39. }
  40.  
  41.