Ejemplo n.º 1
0
    public static double p00_exact(ref p00Data data, int problem)

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    P00_EXACT returns the exact integral for any problem.
    //
    //  Discussion:
    //
    //    This routine provides a "generic" interface to the exact integral
    //    routines for the various problems, and allows a problem to be called
    //    by index (PROBLEM) rather than by name.
    //
    //    In most cases, the "exact" value of the integral is not given;
    //    instead a "respectable" approximation is available.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    31 Julyl 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    //  Parameters:
    //
    //    Input, int PROBLEM, the index of the problem.
    //
    //    Output, double P00_EXACT, the exact value of the integral.
    //
    {
        double exact;

        switch (problem)
        {
        case 1:
            exact = Problem01.p01_exact();
            break;

        case 2:
            exact = Problem02.p02_exact();
            break;

        case 3:
            exact = Problem03.p03_exact();
            break;

        case 4:
            exact = Problem04.p04_exact();
            break;

        case 5:
            exact = Problem05.p05_exact();
            break;

        case 6:
            exact = Problem06.p06_exact(ref data.p6data);
            break;

        case 7:
            exact = Problem07.p07_exact();
            break;

        case 8:
            exact = Problem08.p08_exact();
            break;

        default:
            Console.WriteLine("");
            Console.WriteLine("P00_EXACT - Fatal error!");
            Console.WriteLine("  Illegal problem number = " + problem + "");
            return(1);
        }

        return(exact);
    }