Exemple #1
0
  void positive_jump_impl(RngBase& rng, double& value, const double scale) {
    double new_value;
    do {
      new_value = value + rng.normal() * scale;
    } while (new_value < 0);

    value = new_value;
  }
Exemple #2
0
 void jump_impl(RngBase& rng, double& value, const double scale) {
   value += rng.normal() * scale;
 }
Exemple #3
0
 void jump_impl(RngBase& rng, T& value, const double scale) {
   for(size_t i = 0; i < value.n_elem; i++) {
     value[i] += rng.normal() * scale;
   }
 }
Exemple #4
0
 // needed for completeness
 void jump_impl(RngBase& rng, int& value, const double scale) {
   value += lrint(rng.normal() * scale);
 }