49 | | leaf *tree; |
50 | | |
51 | | public: |
52 | | emlig(leaf *tree) : eEF(); |
53 | | |
54 | | emlig(vec [] conditions) : eEF(); |
| 119 | |
| 120 | vector<vector<&polyhedron>> statistic; |
| 121 | |
| 122 | public: |
| 123 | |
| 124 | emlig(int number_of_parameters) |
| 125 | { |
| 126 | create_statistic(int number_of_parameters); |
| 127 | } |
| 128 | |
| 129 | emlig(vector<vector<&polyhedron>> statistic) |
| 130 | { |
| 131 | this.statistic = statistic; |
| 132 | } |
| 133 | |
| 134 | |
| 135 | |
| 136 | protected: |
| 137 | |
| 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,); |
| 147 | |
| 148 | statistic.push_back(origin_vec); |
| 149 | |
| 150 | for(int i=0;i++;i<number_of_parameters) |
| 151 | { |
| 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)); |
| 157 | |
| 158 | |
| 159 | for(int j=0;j++;j<statistic.size()) |
| 160 | { |
| 161 | vector<&polyhedron>::iterator horiz_ref = statistic[j].begin(); |
| 162 | |
| 163 | int element_number = 0; |
| 164 | |
| 165 | do |
| 166 | { |
| 167 | if(!horiz_ref.parents.empty()) |
| 168 | { |
| 169 | vector<&polyhedron>::iterator end_ref = horiz_ref.parents.end(); |
| 170 | |
| 171 | vector<&polyhedron>::iterator parent_ref = horiz_ref.parents.begin(); |
| 172 | |
| 173 | do |
| 174 | { |
| 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 |
| 207 | { |
| 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(); |
| 220 | } |
| 221 | else |
| 222 | { |
| 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); |
| 232 | |
| 233 | new_statistic1[i+1].push_back(current_copy1); |
| 234 | new_statistic2[i+1].push_back(current_copy2); |
| 235 | |
| 236 | element_number++; |
| 237 | } |
| 238 | while(statistic[j].end() != horiz_ptr++) |
| 239 | } |
| 240 | |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | |
| 245 | |