private static void subset_colex_successor_test() //****************************************************************************80 // // Purpose: // // SUBSET_COLEX_SUCCESSOR_TEST tests SUBSET_COLEX_SUCCESSOR. // // Licensing: // // This code is distributed under the GNU LGPL license. // // Modified: // // 03 December 2015 // // Author: // // John Burkardt // { const int n = 5; Console.WriteLine(""); Console.WriteLine("SUBSET_COLEX_SUCCESSOR_TEST"); Console.WriteLine(" SUBSET_COLEX_SUCCESSOR lists subsets of a set,"); Console.WriteLine(" using the colexicographic ordering."); int[] t = new int[n]; int rank = -1; for (;;) { int rank_old = rank; Subset.subset_colex_successor(n, ref t, ref rank); if (rank <= rank_old) { break; } string cout = " " + rank.ToString().PadLeft(4); int i; for (i = 0; i < n; i++) { cout += " " + t[i].ToString().PadLeft(4); } Console.WriteLine(cout); } }