25#include <lal/LALStdlib.h>
26#include <lal/LALgetopt.h>
27#include <lal/AVFactories.h>
28#include <lal/Random.h>
29#include <lal/LALString.h>
61#define CODES(x) CODES_(x)
76main (
int argc,
char *argv[])
78 const INT4 numPoints = 999;
104 printf (
"\n===== Allocate Memory =====\n");
108 TestStatus (&
status, CODES(0), 1);
120 printf (
"\n===== Test Random Routines =====\n");
135 for (i = 0; i < vector->
length; ++i)
146 FILE *
fp = fopen (
"PrintVector.000",
"w");
147 for (i = 0; i < vector->
length; ++i)
167 FILE *
fp = fopen (
"PrintVector.001",
"w");
168 for (i = 0; i < vector->
length; ++i)
185 printf (
"\n===== Check Errors =====\n");
192 printf (
"\n----- Invalid Length Error: Code 4\n");
214 printf (
"\n===== Clean up and Exit =====\n");
220 TestStatus (&
status, CODES(0), 1);
248 if ((tok = strtok (str,
" ")))
252 if (
status->statusCode == atoi (tok))
257 while ((tok = strtok (NULL,
" ")));
261 if (
status->statusCode == atoi (str))
268 fprintf (stderr,
"\nExiting to system with code %d\n", exitcode);
283 fprintf (stderr,
"Options:\n");
284 fprintf (stderr,
" -h print this message\n");
285 fprintf (stderr,
" -q quiet: run silently\n");
286 fprintf (stderr,
" -v verbose: print extra information\n");
287 fprintf (stderr,
" -d level set lalDebugLevel to level\n");
288 fprintf (stderr,
" -o output random numbers to files\n");
328 fp = freopen (
"/dev/null",
"w", stderr);
331 fprintf(stderr,
"Error: Unable to open /dev/null\n");
334 fp = freopen (
"/dev/null",
"w", stdout);
337 fprintf(stderr,
"Error: Unable to open /dev/null\n");
void REPORTSTATUS(LALStatus *status)
void LALCheckMemoryLeaks(void)
int LALgetopt(int argc, char *const *argv, const char *optstring)
static void Usage(const char *program, int exitcode)
static void ParseOptions(int argc, char *argv[])
int main(int argc, char *argv[])
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
size_t XLALStringCopy(char *dst, const char *src, size_t size)
Copy sources string src to destination string dst.
RandomParams * XLALCreateRandomParams(INT4 seed)
REAL4 XLALUniformDeviate(RandomParams *params)
void XLALDestroyRandomParams(RandomParams *params)
int XLALNormalDeviates(REAL4Vector *deviates, RandomParams *params)
void LALDestroyVector(LALStatus *, REAL4Vector **)
void LALCreateVector(LALStatus *, REAL4Vector **, UINT4)
int XLALClearErrno(void)
Clears the XLAL error number, returns the old value.
static _LAL_INLINE_ int XLALIsREAL4FailNaN(REAL4 val)
Tests if a value is an XLAL REAL4 failure NaN.
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...
void output(int gps_sec, int output_type)