4#ifdef GARFIELD_HEED_INTERFACE
18#include "wcpplib/random/WRandomEngine.h"
33#include "wcpplib/cfortran/ftypes.h"
37#define RANLUX_INSTEAD_OF_RNDM
87extern unsigned long num_ranlux;
88const long step_of_print_ranlux = 1000;
91#ifdef FORT_UNDERSCORES_02
92#ifdef RANLUX_INSTEAD_OF_RNDM
93extern "C" void myiniteranlux__(
void);
94extern "C" void mysaveranlux__(
void);
95extern "C" void myextractranlux__(fint* ivec);
96extern "C" void ranlux__(ffloat* rvec, fint* len);
97extern "C" ffloat sranlux__(
void);
99#ifndef RANF_INSTEAD_OF_RNDM
100extern "C" ffloat rndm__(fint* arg);
102extern "C" ffloat ranfl__(
void);
104extern "C" void myiniterndm__(
void);
105extern "C" void mysaverndm__(
void);
106extern "C" void myextractrndm__(fint* iseed);
108extern "C" ffloat lranor__(ffloat* arg1, ffloat* arg2);
109extern "C" void lspois__(ffloat* amu, fint* n, fint* ierror);
110extern "C" void hisran__(ffloat* y, fint* n, ffloat* xlo, ffloat* xwid,
112extern "C" ffloat flande__(ffloat* x);
114#elif FORT_UNDERSCORES_01
115#ifdef RANLUX_INSTEAD_OF_RNDM
116extern "C" void myiniteranlux_(
void);
117extern "C" void mysaveranlux_(
void);
118extern "C" void myextractranlux_(fint* ivec);
119extern "C" void ranlux_(ffloat* rvec, fint* len);
120extern "C" ffloat sranlux_(
void);
122#ifndef RANF_INSTEAD_OF_RNDM
123extern "C" ffloat rndm_(fint* arg);
125extern "C" ffloat ranfl_(
void);
127extern "C" void myiniterndm_(
void);
128extern "C" void mysaverndm_(
void);
129extern "C" void myextractrndm_(fint* iseed);
131extern "C" ffloat lranor_(ffloat* arg1, ffloat* arg2);
132extern "C" void lspois_(ffloat* amu, fint* n, fint* ierror);
133extern "C" void hisran_(ffloat* y, fint* n, ffloat* xlo, ffloat* xwid,
135extern "C" ffloat flande_(ffloat* x);
137#elif FORT_UNDERSCORES_11
138#ifdef RANLUX_INSTEAD_OF_RNDM
139extern "C" void _myiniteranlux_(
void);
140extern "C" void _mysaveranlux_(
void);
141extern "C" void _myextractranlux_(fint* ivec);
142extern "C" void _ranlux_(ffloat* rvec, fint* len);
143extern "C" ffloat _sranlux_(
void);
145#ifndef RANF_INSTEAD_OF_RNDM
146extern "C" ffloat _rndm_(fint* arg);
148extern "C" ffloat _ranfl_(
void);
150extern "C" void _myiniterndm_(
void);
151extern "C" void _mysaverndm_(
void);
152extern "C" void _myextractrndm_(fint* iseed);
154extern "C" void _lspois_(ffloat* amu, fint* n, fint* ierror);
155extern "C" ffloat _lranor_(ffloat* arg1, ffloat* arg2);
156extern "C" void _hisran_(ffloat* y, fint* n, ffloat* xlo, ffloat* xwid,
158extern "C" ffloat _flande_(ffloat* x);
161#ifdef RANLUX_INSTEAD_OF_RNDM
165extern "C" void ranlux(ffloat* rvec, fint* len);
168#ifndef RANF_INSTEAD_OF_RNDM
169extern "C" ffloat rndm(fint* arg);
171extern "C" ffloat ranfl(
void);
173extern "C" void myiniterndm(
void);
174extern "C" void mysaverndm(
void);
175extern "C" void myextractrndm(fint* iseed);
177extern "C" void lspois(ffloat* amu, fint* n, fint* ierror);
178extern "C" ffloat
lranor(ffloat* arg1, ffloat* arg2);
179extern "C" void hisran(ffloat* y, fint* n, ffloat* xlo, ffloat* xwid,
185#ifdef RANLUX_INSTEAD_OF_RNDM
188#ifdef FORT_UNDERSCORES_02
190#elif FORT_UNDERSCORES_01
192#elif FORT_UNDERSCORES_11
200#ifdef FORT_UNDERSCORES_02
202#elif FORT_UNDERSCORES_01
204#elif FORT_UNDERSCORES_11
212#ifdef FORT_UNDERSCORES_02
213 myextractranlux__(ivec);
214#elif FORT_UNDERSCORES_01
215 myextractranlux_(ivec);
216#elif FORT_UNDERSCORES_11
217 _myextractranlux_(ivec);
224#ifdef FORT_UNDERSCORES_02
226#elif FORT_UNDERSCORES_01
228#elif FORT_UNDERSCORES_11
234 if (step_of_print_ranlux > 1) {
236 for (n = 0; n < len; n++) {
237 long rest = num_ranlux % step_of_print_ranlux;
239 int qp =
mcout.precision();
240 mcout.precision(FLT_DIG);
241 mcout <<
"RANLUX: num_ranlux=" << num_ranlux <<
" r=" <<
vec[n] <<
'\n';
247 mcout <<
"RANLUX: len = " << len <<
'\n';
250 int qp =
mcout.precision();
251 mcout.precision(FLT_DIG);
252 for (n = 0; n < len; n++) {
253 mcout <<
"n=" << n <<
"num_ranlux=" << num_ranlux++
254 <<
" vec[n]=" <<
vec[n] <<
'\n';
265#ifdef FORT_UNDERSCORES_02
267#elif FORT_UNDERSCORES_01
269#elif FORT_UNDERSCORES_11
277#ifdef FORT_UNDERSCORES_02
278 float r = sranlux__();
279#elif FORT_UNDERSCORES_01
280 float r = sranlux_();
281#elif FORT_UNDERSCORES_11
282 float r = _sranlux_();
287 if (step_of_print_ranlux > 1) {
288 rest = num_ranlux % step_of_print_ranlux;
291 int qp =
mcout.precision();
292 mcout.precision(FLT_DIG);
293 mcout <<
"SRANLUX: num_ranlux=" << num_ranlux <<
" r=" << r <<
'\n';
304#ifndef RANF_INSTEAD_OF_RNDM
306inline ffloat RNDM(
void) {
307#ifdef FORT_UNDERSCORES_02
309#elif FORT_UNDERSCORES_01
311#elif FORT_UNDERSCORES_11
318inline ffloat RNDM(
void) {
319#ifdef FORT_UNDERSCORES_02
321#elif FORT_UNDERSCORES_01
323#elif FORT_UNDERSCORES_11
330inline void INITE_RNDM(
void) {
331#ifdef FORT_UNDERSCORES_02
333#elif FORT_UNDERSCORES_01
335#elif FORT_UNDERSCORES_11
341inline void SAVE_RNDM(
void) {
342#ifdef FORT_UNDERSCORES_02
344#elif FORT_UNDERSCORES_01
346#elif FORT_UNDERSCORES_11
353inline void EXTRACT_RNDM(fint* iseed) {
354#ifdef FORT_UNDERSCORES_02
355 myextractrndm__(iseed);
356#elif FORT_UNDERSCORES_01
357 myextractrndm_(iseed);
358#elif FORT_UNDERSCORES_11
359 _myextractrndm_(iseed);
361 myextractrndm(iseed);
367inline ffloat
LRANOR(ffloat* arg1, ffloat* arg2) {
368#ifdef FORT_UNDERSCORES_02
369 return lranor__(arg1, arg2);
370#elif FORT_UNDERSCORES_01
371 return lranor_(arg1, arg2);
372#elif FORT_UNDERSCORES_11
373 return _lranor_(arg1, arg2);
375 return lranor(arg1, arg2);
379inline void LSPOIS(ffloat* amu, fint& n, fint& ierror) {
380#ifdef FORT_UNDERSCORES_02
381 lspois__(amu, &n, &ierror);
382#elif FORT_UNDERSCORES_01
383 lspois_(amu, &n, &ierror);
384#elif FORT_UNDERSCORES_11
385 _lspois_(amu, &n, &ierror);
391inline void HISRAN(ffloat* y, fint n, ffloat xlo, ffloat xwid, ffloat& xran) {
392#ifdef FORT_UNDERSCORES_02
393 hisran__(y, &n, &xlo, &xwid, &xran);
394#elif FORT_UNDERSCORES_01
395 hisran_(y, &n, &xlo, &xwid, &xran);
396#elif FORT_UNDERSCORES_11
397 _hisran_(y, &n, &xlo, &xwid, &xran);
399 hisran(y, &n, &xlo, &xwid, &xran);
404#ifdef FORT_UNDERSCORES_02
406#elif FORT_UNDERSCORES_01
408#elif FORT_UNDERSCORES_11
void lspois(ffloat *amu, fint *n, fint *ierror)
ffloat LRANOR(ffloat *arg1, ffloat *arg2)
void hisran(ffloat *y, fint *n, ffloat *xlo, ffloat *xwid, ffloat *xran)
void EXTRACT_RANLUX(fint *ivec)
void myextractranlux(fint *ivec)
void HISRAN(ffloat *y, fint n, ffloat xlo, ffloat xwid, ffloat &xran)
void LSPOIS(ffloat *amu, fint &n, fint &ierror)
void ranlux(ffloat *rvec, fint *len)
void RANLUX(ffloat *vec, fint len)
ffloat lranor(ffloat *arg1, ffloat *arg2)
HepRandomEngine & random_engine