-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirichlet.h
More file actions
executable file
·117 lines (103 loc) · 3.28 KB
/
dirichlet.h
File metadata and controls
executable file
·117 lines (103 loc) · 3.28 KB
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
/****************************************************************************
* dirichlet.h
* Author Joel Welling
* Copyright 1991, Pittsburgh Supercomputing Center, Carnegie Mellon University
*
* Permission use, copy, and modify this software and its documentation
* without fee for personal use or use within your organization is hereby
* granted, provided that the above copyright notice is preserved in all
* copies and that that copyright and this permission notice appear in
* supporting documentation. Permission to redistribute this software to
* other organizations or individuals is not granted; that must be
* negotiated with the PSC. Neither the PSC nor Carnegie Mellon
* University make any representations about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
*****************************************************************************/
/*
* This module provides an interface to the Dirichlet tesselation package.
*/
/* Include prototypes unless requested not to. NO_SUB_PROTO causes
* all function prototypes not explicitly associated with an 'extern'ed
* function to be omitted. NO_PROTO causes all prototypes to be omitted.
*/
#ifdef NO_PROTO
#define NO_SUB_PROTO
#endif
#ifdef NO_PROTO
#define ___(prototype) ()
#else
#define ___(prototype) prototype
#endif
#ifdef NO_SUB_PROTO
#define __(prototype) ()
#else
#define __(prototype) prototype
#endif
enum dch_search_method { MOST_RECENT_PT, CENTER_PT, UNKNOWN };
struct dch_vtx_struct;
struct dch_pt_struct;
struct dch_vtx_list_struct;
struct dch_pt_list_struct;
typedef struct dch_pt_struct {
struct dch_pt_list_struct *neighbors;
struct dch_vtx_list_struct *verts;
int id;
float *coords;
P_Void_ptr user_hook;
} dch_Pt;
typedef struct dch_pt_list_struct {
dch_Pt *pt;
struct dch_pt_list_struct *next;
} dch_Pt_list;
typedef struct dch_pt_pair_struct {
dch_Pt *pt1, *pt2;
struct dch_pt_pair_struct *next;
} dch_Pt_pair_list;
typedef struct dch_vtx_struct {
struct dch_pt_list_struct *forming_pts;
struct dch_vtx_list_struct *neighbors;
int id;
float distance; /* square of distance, actually */
int deleted;
int degenerate;
float *coords;
P_Void_ptr user_hook;
} dch_Vtx;
typedef struct dch_vtx_list_struct {
dch_Vtx *vtx;
struct dch_vtx_list_struct *next;
} dch_Vtx_list;
typedef struct dch_vtx_pair_struct {
dch_Vtx *vtx1, *vtx2;
struct dch_vtx_pair_struct *next;
} dch_Vtx_pair_list;
typedef struct dch_bndbx_struct {
float *corner1;
float *corner2;
int empty_flag;
} dch_Bndbx;
typedef struct dch_tess_struct {
int dimensionality;
dch_Vtx_list *vtx_list;
dch_Pt_list *pt_list;
dch_Pt_list *bogus_pts;
dch_Vtx_list *infinite_vtxs;
dch_Pt *center_pt;
dch_Pt *most_recent_pt;
dch_Bndbx *bndbx;
enum dch_search_method best_search_method;
int searches_done;
int center_steps;
int most_recent_steps;
float characteristic_length;
float *(*coord_access_fun) __((float *, int, P_Void_ptr *));
} dch_Tess;
float *dch_gauss_elim ___(( float *, int ));
dch_Tess *dch_create_dirichlet_tess
___(( float *, int npts, int dimensionality,
float *(*access_coords) __((float *, int, P_Void_ptr *)) ));
void dch_destroy_tesselation ___(( dch_Tess * ));
/* Clean up the prototyping macros */
#undef __
#undef ___