コード例 #1
0
    private static void sgmga_aniso_balance_test(double alpha_max, int dim_num,
                                                 double[] level_weight)

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    SGMGA_ANISO_BALANCE_TEST calls SGMGA_ANISO_BALANCE.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    03 February 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int dim;

        Console.WriteLine("");
        Console.WriteLine("SGMGA_ANISO_BALANCE_TEST");
        Console.WriteLine("  ALPHA_MAX = " + alpha_max + "");
        Console.WriteLine("  Input weight sum: "
                          + typeMethods.r8vec_sum(dim_num, level_weight) + "");
        string cout = "";

        for (dim = 0; dim < dim_num; dim++)
        {
            cout += "  " + level_weight[dim].ToString(CultureInfo.InvariantCulture).PadLeft(12);
        }

        Console.WriteLine(cout);

        double[] level_weight2 = SGMGAniso.sgmga_aniso_balance(alpha_max, dim_num, level_weight);

        Console.WriteLine("  Output weight sum: "
                          + typeMethods.r8vec_sum(dim_num, level_weight2) + "");
        cout = "";
        for (dim = 0; dim < dim_num; dim++)
        {
            cout += "  " + level_weight2[dim].ToString(CultureInfo.InvariantCulture).PadLeft(12);
        }

        Console.WriteLine(cout);
    }