Ejemplo n.º 1
0
      // method invoked by the solver
      void fill_halos_sclr(const arr_t &a, const rng_t &j, const bool deriv = false)
      {
	using namespace idxperm;
        for (int i = 0; i < this->halo; ++i)
        { 
          for (int jj = j.first(); jj <= j.last(); jj++)
          {
            a(pi<d>(this->left_halo_sclr.last() - i,
                    jj)) 
            =
            a(pi<d>(this->left_edge_sclr + i,
                    this->polar_neighbours(jj)));
              
          }
        }
      }
Ejemplo n.º 2
0
      void fill_halos_vctr_nrml(const arr_t &a, const rng_t &j)
      {
	using namespace idxperm;
        for (int i = 0; i < this->halo; ++i)
        { 
          for (int jj = j.first(); jj <= j.last(); jj++)
          {
            a(pi<d>(this->rght_halo_sclr.first() + i,
                    jj + h)) 
            =
            a(pi<d>(this->rght_intr_vctr.last() - i,
                    this->polar_neighbours(jj) + h));
              
          }
        }
      }
Ejemplo n.º 3
0
  void fun() {
    for(int i=0;i<N;i++) {
      for(int j=0;j<N;j++) {
	gr.random();
      }
    }
    return;
  }
Ejemplo n.º 4
0
 // ctor
 cyclic(
   const rng_t &i, const rng_t &j, int hlo
 ) :
   left_halo(i.first()-hlo, i.first()-1),
   rght_edge(i.last()-hlo+1, i.last()  ),
   rght_halo(i.last()+1, i.last()+hlo  ),
   left_edge(i.first(), i.first()+hlo-1)
 {} 
Ejemplo n.º 5
0
      // ctor
      bcond_t(const rng_t &i, const int halo) :
        halo(halo),
        // sclr
	left_edge_sclr(
          i.first()
        ),
	rght_edge_sclr(
          i.last()
        ),
	left_halo_sclr(
          (i^halo).first(), 
          (i^halo).first() + halo - 1
        ),
	rght_halo_sclr(
          (i^halo).last() - (halo - 1), 
          (i^halo).last()
        ),
	left_intr_sclr(
          (i^(-1)).first(), 
          (i^(-1)).first() + halo - 1
        ),
	rght_intr_sclr(
          (i^(-1)).last() - (halo - 1), 
          (i^(-1)).last()
        ),
        // vctr
        left_halo_vctr(
          (i^h^(halo-1)).first(), 
          (i^h^(halo-1)).first() + halo - 1
        ),
        rght_halo_vctr(
          (i^h^(halo-1)).last() - (halo - 1), 
          (i^h^(halo-1)).last()
        ),
        left_intr_vctr(
          (i^h^(-1)).first(),
          (i^h^(-1)).first() + halo - 1
        ),
        rght_intr_vctr(
          (i^h^(-1)).last() - (halo - 1), 
          (i^h^(-1)).last()
        )
      {} 
Ejemplo n.º 6
0
 mlocuspop_popgenmut_fixture(const unsigned seed = 0)
     /*! N=1000, 4 loci */
     : pop(poptype(1000, make_boundaries())), generation(0), rng{ seed },
       mu(std::vector<double>(nloci, per_locus_rate)),
       rbw(std::vector<double>(nloci - 1, per_locus_rate)),
       mutmodels{ make_mutmodels() }, recmodels{ make_recmodels() },
       vdmm(fill_vdmm()),
       bound_mmodels(fwdpp::extensions::bind_vec_dmm(rng.get(), vdmm)),
       vdrm(fill_vdrm()), bound_recmodels{ fill_bound_recmodels() }
 {
 }