30 #include <lal/LALDatatypes.h>
31 #include <lal/Sequence.h>
32 #include <lal/TimeSeries.h>
33 #include <lal/Units.h>
43 s->
data->
data[n] = rand() / (float) RAND_MAX;
99 x->data->data[0] = 1.0;
100 if((
x->f0 != 0.0) || (
x->deltaT != 1.0) || (
x->data->length != 1) || (
x->data->data[0] != 1.0)) {
101 fprintf(stderr,
"Create test 1 failed\n");
113 if((
y->deltaT !=
x->deltaT) || (
y->f0 !=
x->f0) ||
cmp_real4(
x->data->data + 256,
y->data->data, 512) || (
XLALGPSDiff(&
y->epoch, &
x->epoch) != 256 *
x->deltaT)) {
114 fprintf(stderr,
"Cut test 1 failed\n");
127 for(i = 0; i < (int)
a->data->length; i++)
128 if(
a->data->data[i] != i + 256) {
129 fprintf(stderr,
"Resize test 1a failed\n");
133 fprintf(stderr,
"Resize test 1b failed\n");
static int cmp_real4(REAL4 *a, REAL4 *b, size_t n)
static REAL4TimeSeries * random_timeseries(size_t n)
static INT4TimeSeries * sequential_timeseries(size_t n)
static LIGOTimeGPS gps_zero
#define LIGOTIMEGPSZERO
Zero-initializer for LIGOTimeGPS structs.
float REAL4
Single precision real floating-point number (4 bytes).
INT4TimeSeries * XLALCreateINT4TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyINT4TimeSeries(INT4TimeSeries *series)
void XLALDestroyREAL4TimeSeries(REAL4TimeSeries *series)
REAL4TimeSeries * XLALCutREAL4TimeSeries(const REAL4TimeSeries *series, size_t first, size_t length)
INT4TimeSeries * XLALResizeINT4TimeSeries(INT4TimeSeries *series, int first, size_t length)
REAL4TimeSeries * XLALCreateREAL4TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
const LALUnit lalDimensionlessUnit
dimensionless units
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
Difference between two GPS times as double.
Time series of INT4 data, see DATATYPE-TimeSeries types for more details.
INT4Sequence * data
The sequence of sampled data.
INT4 * data
Pointer to the data array.
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
REAL4Sequence * data
The sequence of sampled data.
REAL4 * data
Pointer to the data array.