COIN-OR::LEMON - Graph Library

Changeset 2596:9c00e972cdfd in lemon-0.x


Ignore:
Timestamp:
03/20/08 17:25:47 (12 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3479
Message:

Back porting commit 81563e019fa4

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lemon/random.h

    r2570 r2596  
    579579    }
    580580
     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
    581601    /// \brief Returns a random real number from the range [0, 1)
    582602    ///
  • test/random_test.cc

    r2553 r2596  
    3434  //Does gamma work with integer k?
    3535  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;
    3641}
Note: See TracChangeset for help on using the changeset viewer.