Exemplo n.º 1
0
    private static void subset_complement_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SUBSET_COMPLEMENT_TEST tests SUBSET_COMPLEMENT.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    06 January 2016
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        Console.WriteLine("");
        Console.WriteLine("SUBSET_COMPLEMENT_TEST");
        Console.WriteLine("  SUBSET_COMPLEMENT returns the complement of a subset.");
        Console.WriteLine("");
        const int n    = 5;
        int       seed = 123456789;

        int[] s1 = Subset.subset_random(n, ref seed);
        typeMethods.i4vec_transpose_print(n, s1, "  Subset S1:            ");

        int[] s2 = Subset.subset_complement(n, s1);
        typeMethods.i4vec_transpose_print(n, s2, "  S2 = complement of S1:");
    }