1 /* ========================================================================== */
2 /* === MATLAB/rand48.c ====================================================== */
3 /* ========================================================================== */
4
5 /* METIS uses drand48 and srand48, which conform to the SVID standard. The
6 * lcc compiler for Windows shipped with MATLAB does not include the drand48
7 * and srand48 routines. This file is a cheap replacement using the
8 * more-common rand and srand instead (which lcc does have).
9 *
10 * This file is only used when compiling CHOLMOD with the cholmod_make.m,
11 * on the PC, with the lcc compiler.
12 */
13
14 #include <stdlib.h>
15
drand48(void)16 double drand48 (void)
17 {
18 return (((double) (rand ( ))) / ((double) RAND_MAX)) ;
19 }
20
srand48(long int seed)21 void srand48 (long int seed)
22 {
23 srand ((unsigned int) seed) ;
24 }
25