Exemplo n.º 1
0
        static void test02()
        //****************************************************************************80
        //
        //  Purpose:
        //
        //    TEST02 tests R8MAT_WRITE.
        //
        //  Licensing:
        //
        //    This code is distributed under the GNU LGPL license.
        //
        //  Modified:
        //
        //    05 February 2012
        //
        //  Author:
        //
        //    John Burkardt
        //
        {
            const int    dim_num       = 4;
            const string file_out_name = "box_behnken_04_33.txt";

            double[] range =
            {
                0.0, 0.0, 0.0, 0.0,
                1.0, 1.0, 1.0, 1.0
            };

            Console.WriteLine();
            Console.WriteLine("TEST02");
            Console.WriteLine("  R8MAT_WRITE writes a Box-Behnken dataset");
            Console.WriteLine("  to a file.");

            typeMethods.r8mat_transpose_print(dim_num, 2, range, "  The ranges:");

            int x_num = BoxBehnken.box_behnken_size(dim_num);

            Console.WriteLine();
            Console.WriteLine("  For dimension DIM_NUM = " + dim_num);
            Console.WriteLine("  the Box-Behnken design is of size " + x_num);

            double[] x = BoxBehnken.box_behnken(dim_num, x_num, range);

            typeMethods.r8mat_write(file_out_name, dim_num, x_num, x);

            Console.WriteLine();
            Console.WriteLine("  The data was written to the file \"" + file_out_name + "\".");
        }
Exemplo n.º 2
0
        static void test01( )
        //****************************************************************************80
        //
        //  Purpose:
        //
        //    TEST01 tests BOX_BEHNKEN.
        //
        //  Licensing:
        //
        //    This code is distributed under the GNU LGPL license.
        //
        //  Modified:
        //
        //    25 October 2008
        //
        //  Author:
        //
        //    John Burkardt
        //
        {
            const int dim_num = 3;

            double[] range =
            {
                0.0, 10.0, 5.0,
                1.0, 11.0, 15.0
            };

            Console.WriteLine();
            Console.WriteLine("TEST01");
            Console.WriteLine("  BOX_BEHNKEN computes a Box-Behnken dataset.");

            typeMethods.r8mat_transpose_print(dim_num, 2, range, "  The ranges:");

            int x_num = BoxBehnken.box_behnken_size(dim_num);

            Console.WriteLine();
            Console.WriteLine("  For dimension DIM_NUM = " + dim_num);
            Console.WriteLine("  the Box-Behnken design is of size " + x_num);

            double[] x = BoxBehnken.box_behnken(dim_num, x_num, range);

            typeMethods.r8mat_transpose_print(dim_num, x_num, x, "  The Box-Behnken design:");
        }