tlds
Transactional Operations for Linked Data Structures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
region.h
Go to the documentation of this file.
1 /* =============================================================================
2  *
3  * region.h
4  *
5  * =============================================================================
6  *
7  * Copyright (C) Stanford University, 2006. All Rights Reserved.
8  * Author: Chi Cao Minh
9  *
10  * =============================================================================
11  *
12  * For the license of bayes/sort.h and bayes/sort.c, please see the header
13  * of the files.
14  *
15  * ------------------------------------------------------------------------
16  *
17  * For the license of kmeans, please see kmeans/LICENSE.kmeans
18  *
19  * ------------------------------------------------------------------------
20  *
21  * For the license of ssca2, please see ssca2/COPYRIGHT
22  *
23  * ------------------------------------------------------------------------
24  *
25  * For the license of lib/mt19937ar.c and lib/mt19937ar.h, please see the
26  * header of the files.
27  *
28  * ------------------------------------------------------------------------
29  *
30  * For the license of lib/rbtree.h and lib/rbtree.c, please see
31  * lib/LEGALNOTICE.rbtree and lib/LICENSE.rbtree
32  *
33  * ------------------------------------------------------------------------
34  *
35  * Unless otherwise noted, the following license applies to STAMP files:
36  *
37  * Copyright (c) 2007, Stanford University
38  * All rights reserved.
39  *
40  * Redistribution and use in source and binary forms, with or without
41  * modification, are permitted provided that the following conditions are
42  * met:
43  *
44  * * Redistributions of source code must retain the above copyright
45  * notice, this list of conditions and the following disclaimer.
46  *
47  * * Redistributions in binary form must reproduce the above copyright
48  * notice, this list of conditions and the following disclaimer in
49  * the documentation and/or other materials provided with the
50  * distribution.
51  *
52  * * Neither the name of Stanford University nor the names of its
53  * contributors may be used to endorse or promote products derived
54  * from this software without specific prior written permission.
55  *
56  * THIS SOFTWARE IS PROVIDED BY STANFORD UNIVERSITY ``AS IS'' AND ANY
57  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
58  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
59  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL STANFORD UNIVERSITY BE LIABLE
60  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
61  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
62  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
63  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
64  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
66  * THE POSSIBILITY OF SUCH DAMAGE.
67  *
68  * =============================================================================
69  */
70 
71 
72 #ifndef REGION_H
73 #define REGION_H 1
74 
75 
76 #include "element.h"
77 #include "heap.h"
78 #include "mesh.h"
79 #include "tm.h"
80 
81 
82 typedef struct region region_t;
83 
84 
85 /* =============================================================================
86  * Pregion_alloc
87  * =============================================================================
88  */
89 region_t*
90 Pregion_alloc ();
91 region_t*
93 
94 
95 /* =============================================================================
96  * Pregion_free
97  * =============================================================================
98  */
99 void
100 Pregion_free (region_t* regionPtr);
101 void
102 TMregion_free (TM_ARGDECL region_t* regionPtr);
103 
104 
105 /* =============================================================================
106  * TMregion_refine
107  *
108  * Calculate refined triangles. The region is built by using a breadth-first
109  * search starting from the element (elementPtr) containing the new point we
110  * are adding. If expansion hits a boundary segment (encroachment) we build
111  * a region around that element instead, to avoid a potential infinite loop.
112  *
113  * Returns net number of elements added to mesh.
114  * =============================================================================
115  */
116 long
118  region_t* regionPtr, element_t* elementPtr, mesh_t* meshPtr);
119 
120 
121 /* =============================================================================
122  * Pregion_clearBad
123  * =============================================================================
124  */
125 void
126 Pregion_clearBad (region_t* regionPtr);
127 
128 
129 /* =============================================================================
130  * TMregion_transferBad
131  * =============================================================================
132  */
133 void
134 TMregion_transferBad (TM_ARGDECL region_t* regionPtr, heap_t* workHeapPtr);
135 
136 
137 #define PREGION_ALLOC() Pregion_alloc()
138 #define PREGION_FREE(r) Pregion_free(r)
139 #define PREGION_CLEARBAD(r) Pregion_clearBad(r)
140 #define TMREGION_REFINE(r, e, m) TMregion_refine(TM_ARG r, e, m)
141 #define TMREGION_TRANSFERBAD(r, q) TMregion_transferBad(TM_ARG r, q)
142 
143 
144 #endif /* REGION_H */
145 
146 
147 /* =============================================================================
148  *
149  * End of region.h
150  *
151  * =============================================================================
152  */
void Pregion_free(region_t *regionPtr)
Definition: region.c:146
region_t * TMregion_alloc(TM_ARGDECL_ALONE)
Definition: region.c:121
Definition: mesh.c:88
#define TM_ARGDECL
Definition: tm.h:532
Definition: element.c:84
long TMregion_refine(TM_ARGDECL region_t *regionPtr, element_t *elementPtr, mesh_t *meshPtr)
Definition: region.c:358
#define TM_ARGDECL_ALONE
Definition: tm.h:533
void Pregion_clearBad(region_t *regionPtr)
Definition: region.c:413
Definition: heap.c:78
void TMregion_free(TM_ARGDECL region_t *regionPtr)
Definition: region.c:156
region_t * Pregion_alloc()
Definition: region.c:101
Definition: region.c:84
void TMregion_transferBad(TM_ARGDECL region_t *regionPtr, heap_t *workHeapPtr)
Definition: region.c:424