25 | | vector<&polyhedron> parents; |
26 | | |
27 | | vector<&polyhedron> children; |
28 | | |
29 | | vector<&vertex> vertices; |
30 | | |
31 | | vector<&polyhedron> positivechildren; |
32 | | |
33 | | vector<&polyhedron> negativechildren; |
34 | | |
35 | | vector<&polyhedron> neutralchildren; |
36 | | |
37 | | vector<vector<&vertex>> triangulations; |
38 | | |
39 | | int multiplicity = 1; |
| 27 | /// A property having a value of 1 usually, with higher value only if the polyhedron arises as a coincidence of |
| 28 | /// more than just the necessary number of conditions. For example if a newly created line passes through an already |
| 29 | /// existing point, the points multiplicity will rise by 1. |
| 30 | int multiplicity; |
42 | | |
| 33 | /// A list of polyhedrons parents within the Hasse diagram. |
| 34 | vector<polyhedron*> parents; |
| 35 | |
| 36 | /// A list of polyhedrons children withing the Hasse diagram. |
| 37 | vector<polyhedron*> children; |
| 38 | |
| 39 | /// All the vertices of the given polyhedron |
| 40 | vector<vertex*> vertices; |
| 41 | |
| 42 | /// A list used for storing children that lie in the positive region related to a certain condition |
| 43 | vector<polyhedron*> positivechildren; |
| 44 | |
| 45 | /// A list used for storing children that lie in the negative region related to a certain condition |
| 46 | vector<polyhedron*> negativechildren; |
| 47 | |
| 48 | /// Children intersecting the condition |
| 49 | vector<polyhedron*> neutralchildren; |
| 50 | |
| 51 | /// List of triangulation polyhedrons of the polyhedron given by their relative vertices. |
| 52 | vector<vector<vertex*>> triangulations; |
| 53 | |
| 54 | /// A list of relative addresses serving for Hasse diagram construction. |
47 | | parents = new vector<&polyhedron>(); |
48 | | children = new vector<&polyhedron>(); |
49 | | vertices = new vector<&vertex>(); |
50 | | |
51 | | positivechildren = new vector(&polyhedron)(); |
52 | | negativechildren = new vector(&polyhedron)(); |
53 | | neutralchildren = new vector(&polyhedron)(); |
54 | | |
55 | | triangulations = new vector<vector<&vertex>>(); |
56 | | |
57 | | kids_rel_addresses = new vector<int>(); |
58 | | |
59 | | } |
60 | | |
61 | | |
| 60 | multiplicity = 1; |
| 61 | } |
| 62 | |
| 63 | /// Setter for raising multiplicity |
138 | | create_statistic(int number_of parameters) |
139 | | { |
140 | | vector<double> origin_coord = new vector<double>(); |
141 | | |
142 | | origin = new vertex(origin_coord); |
143 | | |
144 | | origin.vertices.push_back(origin); |
145 | | |
146 | | vector<&polyhedron> origin_vec = new vector(&polyhedron)(1,); |
| 157 | void create_statistic(int number_of_parameters) |
| 158 | { |
| 159 | vector<double> origin_coord; |
| 160 | |
| 161 | vertex *origin = new vertex(origin_coord); |
| 162 | |
| 163 | origin->vertices.push_back(origin); |
| 164 | |
| 165 | vector<polyhedron*> origin_vec; |
| 166 | |
| 167 | origin_vec.push_back(origin); |
152 | | vertex new_point1 = new vertex(origin.get_coordinates().push_back(max_range)); |
153 | | vertex new_point2 = new vertex(origin.get_coordinates().push_back(-max_range)); |
154 | | |
155 | | vector(vector(&polyhedron)) new_statistic1 = new vector(vector(&polyhedron)); |
156 | | vector(vector(&polyhedron)) new_statistic2 = new vector(vector(&polyhedron)); |
| 173 | vector<double> origin_coord1 = origin->get_coordinates(); |
| 174 | vector<double> origin_coord2 = origin->get_coordinates(); |
| 175 | |
| 176 | origin->push_coordinate(0); |
| 177 | |
| 178 | origin_coord1.push_back(max_range); |
| 179 | origin_coord2.push_back(-max_range); |
| 180 | |
| 181 | vertex *new_point1 = new vertex(origin_coord1); |
| 182 | vertex *new_point2 = new vertex(origin_coord2); |
| 183 | |
| 184 | vector<vector<polyhedron*>> new_statistic1; |
| 185 | vector<vector<polyhedron*>> new_statistic2; |
175 | | parent_ref.kids_rel_addresses.push_back(element_number); |
176 | | |
177 | | parent_ref++; |
178 | | } |
179 | | while(parent_ref!=end_ref) |
180 | | } |
181 | | |
182 | | toprow current_copy1 = new toprow(new vector<int>(i+2,0)); |
183 | | toprow current_copy2 = new toprow(new vector<int>(i+2,0)); |
184 | | |
185 | | vector<&vertex>::iterator vert_ref = horiz_ref.vertices.begin(); |
186 | | |
187 | | do |
188 | | { |
189 | | current_copy1.vertices.push_back(vert_ref); |
190 | | current_copy2.vertices.push_back(vert_ref); |
191 | | |
192 | | vert_ref++; |
193 | | } |
194 | | while(!vert_ref!=horiz_ref.vertices.end()) |
195 | | |
196 | | current_copy1.vertices.push_back(new_point1); |
197 | | current_copy2.vertices.push_back(new_point2); |
198 | | |
199 | | current_copy1.triangulations.push_back(current_copy1.vertices); |
200 | | current_copy2.triangulations.push_back(current_copy2.vertices); |
201 | | |
202 | | vector<int>::iterator kid_ref = horiz_ref.kids_rel_addresses.begin(); |
203 | | |
204 | | if(!horiz_ref.kids_rel_addresses.empty()) |
205 | | { |
206 | | do |
| 198 | (*parent_ref)->kids_rel_addresses.push_back(element_number); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | vector<double> vec1(i+2,0); |
| 203 | vector<double> vec2(i+2,0); |
| 204 | |
| 205 | toprow *current_copy1 = new toprow(vec1); |
| 206 | toprow *current_copy2 = new toprow(vec2); |
| 207 | |
| 208 | for(vector<vertex*>::iterator vert_ref = (*horiz_ref)->vertices.begin();vert_ref<(*horiz_ref)->vertices.end();vert_ref++) |
| 209 | { |
| 210 | current_copy1->vertices.push_back(*vert_ref); |
| 211 | current_copy2->vertices.push_back(*vert_ref); |
| 212 | } |
| 213 | |
| 214 | |
| 215 | current_copy1->vertices.push_back(new_point1); |
| 216 | current_copy2->vertices.push_back(new_point2); |
| 217 | |
| 218 | current_copy1->triangulations.push_back(current_copy1->vertices); |
| 219 | current_copy2->triangulations.push_back(current_copy2->vertices); |
| 220 | |
| 221 | |
| 222 | |
| 223 | if(!(*horiz_ref)->kids_rel_addresses.empty()) |
| 224 | { |
| 225 | for(vector<int>::iterator kid_ref = (*horiz_ref)->kids_rel_addresses.begin();kid_ref<(*horiz_ref)->kids_rel_addresses.end();kid_ref++) |
208 | | current_copy1.children.push_back(new_statistic1[i,kid_ref]); |
209 | | current_copy2.children.push_back(new_statistic2[i,kid_ref]); |
210 | | |
211 | | new_statistic1[i,kid_ref].parents.push_back(current_copy1); |
212 | | new_statistic2[i,kid_ref].parents.push_back(current_copy2); |
213 | | |
214 | | kid_ref++; |
215 | | |
216 | | } |
217 | | while(kid_ref!=horiz_ref.kids_rel_addresses.end()) |
218 | | |
219 | | horiz_ref.kids_rel_addresses.clear(); |
| 227 | current_copy1->children.push_back(new_statistic1[i][(*kid_ref)]); |
| 228 | current_copy2->children.push_back(new_statistic2[i][(*kid_ref)]); |
| 229 | |
| 230 | new_statistic1[i][(*kid_ref)]->parents.push_back(current_copy1); |
| 231 | new_statistic2[i][(*kid_ref)]->parents.push_back(current_copy2); |
| 232 | } |
| 233 | |
| 234 | (*horiz_ref)->kids_rel_addresses.clear(); |
223 | | current_copy1.children.push_back(new_point1); |
224 | | current_copy2.childern.push_back(new_point2); |
225 | | |
226 | | new_point1.parents.push_back(current_copy1); |
227 | | new_point2.parents.push_back(current_copy2); |
228 | | } |
229 | | |
230 | | current_copy1.children.push_back(horiz_ref); |
231 | | current_copy2.children.push_back(horiz_ref); |
| 238 | current_copy1->children.push_back(new_point1); |
| 239 | current_copy2->children.push_back(new_point2); |
| 240 | |
| 241 | new_point1->parents.push_back(current_copy1); |
| 242 | new_point2->parents.push_back(current_copy2); |
| 243 | } |
| 244 | |
| 245 | current_copy1->children.push_back(*horiz_ref); |
| 246 | current_copy2->children.push_back(*horiz_ref); |