-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathtiles2.h
125 lines (100 loc) · 5.03 KB
/
tiles2.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#ifndef _TILES2_H_
#define _TILES2_H_
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#define MAX_NUM_VARS 20 // Maximum number of variables in a grid-tiling
#define MAX_NUM_COORDS 100 // Maximum number of hashing coordinates
#define MaxLONGINT 2147483647
void GetTiles(
int tiles[], // provided array contains returned tiles (tile indices)
int num_tilings, // number of tile indices to be returned in tiles
int memory_size, // total number of possible tiles
float floats[], // array of floating point variables
int num_floats, // number of floating point variables
int ints[], // array of integer variables
int num_ints); // number of integer variables
class collision_table {
public:
collision_table(int,int);
~collision_table();
long m;
long *data;
int safe;
long calls;
long clearhits;
long collisions;
void reset();
int usage();
void save(int);
void restore(int);
};
void GetTiles(
int tiles[], // provided array contains returned tiles (tile indices)
int num_tilings, // number of tile indices to be returned in tiles
collision_table *ctable, // total number of possible tiles
float floats[], // array of floating point variables
int num_floats, // number of floating point variables
int ints[], // array of integer variables
int num_ints); // number of integer variables
int hash_UNH(int *ints, int num_ints, long m, int increment);
int hash(int *ints, int num_ints, collision_table *ctable);
// no ints
void GetTiles(int tiles[],int nt,int memory,float floats[],int nf);
void GetTiles(int tiles[],int nt,collision_table *ct,float floats[],int nf);
// one int
void GetTiles(int tiles[],int nt,int memory,float floats[],int nf,int h1);
void GetTiles(int tiles[],int nt,collision_table *ct,float floats[],int nf,int h1);
// two ints
void GetTiles(int tiles[],int nt,int memory,float floats[],int nf,int h1,int h2);
void GetTiles(int tiles[],int nt,collision_table *ct,float floats[],int nf,int h1,int h2);
// three ints
void GetTiles(int tiles[],int nt,int memory,float floats[],int nf,int h1,int h2,int h3);
void GetTiles(int tiles[],int nt,collision_table *ct,float floats[],int nf,int h1,int h2,int h3);
// one float, no ints
void GetTiles1(int tiles[],int nt,int memory,float f1);
void GetTiles1(int tiles[],int nt,collision_table *ct,float f1);
// one float, one int
void GetTiles1(int tiles[],int nt,int memory,float f1,int h1);
void GetTiles1(int tiles[],int nt,collision_table *ct,float f1,int h1);
// one float, two ints
void GetTiles1(int tiles[],int nt,int memory,float f1,int h1,int h2);
void GetTiles1(int tiles[],int nt,collision_table *ct,float f1,int h1,int h2);
// one float, three ints
void GetTiles1(int tiles[],int nt,int memory,float f1,int h1,int h2,int h3);
void GetTiles1(int tiles[],int nt,collision_table *ct,float f1,int h1,int h2,int h3);
// two floats, no ints
void GetTiles2(int tiles[],int nt,int memory,float f1,float f2);
void GetTiles2(int tiles[],int nt,collision_table *ct,float f1,float f2);
// two floats, one int
void GetTiles2(int tiles[],int nt,int memory,float f1,float f2,int h1);
void GetTiles2(int tiles[],int nt,collision_table *ct,float f1,float f2,int h1);
// two floats, two ints
void GetTiles2(int tiles[],int nt,int memory,float f1,float f2,int h1,int h2);
void GetTiles2(int tiles[],int nt,collision_table *ct,float f1,float f2,int h1,int h2);
// two floats, three ints
void GetTiles2(int tiles[],int nt,int memory,float f1,float f2,int h1,int h2,int h3);
void GetTiles2(int tiles[],int nt,collision_table *ct,float f1,float f2,int h1,int h2,int h3);
void GetTilesWrap(
int tiles[], // provided array contains returned tiles (tile indices)
int num_tilings, // number of tile indices to be returned in tiles
int memory_size, // total number of possible tiles
float floats[], // array of floating point variables
int num_floats, // number of floating point variables
int wrap_widths[], // array of widths (length and units as in floats)
int ints[], // array of integer variables
int num_ints); // number of integer variables
void GetTilesWrap(
int tiles[], // provided array contains returned tiles (tile indices)
int num_tilings, // number of tile indices to be returned in tiles
collision_table *ctable, // total number of possible tiles
float floats[], // array of floating point variables
int num_floats, // number of floating point variables
int wrap_widths[], // array of widths (length and units as in floats)
int ints[], // array of integer variables
int num_ints); // number of integer variables
// no ints
void GetTilesWrap(int tiles[],int num_tilings,int memory_size,float floats[],
int num_floats,int wrap_widths[]);
#endif