PhotosDebugRandom.h
1 #ifndef _PhotosDebugRandom_included_
2 #define _PhotosDebugRandom_included_
3 /**
4  * @class PhotosDebugRandom
5  *
6  * @brief Random generator for debugging purposes
7  *
8  * Random generator with ability to save and restore state, set custom
9  * state and print current state. This class extends PhotosRandom class.
10  * PhotosRandom is a static class, therefore this extension works
11  * automatically for FORTRAN code without any changes.
12  * Our random generator is the C++ follow-up of FORTRAN generator by
13  * F. James DD-Report, November 1988. and G. Marsaglia and A. Zaman,
14  * FSU-SCR-87-50,
15  *
16  * @author Tomasz Przedzinski
17  * @date 28th June 2012
18  */
19 
20 #include "PhotosRandom.h"
21 
22 namespace Photospp
23 {
24 
26 {
27 public:
28  /* Save current state */
29  static void saveState();
30 
31  /* Restore state from save */
32  static void restoreState();
33 
34  /* Set current state provided by user */
35  static void setState(int i, int j, double c, double list[97]);
36 
37  /* Save state provided by user */
38  static void setSaveState(int i, int j, double c, double list[97]);
39 
40  /* Print state in a form that can be easily copied into the code */
41  static void print();
42 
43 private:
44  static int i97_saved;
45  static int j97_saved;
46  static double uran_saved[97];
47  static double cran_saved;
48 };
49 
50 } // namespace Photospp
51 #endif