/* tfsread.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 contents of a binary factor model time series file. Input parameter: binary_in_file -> name of input file [ created by gfarma ] test output generated using data/tfs0.b */ #include "ccmath.h" void main(int na,char **av) { FILE *fin; int i,j,k,n,m; char xl[4]; struct fmod y[20]; if(na!=2){ printf("para: binary_input_file\n"); exit(1);} fin=fopen(*++av,"rb"); fread((void *)&n,sizeof(int),1,fin); /* read and print series in blocks of 20 */ printf(" series length = %d\n",n); fprintf(stderr,"enter: q or Q to quit\n"); for(j=0,m=20;;){ k=fread((void *)y,sizeof(struct fmod),m,fin); for(i=0; i