/* tsread.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Utility reads and displays values in a binary ARMA model time series file. Input parameter: binary_in_file -> name of binary ARMA time series file [ created by garma ] Test output from: data/ts0.b */ #include "ccmath.h" void main(int na,char **av) { FILE *fp; double y[20]; int i,j,k,n,m; char lx[4]; if(na!=2){ printf("para: binary_in_file\n"); exit(-1);} fp=fopen(*++av,"rb"); fread((void *)&n,sizeof(int),1,fp); printf(" length of ARMA series = %d\n",n); /* read and display series in blocks of 20 */ fprintf(stderr,"enter q or Q to quit\n"); for(m=20,j=0;;){ k=fread((void *)y,sizeof(y[0]),m,fp); for(i=0; i