#ifndef vector_included #define vector_included #ifndef BADFLOAT #define BADFLOAT ((float) 1.0e38) #endif #ifndef ADJ_BADFLOAT #define ADJ_BADFLOAT ((float) 9.99999e37) #endif #define good_float(x) ( (x) < ADJ_BADFLOAT ) #define average(a,b) ( 0.5 * ( (a) + (b) ) ) /* VECTORS */ void make_uniform_grid(double first, double last, int n, float array[]); void scale_elements(float scales[], float array[], float out_array[], int n); void make_sinusoid(float array[], int n, double amp, double cycles, double degrees); void integrate_tr( float f[], float z[], float integral[], int n); double average_tr( float f[], float z[], int n); double scalar_product(float a[], float b[], int n); double mode_projection(float a[], float b[], int n); void stats(float a[], int n, double *mean_ptr, double *variance_ptr); /* MATRIX */ void matrix_mult(float *c, float *a, float *b, int m, int n, int p); /* c=a*b: c, m by p; a, m by n; b n by p */ void make_identity_matrix(float *imatrix, int n); /* must be dimension [n][n] */ /* FLATFILE */ int read_array_double( FILE *fp_in, double array[], int n, char format[]); int read_array_float( FILE *fp_in, float array[], int n, char format[]); int read_array_4( FILE *fp_in, int array[], int n, char format[]); int read_array_2( FILE *fp_in, short array[], int n, char format[]); int read_array_1( FILE *fp_in, char array[], int n, char format[]); /* INTERP */ double interpolate (float *z, float *f, double zi); /* REGRID */ void regrid (float zo[], float fo[], float zn[], float fn[], int m, int n, int *n0_ptr, int *nout_ptr); /* INTGRID */ void intgrid (float zo[], float fo[], float zn[], float fn[], int m, int n, int *n0_ptr, int *nout_ptr); /* REGRIDLI */ void regridli (float zo[], float fo[], float zn[], float fn[], int m, int n, int *n0_ptr, int *nout_ptr); /* DETREND */ void detrend(float array[], int n); /* SCOMPLEX */ void split_odd_even( float *a, int n); /* REFCALC */ double subtract_reference(float *data, int n, int first, int last); double array_mean(float *data, int n); /* DERIV */ void dif1(float *array, float *dif, int n); void avg_adjacent1(float *array, float *array_aa, int n); void dif2(float *array, float *dif, int n); void avg_adjacent2(float *array, float *array_aa, int n); void deriv1(float *x, float *y, float *xa, float *yd, int n); void deriv2(float *x, float *y, float *xa, float *yd, int n); /* Added 88-04-26: */ /* FILLGAPS*/ int fill_gaps(float *f, int n); /* S_REGRID */ int s_regrid(float *zo, float *fo, float *zn, float *fn, int no, int nn); /* S_INTGRD */ int s_intgrid(float *zo, float *fo, float *zn, float *fn, int no, int nn); /* ROTATE */ void rotate_vector(double angle, float *u, float *v, int n); /* added Thu 10-06-1988 */ /* S_REGRLI.C */ int s_regridli(float *zo, float *fo, float *zn, float *fn, int no, int nn); #endif /* ifndef vector_included */