Ejemplo n.º 1
0
    public static void p00_fun(ref p00Data data, int problem, int option, int n, double[] x, ref double[] f)

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    P00_FUN evaluates the integrand for any problem.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    31 July 2010
    //
    //  Author:
    //
    //    John Burkardt
    //
    //  Parameters:
    //
    //    Input, int PROBLEM, the index of the problem.
    //
    //    Input, int OPTION:
    //    0, integrand is f(x).
    //    1, integrand is exp(-x*x) * f(x);
    //    2, integrand is exp(-x*x/2) * f(x);
    //
    //    Input, int N, the number of points.
    //
    //    Input, double X[N], the evaluation points.
    //
    //    Output, double F[N], the function values.
    //
    {
        switch (problem)
        {
        case 1:
            Problem01.p01_fun(option, n, x, ref f);
            break;

        case 2:
            Problem02.p02_fun(option, n, x, ref f);
            break;

        case 3:
            Problem03.p03_fun(option, n, x, ref f);
            break;

        case 4:
            Problem04.p04_fun(option, n, x, ref f);
            break;

        case 5:
            Problem05.p05_fun(option, n, x, ref f);
            break;

        case 6:
            Problem06.p06_fun(ref data.p6data, option, n, x, ref f);
            break;

        case 7:
            Problem07.p07_fun(option, n, x, ref f);
            break;

        case 8:
            Problem08.p08_fun(option, n, x, ref f);
            break;

        default:
            Console.WriteLine("");
            Console.WriteLine("P00_FUN - Fatal error!");
            Console.WriteLine("  Illegal problem number = " + problem + "");
            break;
        }
    }