same.c
Go to the documentation of this file.
00001 /* Oct.16, 1990.  definition of error is changed to Euclid norm        */
00002 /*                UNIT is considered when error is evaluated           */ 
00003 
00004 #include "arith.h"
00005 
00006 same(w,en,hashtab)
00007 REAL w[MAXRANK][MAXEDGE];
00008 int en;
00009 TABLE hashtab;
00010 {
00011     VECTOR w1,w2;
00012     REAL error;
00013     int i,k,hashkey,hashval;
00014 
00015     for(i=0; i<MAXRANK; i++)
00016         w1[i]= w[i][en];
00017 
00018     hashval=hash5(w1);
00019 
00020     for(k=hashval; k<HASHNO; k++){
00021         hashkey= hashtab[k];
00022         if(hashkey == EMPTY){
00023             return(k);
00024         }
00025         else{
00026             error= 0.0e0;
00027             for(i=0; i<MAXRANK; i++){
00028                 w2[i] = w[i][hashkey];
00029                 error += (w1[i] - w2[i]) * (w1[i] - w2[i]);
00030             }
00031             if(sqrt(error) < EPS / UNIT)
00032                 return(COLLISION);
00033         }
00034     }
00035 
00036     for(k=0; k<HASHNO; k++){
00037         hashkey= hashtab[k];
00038         if(hashkey == EMPTY){
00039             return(k);
00040         }
00041         else{
00042             error= 0.0e0;
00043             for(i=0; i<MAXRANK; i++){
00044                 w2[i] = w[i][hashkey];
00045                 error += (w1[i] - w2[i]) * (w1[i] - w2[i]);
00046             }
00047             if(sqrt(error) < EPS / UNIT)
00048                 return(COLLISION);
00049         }
00050     }
00051 }
00052 
00053 
00054 
00055 
00056 


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Mar 9 2017 04:57:50