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

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST01 tests TRIANGLE_NCC_RULE_NUM, TRIANGLE_NCC_DEGREE, TRIANGLE_NCC_ORDER_NUM.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    30 January 2007
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int rule;

        Console.WriteLine("");
        Console.WriteLine("TEST01");
        Console.WriteLine("  TRIANGLE_NCC_RULE_NUM returns the number of rules;");
        Console.WriteLine("  TRIANGLE_NCC_DEGREE returns the degree of a rule;");
        Console.WriteLine("  TRIANGLE_NCC_ORDER_NUM returns the order of a rule.");

        int rule_num = NewtonCotesClosed.triangle_ncc_rule_num();

        Console.WriteLine("");
        Console.WriteLine("  Number of available rules = " + rule_num + "");
        Console.WriteLine("");
        Console.WriteLine("      Rule    Degree     Order");
        Console.WriteLine("");

        for (rule = 1; rule <= rule_num; rule++)
        {
            int order_num = NewtonCotesClosed.triangle_ncc_order_num(rule);
            int degree    = NewtonCotesClosed.triangle_ncc_degree(rule);
            Console.WriteLine("  " + rule.ToString(CultureInfo.InvariantCulture).PadLeft(8)
                              + "  " + degree.ToString(CultureInfo.InvariantCulture).PadLeft(8)
                              + "  " + order_num.ToString(CultureInfo.InvariantCulture).PadLeft(8) + "");
        }
    }