Changeset 2596:9c00e972cdfd in lemon0.x
 Timestamp:
 03/20/08 17:25:47 (16 years ago)
 Branch:
 default
 Phase:
 public
 Convert:
 svn:c9d7d8f590d60310b91f818b3a526b0e/lemon/trunk@3479
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

lemon/random.h
r2570 r2596 579 579 } 580 580 581 /// \brief Seeding random sequence 582 /// 583 /// Seeding the random sequence. The current number type will be 584 /// converted to the architecture word type. 585 template <typename Number> 586 void seed(Number seed) { 587 _random_bits::Initializer<Number, Word>::init(core, seed); 588 } 589 590 /// \brief Seeding random sequence 591 /// 592 /// Seeding the random sequence. The given range should contain 593 /// any number type and the numbers will be converted to the 594 /// architecture word type. 595 template <typename Iterator> 596 void seed(Iterator begin, Iterator end) { 597 typedef typename std::iterator_traits<Iterator>::value_type Number; 598 _random_bits::Initializer<Number, Word>::init(core, begin, end); 599 } 600 581 601 /// \brief Returns a random real number from the range [0, 1) 582 602 /// 
test/random_test.cc
r2553 r2596 34 34 //Does gamma work with integer k? 35 35 a=rnd.gamma(4.0,0); 36 37 lemon::rnd.seed(100); 38 lemon::rnd.seed(seed_array, seed_array + 39 (sizeof(seed_array) / sizeof(seed_array[0]))); 40 return 0; 36 41 }
Note: See TracChangeset
for help on using the changeset viewer.