Ejemplo n.º 1
0
    private static void subset_intersect_test()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SUBSET_INTERSECT_TEST tests SUBSET_INTERSECT.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    09 January 2016
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        Console.WriteLine("");
        Console.WriteLine("SUBSET_INTERSECT_TEST");
        Console.WriteLine("  SUBSET_INTERSECT returns the intersection of two subsets.");
        Console.WriteLine("");

        const int n    = 7;
        int       seed = 123456789;

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

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

        int[] s3 = Subset.subset_intersect(n, s1, s2);
        typeMethods.i4vec_transpose_print(n, s3, "  Intersect:");
    }