X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fdisembl%2FTisean_3.0.1%2Fsource_c%2Froutines%2Ffind_multi_neighbors.c;fp=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fdisembl%2FTisean_3.0.1%2Fsource_c%2Froutines%2Ffind_multi_neighbors.c;h=14f729e09ec874535636cfa6d5d9e1a966380bc2;hb=dbde3fb6f00b9bb770343631a517c0e599db8528;hp=0000000000000000000000000000000000000000;hpb=85f830bbd51a7277994bd4233141016304e210c9;p=jabaws.git diff --git a/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/routines/find_multi_neighbors.c b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/routines/find_multi_neighbors.c new file mode 100644 index 0000000..14f729e --- /dev/null +++ b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/routines/find_multi_neighbors.c @@ -0,0 +1,59 @@ +/* + * 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: Jul 9, 1999 */ +#include + +unsigned long find_multi_neighbors(double **s,long **box,long *list,double **x, + unsigned long l,unsigned int bs,unsigned int dim, + unsigned int emb,unsigned int del,double eps, + unsigned long *flist) +{ + unsigned long nf=0; + int i,i1,i2,j,j1,k,k1,li; + int ib=bs-1; + long element; + double dx=0.0; + + i=(int)(x[0][0]/eps)&ib; + j=(int)(x[dim-1][0]/eps)&ib; + + for (i1=i-1;i1<=i+1;i1++) { + i2=i1&ib; + for (j1=j-1;j1<=j+1;j1++) { + element=box[i2][j1&ib]; + while (element != -1) { + for (k=0;k eps) + break; + } + if (dx > eps) + break; + } + if (dx <= eps) + flist[nf++]=element; + element=list[element]; + } + } + } + return nf; +}