#include <limits.h>
#include <float.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
Go to the source code of this file.
static void define_constants |
( |
void |
| ) |
|
|
static |
static void error |
( |
int |
no | ) |
|
|
static |
Definition at line 417 of file ranlxs.cxx.
References exit(), and printf().
Referenced by rlxs_get(), rlxs_init(), and rlxs_reset().
422 printf(
"Error in rlxs_init\n");
423 printf(
"Arithmetic on this machine is not suitable for ranlxs\n");
426 printf(
"Error in subroutine rlxs_init\n");
427 printf(
"Bad choice of luxury level (should be 0,1 or 2)\n");
430 printf(
"Error in subroutine rlxs_init\n");
431 printf(
"Bad choice of seed (should be between 1 and 2^31-1)\n");
434 printf(
"Error in rlxs_get\n");
435 printf(
"Undefined state (ranlxs is not initialized)\n");
438 printf(
"Error in rlxs_reset\n");
439 printf(
"Arithmetic on this machine is not suitable for ranlxs\n");
442 printf(
"Error in rlxs_reset\n");
443 printf(
"Unexpected input data\n");
446 printf(
"Program aborted\n");
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void ranlxs |
( |
float |
r[], |
|
|
int |
n |
|
) |
| |
void rlxs_get |
( |
int |
state[] | ) |
|
void rlxs_init |
( |
int |
level, |
|
|
int |
seed |
|
) |
| |
Definition at line 495 of file ranlxs.cxx.
References vec_t::c1, vec_t::c2, vec_t::c3, vec_t::c4, define_constants(), error(), i, pr, seed, and x.
Referenced by ranlxs().
498 int ibit,jbit,xbit[31];
501 if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24))
523 if ((
seed<=0)||(i!=0))
540 xbit[ibit]=(xbit[ibit]+xbit[jbit])%2;
static void define_constants(void)
static void error(int no)
void rlxs_reset |
( |
int |
state[] | ) |
|
Definition at line 613 of file ranlxs.cxx.
References vec_t::c1, vec_t::c2, vec_t::c3, vec_t::c4, define_constants(), error(), ir, pr, rlxs_size(), and x.
617 if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24))
627 if ((state[k+1]<0)||(state[k+1]>=167777216))
633 if (((state[97]!=0)&&(state[97]!=1))||
634 ((state[98]!=0)&&(state[98]!=1))||
635 ((state[99]!=0)&&(state[99]!=1))||
636 ((state[100]!=0)&&(state[100]!=1)))
652 if (((
pr!=109)&&(
pr!=202)&&(
pr!=397))||
static void define_constants(void)
static void error(int no)
static void update |
( |
void |
| ) |
|
|
static |