X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fdisembl%2FTisean_3.0.1%2Fsource_c%2Fpolypar.c;fp=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fdisembl%2FTisean_3.0.1%2Fsource_c%2Fpolypar.c;h=1fefa7ef9090c0381d6c7d315fc4c9788b256754;hb=dbde3fb6f00b9bb770343631a517c0e599db8528;hp=0000000000000000000000000000000000000000;hpb=85f830bbd51a7277994bd4233141016304e210c9;p=jabaws.git diff --git a/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/polypar.c b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/polypar.c new file mode 100644 index 0000000..1fefa7e --- /dev/null +++ b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/polypar.c @@ -0,0 +1,121 @@ +/* + * 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