Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /sml/trunk/benchmarks/programs/tsp/rand-sig.sml
ViewVC logotype

Annotation of /sml/trunk/benchmarks/programs/tsp/rand-sig.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 193 - (view) (download)

1 : monnier 193 (* rand-sig.sml
2 :     *
3 :     * COPYRIGHT (c) 1993 by AT&T Bell Laboratories. See COPYRIGHT file for details.
4 :     * COPYRIGHT (c) 1998 by AT&T Laboratories.
5 :     *
6 :     * Signature for a simple random number generator.
7 :     *
8 :     *)
9 :    
10 :     signature RAND =
11 :     sig
12 :    
13 :     type rand = Word31.word
14 :    
15 :     val randMin : rand
16 :     val randMax : rand
17 :    
18 :     val random : rand -> rand
19 :     (* Given seed, return value randMin <= v <= randMax
20 :     * Iteratively using the value returned by random as the
21 :     * next seed to random will produce a sequence of pseudo-random
22 :     * numbers.
23 :     *)
24 :    
25 :     val mkRandom : rand -> unit -> rand
26 :     (* Given seed, return function generating a sequence of
27 :     * random numbers randMin <= v <= randMax
28 :     *)
29 :    
30 :     val norm : rand -> real
31 :     (* Map values in the range [randMin,randMax] to (0.0,1.0) *)
32 :    
33 :     val range : (int * int) -> rand -> int
34 :     (* Map v, randMin <= v <= randMax, to integer range [i,j]
35 :     * Exception -
36 :     * Fail if j < i
37 :     *)
38 :    
39 :     end (* RAND *)
40 :    

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0