/* * This file is part of TISEAN * * Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber * * TISEAN is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * TISEAN is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with TISEAN; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /*Author: Rainer Hegger Last modified: Sep 3, 1999 */ /*Note: Keep in mind that the first index runs the dimension, the second the time series index */ #include #include #include #include #include "tsa.h" #include "tisean_cec.h" #define SIZE_STEP 1000 extern void check_alloc(void*); double **get_multi_series(char *name,unsigned long *l,unsigned long ex, unsigned int *col,char *which,char colfix, unsigned int verbosity) { char *input,**format; int i,j; unsigned int *hcol,maxcol=0,colcount=0; unsigned long count,max_size=SIZE_STEP,hl,allcount; int input_size=INPUT_SIZE; double **x; FILE *fin; if (strlen(which) > 0) { colcount=1; for (i=0;i maxcol) maxcol=hcol[i]; while ((int)(*which) && !isspace((unsigned int)(*which))) which++; while ((int)(*which) && isspace((unsigned int)(*which))) which++; if (!((int)(*which))) break; } else i= -1; if (*which) sscanf(which,"%u",&hcol[i]); else for (j=i+1;j< *col;j++) hcol[j]= ++maxcol; if (verbosity&VER_INPUT) { fprintf(stderr,"Using columns: "); for (i=0;i< *col;i++) fprintf(stderr,"%d ",hcol[i]); fprintf(stderr,"\n"); } check_alloc(format=(char**)malloc(sizeof(char*)* *col)); for (i=0;i< *col;i++) { check_alloc(format[i]=(char*)calloc((size_t)(4*hcol[i]),(size_t)1)); strcpy(format[i],""); for (j=1;j count) for (i=0;i< *col;i++) check_alloc(x[i]=(double*)realloc(x[i],sizeof(double)*count)); return x; } #undef SIZE_STEP