2 #include "PhotosDebugRandom.h"
8 int PhotosDebugRandom::i97_saved = 0;
9 int PhotosDebugRandom::j97_saved = 0;
10 double PhotosDebugRandom::uran_saved[97] = { 0 };
11 double PhotosDebugRandom::cran_saved = 0;
13 void PhotosDebugRandom::saveState()
19 for (
int i = 0; i < 97; i++) uran_saved[i] = uran[i];
22 void PhotosDebugRandom::restoreState()
28 for (
int i = 0; i < 97; i++) uran[i] = uran_saved[i];
31 void PhotosDebugRandom::setState(
int i,
int j,
double c,
double list[97])
36 for (
int ii = 0; ii < 97; ii++) uran[ii] = list[ii];
39 void PhotosDebugRandom::setSaveState(
int i,
int j,
double c,
double list[97])
44 for (
int ii = 0; ii < 97; ii++) uran_saved[ii] = list[ii];
47 void PhotosDebugRandom::print()
49 int coutPrec = cout.precision(18);
50 ios_base::fmtflags flags = cout.setf(ios_base::scientific, ios_base::floatfield);
54 cout <<
"double uran_state[97] = { ";
55 for (
int i = 0; i < 96; i++) cout << uran[i] <<
", ";
56 cout << uran[96] <<
" };" << endl << endl;
57 cout <<
"PhotosDebugRandom::setState( " << i97 <<
", " << j97 <<
", " << cran <<
", uran_state );" << endl;
62 cout.precision(coutPrec);
static void RedirectOutput(void(*func)(), ostream &where= *out)
Redirects output to log.
static void RevertOutput()
WARNING! If You're redirecting more than one function, do not forget to use RevertOutput() afterwards...