/* * 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 4, 1999 */ #include #include #include #include #include "routines/tsa.h" #define WID_STR "Creates a parameter file containing all terms\n\t\ for a polynomial" char *outfile=NULL; unsigned int dim=2,order=3; unsigned int verbosity=0xff; FILE *file=NULL; void make_parameter(unsigned int*,unsigned int, unsigned int); void show_options(char *progname) { what_i_do(progname,WID_STR); fprintf(stderr," Usage: %s [Options]\n",progname); fprintf(stderr," Options:\n"); fprintf(stderr,"\t-m embedding dimension [Default: %u]\n",dim); fprintf(stderr,"\t-p order of the polynomial [Default: %u]\n",order); fprintf(stderr,"\t-o parameter file [Default: parameter.pol]\n"); fprintf(stderr,"\t-V verbosity level [Default: 1]\n\t\t" "0='only panic messages'\n\t\t" "1='+ input/output messages'\n"); fprintf(stderr,"\t-h show these options\n"); exit(0); } void scan_options(int n,char **in) { char *out; if ((out=check_option(in,n,'m','u')) != NULL) sscanf(out,"%u",&dim); if ((out=check_option(in,n,'p','u')) != NULL) sscanf(out,"%u",&order); if ((out=check_option(in,n,'V','u')) != NULL) sscanf(out,"%u",&verbosity); if ((out=check_option(in,n,'o','o')) != NULL) { if (strlen(out) > 0) outfile=out; } } void make_parameter(unsigned int *par,unsigned int d,unsigned int sum) { int i,j; for (i=0;i<=order;i++) { sum += i; if (sum <= order) { par[d]=i; if (d == 0) { for (j=0;j