Up Top       Prev STD_OUTPUT      Next STRING



class interface STD_RAND
   -- Press' standard generator, which uses the minimal standard
   -- and then uses shuffling to break up short order corelations.

creation
   make
      -- Create the generator with an automatic hazardous setting of
      -- the seed_value.
      -- Because automatic setting may be done using internal address
      -- of Current for example, it may produces platform dependent
      -- behavior or compilation-mode dependant behavior.
      -- Also consider with_seed to chose the most appropriate.


   with_seed (seed_value: INTEGER)
      -- Create the generator with an explicit seed_value.

      require
         valid_seed: seed_value > 0 and seed_value < im

feature(s) from GEN_RAND
   -- Creation procedures:

   make
      -- Create the generator with an automatic hazardous setting of
      -- the seed_value.
      -- Because automatic setting may be done using internal address
      -- of Current for example, it may produces platform dependent
      -- behavior or compilation-mode dependant behavior.
      -- Also consider with_seed to chose the most appropriate.


   with_seed (seed_value: INTEGER)
      -- Create the generator with an explicit seed_value.

      require
         valid_seed: seed_value > 0 and seed_value < im

feature(s) from GEN_RAND   next
      -- Compute next random number in sequence.


feature(s) from GEN_RAND
   -- No modifications:

   last_double: DOUBLE
      -- Look at the last computed number.
      -- Range 0 to 1

      ensure
         Result > 0 and Result <= 1

   last_real: REAL
      -- Look at the last computed number.
      -- Range 0 to 1

      ensure
         Result > 0 and Result <= 1

   last_integer (n: INTEGER): INTEGER
      -- Look the last computed number.
      -- Range 1 to n.

      require
         n >= 1
      ensure
         1 <= Result and Result <= n

feature(s) from MIN_STAND   im: INTEGER


invariant
   good_seed: seed > 0 and seed < im;

end of STD_RAND




All classes inherit from ANY, ANY inherits from PLATFORM and PLATFORM inherits from GENERAL.



Generated by short -html_deb on 31 March 2005.