-
Notifications
You must be signed in to change notification settings - Fork 54
/
cvt_metric.html
226 lines (195 loc) · 6.16 KB
/
cvt_metric.html
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<html>
<head>
<title>
CVT_METRIC - CVT Calculation With Varying Metric
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
CVT_METRIC <br> CVT Calculation With Varying Metric
</h1>
<hr>
<p>
<b>CVT_METRIC</b>
is a MATLAB program which
computes a CVT (Centroidal Voronoi Tessellation)
calculation under a spatially varying metric.
</p>
<p>
What we are saying is that the distance between two vectors
<b>a</b> and <b>b</b> is no longer simply the Euclidean distance,
but rather a quadratic form involving a spatially varying,
positive definite symmetric matrix that represents the metric:
<pre><b>
d(a,b) = ( a - b )' * A * ( a - b )
</b></pre>
We assume that <b>A</b> varies spatially, but we would prefer
to simplify this variation in a manner that saves us computational
effort, while allowing us to recover the variational behavior
if we are willing to use a finer spatial sampling.
</p>
<p>
The metric function is distinct from the <i>density</i> function,
which can also be used in these kinds of problems. The density
function is weaker, and corresponds to a metric whose matrix
at any point is a multiple of the identity matrix. A density
function approach cannot result in the more interesting anisotropic
effects that an arbitrary metric produces.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Languages:
</h3>
<p>
<b>CVT_METRIC</b> is available in
<a href = "../../m_src/cvt_metric/cvt_metric.html">a MATLAB version</a>.
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../m_src/cvt_1d_lloyd/cvt_1d_lloyd.html">
CVT_1D_LLOYD</a>,
a MATLAB program which
computes an N-point Centroidal Voronoi Tessellation (CVT)
within the interval [0,1], under a uniform density.
</p>
<p>
<a href = "../../m_src/cvt_1d_nonuniform/cvt_1d_nonuniform.html">
CVT_1D_NONUNIFORM</a>,
a MATLAB library which
allows the user to watch the evolution of a CVT computed over
a 1D interval with a nonuniform density.
</p>
<p>
<a href = "../../m_src/cvt_2d_sampling/cvt_2d_sampling.html">
CVT_2D_SAMPLING</a>,
a MATLAB program which
computes an N-point Centroidal Voronoi Tessellation (CVT)
within the unit square [0,1]x[0,1], under a uniform density,
using sampling to estimate the Voronoi regions.
</p>
<p>
<a href = "../../m_src/cvt_demo/cvt_demo.html">
CVT_DEMO</a>,
a MATLAB library which
allows the user to generate a CVT over several geometric
regions using uniform or nonuniform density.
</p>
<p>
<a href = "../../m_src/lcvt/lcvt.html">
LCVT</a>,
a MATLAB library which
computes a "Latinized"
Centroidal Voronoi Tessellation.
</p>
<p>
<a href = "../../m_src/test_triangulation/test_triangulation.html">
TEST_TRIANGULATION</a>,
a MATLAB library which
defines the geometry of a number of sample regions.
</p>
<h3 align = "center">
Reference:
</h3>
<p>
<ol>
<li>
Franz Aurenhammer,<br>
Voronoi diagrams -
a study of a fundamental geometric data structure,<br>
ACM Computing Surveys,<br>
Volume 23, Number 3, pages 345-405, September 1991.
</li>
<li>
Qiang Du, Vance Faber, Max Gunzburger,<br>
Centroidal Voronoi Tessellations: Applications and Algorithms,<br>
SIAM Review, Volume 41, 1999, pages 637-676.
</li>
</ol>
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "cvt_square_metric.m">cvt_square_metric.m</a>,
the text of the MATLAB function.
</li>
<li>
<a href = "square_uniform.m">square_uniform.m</a>,
the routine which returns sample points from the square.
</li>
<li>
<a href = "timestamp.m">timestamp.m</a>,
prints the YMDHMS date as a timestamp.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
The following files contain functions to evaluate
various simple metrics:
<ul>
<li>
<a href = "metric_01.m">metric_01.m</a>,
the identity matrix.
</li>
<li>
<a href = "metric_02.m">metric_02.m</a>,
the matrix [9,0;0,1].
</li>
<li>
<a href = "metric_03.m">metric_03.m</a>,
the matrix [1,0;0,100].
</li>
<li>
<a href = "metric_04.m">metric_04.m</a>,
the matrix [1,0;0,1] * (0.2+sin(2*pi*x)**2 * sin(2*pi*y)**2).
</li>
<li>
<a href = "metric_05.m">metric_05.m</a>,
the matrix [2,3;3,5].
</li>
</ul>
</p>
<p>
Here are images of CVT point sets. These are crude
calculations, with a relatively low number of sample
points and iterations. This is partly because I haven't
figured out how to optimize these calculations in MATLAB.
<ul>
<li>
<a href = "metric_03.png">metric_03.png</a>,
200 generators, using 1600 sample points, and 20 iterations,
with the constant metric [1,0;0,100].
</li>
<li>
<a href = "metric_04.png">metric_04.png</a>,
200 generators, using 1600 sample points, and 20 iterations,
with the metric matrix
[1,0;0,1] * (0.2+sin(2*pi*x)**2 * sin(2*pi*y)**2).
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../m_src.html">
the MATLAB source codes</a>.
</p>
<hr>
<i>
Last revised on 25 May 2006.
</i>
<!-- John Burkardt -->
</body>
</html>