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_neighbors.c;fp=website%2Farchive%2Fbinaries%2Fmac%2Fsrc%2Fdisembl%2FTisean_3.0.1%2Fsource_c%2Froutines%2Ffind_neighbors.c;h=e41292378128d7d0dbd7c88fbc0d332447054f19;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_neighbors.c b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/routines/find_neighbors.c new file mode 100644 index 0000000..e412923 --- /dev/null +++ b/website/archive/binaries/mac/src/disembl/Tisean_3.0.1/source_c/routines/find_neighbors.c @@ -0,0 +1,55 @@ +/* + * 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: March 1st, 1998 */ +#include + +unsigned long find_neighbors(double *s,long **box,long *list,double *x, + unsigned long l,unsigned int bs,unsigned int dim, + unsigned int del,double eps,unsigned long *flist) +{ + unsigned long nf=0; + int i,i1,i2,j,j1,k,k1; + int ib=bs-1; + long element; + double dx; + + k=(int)((dim-1)*del); + i=(int)(x[-k]/eps)&ib; + j=(int)(x[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 (k == dim) + flist[nf++]=element; + element=list[element]; + } + } + } + return nf; +}