Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Analysis.AlgorithmBehavior/qhull-2012.1/src/libqhull/qh-merge.htm @ 10621

Last change on this file since 10621 was 10207, checked in by ascheibe, 11 years ago

#1886 added a unit test for volume calculation and the qhull library

File size: 15.1 KB
RevLine 
[10207]1<!-- Do not edit with Front Page, it adds too many spaces -->
2<html>
3<head>
4<meta http-equiv="Content-Type"
5content="text/html; charset=iso-8859-1">
6<title>merge.c -- facet merge operations</title>
7</head>
8
9<body>
10<!-- Navigation links -->
11<p><a name="TOP"><b>Up:</b></a> <a
12href="http://www.qhull.org">Home page</a> for Qhull<br>
13<b>Up:</b> <a href="../../html/index.htm#TOC">Qhull manual</a>: Table of Contents <br>
14<b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
15&#149; <a href="../../html/qh-quick.htm#options">Options</a>
16&#149; <a href="../../html/qh-opto.htm#output">Output</a>
17&#149; <a href="../../html/qh-optf.htm#format">Formats</a>
18&#149; <a href="../../html/qh-optg.htm#geomview">Geomview</a>
19&#149; <a href="../../html/qh-optp.htm#print">Print</a>
20&#149; <a href="../../html/qh-optq.htm#qhull">Qhull</a>
21&#149; <a href="../../html/qh-optc.htm#prec">Precision</a>
22&#149; <a href="../../html/qh-optt.htm#trace">Trace</a><br>
23<b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a><br>
24<b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
25<b>To:</b> <a href="qh-geom.htm">Geom</a> &#149; <a href="qh-globa.htm">Global</a>
26&#149; <a href="qh-io.htm">Io</a> &#149; <a href="qh-mem.htm">Mem</a>
27&#149; <a href="qh-merge.htm#TOC">Merge</a> &#149; <a href="qh-poly.htm">Poly</a>
28&#149; <a href="qh-qhull.htm">Qhull</a> &#149; <a href="qh-set.htm">Set</a>
29&#149; <a href="qh-stat.htm">Stat</a> &#149; <a href="qh-user.htm">User</a>
30</p>
31<hr>
32
33<h2>merge.c -- facet merge operations</h2>
34<blockquote>
35<p>Qhull handles precision problems by merged facets or joggled input.
36Except for redundant vertices, it corrects a problem by
37merging two facets. When done, all facets are clearly
38convex. See <a href="../../html/qh-impre.htm">Imprecision in Qhull</a>
39for further information. </p>
40<p>Users may joggle the input ('<a href="../../html/qh-optq.htm#QJn">QJn</a>')
41instead of merging facets. </p>
42<p>Qhull detects and corrects the following problems: </p>
43<ul>
44<li><b>More than two facets meeting at a ridge. </b>When
45Qhull creates facets, it creates an even number
46of facets for each ridge. A convex hull always
47has two facets for each ridge. More than two
48facets may be created if non-adjacent facets
49share a vertex. This is called a <em>duplicate
50ridge</em>. In 2-d, a duplicate ridge would
51create a loop of facets. </li>
52</ul>
53<ul>
54<li><b>A facet contained in another facet. </b>Facet
55merging may leave all vertices of one facet as a
56subset of the vertices of another facet. This is
57called a <em>redundant facet</em>. </li>
58</ul>
59<ul>
60<li><b>A facet with fewer than three neighbors. </b>Facet
61merging may leave a facet with one or two
62neighbors. This is called a <em>degenerate facet</em>.
63</li>
64</ul>
65<ul>
66<li><b>A facet with flipped orientation. </b>A
67facet's hyperplane may define a halfspace that
68does not include the interior point.This is
69called a <em>flipped facet</em>. </li>
70</ul>
71<ul>
72<li><strong>A coplanar horizon facet.</strong> A
73newly processed point may be coplanar with an
74horizon facet. Qhull creates a new facet without
75a hyperplane. It links new facets for the same
76horizon facet together. This is called a <em>samecycle</em>.
77The new facet or samecycle is merged into the
78horizon facet. </li>
79</ul>
80<ul>
81<li><b>Concave facets. </b>A facet's centrum may be
82above a neighboring facet. If so, the facets meet
83at a concave angle. </li>
84</ul>
85<ul>
86<li><b>Coplanar facets. </b>A facet's centrum may be
87coplanar with a neighboring facet (i.e., it is
88neither clearly below nor clearly above the
89facet's hyperplane). Qhull removes coplanar
90facets in independent sets sorted by angle.</li>
91</ul>
92<ul>
93<li><b>Redundant vertex. </b>A vertex may have fewer
94than three neighboring facets. If so, it is
95redundant and may be renamed to an adjacent
96vertex without changing the topological
97structure.This is called a <em>redundant vertex</em>.
98</li>
99</ul>
100</blockquote>
101<p><b>Copyright &copy; 1995-2012 C.B. Barber</b></p>
102<hr>
103<p><a href="#TOP">&#187;</a> <a href="qh-geom.htm#TOC">Geom</a>
104<a name="TOC">&#149;</a> <a href="qh-globa.htm#TOC">Global</a>
105&#149; <a href="qh-io.htm#TOC">Io</a> &#149; <a href="qh-mem.htm#TOC">Mem</a>
106&#149; <b>Merge</b> &#149; <a href="qh-poly.htm#TOC">Poly</a>
107&#149; <a href="qh-qhull.htm#TOC">Qhull</a> &#149; <a href="qh-set.htm#TOC">Set</a>
108&#149; <a href="qh-stat.htm#TOC">Stat</a> &#149; <a href="qh-user.htm#TOC">User</a>
109</p>
110<h3>Index to <a href="merge.c">merge.c</a> and
111<a href="merge.h">merge.h</a></h3>
112<ul>
113<li><a href="#mtype">merge.h data types, macros, and
114global sets</a> </li>
115<li><a href="#mconst">merge.h constants</a> </li>
116</ul>
117<ul>
118<li><a href="#mtop">top-level merge functions</a> </li>
119<li><a href="#mset">functions for identifying merges</a></li>
120<li><a href="#mbest">functions for determining the
121best merge</a> </li>
122<li><a href="#mmerge">functions for merging facets</a>
123</li>
124<li><a href="#mcycle">functions for merging a cycle
125of facets</a> </li>
126<li><a href="#mrename">functions for renaming a
127vertex</a> </li>
128<li><a href="#mvertex">functions for identifying
129vertices for renaming</a> </li>
130<li><a href="#mcheck">functions for check and trace</a> </li>
131</ul>
132<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mtype">merge.h data
133types, macros, and global sets</a></h3>
134<ul>
135<li><a href="merge.h#mergeT">mergeT</a> structure to
136identify a merge of two facets</li>
137<li><a href="merge.h#FOREACHmerge_">FOREACHmerge_</a>
138assign 'merge' to each merge in merges </li>
139<li><a href="libqhull.h#qh-set">qh global sets</a>
140qh.facet_mergeset contains non-convex merges
141while qh.degen_mergeset contains degenerate and
142redundant facets</li>
143</ul>
144<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mconst">merge.h
145constants</a></h3>
146<ul>
147<li><a href="libqhull.h#qh-prec">qh precision constants</a>
148precision constants for Qhull </li>
149<li><a href="merge.h#MRG">MRG...</a> indicates the
150type of a merge (mergeT-&gt;type)</li>
151<li><a href="merge.h#qh_ANGLEredundant">qh_ANGLEredundant</a>
152indicates redundant merge in mergeT-&gt;angle </li>
153<li><a href="merge.h#qh_ANGLEdegen">qh_ANGLEdegen</a>
154indicates degenerate facet in mergeT-&gt;angle </li>
155<li><a href="merge.h#qh_ANGLEconcave">qh_ANGLEconcave</a>
156offset to indicate concave facets in
157mergeT-&gt;angle </li>
158<li><a href="merge.h#qh_MERGEapex">qh_MERGEapex</a>
159flag for qh_mergefacet() to indicate an apex
160merge </li>
161</ul>
162<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mtop">top-level merge
163functions</a></h3>
164<ul>
165<li><a href="merge.c#all_merges">qh_all_merges</a>
166merge all non-convex facets </li>
167<li><a href="merge.c#checkzero">qh_checkzero</a>
168check that facets are clearly convex </li>
169<li><a href="merge.c#flippedmerges">qh_flippedmerges</a>
170merge flipped facets into best neighbor </li>
171<li><a href="merge.c#forcedmerges">qh_forcedmerges</a>
172merge all duplicate ridges </li>
173<li><a href="merge.c#merge_degenredundant">qh_merge_degenredundant</a>
174merge degenerate and redundant facets </li>
175<li><a href="merge.c#merge_nonconvex">qh_merge_nonconvex</a>
176merge a non-convex ridge </li>
177<li><a href="merge.c#premerge">qh_premerge</a>
178pre-merge non-convex facets </li>
179<li><a href="merge.c#postmerge">qh_postmerge</a>
180post-merge nonconvex facets as defined by
181maxcentrum/maxangle </li>
182</ul>
183
184<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mset">functions for
185identifying merges</a></h3>
186<ul>
187<li><a href="merge.c#appendmergeset">qh_appendmergeset</a>
188appends an entry to qh.facet_mergeset</li>
189<li><a href="merge.c#compareangle">qh_compareangle</a>
190used by qsort() to order merges </li>
191<li><a href="merge.c#comparemerge">qh_comparemerge</a>
192used by qsort() to order merges </li>
193<li><a href="merge.c#degen_redundant_facet">qh_degen_redundant_facet</a>
194check for a degenerate and redundant facet</li>
195<li><a href="merge.c#degen_redundant_neighbors">qh_degen_redundant_neighbors</a>
196append degenerate and redundant neighbors to
197qh.degen_mergeset </li>
198<li><a href="merge.c#getmergeset_initial">qh_getmergeset_initial</a>
199build initial qh.facet_mergeset </li>
200<li><a href="merge.c#getmergeset">qh_getmergeset</a>
201update qh.facet_mergeset </li>
202<li><a href="merge.c#mark_dupridges">qh_mark_dupridges</a>
203add duplicated ridges to qh.facet_mergeset</li>
204<li><a href="merge.c#maydropneighbor">qh_maydropneighbor</a>
205drop neighbor relationship if no ridge between
206facet and neighbor </li>
207<li><a href="merge.c#test_appendmerge">qh_test_appendmerge</a>
208test a pair of facets for convexity and append to
209qh.facet_mergeset if non-convex </li>
210<li><a href="merge.c#test_vneighbors">qh_test_vneighbors</a>
211test vertex neighbors for convexity </li>
212</ul>
213
214<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mbest">functions for
215determining the best merge</a></h3>
216<ul>
217<li><a href="merge.c#findbest_test">qh_findbest_test</a>
218test neighbor for best merge </li>
219<li><a href="merge.c#findbestneighbor">qh_findbestneighbor</a>
220finds best neighbor of a facet for merging (i.e.,
221closest hyperplane) </li>
222</ul>
223
224<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mmerge">functions for
225merging facets</a></h3>
226<ul>
227<li><a href="merge.c#copynonconvex">qh_copynonconvex</a>
228copy non-convex flag to another ridge for the
229same neighbor </li>
230<li><a href="merge.c#makeridges">qh_makeridges</a>
231creates explicit ridges between simplicial facets
232</li>
233<li><a href="merge.c#mergefacet">qh_mergefacet</a>
234merges one facet into another facet</li>
235<li><a href="merge.c#mergeneighbors">qh_mergeneighbors</a>
236merges the neighbors of two facets </li>
237<li><a href="merge.c#mergeridges">qh_mergeridges</a>
238merges the ridge sets of two facets </li>
239<li><a href="merge.c#mergesimplex">qh_mergesimplex</a>
240merge a simplicial facet into another simplicial
241facet </li>
242<li><a href="merge.c#mergevertex_del">qh_mergevertex_del</a>
243delete a vertex due to merging one facet into
244another facet </li>
245<li><a href="merge.c#mergevertex_neighbors">qh_mergevertex_neighbors</a>
246merge the vertex neighbors of two facets </li>
247<li><a href="merge.c#mergevertices">qh_mergevertices</a>
248merge the vertex sets of two facets </li>
249<li><a href="merge.c#newvertices">qh_newvertices</a>
250register all vertices as new vertices </li>
251<li><a href="merge.c#updatetested">qh_updatetested</a>
252clear tested flags and centrums involved in a
253merge </li>
254<li><a href="merge.c#willdelete">qh_willdelete</a>
255moves facet to qh.visible_list; sets replacement
256or NULL </li>
257</ul>
258
259<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mcycle">functions for
260merging a cycle of facets</a></h3>
261<p>If a point is coplanar with an horizon facet, the
262corresponding new facets are linked together (a <em>samecycle</em>)
263for merging.</p>
264<ul>
265<li><a href="merge.c#basevertices">qh_basevertices</a>
266return temporary set of base vertices for a
267samecycle </li>
268<li><a href="merge.c#mergecycle">qh_mergecycle</a>
269merge a samecycle into a horizon facet </li>
270<li><a href="merge.c#mergecycle_all">qh_mergecycle_all</a>
271merge all samecycles into horizon facets</li>
272<li><a href="merge.c#mergecycle_facets">qh_mergecycle_facets</a>
273finish merge of samecycle </li>
274<li><a href="merge.c#mergecycle_neighbors">qh_mergecycle_neighbors</a>
275merge neighbor sets for samecycle </li>
276<li><a href="merge.c#mergecycle_ridges">qh_mergecycle_ridges</a>
277merge ridge sets for samecycle </li>
278<li><a href="merge.c#mergecycle_vneighbors">qh_mergecycle_vneighbors</a>
279merge vertex neighbor sets for samecycle </li>
280</ul>
281<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mrename">functions
282for renaming a vertex</a></h3>
283<ul>
284<li><a href="merge.c#comparevisit">qh_comparevisit</a>
285used by qsort() to order vertices by visitid</li>
286<li><a href="merge.c#reducevertices">qh_reducevertices</a>
287reduce vertex sets </li>
288<li><a href="merge.c#redundant_vertex">qh_redundant_vertex</a>
289returns true if detect and rename redundant
290vertex </li>
291<li><a href="merge.c#rename_sharedvertex">qh_rename_sharedvertex</a>
292detect and rename a shared vertex </li>
293<li><a href="merge.c#renameridgevertex">qh_renameridgevertex</a>
294rename oldvertex to newvertex in a ridge </li>
295<li><a href="merge.c#renamevertex">qh_renamevertex</a>
296rename oldvertex to newvertex in ridges </li>
297<li><a href="merge.c#remove_extravertices">qh_remove_extravertices</a>
298remove extra vertices in non-simplicial facets </li>
299</ul>
300
301<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mvertex">functions
302for identifying vertices for renaming</a></h3>
303<ul>
304<li><a href="merge.c#find_newvertex">qh_find_newvertex</a>
305locate new vertex for renaming old vertex </li>
306<li><a href="merge.c#hashridge">qh_hashridge</a> add
307ridge to hashtable </li>
308<li><a href="merge.c#hashridge_find">qh_hashridge_find</a>
309returns matching ridge in hashtable</li>
310<li><a href="merge.c#neighbor_intersections">qh_neighbor_intersections</a>
311return intersection of vertex sets for
312neighboring facets </li>
313<li><a href="merge.c#vertexridges">qh_vertexridges</a>
314return temporary set of ridges adjacent to a
315vertex </li>
316<li><a href="merge.c#vertexridges_facet">qh_vertexridges_facet</a>
317add adjacent ridges for a vertex in facet </li>
318</ul>
319
320<h3><a href="qh-merge.htm#TOC">&#187;</a><a name="mcheck">functions for check and
321trace</a></h3>
322<ul>
323<li><a href="merge.c#checkconnect">qh_checkconnect</a>
324check that new facets are connected </li>
325<li><a href="merge.c#tracemerge">qh_tracemerge</a>
326print trace message after merge </li>
327<li><a href="merge.c#tracemerging">qh_tracemerging</a>
328print trace message during post-merging </li>
329</ul>
330
331<p><!-- Navigation links --> </p>
332<hr>
333<p><b>Up:</b>
334<a href="http://www.qhull.org">Home page for
335Qhull</a> <br>
336<b>Up:</b> <a href="../../html/index.htm#TOC">Qhull manual: Table of Contents</a> <br>
337<b>Up:</b> <a href="../../html/qh-quick.htm#programs">Programs</a>
338&#149; <a href="../../html/qh-quick.htm#options">Options</a>
339&#149; <a href="../../html/qh-opto.htm#output">Output</a>
340&#149; <a href="../../html/qh-optf.htm#format">Formats</a>
341&#149; <a href="../../html/qh-optg.htm#geomview">Geomview</a>
342&#149; <a href="../../html/qh-optp.htm#print">Print</a>
343&#149; <a href="../../html/qh-optq.htm#qhull">Qhull</a>
344&#149; <a href="../../html/qh-optc.htm#prec">Precision</a>
345&#149; <a href="../../html/qh-optt.htm#trace">Trace</a><br>
346<b>Up:</b> <a href="../../html/qh-code.htm#TOC">Qhull code: Table of Contents</a> <br>
347<b>To:</b> <a href="index.htm">Qhull functions</a>, macros, and data structures<br>
348<b>To:</b> <a href="qh-geom.htm">Geom</a> &#149;
349<a href="qh-globa.htm">Global</a> &#149; <a href="qh-io.htm">Io</a>
350&#149; <a href="qh-mem.htm">Mem</a> &#149; <a href="qh-merge.htm">Merge</a>
351&#149; <a href="qh-poly.htm">Poly</a> &#149; <a href="qh-qhull.htm#TOC">Qhull</a>
352&#149; <a href="qh-set.htm">Set</a> &#149; <a href="qh-stat.htm">Stat</a>
353&#149; <a href="qh-user.htm">User</a><br>
354</p>
355<p><!-- GC common information --> </p>
356<hr>
357<p><a href="http://www.geom.uiuc.edu/"><img
358src="../../html/qh--geom.gif" align="middle" width="40" height="40"></a><i>The
359Geometry Center Home Page </i></p>
360<p>Comments to: <a href=mailto:qhull@qhull.org>qhull@qhull.org</a>
361</a><br>
362Created: May 2, 1997 --- <!-- hhmts start --> Last modified: see top <!-- hhmts end --> </p>
363</body>
364</html>
Note: See TracBrowser for help on using the repository browser.