Ejemplo n.º 1
0
solver::solver(physical_world * pass_object, unsigned int max_iterations, double treshold)
{
    // physical_object = new physical_world(pass_object);
    physical_object = pass_object;
    max_it = max_iterations;
    conv_treshold = treshold;

    run_iteration();
}
Ejemplo n.º 2
0
 /**
  * Run a microbenchmkark for a constructed fixture.
  *
  * Run the warmup iterations and then run the actual iterations for
  * the test.  The results of the test are ignored during the warmup
  * phase.
  *
  * @param fixture the object under test
  * @param r where to store the results of the test
  * @param size the size of the test
  */
 void run_base(Fixture& fixture, results& r, int size) {
   for (int i = 0; i != config_.warmup_iterations(); ++i) {
     (void)clock::now();
     fixture.run();
   }
   r.reserve(r.size() + config_.iterations());
   for (int i = 0; i != config_.iterations(); ++i) {
     run_iteration(fixture, r, size);
   }
 }
Ejemplo n.º 3
0
solver::solver(physical_world * pass_object, unsigned int max_iterations, double treshold,int N_n, int N_p)
{
    // physical_object = new physical_world(pass_object);
    physical_object = pass_object;
    max_it = max_iterations;
    conv_treshold = treshold;
    Number_of_neutrons = N_n;
    Number_of_protons = N_p;
    Nbasis = physical_object->N_max;
    Nparticles = physical_object->N_part;
    h = arma::zeros<mat>(Nbasis,Nbasis);
    Init_rho();
    e = arma::ones<vec>(Nbasis);

    run_iteration();
}
Ejemplo n.º 4
0
void
test_harness(struct unit_test tests[MAX_TESTS], int iterations)
{
    int i, n, kqfd;
    struct test_context *ctx;

    printf("Running %d iterations\n", iterations);

    testing_begin();

    ctx = calloc(1, sizeof(*ctx));

    test(peer_close_detection, ctx);

    test(kqueue, ctx);
    test(kevent, ctx);

    if ((kqfd = kqueue()) < 0)
        die("kqueue()");

    test(ev_receipt, ctx);
    /* TODO: this fails now, but would be good later 
    test(kqueue_descriptor_is_pollable);
    */

    free(ctx);

    n = 0;
    for (i = 0; i < iterations; i++) {
        ctx = calloc(1, sizeof(*ctx));
        if (ctx == NULL)
            abort();
        ctx->iteration = n++;
        ctx->kqfd = kqfd;
        memcpy(&ctx->tests, tests, sizeof(ctx->tests));
        ctx->iterations = iterations;

        run_iteration(ctx);
    }
    testing_end();

    close(kqfd);
}