PhotosDebugRandom.h

00001 #ifndef _PhotosDebugRandom_included_
00002 #define _PhotosDebugRandom_included_
00003 /**
00004  * @class PhotosDebugRandom
00005  *
00006  * @brief Random generator for debugging purposes
00007  *
00008  * Random generator with ability to save and restore state, set custom
00009  * state and print current state. This class extends PhotosRandom class.
00010  * PhotosRandom is a static class, therefore this extension works
00011  * automatically for FORTRAN code without any changes.
00012  * Our random generator is the C++ follow-up of FORTRAN generator by 
00013  * F. James DD-Report, November 1988. and  G. Marsaglia and A. Zaman,  
00014  * FSU-SCR-87-50,
00015  *
00016  * @author Tomasz Przedzinski
00017  * @date 28th June 2012
00018  */
00019  
00020 #include "PhotosRandom.h"
00021 
00022 namespace Photospp
00023 {
00024 
00025 class PhotosDebugRandom : PhotosRandom
00026 {
00027 public:
00028   /* Save current state */
00029   static void saveState();
00030   
00031   /* Restore state from save */
00032   static void restoreState();
00033 
00034   /* Set current state provided by user */
00035   static void setState(int i, int j, double c, double list[97]);
00036 
00037   /* Save state provided by user */
00038   static void setSaveState(int i, int j, double c, double list[97]);
00039   
00040   /* Print state in a form that can be easily copied into the code */
00041   static void print();
00042 
00043 private:
00044   static int i97_saved;
00045   static int j97_saved;
00046   static double uran_saved[97];
00047   static double cran_saved;
00048 };
00049 
00050 } // namespace Photospp
00051 #endif
Generated on Sun Oct 20 20:23:56 2013 for C++InterfacetoPHOTOS by  doxygen 1.6.3