ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/md_code/randomSPRNG.cpp
Revision: 220
Committed: Mon Dec 30 16:20:42 2002 UTC (21 years, 6 months ago) by chuckv
File size: 593 byte(s)
Log Message:
Added more code to randomSPRNG classes.

File Contents

# Content
1 #include <iostream>
2 #include <cmath>
3
4 #include "randomSPRNG.hpp"
5 #include "simError.h"
6
7
8 /* randomStreamSPRNF creates a new SPRNG stream for random numbers
9 */
10
11 int ranStreamSPRNG::nSPRNGStreams;
12
13 randomStreamSPRNG::randomStreamSPRNG(){
14 #ifdef IS_MPI
15
16
17
18 #else
19 nSPRNGStreams++;
20
21 myStreamNumber = nSPRNGStreams;
22
23 thisStream = init_sprng(GTYPE,streamnum,nstreams,SEED,SPRNG_DEFAULT);
24
25
26 #endif
27 }
28
29 randomStreamSPRNG::~randomStreamSPRNG(){
30
31 free_sprng(int *thisStream);
32 nSPRNGStreams--;
33
34
35 }
36
37
38 double getRanStreamSPRNG(){
39 double ranNum;
40 nanNum = sprng(thisStream);
41 return ranNum;
42 }