/*************************************************************** deriv.c Routines for calculating differences and derivatives. Header: vector.h Library: vector_x.lib */ #include "common.h" #include "ioserv.h" /* check_error() */ #include "vector.h" /*************************************************************** dif1 and avg_adjacent1 Functions for taking first differences. The input and output arrays can be the same. The difference x(i+1)-x(i) is placed in element i of the output array by dif1. avg_adjacent1 similarly puts the average of the i+1th and the ith elements of the source into the ith element of the destination. */ void dif1(float array[], float dif[], int n) { int i; float *x0, *x1, *d; x0 = array; x1 = array + 1; d = dif; for (i=0; i