예제 #1
0
    public static void test()
    {
        ProblemSize ps = new()
        {
            chain_num = 10,
            cr_num    = 3,
            gen_num   = 10,
            pair_num  = 3,
            par_num   = 10
        };

        ProblemValue pv = new()
        {
            chain_filename         = "problem0_chain00.txt",
            gr_filename            = "problem0_gr.txt",
            gr_threshold           = 1.2,
            jumpstep               = 5,
            printstep              = 10,
            restart_read_filename  = "",
            restart_write_filename = "problem0_restart.txt",
            limits = new double[ps.par_num * 2]
        };

        for (int j = 0; j < ps.par_num; j++)
        {
            pv.limits[0 + j * 2] = -10.0;
            pv.limits[1 + j * 2] = +10.0;
        }

        Dream.dream(ref ps, ref pv, prior_sample, prior_density, sample_likelihood);
    }

    private static Dream.DensityResult prior_density(int par_num, double[] zp, int zpIndex = 0)
예제 #2
0
    public static void test()
    {
        ProblemSize ps = new()
        {
            chain_num = 10,
            cr_num    = 3,
            gen_num   = 10,
            pair_num  = 3,
            //par_num = 100;
            par_num = 5
        };

        covariance_initialize(ps.par_num);

        ProblemValue pv = new()
        {
            chain_filename         = "problem1_chain00.txt",
            gr_filename            = "problem1_gr.txt",
            gr_threshold           = 1.2,
            jumpstep               = 5,
            printstep              = 10,
            restart_read_filename  = "",
            restart_write_filename = "problem1_restart.txt",
            limits = new double[ps.par_num * 2]
        };

        for (int j = 0; j < ps.par_num; j++)
        {
            pv.limits[0 + j * 2] = 9.9;
            pv.limits[1 + j * 2] = +10.0;
        }

        Dream.dream(ref ps, ref pv, prior_sample, prior_density, sample_likelihood);
    }

    private static void covariance_initialize(int par_num)