-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgridcellhash.h
44 lines (35 loc) · 898 Bytes
/
gridcellhash.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
#include "inthash.h"
#ifdef MEMWATCH
#include "memwatch.h"
#endif
#ifdef USEMEMCHECK
#include <memcheck.h>
#endif
#ifdef DMALLOC
#include <dmalloc.h>
#endif
#ifndef _GCHASH_
#define _GCHASH_
typedef struct {
long id;
double val;
} GridCell;
typedef struct {
GridCell *GridCells;
long NumGridCellsAlloc;
long NumGridCells;
struct inthash *ih;
} GridCellHash;
#define GCH_INVALID IH_INVALID
/* in gridcellhash.c */
void id2ijk(long id, long N, long *i, long *j, long *k);
int compGridCell(const void *a, const void *b);
long getonlyid_gchash(GridCellHash *gch, long id);
long getid_gchash(GridCellHash *gch, long id);
void minmem_gchash(GridCellHash *gch);
GridCellHash *init_gchash(void);
void free_gchash(GridCellHash *gch);
void sortcells_gchash(GridCellHash *gch);
void destroyhash_gchash(GridCellHash *gch);
void rebuildhash_gchash(GridCellHash *gch);
#endif /* _GCHASH_ */