22#include <lal/LALStdlib.h>
23#include <lal/Random.h>
24#include <lal/Sequence.h>
25#include <lal/XLALError.h>
80static const INT4 m = 2147483647;
96 i =
a*(i - k*
q) -
r*k;
127 for ( n = 0; n < 8; ++n )
131 for ( n = 0; n <
sizeof( params->
v )/
sizeof( *params->
v ); ++n )
135 params->
y = params->
v[0];
158 params->
y = params->
v[n];
176 if ( ! deviates || ! deviates->
data || ! params )
181 data = deviates->
data;
182 half = deviates->
length/2;
200 while (rsq >= 1 || rsq == 0);
202 fac = sqrt(-2*log(rsq)/rsq);
224 while (rsq >= 1 || rsq == 0);
226 fac = sqrt(-2*log(rsq)/rsq);
249 deviate = deviates->
data[0];
#define ABORT(statusptr, code, mesg)
#define ASSERT(assertion, statusptr, code, mesg)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define XLAL_NUM_ELEM(x)
MACRO which gives the number of elements in a fixed-size array.
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
REAL4 XLALNormalDeviate(RandomParams *params)
INT4 XLALBasicRandom(INT4 i)
RandomParams * XLALCreateRandomParams(INT4 seed)
void LALCreateRandomParams(LALStatus *status, RandomParams **params, INT4 seed)
REAL4 XLALUniformDeviate(RandomParams *params)
void XLALDestroyRandomParams(RandomParams *params)
void LALNormalDeviates(LALStatus *status, REAL4Vector *deviates, RandomParams *params)
int XLALNormalDeviates(REAL4Vector *deviates, RandomParams *params)
void LALUniformDeviate(LALStatus *status, REAL4 *deviate, RandomParams *params)
void LALDestroyRandomParams(LALStatus *status, RandomParams **params)
void XLALResetRandomParams(RandomParams *params, INT4 seed)
#define RANDOMH_ENNUL
Non-null pointer.
#define RANDOMH_ESIZE
Invalid size.
#define RANDOMH_ENULL
Null pointer.
REAL4Sequence * XLALCreateREAL4Sequence(size_t length)
void XLALDestroyREAL4Sequence(REAL4Sequence *sequence)
#define XLAL_ERROR_NULL(...)
Macro to invoke a failure from a XLAL routine returning a pointer.
#define xlalErrno
Modifiable lvalue containing the XLAL error number.
#define XLAL_ERROR(...)
Macro to invoke a failure from a XLAL routine returning an integer.
#define XLAL_IS_REAL4_FAIL_NAN(val)
Tests if val is a XLAL REAL4 failure NaN.
#define XLAL_ERROR_REAL4(...)
Macro to invoke a failure from a XLAL routine returning a REAL4.
int XLALClearErrno(void)
Clears the XLAL error number, returns the old value.
@ XLAL_EBADLEN
Inconsistent or invalid length.
@ XLAL_ENOMEM
Memory allocation error.
@ XLAL_SUCCESS
Success return value (not an error number)
@ XLAL_EFAULT
Invalid pointer.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
LAL status structure, see The LALStatus structure for more details.
Vector of type REAL4, see DATATYPE-Vector types for more details.
REAL4 * data
Pointer to the data array.
UINT4 length
Number of elements in array.
This structure contains the parameters necessary for generating the current sequence of random number...