Timothy  0.9
Tissue Modelling Framework
 All Data Structures Files Functions Variables Typedefs Macros
random.c
Go to the documentation of this file.
1 /* **************************************************************************
2  * This file is part of Timothy
3  *
4  * Copyright (c) 2014/15 Maciej Cytowski
5  * Copyright (c) 2014/15 ICM, University of Warsaw, Poland
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  * *************************************************************************/
22 
23 #include <stdlib.h>
24 #include <sprng.h>
25 
26 #include "global.h"
27 
36 {
37  int gtype; // RNG type: DEFAULT_RNG_TYPE, SPRNG_LFG, SPRNG_LCG, SPRNG_LCG64, SPRNG_CMRG, SPRNG_MLFG, SPRNG_PMLCG
38  gtype = DEFAULT_RNG_TYPE;
39  stream = init_sprng(gtype, MPIrank, MPIsize, SEED, SPRNG_DEFAULT);
40 }
41 
46 {
47  free_sprng(stream);
48 }
int MPIrank
Definition: global.h:134
int MPIsize
Definition: global.h:135
contains the most important global variables, arrays and defines
void randomStreamFree()
Definition: random.c:45
void randomStreamInit()
Definition: random.c:35
#define SEED
Definition: global.h:274
int * stream
Definition: global.h:275