Beispiel #1
0
    private static void Main()
/******************************************************************************/
//
//  Purpose:
//
//    MAIN is the main program for SHEPARD_INTERP_1D_TEST.
//
//  Discussion:
//
//    SHEPARD_INTERP_1D_TEST tests the SHEPARD_INTERP_1D library.
//
//  Licensing:
//
//    This code is distributed under the GNU LGPL license.
//
//  Modified:
//
//    03 July 2015
//
//  Author:
//
//    John Burkardt
//
    {
        int p_num = 5;

        double[] p_test =
        {
            0.0, 1.0, 2.0, 4.0, 8.0
        }

        ;

        Console.WriteLine("");
        Console.WriteLine("SHEPARD_INTERP_1D_TEST:");
        Console.WriteLine("  Test the SHEPARD_INTERP_1D library.");
        Console.WriteLine("  The R8LIB library is needed.");
        Console.WriteLine("  This test needs the TEST_INTERP library as well.");

        shepard_basis_1d_test();

        shepard_value_1d_test();

        int prob_num = TestInterp.p00_prob_num();

        for (int prob = 1; prob <= prob_num; prob++)
        {
            for (int j = 0; j < p_num; j++)
            {
                double p = p_test[j];
                test01(prob, p);
            }
        }

        Console.WriteLine("");
        Console.WriteLine("SHEPARD_INTERP_1D_TEST:");
        Console.WriteLine("  Normal end of execution.");
        Console.WriteLine("");
    }
Beispiel #2
0
    private static void Main()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    MAIN is the main program for VANDERMONDE_INTERP_1D_TEST.
    //
    //  Discussion:
    //
    //    VANDERMONDE_INTERP_1D_TEST tests the VANDERMONDE_INTERP_1D library.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    03 July 2013
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int prob;

        Console.WriteLine("");
        Console.WriteLine("VANDERMONDE_INTERP_1D_TEST:");
        Console.WriteLine("  Test the VANDERMONDE_INTERP_1D library.");
        Console.WriteLine("  The QR_SOLVE library is needed.");
        Console.WriteLine("  The R8LIB library is needed.");
        Console.WriteLine("  This test needs the CONDITION library.");
        Console.WriteLine("  This test needs the TEST_INTERP library.");

        vandermonde_coef_1d_test();

        vandermonde_matrix_1d_test();

        vandermonde_value_1d_test();

        int prob_num = TestInterp.p00_prob_num();

        for (prob = 1; prob <= prob_num; prob++)
        {
            test01(prob);
        }

        for (prob = 1; prob <= prob_num; prob++)
        {
            test02(prob);
        }

        Console.WriteLine("");
        Console.WriteLine("VANDERMONDE_INTERP_1D_TEST:");
        Console.WriteLine("  Normal end of execution.");
        Console.WriteLine("");
    }
Beispiel #3
0
    private static void Main()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    MAIN is the main program for PWL_INTERP_1D_TEST.
    //
    //  Discusion:
    //
    //    PWL_INTERP_1D_TEST tests the PWL_INTERP_1D library.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    01 July 2015
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int prob;

        Console.WriteLine("");
        Console.WriteLine("PWL_INTERP_1D_TEST:");
        Console.WriteLine("  Test the PWL_INTERP_1D library.");
        Console.WriteLine("  The R8LIB library is needed.");
        Console.WriteLine("  The test needs the TEST_INTERP library.");

        pwl_basis_1d_test();

        pwl_value_1d_test();

        int prob_num = TestInterp.p00_prob_num();

        for (prob = 1; prob <= prob_num; prob++)
        {
            pwl_interp_1d_test01(prob);
        }

        Console.WriteLine("");
        Console.WriteLine("PWL_INTERP_1D_TEST:");
        Console.WriteLine("  Normal end of execution.");
        Console.WriteLine("");
    }
Beispiel #4
0
    private static void Main()
    //****************************************************************************80
    //
    //  Purpose:
    //
    //    MAIN is the main program for RBF_INTERP_1D_TEST.
    //
    //  Discussion:
    //
    //    RBF_INTERP_1D_TEST tests the RBF_INTERP_1D library.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    05 October 2012
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int prob;

        Console.WriteLine("");
        Console.WriteLine("RBF_INTERP_1D_TEST:");
        Console.WriteLine("  Test the RBF_INTERP_1D library.");
        Console.WriteLine("  The R8LIB library is needed.");
        Console.WriteLine("  The test needs the TEST_INTERP library.");

        int prob_num = TestInterp.p00_prob_num();

        for (prob = 1; prob <= prob_num; prob++)
        {
            //
            //  Determine an appropriate value of R0, the spacing parameter.
            //
            int      nd = TestInterp.p00_data_num(prob);
            double[] xy = TestInterp.p00_data(prob, 2, nd);
            double[] xd = new double[nd];
            int      i;
            for (i = 0; i < nd; i++)
            {
                xd[i] = xy[0 + i * 2];
            }

            double xmax = typeMethods.r8vec_max(nd, xd);
            double xmin = typeMethods.r8vec_min(nd, xd);
            double r0   = (xmax - xmin) / (nd - 1);

            test01(prob, RadialBasisFunctions.phi1, "phi1", r0);
            test01(prob, RadialBasisFunctions.phi2, "phi2", r0);
            test01(prob, RadialBasisFunctions.phi3, "phi3", r0);
            test01(prob, RadialBasisFunctions.phi4, "phi4", r0);
        }

        /*
         * Terminate.
         */
        Console.WriteLine("");
        Console.WriteLine("RBF_INTERP_1D_TEST:");
        Console.WriteLine("  Normal end of execution.");
        Console.WriteLine("");
    }