Changeset 1357 for applications/robust
- Timestamp:
- 05/06/11 16:25:00 (14 years ago)
- Location:
- applications/robust
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/main.cpp
r1349 r1357 18 18 19 19 const int emlig_size = 2; 20 const int utility_constant = 10;20 const int utility_constant = 5; 21 21 22 22 … … 139 139 vector<vector<string>> strings; 140 140 141 char* file_strings[3] = {"c:\\data CDClosePercDiff","c:\\ar_student_single","c:\\ar_cauchy_single"};141 char* file_strings[3] = {"c:\\dataADClosePercDiff","c:\\ar_student_single","c:\\ar_cauchy_single"}; 142 142 143 143 for(int i = 0;i<3;i++) … … 166 166 } 167 167 } 168 169 168 170 169 171 for(int j = 0;j<strings.size();j++) … … 171 173 vector<vec> conditions; 172 174 //emlig* emliga = new emlig(2); 173 RARX* my_rarx = new RARX(2, 10,false);175 RARX* my_rarx = new RARX(2,8,false); 174 176 175 177 -
applications/robust/robustlib.cpp
r1349 r1357 169 169 base_ref++; 170 170 171 if(base_ref == simplex->vertices.end() )171 if(base_ref == simplex->vertices.end()&&simplex->vertices.size()!=2) 172 172 { 173 173 throw new exception("Equal local conditions are paired. If this ever occurs, the software has to be modified to include multiplied a_0!!"); 174 174 } 175 /* 176 else if(implex->vertices.size()==2) 177 { 178 return relative_coords[0]*exp 179 } 180 */ 175 181 176 182 order_correct = false; -
applications/robust/robustlib.h
r1356 r1357 22 22 using namespace itpp; 23 23 24 const double max_range = 5 0;//numeric_limits<double>::max()/10e-10;24 const double max_range = 5;//numeric_limits<double>::max()/10e-10; 25 25 26 26 /// An enumeration of possible actions performed on the polyhedrons. We can merge them or split them. … … 924 924 case 0: 925 925 current_parent->neutralchildren.push_back(sender); 926 current_parent->positiveneutralvertices.insert(sender->positiveneutralvertices.begin(),sender->positiveneutralvertices.end()); 927 current_parent->negativeneutralvertices.insert(sender->negativeneutralvertices.begin(),sender->negativeneutralvertices.end()); 926 927 if(level!=0) 928 { 929 current_parent->positiveneutralvertices.insert(sender->positiveneutralvertices.begin(),sender->positiveneutralvertices.end()); 930 current_parent->negativeneutralvertices.insert(sender->negativeneutralvertices.begin(),sender->negativeneutralvertices.end()); 931 } 932 else 933 { 934 current_parent->positiveneutralvertices.insert(*sender->vertices.begin()); 935 current_parent->negativeneutralvertices.insert(*sender->vertices.begin()); 936 } 928 937 929 938 if(sender->totally_neutral) … … 1317 1326 1318 1327 current_vertex->raise_multiplicity(); 1319 current_vertex->parentconditions.insert(condition_to_add); 1320 1321 current_vertex->negativeneutralvertices.insert(current_vertex); 1322 current_vertex->positiveneutralvertices.insert(current_vertex); 1328 current_vertex->parentconditions.insert(condition_to_add); 1323 1329 } 1324 1330 else … … 1367 1373 for(list<polyhedron*>::iterator merge_ref = for_merging[i].begin();merge_ref!=for_merging[i].end();merge_ref++) 1368 1374 { 1369 cout << (*merge_ref)->get_state(MERGE) << ","; 1370 } 1371 1372 cout << endl; 1375 1376 for(list<polyhedron*>::iterator par_ref = (*merge_ref)->children.begin();par_ref!=(*merge_ref)->children.end();par_ref++) 1377 { 1378 if(find((*par_ref)->parents.begin(),(*par_ref)->parents.end(),(*merge_ref))==(*par_ref)->parents.end()) 1379 { 1380 cout << "Parent/child relations are not matched!" << endl; 1381 } 1382 } 1383 1384 //cout << (*merge_ref)->get_state(MERGE) << ","; 1385 } 1386 1387 // cout << endl; 1373 1388 } 1374 1389 */ 1390 1391 1375 1392 1376 1393 cout << "Merging." << endl; … … 1591 1608 { 1592 1609 (*grand_p_ref)->totallyneutralgrandchildren.erase(*merge_ref); 1593 } 1610 } 1611 1612 statistic.delete_polyhedron(k-1,*merge_ref); 1613 1594 1614 1595 for_splitting[k-1].remove(*merge_ref);1596 1597 statistic.delete_polyhedron(k-1,*merge_ref);1598 1615 1599 1616 if(k==1) 1600 { 1617 { 1601 1618 vertices_to_be_reduced.insert((vertex*)(*merge_ref)); 1619 for_splitting[k-1].remove(*merge_ref); 1602 1620 } 1603 1621 else 1604 1622 { 1605 delete *merge_ref; 1623 delete (*merge_ref); 1624 for_splitting[k-1].remove(*merge_ref); 1606 1625 } 1607 1626 } … … 1620 1639 else 1621 1640 { 1622 delete *vert_ref;1641 delete (*vert_ref); 1623 1642 } 1624 1643 } … … 1812 1831 */ 1813 1832 1814 cout << "Normalization factor: " << normalization_factor << endl;1833 // cout << "Normalization factor: " << normalization_factor << endl; 1815 1834 1816 1835 log_nc = log(normalization_factor) + logfact(condition_order-number_of_parameters-2); … … 2708 2727 2709 2728 yt.ins(c_size,1.0); 2710 } 2711 2729 } 2730 2712 2731 if(yt.size() == posterior->number_of_parameters+1) 2713 2732 {