Subversion Repositories gelsvn

Rev

Rev 601 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 601 Rev 609
1
/* ----------------------------------------------------------------------- *
1
/* ----------------------------------------------------------------------- *
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
3
 * Copyright (C) the authors and DTU Informatics
3
 * Copyright (C) the authors and DTU Informatics
4
 * For license and list of authors, see ../../doc/intro.pdf
4
 * For license and list of authors, see ../../doc/intro.pdf
5
 * ----------------------------------------------------------------------- */
5
 * ----------------------------------------------------------------------- */
6
 
6
 
7
#include <time.h>
7
#include <time.h>
8
#include <iostream>
8
#include <iostream>
9
#include "../CGLA/CGLA.h"
9
#include "../CGLA/CGLA.h"
10
#include "HashKey.h"
10
#include "HashKey.h"
11
 
11
 
12
using namespace CGLA;
12
using namespace CGLA;
13
 
13
 
14
namespace Util
14
namespace Util
15
{
15
{
16
	
16
	
17
	int randoms1[UCHAR_MAX];
17
	int randoms1[UCHAR_MAX];
18
	int randoms2[UCHAR_MAX];
18
	int randoms2[UCHAR_MAX];
19
	int randoms3[UCHAR_MAX];
19
	int randoms3[UCHAR_MAX];
20
 
20
 
21
 
21
 
22
	
22
	
23
	bool init_randoms()
23
	bool init_randoms()
24
	{
24
	{
25
		gel_srand(1);
25
		gel_srand(1);
26
		int i;
26
		int i;
27
		for(i=0;i<UCHAR_MAX-1;i++)
27
		for(i=0;i<UCHAR_MAX-1;i++)
28
			randoms1[i] = gel_rand();
28
			randoms1[i] = gel_rand();
29
		for(i=0;i<UCHAR_MAX-1;i++)
29
		for(i=0;i<UCHAR_MAX-1;i++)
30
		randoms2[i] = gel_rand();
30
		randoms2[i] = gel_rand();
31
		for(i=0;i<UCHAR_MAX-1;i++)
31
		for(i=0;i<UCHAR_MAX-1;i++)
32
			{
32
			{
33
				randoms3[i] = gel_rand();
33
				randoms3[i] = gel_rand();
34
			}
34
			}
35
		return true;
35
		return true;
36
	}
36
	}
37
 
37
 
38
	void do_init_randoms()
38
	void do_init_randoms()
39
	{
39
	{
40
		static bool randoms_are_initialized = init_randoms();
40
		init_randoms();
41
	}
41
	}
42
 
42
 
43
}
43
}
44
 
44