Main Page
Namespaces
Classes
Files
File List
File Members
contrib
contact
clib
hash5.c
Go to the documentation of this file.
1
/* Oct.16, 1990. */
2
/* 123456.789 was changed to 12345.6789 because hash is too sensible */
3
4
#include "
arith.h
"
5
6
hash5
(w)
7
VECTOR
w;
8
{
9
REAL
x,
d
[
MAXRANK
];
10
int
i,hash;
11
12
for
(i=0; i<
MAXRANK
; i++){
13
d[i]= (w[i]+1)*1.5;
14
}
15
16
x = d[0]*1.23+d[1]*3.21+d[2]*2.35+d[3]*16.35+d[4]*23.57+d[5]*15.63;
17
hash= (int)(12345.6789 * x) %
HASHNO
;
18
return
(hash);
19
}
20
d
d
arith.h
VECTOR
REAL VECTOR[MAX]
Definition:
arith.h:26
REAL
double REAL
Definition:
arith.h:25
MAXRANK
#define MAXRANK
Definition:
arith.h:13
hash5
hash5(VECTOR w)
Definition:
hash5.c:6
HASHNO
#define HASHNO
Definition:
arith.h:23
euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 20:00:44