same2.c
Go to the documentation of this file.
1 #include "arith.h"
2 
3 same2(w,en,hashtab)
5 int en;
6 TABLE hashtab;
7 {
8  VECTOR w1,w2;
9  REAL error;
10  int i,k,hashkey,hashval;
11 
12  for(i=0; i<MAXRANK; i++)
13  w1[i]= w[i][en];
14 
15  hashval=hash5(w1);
16  for(k=hashval; k<HASHNO; k++){
17  hashkey= hashtab[k];
18  if(hashkey == EMPTY){
19  return(k);
20  }
21  else{
22  error= 0.0e0;
23  for(i=0; i<MAXRANK; i++){
24  w2[i] = w[i][hashkey];
25  error += fabs(w1[i] - w2[i]);
26  }
27  if(error < EPS * MAXRANK)
28  return(COLLISION);
29  }
30  }
31 
32  for(k=0; k<HASHNO; k++){
33  hashkey= hashtab[k];
34  if(hashkey == EMPTY){
35  return(k);
36  }
37  else{
38  error= 0.0e0;
39  for(i=0; i<MAXRANK; i++){
40  w2[i] = w[i][hashkey];
41  error += fabs(w1[i] - w2[i]);
42  }
43  if(error < EPS * MAXRANK)
44  return(COLLISION);
45  }
46  }
47 }
48 
49 
50 
51 
52 
#define EMPTY
Definition: arith.h:21
REAL VECTOR[MAX]
Definition: arith.h:26
double REAL
Definition: arith.h:25
#define MAXEDGE
Definition: arith.h:14
int TABLE[HASHNO]
Definition: arith.h:29
#define MAXRANK
Definition: arith.h:13
same2(w, int en, TABLE hashtab)
Definition: same2.c:3
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
Definition: eus.c:297
hash5(VECTOR w)
Definition: hash5.c:6
#define HASHNO
Definition: arith.h:23
#define COLLISION
Definition: arith.h:22
#define EPS
Definition: arith.h:15


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 20:00:44