Changeset 187
- Timestamp:
- 02/01/10 20:13:46 (14 years ago)
- Location:
- trunk/yao
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/YAOObjects/Order.cpp
r182 r187 766 766 // -------------------------------- 767 767 768 for(int i = 0; i < outerComp.size(); i++) Read (i);768 for(int i = 0; i < outerComp.size(); i++) Read3D(i); 769 769 770 770 break; … … 842 842 843 843 844 844 845 845 int Order::getCommonSignInner(int noFixed, int noFree, myGraphType& currentGraph) { 846 846 847 // Create a graph that will be fixed before to perform the sign analyzis (working graph) 848 // ------------------------------------------------------------------------------------- 849 847 850 myGraphType fixedGraph; 848 851 852 // Copy into the working graph the informations of the graph given as parameter 853 // ---------------------------------------------------------------------------- 854 849 855 copyGraph(currentGraph, fixedGraph); 850 856 851 fixGraph(fixedGraph, noFixed); 852 853 int recVal = 0; 854 855 for(tie(edgeIterOne, edgeIterTwo) = edges(fixedGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 856 857 int val0 = get(boost::edge_weight_d1_t(), fixedGraph, *edgeIterOne); 858 int val1 = get(boost::edge_weight_d2_t(), fixedGraph, *edgeIterOne); 859 int val2 = get(boost::edge_weight_d3_t(), fixedGraph, *edgeIterOne); 860 861 if(recVal != 2) { 862 863 switch(noFree) { 864 865 case 0: if(val0 != 0) { if(recVal + val0 == 0) { recVal = 2; } else { recVal = val0; } } break; 866 case 1: if(val1 != 0) { if(recVal + val1 == 0) { recVal = 2; } else { recVal = val1; } } break; 867 case 2: if(val2 != 0) { if(recVal + val2 == 0) { recVal = 2; } else { recVal = val2; } } break; 857 // Fix the working graph by keeping only edges with null value for the dimension "noFixed" given as parameter 858 // ---------------------------------------------------------------------------------------------------------- 859 860 fixGraph(fixedGraph, noFixed); 861 862 // Perform a sign analyzis on the fixed graph for the dimension "noFree" given as paramater 863 // ---------------------------------------------------------------------------------------- 864 865 return(getCommonSign(noFree, fixedGraph)); 866 867 }; 868 869 870 871 void Order::showOuter() { 872 873 cout << endl << "PROTOTYPE : outerComp[noComp3D]" << endl; 874 875 // For all 3D component embedded in the vector outerComp 876 // ----------------------------------------------------- 877 878 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 879 880 // Display all relevant informations on components : dimension and sign of the three first axis 881 // -------------------------------------------------------------------------------------------- 882 883 cout << endl << "outerComp[" << noComp3D << "].cfcSign[0].first : " << outerComp[noComp3D].cfcSign[0].first << " , second : " << outerComp[noComp3D].cfcSign[0].second; 884 cout << endl << "outerComp[" << noComp3D << "].cfcSign[1].first : " << outerComp[noComp3D].cfcSign[1].first << " , second : " << outerComp[noComp3D].cfcSign[1].second; 885 cout << endl << "outerComp[" << noComp3D << "].cfcSign[2].first : " << outerComp[noComp3D].cfcSign[2].first << " , second : " << outerComp[noComp3D].cfcSign[2].second; 886 887 cout << endl; 888 889 } 890 }; 891 892 893 void Order::showInner(int noFixed1, int noFixed2, int freeDim) { 894 895 cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl; 896 897 // For all 3D component embedded in the vector outerComp 898 // ------------------------------------------------------ 899 900 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 901 902 // For all 2D component embedded in the vector middleComp 903 // ------------------------------------------------------- 904 905 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 906 907 // For all 1D component embedded in the vector innerComp 908 // ----------------------------------------------------- 909 910 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) { 911 912 // Display all relevant informations on components : dimension and sign of the remaining axis then embedded moduls 913 // --------------------------------------------------------------------------------------------------------------- 914 915 916 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "] Dim1 : " << 917 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << " , second : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second; 918 919 cout << endl; 920 921 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) { 922 923 int noModd = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]; 924 925 cout << endl << "NO MOD : " << noModd; 926 927 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].embeddedModuls[" << noMod << "] : " 928 << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]); 929 930 } 931 932 cout << endl; 933 868 934 } 869 935 } 870 936 } 871 872 return(recVal);873 937 }; 874 875 876 877 void Order::showOuter() {878 879 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) {880 881 cout << endl << "outerComp[" << noComp3D << "].cfcSign[0].first : " << outerComp[noComp3D].cfcSign[0].first << " , second : " << outerComp[noComp3D].cfcSign[0].second;882 cout << endl << "outerComp[" << noComp3D << "].cfcSign[1].first : " << outerComp[noComp3D].cfcSign[1].first << " , second : " << outerComp[noComp3D].cfcSign[1].second;883 cout << endl << "outerComp[" << noComp3D << "].cfcSign[2].first : " << outerComp[noComp3D].cfcSign[2].first << " , second : " << outerComp[noComp3D].cfcSign[2].second;884 885 cout << endl;886 887 for(int noMod = 0; noMod < outerComp[noComp3D].embeddedModuls.size(); noMod++)888 cout << endl << "outerComp[" << noComp3D << "].embeddedModuls[" << noMod << "] : " << get(boost::vertex_name_t(), myGraph, outerComp[noComp3D].embeddedModuls[noMod]);889 cout << endl;890 }891 };892 893 894 void Order::showInner(int noFixed1, int noFixed2, int freeDim) {895 896 cout << endl << "showInner(" << noFixed1 << ", " << noFixed2 << ", " << freeDim << ")" << endl;897 898 cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl;899 900 901 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) {902 903 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) {904 905 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) {906 907 908 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "] Dim1 : " <<909 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << " , second : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second;910 911 cout << endl;912 913 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) {914 915 int noModd = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod];916 917 cout << endl << "NO MOD : " << noModd;918 919 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].embeddedModuls[" << noMod << "] : "920 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod] << " ==> "921 << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod])922 << " noMod : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod];923 924 }925 926 cout << endl;927 928 }929 }930 }931 };932 933 934 935 936 937 938 938 939 … … 1089 1090 if(outerComp[noComponent].cfcSign[2].second == 2) 1090 1091 if(outerComp[noComponent].cfcSign[1].second != 2) 1091 if(!isToDecompose(0, 1, 2, myGraph)) 1092 // if(!isToDecompose(0, 1, 2, myGraph)) 1093 if(!isToDecompose(2, myGraph)) 1092 1094 1093 1095 outerComp[noComponent].cfcSign[2].second = 3; … … 1109 1111 if(outerComp[noComponent].cfcSign[2].second == 2) 1110 1112 if(outerComp[noComponent].cfcSign[1].second != 2) 1111 if(!isToDecompose(0, 1, 2, myGraph)) 1113 // if(!isToDecompose(0, 1, 2, myGraph)) 1114 if(!isToDecompose(2, myGraph)) 1112 1115 1113 1116 outerComp[noComponent].cfcSign[2].second = 3; … … 1127 1130 if(outerComp[noComponent].cfcSign[2].second == 2) 1128 1131 if(outerComp[noComponent].cfcSign[1].second != 2) 1129 if(!isToDecompose(0, 1, 2, myGraph)) 1132 // if(!isToDecompose(0, 1, 2, myGraph)) 1133 if(!isToDecompose(2, myGraph)) 1130 1134 1131 1135 outerComp[noComponent].cfcSign[2].second = 3; … … 1150 1154 if(outerComp[noComponent].cfcSign[1].second == 2) 1151 1155 if(outerComp[noComponent].cfcSign[2].second != 2) 1152 if(!isToDecompose(0, 2, 1, myGraph)) 1156 // if(!isToDecompose(0, 2, 1, myGraph)) 1157 if(!isToDecompose(1, myGraph)) 1153 1158 1154 1159 outerComp[noComponent].cfcSign[1].second = 3; … … 1175 1180 if(outerComp[noComponent].cfcSign[0].second == 2) 1176 1181 if(outerComp[noComponent].cfcSign[2].second != 2) 1177 if(!isToDecompose(1, 2, 0, myGraph)) 1182 // if(!isToDecompose(1, 2, 0, myGraph)) 1183 if(!isToDecompose(0, myGraph)) 1178 1184 1179 1185 outerComp[noComponent].cfcSign[0].second = 3; … … 1200 1206 if(outerComp[noComponent].cfcSign[2].second == 2) 1201 1207 if(outerComp[noComponent].cfcSign[0].second != 2) 1202 if(!isToDecompose(1, 0, 2, myGraph)) 1208 // if(!isToDecompose(1, 0, 2, myGraph)) 1209 if(!isToDecompose(2, myGraph)) 1203 1210 1204 1211 outerComp[noComponent].cfcSign[2].second = 3; … … 1226 1233 if(outerComp[noComponent].cfcSign[1].second == 2) 1227 1234 if(outerComp[noComponent].cfcSign[0].second != 2) 1228 if(!isToDecompose(2, 0, 1, myGraph)) 1235 // if(!isToDecompose(2, 0, 1, myGraph)) 1236 if(!isToDecompose(1, myGraph)) 1229 1237 1230 1238 outerComp[noComponent].cfcSign[1].second = 3; … … 1416 1424 1417 1425 1426 1427 1418 1428 void Order::keepComponent(int noComp, myGraphType& componentGraph) { 1419 1429 1420 1430 typedef boost::graph_traits<myGraphType>::edge_iterator edgeIterType; 1421 1431 1422 1432 std::vector<edgeIterType> edgeIterVector; 1423 1433 1434 // Insert all edges of the graph inside a vector of edge 1435 // ----------------------------------------------------- 1436 1424 1437 for(tie(edgeIterOne, edgeIterTwo) = edges(componentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) edgeIterVector.push_back(edgeIterOne); 1425 1438 1439 // Reverse the vector to avoid a mess in the indexes when the edges are deleted 1440 // ---------------------------------------------------------------------------- 1441 1426 1442 reverse(edgeIterVector.begin(), edgeIterVector.end()); 1427 1443 1444 // For all edges embeded in the vector 1445 // ----------------------------------- 1446 1428 1447 for(int i = 0; i < edgeIterVector.size(); i++) 1429 1448 1449 // If the edge does not connect two nodes of the component "noComp" given as parameter (ie. if the edge is not fully integrated in the comoponent) 1450 // ----------------------------------------------------------------------------------------------------------------------------------------------- 1451 1430 1452 if( get(boost::vertex_affected_comp_t(), componentGraph, boost::source(*(edgeIterVector[i]), componentGraph)) != noComp || 1431 1432 get(boost::vertex_affected_comp_t(), componentGraph, boost::target(*(edgeIterVector[i]), componentGraph)) != noComp ) 1453 1454 get(boost::vertex_affected_comp_t(), componentGraph, boost::target(*(edgeIterVector[i]), componentGraph)) != noComp ) 1455 1456 1457 // Remove the edge for keeping just edges of the relevant component 1458 // ---------------------------------------------------------------- 1433 1459 1434 1460 boost::remove_edge(*(edgeIterVector[i]), componentGraph); 1435 1461 1436 typedef boost::graph_traits<myGraphType>::vertex_iterator vertexIterType; 1437 1438 std::vector<vertexIterType> vertexIterVector; 1439 1440 for(tie(vertexIterOne, vertexIterTwo) = vertices(componentGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) vertexIterVector.push_back(vertexIterOne); 1441 1442 reverse(vertexIterVector.begin(), vertexIterVector.end()); 1443 1444 for(int i = 0; i < vertexIterVector.size(); i++) 1445 1446 if(get(boost::vertex_affected_comp_t(), componentGraph, *(vertexIterVector[i])) != noComp) 1447 1448 boost::remove_vertex(*(vertexIterVector[i]), componentGraph); 1449 1450 }; 1451 1452 1453 1454 1455 1462 typedef boost::graph_traits<myGraphType>::vertex_iterator vertexIterType; 1463 1464 std::vector<vertexIterType> vertexIterVector; 1465 1466 // Insert all vertices of the graph inside a vector of vertex 1467 // ---------------------------------------------------------- 1468 1469 for(tie(vertexIterOne, vertexIterTwo) = vertices(componentGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) vertexIterVector.push_back(vertexIterOne); 1470 1471 // Reverse the vector to avoid a mess in the indexes when the vertices are deleted 1472 // ---------------------------------------------------------------------------- 1473 1474 reverse(vertexIterVector.begin(), vertexIterVector.end()); 1475 1476 // For all vertices embeded in the vector 1477 // ----------------------------------- 1478 1479 for(int i = 0; i < vertexIterVector.size(); i++) 1480 1481 // If the vertex is not a part of the component "noComp" given as parameter 1482 // ------------------------------------------------------------------------ 1483 1484 if(get(boost::vertex_affected_comp_t(), componentGraph, *(vertexIterVector[i])) != noComp) 1485 1486 // Remove the vertex for keeping just vertices of the relevant component 1487 // --------------------------------------------------------------------- 1488 1489 boost::remove_vertex(*(vertexIterVector[i]), componentGraph); 1490 1491 }; 1456 1492 1457 1493 … … 1486 1522 1487 1523 1524 1525 1488 1526 int Order::getCommonSign(int noAxis, myGraphType& fixedGraph) { 1489 1527 1528 // Initial value set to zero (which means free sign) 1529 // ------------------------------------------------- 1530 1490 1531 int recVal = 0; 1491 1532 1492 for(tie(edgeIterOne, edgeIterTwo) = edges(fixedGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1493 1494 int val0 = get(boost::edge_weight_d1_t(), fixedGraph, *edgeIterOne); 1495 int val1 = get(boost::edge_weight_d2_t(), fixedGraph, *edgeIterOne); 1496 int val2 = get(boost::edge_weight_d3_t(), fixedGraph, *edgeIterOne); 1497 1498 if(recVal != 2) { 1499 1500 switch(noAxis) { 1501 1502 case 0: if(val0 != 0) { if(recVal + val0 == 0) { recVal = 2; } else { recVal = val0; } } break; 1503 case 1: if(val1 != 0) { if(recVal + val1 == 0) { recVal = 2; } else { recVal = val1; } } break; 1504 case 2: if(val2 != 0) { if(recVal + val2 == 0) { recVal = 2; } else { recVal = val2; } } break; 1505 } 1506 1507 } 1508 } 1533 // For all edges of the graph 1534 // -------------------------- 1535 1536 for(tie(edgeIterOne, edgeIterTwo) = edges(fixedGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1537 1538 // Get informations on the sign for the dimensions i, j and k 1539 // ----------------------------------------------------------- 1540 1541 int val0 = get(boost::edge_weight_d1_t(), fixedGraph, *edgeIterOne); 1542 int val1 = get(boost::edge_weight_d2_t(), fixedGraph, *edgeIterOne); 1543 int val2 = get(boost::edge_weight_d3_t(), fixedGraph, *edgeIterOne); 1544 1545 // If the recorded value recVal is not equal to 2 (ie. if it is equal to 2, there is no need to go further in the sign analyzis) 1546 // ----------------------------------------------------------------------------------------------------------------------------- 1547 1548 if(recVal != 2) { 1549 1550 // The sign analyzed is this of the dimension "noAxis" given as parameter 1551 // ---------------------------------------------------------------------- 1552 1553 switch(noAxis) { 1554 1555 // If the current value is not null and recVal + the current value is equal to zero, it means there is a couple -1 an +1 and then no common sign 1556 // --------------------------------------------------------------------------------------------------------------------------------------------- 1557 1558 case 0: if(val0 != 0) { if(recVal + val0 == 0) { recVal = 2; } else { recVal = val0; } } break; 1559 case 1: if(val1 != 0) { if(recVal + val1 == 0) { recVal = 2; } else { recVal = val1; } } break; 1560 case 2: if(val2 != 0) { if(recVal + val2 == 0) { recVal = 2; } else { recVal = val2; } } break; 1561 } 1562 } 1563 } 1509 1564 1510 1565 return(recVal); … … 1514 1569 1515 1570 1516 1517 1518 void Order::copyGraph( myGraphType& upperGraph, myGraphType& outGraph) { 1519 1520 for(int noVertex = 0; noVertex < boost::num_vertices(upperGraph); noVertex++) add_vertex(outGraph); 1571 1572 void Order::copyGraph( myGraphType& upperGraph, myGraphType& outGraph) { 1573 1574 // Create a new graph "outGraph" with one vertex for each vertex of the graph that have to be copied "upperGraph" 1575 // -------------------------------------------------------------------------------------------------------------- 1576 1577 for(int noVertex = 0; noVertex < boost::num_vertices(upperGraph); noVertex++) add_vertex(outGraph); 1578 1579 // Add one edge for each edge of the graph that have to be copied (the vertices are created with the same indexes than in the original graph and then the edges connect the right vertices) 1580 // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1581 1521 1582 for(tie(edgeIterOne, edgeIterTwo) = edges(upperGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) add_edge(boost::source(*edgeIterOne, upperGraph), boost::target(*edgeIterOne, upperGraph), outGraph); 1522 1583 1584 // For all vertices 1585 // ---------------- 1586 1523 1587 for(tie(vertexIterOne, vertexIterTwo) = vertices(upperGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 1524 1525 put(get(boost::vertex_name_t(), outGraph), *vertexIterOne, get(boost::vertex_name_t(), upperGraph, *vertexIterOne)); 1526 put(get(boost::vertex_topo_order_t(), outGraph), *vertexIterOne, get(boost::vertex_topo_order_t(), upperGraph, *vertexIterOne)); 1527 put(get(boost::vertex_affected_comp_t(), outGraph), *vertexIterOne, get(boost::vertex_affected_comp_t(), upperGraph, *vertexIterOne)); 1528 put(get(boost::vertex_original_id_t(), outGraph), *vertexIterOne, get(boost::vertex_original_id_t(), upperGraph, *vertexIterOne)); 1529 1530 } 1588 1589 // Copy the properties from the original graph into the target graph 1590 // ----------------------------------------------------------------- 1591 1592 put(get(boost::vertex_name_t(), outGraph), *vertexIterOne, get(boost::vertex_name_t(), upperGraph, *vertexIterOne)); 1593 put(get(boost::vertex_topo_order_t(), outGraph), *vertexIterOne, get(boost::vertex_topo_order_t(), upperGraph, *vertexIterOne)); 1594 put(get(boost::vertex_affected_comp_t(), outGraph), *vertexIterOne, get(boost::vertex_affected_comp_t(), upperGraph, *vertexIterOne)); 1595 put(get(boost::vertex_original_id_t(), outGraph), *vertexIterOne, get(boost::vertex_original_id_t(), upperGraph, *vertexIterOne)); 1596 1597 } 1531 1598 1532 1599 … … 1539 1606 put(get(boost::edge_weight_d3_t(), outGraph), *edgeIterOne, get(boost::edge_weight_d3_t(), upperGraph, *edgeIterOne)); 1540 1607 1541 1608 } 1542 1609 */ 1543 1610 1544 1545 std::vector<int> dim_1; 1546 std::vector<int> dim_2; 1547 std::vector<int> dim_3; 1611 // As it is not possible to populate the edges properties the same way than the vertices properties, this operation is made in two steps : data structures are populated 1612 // from the source graph then target graph properties are populated from the structures 1613 1614 // Create one vector by edge property that have to be copied in the new graph 1615 // -------------------------------------------------------------------------- 1616 1617 std::vector<int> dim_1; 1618 std::vector<int> dim_2; 1619 std::vector<int> dim_3; 1620 1621 // For all edges in the original graph 1622 // ----------------------------------- 1548 1623 1549 1624 for(tie(edgeIterOne, edgeIterTwo) = edges(upperGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1550 1625 1551 dim_1.push_back(get(boost::edge_weight_d1_t(), upperGraph, *edgeIterOne)); 1552 dim_2.push_back(get(boost::edge_weight_d2_t(), upperGraph, *edgeIterOne)); 1553 dim_3.push_back(get(boost::edge_weight_d3_t(), upperGraph, *edgeIterOne)); 1554 1555 } 1626 // Insert the properties into the dedicated vectors 1627 // ------------------------------------------------ 1628 1629 dim_1.push_back(get(boost::edge_weight_d1_t(), upperGraph, *edgeIterOne)); 1630 dim_2.push_back(get(boost::edge_weight_d2_t(), upperGraph, *edgeIterOne)); 1631 dim_3.push_back(get(boost::edge_weight_d3_t(), upperGraph, *edgeIterOne)); 1632 1633 } 1556 1634 1557 1635 int cmptArc = 0; 1558 1636 1637 // For all edges in the target graph 1638 // --------------------------------- 1639 1559 1640 for(tie(edgeIterOne, edgeIterTwo) = edges(outGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1560 1641 1561 put(get(boost::edge_weight_d1_t(), outGraph), *edgeIterOne, dim_1[cmptArc]); 1562 put(get(boost::edge_weight_d2_t(), outGraph), *edgeIterOne, dim_2[cmptArc]); 1563 put(get(boost::edge_weight_d3_t(), outGraph), *edgeIterOne, dim_3[cmptArc]); 1564 1565 cmptArc++; 1566 1567 } 1642 // Populate the properties from the dedicated vector 1643 // ------------------------------------------------- 1644 1645 put(get(boost::edge_weight_d1_t(), outGraph), *edgeIterOne, dim_1[cmptArc]); 1646 put(get(boost::edge_weight_d2_t(), outGraph), *edgeIterOne, dim_2[cmptArc]); 1647 put(get(boost::edge_weight_d3_t(), outGraph), *edgeIterOne, dim_3[cmptArc]); 1648 1649 cmptArc++; 1650 1651 } 1568 1652 1569 1653 }; 1570 1654 1571 1655 1572 1573 void Order::showGraph( myGraphType& currentGraph) { 1574 1575 cout << endl << "showGraph(currentGraph) : " << endl << endl; 1576 1577 int cmptMod = 0; 1578 1579 for(tie(vertexIterOne, vertexIterTwo) = vertices(currentGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 1580 1581 cout << endl << "Module " << cmptMod << ":\t" 1582 << "Nom : " << get(boost::vertex_name_t(), myGraph, get(boost::vertex_original_id_t(), currentGraph, *vertexIterOne)) 1583 << ", No ordre : " << get(boost::vertex_topo_order_t(), currentGraph, *vertexIterOne) 1584 << ", No Composante : " << get(boost::vertex_affected_comp_t(), currentGraph, *vertexIterOne) 1585 << ", No Id graph original : " << get(boost::vertex_original_id_t(), currentGraph, *vertexIterOne); 1586 1587 cmptMod++; 1588 1589 } 1590 1591 int cmptArc = 0; 1592 1593 cout << endl << endl; 1594 1595 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1596 1597 cout << endl << "Arc " << cmptArc << " :\t" 1598 << get(boost::vertex_name_t(), currentGraph, boost::source(*edgeIterOne, currentGraph)) 1599 << " ( " << get(boost::edge_weight_d1_t(), currentGraph, *edgeIterOne) 1600 << ", " << get(boost::edge_weight_d2_t(), currentGraph, *edgeIterOne) 1601 << ", " << get(boost::edge_weight_d3_t(), currentGraph, *edgeIterOne) 1602 <<") ==> " << get(boost::vertex_name_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)); 1603 1604 cmptArc++; 1605 1606 } 1607 }; 1608 1609 1610 1656 void Order::showGraph( myGraphType& currentGraph) { 1657 1658 cout << endl << "showGraph : " << endl << endl; 1659 1660 int cmptMod = 0; 1661 1662 // For all vertex embedded in the current graph 1663 // -------------------------------------------- 1664 1665 for(tie(vertexIterOne, vertexIterTwo) = vertices(currentGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 1666 1667 // Display all relevant informations on the vertex (ie the modul) 1668 // -------------------------------------------------------------- 1669 1670 cout << endl << "Module " << cmptMod << ":\t" 1671 1672 // Name of the modul as it appears in the description file 1673 // ------------------------------------------------------- 1674 1675 << "Nom : " << get(boost::vertex_name_t(), myGraph, get(boost::vertex_original_id_t(), currentGraph, *vertexIterOne)) 1676 1677 // Order affected to the modul in the current graph (iformation coming from the topological sort) 1678 // ---------------------------------------------------------------------------------------------- 1679 1680 << ", No ordre : " << get(boost::vertex_topo_order_t(), currentGraph, *vertexIterOne) 1681 1682 // Component in which the modul is integrated (infromation coming from the strong component search) 1683 // ------------------------------------------------------------------------------------------------ 1684 1685 << ", No Composante : " << get(boost::vertex_affected_comp_t(), currentGraph, *vertexIterOne) 1686 1687 // Index that is affected to the modul in the main graph (as vertices are automatically indexed by boost, it is very important to keep this information inside the sub-graphs) 1688 // --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1689 1690 << ", No Id graph original : " << get(boost::vertex_original_id_t(), currentGraph, *vertexIterOne); 1691 1692 cmptMod++; 1693 } 1694 1695 1696 int cmptArc = 0; 1697 1698 cout << endl << endl; 1699 1700 // For all edge embedded in the current graph 1701 // ------------------------------------------ 1702 1703 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 1704 1705 // Display all relevant informations on the edge (ie connection between two moduls) 1706 // -------------------------------------------------------------------------------- 1707 1708 cout << endl << "Arc " << cmptArc << " :\t" 1709 1710 // Name of the source modul of the connection 1711 // ------------------------------------------ 1712 1713 << get(boost::vertex_name_t(), currentGraph, boost::source(*edgeIterOne, currentGraph)) 1714 1715 // Sign of the dimension i of the connection 1716 // ----------------------------------------- 1717 1718 << " ( " << get(boost::edge_weight_d1_t(), currentGraph, *edgeIterOne) 1719 1720 // Sign of the dimension j of the connection 1721 // ----------------------------------------- 1722 1723 << ", " << get(boost::edge_weight_d2_t(), currentGraph, *edgeIterOne) 1724 1725 // Sign of the dimension k of the connection 1726 // ----------------------------------------- 1727 1728 << ", " << get(boost::edge_weight_d3_t(), currentGraph, *edgeIterOne) 1729 1730 // Name of the tagret modul of the connection 1731 // ------------------------------------------ 1732 1733 <<") ==> " << get(boost::vertex_name_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)); 1734 cmptArc++; 1735 1736 } 1737 }; 1738 1739 1740 1611 1741 void Order::readParam(int noAxis, int valAxis, int noParam) { 1612 1742 1743 // Static value that record the last parameter level that have been inserted (ie parameter position in the order statement) 1744 // ------------------------------------------------------------------------------------------------------------------------ 1745 1613 1746 static int lastParam; 1614 1747 1748 // The function have a special behaviour if noParam have a null value 1749 // ------------------------------------------------------------------ 1750 1615 1751 if(noParam > 0) { 1616 1752 1617 int deltaParam = lastParam - noParam; 1618 1619 lastParam = noParam; 1620 1621 switch(deltaParam) { 1622 1623 case 0: 1624 if(noParam == 3) cout << endl << endl << "\t\tforder"; 1625 if(noParam == 2) cout << endl << endl << "\tforder"; 1626 if(noParam == 1) cout << endl << endl << "forder"; 1627 break; 1628 1629 case 1: 1630 if(noParam == 2) cout << endl << endl << "\t\tforder" << endl << "\tforder"; 1631 if(noParam == 1) cout << endl << endl << "\tforder" << endl << "forder"; 1632 break; 1633 1634 case 2: cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder"; 1635 break; 1636 } 1637 1638 1639 1640 switch(noParam) { 1641 1642 case 1: cout << endl << endl; break; 1643 case 2: cout << endl << endl << "\t"; break; 1644 case 3: cout << endl << endl << "\t\t"; break; 1645 } 1646 1647 switch(valAxis) { 1648 1649 case 0: cout << "order " << "\t" << "Y." << noAxis + 1; break; 1650 case 3: cout << "order " << "\t" << "Y." << noAxis + 1; break; 1651 case -1: cout << "order " << "\t" << "YA" << noAxis + 1; break; 1652 case 1: cout << "order " << "\t" << "YB" << noAxis + 1; break; 1653 case 2: cout << "order " << "\t" << "Y." << noAxis + 1; break; // A VOIR !!!! 1654 } 1753 // Record the difference between the current parameter level and the former parameter level 1754 // ---------------------------------------------------------------------------------------- 1755 1756 int deltaParam = lastParam - noParam; 1757 1758 // Reset the lastParam static value with the current parameter level (for the next function call) 1759 // ---------------------------------------------------------------------------------------------- 1760 1761 lastParam = noParam; 1762 1763 // Accordignly to the difference of levels, the number of "forder" tokens to close the order statement will be different 1764 // --------------------------------------------------------------------------------------------------------------------- 1765 1766 switch(deltaParam) { 1767 1768 // If there is no difference between the last level and the current one, then one order have to be closed (those of the current level) 1769 // ----------------------------------------------------------------------------------------------------------------------------------- 1770 1771 case 0: 1772 1773 // If the current level is the third one, it means the order have to be closed with two tabulation offsets 1774 // ------------------------------------------------------------------------------------------------------- 1775 1776 if(noParam == 3) cout << endl << endl << "\t\tforder"; 1777 1778 // If the current level is the second one, it means the order have to be closed with one tabulation offset 1779 // ------------------------------------------------------------------------------------------------------- 1780 1781 if(noParam == 2) cout << endl << endl << "\tforder"; 1782 1783 // If the current level is the first one, it means the order have to be closed without tabulation offset 1784 // ----------------------------------------------------------------------------------------------------- 1785 1786 if(noParam == 1) cout << endl << endl << "forder"; 1787 break; 1788 1789 // If the last parameter is one level higer than the current one, then two parameters have to be closed (one for the current level and one for the higher) 1790 // -------------------------------------------------------------------------------------------------------------------------------------------------------- 1791 1792 case 1: 1793 1794 // If the current parameter is the second one, the order statement have to be closed with two tabulation offset then one tabulation offset 1795 // --------------------------------------------------------------------------------------------------------------------------------------- 1796 1797 if(noParam == 2) cout << endl << endl << "\t\tforder" << endl << "\tforder"; 1798 1799 // If the current parameter is the first one, the order statement have to be closed with one tabulation offset then no offset 1800 // --------------------------------------------------------------------------------------------------------------------------- 1801 1802 if(noParam == 1) cout << endl << endl << "\tforder" << endl << "forder"; 1803 break; 1804 1805 // If the last parameter is two levels higer than the current one, then three parameters have to be closed (one for the current level and one for each higer) 1806 // ----------------------------------------------------------------------------------------------------------------------------------------------------------- 1807 1808 case 2: 1809 1810 // The order statement have to be closed with two tabulations (higer level), one tabulation (middle level) and no tabulation (lower level) 1811 // ---------------------------------------------------------------------------------------------------------------------------------------- 1812 1813 cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder"; 1814 1815 break; 1816 1817 } 1818 1819 1820 // Set up tabulation offsets for displaying moduls after the order parameters 1821 // -------------------------------------------------------------------------- 1822 1823 switch(noParam) { 1824 1825 // If the parameter is the first, then no offset is needed 1826 // ------------------------------------------------------- 1827 1828 case 1: cout << endl << endl; break; 1829 1830 // If the parameter is the second, then one offset is needed 1831 // --------------------------------------------------------- 1832 1833 case 2: cout << endl << endl << "\t"; break; 1834 1835 // If the parameter is the third, then two offsets are needed 1836 // ---------------------------------------------------------- 1837 1838 case 3: cout << endl << endl << "\t\t"; break; 1839 } 1840 1841 // Set up the parameter sign accordignly to the axis value 1842 // ------------------------------------------------------- 1843 1844 switch(valAxis) { 1845 1846 // If the axis value is set to 0 (null values on each edges), then the dimension can be crossed both way (free) 1847 // ------------------------------------------------------------------------------------------------------------ 1848 1849 case 0: cout << "order " << "\t" << "Y." << noAxis + 1; break; 1850 1851 // If the axis value is set to 3 (no edges), then the dimension can be crossed both way (free) 1852 // ------------------------------------------------------------------------------------------- 1853 1854 case 3: cout << "order " << "\t" << "Y." << noAxis + 1; break; 1855 1856 // If the axis value is set to -1, then the dimension must be crossed increasingly 1857 // ------------------------------------------------------------------------------- 1858 1859 case -1: cout << "order " << "\t" << "YA" << noAxis + 1; break; 1860 1861 // If the axis value is set to +1, then the dimension must be crossed decreasingly 1862 // ------------------------------------------------------------------------------- 1863 1864 case 1: cout << "order " << "\t" << "YB" << noAxis + 1; break; 1865 1866 // If the axis value is set to 2 (no common value), then the dimension can be crossed both way (free) 1867 // -------------------------------------------------------------------------------------------------- 1868 1869 case 2: cout << "order " << "\t" << "Y." << noAxis + 1; break; // A VOIR !!!! 1870 } 1655 1871 } 1656 1872 1873 // If the function is called with a null value for noParam, then tho order statement must be closed 1874 // ------------------------------------------------------------------------------------------------ 1657 1875 1658 1876 else { 1659 1877 1660 if(lastParam == 3) cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl; 1661 if(lastParam == 2) cout << endl << endl << "\tforder" << endl << "forder" << endl << endl; 1662 if(lastParam == 1) cout << endl << endl << "forder" << endl << endl; 1663 } 1878 // If the last parameter was the third in the order statement, then three parameters have to be closed (one for each open parameter) 1879 // --------------------------------------------------------------------------------------------------------------------------------- 1880 1881 if(lastParam == 3) cout << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl; 1882 1883 // If the last parameter was the second in the order statement, then two parameters have to be closed (one for each open parameter) 1884 // -------------------------------------------------------------------------------------------------------------------------------- 1885 1886 if(lastParam == 2) cout << endl << endl << "\tforder" << endl << "forder" << endl << endl; 1887 1888 // If the last parameter was the first in the order statement, then one parameter have to be closed 1889 // ------------------------------------------------------------------------------------------------ 1890 1891 if(lastParam == 1) cout << endl << endl << "forder" << endl << endl; 1892 } 1664 1893 1665 1894 1666 1895 }; 1667 1668 1896 1669 1897 … … 1842 2070 1843 2071 1844 1845 2072 void Order::fixGraph(myGraphType& currentGraph, int noFixedDim) { 1846 2073 1847 typedef boost::graph_traits<myGraphType>::edge_iterator edgeIterType; 1848 1849 std::vector<edgeIterType> edgeIterVector; 1850 1851 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) edgeIterVector.push_back(edgeIterOne); 1852 1853 reverse(edgeIterVector.begin(), edgeIterVector.end()); 1854 1855 for(int i = 0; i < edgeIterVector.size(); i++) { 1856 1857 if(noFixedDim == 0) if(get(boost::edge_weight_d1_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 1858 if(noFixedDim == 1) if(get(boost::edge_weight_d2_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 1859 if(noFixedDim == 2) if(get(boost::edge_weight_d3_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 1860 } 1861 }; 2074 // Putting iterators inside a vector is more convenient , especially for deletions 2075 // ------------------------------------------------------------------------------- 2076 2077 typedef boost::graph_traits<myGraphType>::edge_iterator edgeIterType; 2078 2079 std::vector<edgeIterType> edgeIterVector; 2080 2081 // Insert all edges of the graph inside a vector of edge 2082 // ----------------------------------------------------- 2083 2084 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) edgeIterVector.push_back(edgeIterOne); 2085 2086 // Reverse the vector to avoid a mess in the indexes when the edges are deleted 2087 // ---------------------------------------------------------------------------- 2088 2089 reverse(edgeIterVector.begin(), edgeIterVector.end()); 2090 2091 // For all edges inside the vector 2092 // ------------------------------- 2093 2094 for(int i = 0; i < edgeIterVector.size(); i++) { 2095 2096 // If the sign value for the edge is not null for the dimension "noFixedDim" given as parameter, then delete the edge 2097 // ------------------------------------------------------------------------------------------------------------------ 2098 2099 if(noFixedDim == 0) if(get(boost::edge_weight_d1_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 2100 if(noFixedDim == 1) if(get(boost::edge_weight_d2_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 2101 if(noFixedDim == 2) if(get(boost::edge_weight_d3_t(), currentGraph, *(edgeIterVector[i])) != 0) boost::remove_edge(*(edgeIterVector[i]), currentGraph); 2102 } 2103 }; 1862 2104 1863 2105 … … 1865 2107 void Order::reduceGraph(myGraphType innerGraph, myGraphType& outerGraph, int nbComp) { 1866 2108 1867 // Create a graph that will contain one vertex by component 1868 1869 for(int noComp = 0; noComp < nbComp; noComp++) add_vertex(outerGraph); 1870 1871 // For all edges in the currentGraph 2109 // Create a graph that will contain one vertex by component 2110 // -------------------------------------------------------- 2111 2112 for(int noComp = 0; noComp < nbComp; noComp++) add_vertex(outerGraph); 2113 2114 // For all edges in the graph that have to reduced 2115 // ----------------------------------------------- 1872 2116 1873 2117 for(tie(edgeIterOne, edgeIterTwo) = edges(innerGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { … … 1878 2122 1879 2123 // If the target and the source modul of the edge are not in the same component, add an edge to the reduced graph 2124 // -------------------------------------------------------------------------------------------------------------- 1880 2125 1881 2126 if(sourceComp != targetComp) add_edge(sourceComp, targetComp, outerGraph); 1882 2127 1883 2128 } 1884 2129 }; 1885 2130 1886 1887 1888 1889 2131 1890 2132 … … 1918 2160 // --------------------------------------------------------- 1919 2161 1920 for(tie(vertexIterOne, vertexIterTwo) = vertices(fixedGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) put(get(boost::vertex_affected_comp_t(), fixedGraph), *vertexIterOne, -1); 1921 1922 // Perform a strong components search on the 2D graph 1923 // -------------------------------------------------- 1924 1925 boost::strong_components(fixedGraph, &middleComponentsList[0], boost::root_map(&verticesDiscoverList[0])); 1926 1927 // Update vertices properties of the 2D graph : set a component Id on each vertex 1928 // ------------------------------------------------------------------------------ 1929 1930 for(int i = 0; i < middleComponentsList.size(); i++) put(get(boost::vertex_affected_comp_t(), fixedGraph), i, middleComponentsList[i]); 1931 1932 // Setting the number of components that have been detected 1933 // -------------------------------------------------------- 1934 1935 int nbComponents = *max_element(middleComponentsList.begin(), middleComponentsList.end()) + 1; 1936 1937 // Setting the third dimension size of innerComp array 1938 // --------------------------------------------------- 1939 1940 innerComp[noComp][fixedDim] = new cfcStructTableType*[nbComponents]; 1941 1942 // Setting the fourth dimension size of the innerComp array 1943 // -------------------------------------------------------- 1944 1945 for(int noCompD2 = 0; noCompD2 < nbComponents; noCompD2++) innerComp[noComp][fixedDim][noCompD2] = new cfcStructTableType[3]; 1946 1947 1948 // ***************************************************** 1949 // **** ****** 1950 // **** ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION ****** 1951 // **** ****** 1952 // ***************************************************** 1953 1954 // Resize the middleComp array with the size of 2D components that have been detected 1955 // ---------------------------------------------------------------------------------- 1956 1957 middleComp[noComp][fixedDim].resize(nbComponents); 1958 1959 // Set up the array that will be used to register the informations about imposed values for the axis 1960 // ------------------------------------------------------------------------------------------------- 1961 1962 int ** isImposed2D = new int*[nbComponents]; 1963 1964 for(int i = 0; i < nbComponents; i++) isImposed2D[i] = new int[2]; 1965 1966 // For each component, set the sign for the first and second dimensions then register this sign in the cfcSign attribute 1967 // --------------------------------------------------------------------------------------------------------------------- 1968 1969 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 1970 1971 // Setting inial imposed values (0 mean no imposed) 1972 // ------------------------------------------------ 1973 1974 isImposed2D[noComponent][0] = 0; 1975 isImposed2D[noComponent][1] = 0; 1976 1977 middleComp[noComp][fixedDim][noComponent].cfcSign.resize(2); 1978 1979 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = dimOne; 1980 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = dimTwo; 1981 1982 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = 0; 1983 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 1984 1985 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = getCommonSign(dimOne, noComponent, fixedGraph); 1986 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = getCommonSign(dimTwo, noComponent, fixedGraph); 1987 1988 // Detecting all possible axis combinations 1989 // ---------------------------------------- 1990 1991 int noConf = -1; 2162 for(tie(vertexIterOne, vertexIterTwo) = vertices(fixedGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) put(get(boost::vertex_affected_comp_t(), fixedGraph), *vertexIterOne, -1); 2163 2164 // Perform a strong components search on the 2D graph 2165 // -------------------------------------------------- 2166 2167 boost::strong_components(fixedGraph, &middleComponentsList[0], boost::root_map(&verticesDiscoverList[0])); 2168 2169 // Update vertices properties of the 2D graph : set a component Id on each vertex 2170 // ------------------------------------------------------------------------------ 2171 2172 for(int i = 0; i < middleComponentsList.size(); i++) put(get(boost::vertex_affected_comp_t(), fixedGraph), i, middleComponentsList[i]); 2173 2174 // Setting the number of components that have been detected 2175 // -------------------------------------------------------- 2176 2177 int nbComponents = *max_element(middleComponentsList.begin(), middleComponentsList.end()) + 1; 2178 2179 // Setting the third dimension size of innerComp array 2180 // --------------------------------------------------- 2181 2182 innerComp[noComp][fixedDim] = new cfcStructTableType*[nbComponents]; 2183 2184 // Setting the fourth dimension size of the innerComp array 2185 // -------------------------------------------------------- 2186 2187 for(int noCompD2 = 0; noCompD2 < nbComponents; noCompD2++) innerComp[noComp][fixedDim][noCompD2] = new cfcStructTableType[3]; 2188 2189 2190 // ***************************************************** 2191 // **** ****** 2192 // **** ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION ****** 2193 // **** ****** 2194 // ***************************************************** 2195 2196 // Resize the middleComp array with the size of 2D components that have been detected 2197 // ---------------------------------------------------------------------------------- 2198 2199 middleComp[noComp][fixedDim].resize(nbComponents); 2200 2201 // Set up the array that will be used to register the informations about imposed values for the axis 2202 // ------------------------------------------------------------------------------------------------- 2203 2204 int ** isImposed2D = new int*[nbComponents]; 2205 2206 for(int i = 0; i < nbComponents; i++) isImposed2D[i] = new int[2]; 2207 2208 // For each component, set the sign for the first and second dimensions then register this sign in the cfcSign attribute 2209 // --------------------------------------------------------------------------------------------------------------------- 2210 2211 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 2212 2213 // Setting inial imposed values (0 mean no imposed) 2214 // ------------------------------------------------ 2215 2216 isImposed2D[noComponent][0] = 0; 2217 isImposed2D[noComponent][1] = 0; 2218 2219 middleComp[noComp][fixedDim][noComponent].cfcSign.resize(2); 2220 2221 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = dimOne; 2222 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = dimTwo; 2223 2224 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = 0; 2225 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 2226 2227 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = getCommonSign(dimOne, noComponent, fixedGraph); 2228 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = getCommonSign(dimTwo, noComponent, fixedGraph); 2229 2230 // Detecting all possible axis combinations 2231 // ---------------------------------------- 2232 2233 int noConf = -1; 2234 2235 int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 2236 int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 2237 2238 2239 int axis0 = dimOne; 2240 int axis1 = dimTwo; 2241 2242 if(sign0 != 2 && sign1 != 2) noConf = 0; // axis0 -> axis1 (axis1 free) 2243 if(sign0 != 2 && sign1 == 2) noConf = 1; // axis0 -> axis1 2244 if(sign0 == 2 && sign1 == 2) noConf = 2; // axis0 -> axis1 2245 if(sign0 == 2 && sign1 != 2) noConf = 3; // axis1 -> axis0 2246 2247 // Looking at combinations to set imposed values for the second axis 2248 // ----------------------------------------------------------------- 2249 2250 if(noConf < 3) isImposed2D[noComponent][1] = getImposed(axis1, noComponent, fixedGraph); 2251 2252 if(noConf == 3) isImposed2D[noComponent][1] = getImposed(axis0, noComponent, fixedGraph); 2253 2254 // Sort the axis then set their values accordignly to the combination available for the current 2D component 2255 // --------------------------------------------------------------------------------------------------------- 2256 2257 if(noConf == 0) { 2258 2259 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 2260 2261 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 2262 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 2263 } 2264 2265 if(noConf > 0 && noConf < 3) { 2266 2267 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 2268 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 2269 } 2270 2271 if(noConf == 3) { 2272 2273 int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 2274 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 2275 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = tmpVal; 2276 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = axis1; 2277 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 2278 2279 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0]; 2280 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][1]; 2281 } 2282 2283 2284 } 2285 2286 2287 2288 // ***************************************************** 2289 // **** ****** 2290 // **** ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION ****** 2291 // **** ****** 2292 // ***************************************************** 2293 2294 myGraphType cfcGraph; 2295 2296 reduceGraph(fixedGraph, cfcGraph, nbComponents); 2297 2298 // ***************************************************** 2299 // **** ****** 2300 // **** ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION ****** 2301 // **** ****** 2302 // ***************************************************** 2303 2304 std::deque<int> topoOrder; 2305 2306 if(boost::num_vertices(cfcGraph) > 1) { 2307 2308 // Perform a topological sort on the graph whose vertices are the components (reduced graph) 2309 // ----------------------------------------------------------------------------------------- 2310 2311 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 2312 2313 // ***************************************************** 2314 // **** ****** 2315 // **** ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION ****** 2316 // **** ****** 2317 // ***************************************************** 2318 2319 // Sort the middle structure table elements (2D graph components) accordignly to the sorting performed on the reduced graph 2320 // ------------------------------------------------------------------------------------------------------------------------ 2321 2322 vector<cfcStruct> sortedCfcStructTable; 2323 2324 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) sortedCfcStructTable.push_back(middleComp[noComp][fixedDim][topoOrder[noComponent]]); 2325 2326 middleComp[noComp][fixedDim].clear(); 2327 2328 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) middleComp[noComp][fixedDim].push_back(sortedCfcStructTable[noComponent]); 2329 2330 } 2331 2332 else { topoOrder[0] = 0; } 2333 2334 2335 // ***************************************************** 2336 // **** ****** 2337 // **** ETAPE 9 DE LA PROCEDURE A DEUX DIMENSION ****** 2338 // **** ****** 2339 // ***************************************************** 2340 2341 2342 // Create a graph that just keep the current 2D component egdes and vertices 2343 // ------------------------------------------------------------------------- 2344 2345 for(int noComp2D = 0; noComp2D < nbComponents; noComp2D++) { 2346 2347 myGraphType outputGraph; 2348 2349 copyGraph(fixedGraph, outputGraph); 2350 2351 keepComponent(topoOrder[noComp2D], outputGraph); 2352 2353 2354 // Create the two 1D component vectors corresponding to the two third dimensions availables 2355 // ---------------------------------------------------------------------------------------- 2356 2357 switch(fixedDim) { 2358 2359 case 0: 2360 2361 setInner(noComp, fixedDim, noComp2D, 1, 2, outputGraph); // jk 1992 2362 1993 int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 1994 int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 1995 1996 int axis0 = dimOne; 1997 int axis1 = dimTwo; 1998 1999 if(sign0 != 2 && sign1 != 2) noConf = 0; // axis0 -> axis1 (axis1 free) 2000 if(sign0 != 2 && sign1 == 2) noConf = 1; // axis0 -> axis1 2001 if(sign0 == 2 && sign1 == 2) noConf = 2; // axis0 -> axis1 2002 if(sign0 == 2 && sign1 != 2) noConf = 3; // axis1 -> axis0 2003 2004 // Looking at combinations to set imposed values for the second axis 2005 // ----------------------------------------------------------------- 2006 2007 if(noConf < 3) isImposed2D[noComponent][1] = getImposed(axis1, noComponent, fixedGraph); 2008 2009 if(noConf == 3) isImposed2D[noComponent][1] = getImposed(axis0, noComponent, fixedGraph); 2010 2011 // Sort the axis then set their values accordignly to the combination available for the current 2D component 2012 // --------------------------------------------------------------------------------------------------------- 2013 2014 if(noConf == 0) { 2015 2016 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 2017 2018 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 2019 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 2020 } 2021 2022 if(noConf > 0 && noConf < 3) { 2023 2024 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 2025 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 2026 } 2027 2028 if(noConf == 3) { 2029 2030 int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 2031 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 2032 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = tmpVal; 2033 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = axis1; 2034 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 2035 2036 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0]; 2037 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][1]; 2038 } 2039 2040 2041 } 2042 2043 2044 2045 // ***************************************************** 2046 // **** ****** 2047 // **** ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION ****** 2048 // **** ****** 2049 // ***************************************************** 2050 2051 myGraphType cfcGraph; 2052 2053 reduceGraph(fixedGraph, cfcGraph, nbComponents); 2054 2055 // ***************************************************** 2056 // **** ****** 2057 // **** ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION ****** 2058 // **** ****** 2059 // ***************************************************** 2060 2061 std::deque<int> topoOrder; 2062 2063 if(boost::num_vertices(cfcGraph) > 1) { 2064 2065 // Perform a topological sort on the graph whose vertices are the components (reduced graph) 2066 // ----------------------------------------------------------------------------------------- 2067 2068 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 2069 2070 // ***************************************************** 2071 // **** ****** 2072 // **** ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION ****** 2073 // **** ****** 2074 // ***************************************************** 2075 2076 // Sort the middle structure table elements (2D graph components) accordignly to the sorting performed on the reduced graph 2077 // ------------------------------------------------------------------------------------------------------------------------ 2078 2079 vector<cfcStruct> sortedCfcStructTable; 2080 2081 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) sortedCfcStructTable.push_back(middleComp[noComp][fixedDim][topoOrder[noComponent]]); 2082 2083 middleComp[noComp][fixedDim].clear(); 2084 2085 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) middleComp[noComp][fixedDim].push_back(sortedCfcStructTable[noComponent]); 2086 2087 } 2088 2089 else { topoOrder[0] = 0; } 2090 2091 2092 // ***************************************************** 2093 // **** ****** 2094 // **** ETAPE 9 DE LA PROCEDURE A DEUX DIMENSION ****** 2095 // **** ****** 2096 // ***************************************************** 2097 2098 2099 // Create a graph that just keep the current 2D component egdes and vertices 2363 setInner(noComp, fixedDim, noComp2D, 2, 1, outputGraph); // kj 2364 2365 break; 2366 2367 case 1: 2368 2369 setInner(noComp, fixedDim, noComp2D, 0, 2, outputGraph); // ik 2370 2371 setInner(noComp, fixedDim, noComp2D, 2, 0, outputGraph); // ki 2372 2373 break; 2374 2375 case 2: 2376 2377 setInner(noComp, fixedDim, noComp2D, 0, 1, outputGraph); // ij 2378 2379 setInner(noComp, fixedDim, noComp2D, 1, 0, outputGraph); // ji 2380 2381 break; 2382 } 2383 } 2384 }; 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 void Order::Read1D(int noComp1D) { 2395 2396 2397 // Get the axis number (the component value in 3D and 2D are the same and the axis numbers are 0 (i) and 1 (j) 2398 // ----------------------------------------------------------------------------------------------------------- 2399 2400 // ****** int noAxis1 = innerComp[0][0][0][1][noComp1D].cfcSign[0].first; 2401 2402 // Get the axis value : the component Id in 3D and 2D is zero and the axis numbers is 2 (k) 2403 // ---------------------------------------------------------------------------------------- 2404 2405 int valAxis1 = innerComp[0][0][0][1][noComp1D].cfcSign[0].second; 2406 2407 // Read the order parameter for the 0 axis number (i dimension) 2408 // ------------------------------------------------------------ 2409 2410 readParam(0, valAxis1, 1); 2411 2412 // ********* readParam(noAxis1 -2, valAxis1, 1); 2413 2414 cout << endl << endl << "\t\t"; 2415 2416 // For all moduls embedded in the 1D component "noComp1D" given as parameter 2100 2417 // ------------------------------------------------------------------------- 2101 2418 2102 for(int noComp2D = 0; noComp2D < nbComponents; noComp2D++) { 2103 2104 myGraphType outputGraph; 2105 2106 copyGraph(fixedGraph, outputGraph); 2107 2108 keepComponent(topoOrder[noComp2D], outputGraph); 2109 2110 2111 // Create the two 1D component vectors corresponding to the two third dimensions availables 2112 // ---------------------------------------------------------------------------------------- 2113 2114 switch(fixedDim) { 2115 2116 case 0: 2117 2118 setInner(noComp, fixedDim, noComp2D, 1, 2, outputGraph); // jk 2119 2120 setInner(noComp, fixedDim, noComp2D, 2, 1, outputGraph); // kj 2121 2122 break; 2123 2124 case 1: 2125 2126 setInner(noComp, fixedDim, noComp2D, 0, 2, outputGraph); // ik 2127 2128 setInner(noComp, fixedDim, noComp2D, 2, 0, outputGraph); // ki 2129 2130 break; 2131 2132 case 2: 2133 2134 setInner(noComp, fixedDim, noComp2D, 0, 1, outputGraph); // ij 2135 2136 setInner(noComp, fixedDim, noComp2D, 1, 0, outputGraph); // ji 2137 2138 break; 2139 } 2140 } 2419 for(int noMod = 0; noMod < innerComp[0][0][0][1][noComp1D].embeddedModuls.size(); noMod++) { 2420 2421 // Display the modul name as they appear in the description file 2422 // ------------------------------------------------------------- 2423 2424 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][0][1][noComp1D].embeddedModuls[noMod]) << " "; 2425 2426 } 2427 2428 // Close the order statement 2429 // ------------------------- 2430 2431 readParam(0, 0, 0); 2432 2433 }; 2434 2435 2436 void Order::Read2D(int noComp2D) { 2437 2438 // Get the axis number (dimension) and the axis value for the first axis crossed in the order statement (the 3D component is zero) 2439 // ------------------------------------------------------------------------------------------------------------------------------- 2440 2441 int noFixed1 = middleComp[0][0][noComp2D].cfcSign[0].first; int valFixed1 = middleComp[0][0][noComp2D].cfcSign[0].second; 2442 2443 // Get the axis number (dimension) and the axis value for the second axis crossed in the order statement (the 3D component is zero) 2444 // --------------------------------------------------------------------------------------------------------------------------------- 2445 2446 int noAxis2 = middleComp[0][0][noComp2D].cfcSign[1].first; int valAxis2 = middleComp[0][0][noComp2D].cfcSign[1].second; 2447 2448 // Read the order parameter for this axis dimension and this axis value 2449 // --------------------------------------------------------------------- 2450 2451 readParam(noFixed1 -1, valFixed1, 1); 2452 2453 // If the second axis value is defined in the 2D component graph 2454 // ------------------------------------------------------------- 2455 2456 if(valAxis2 != 2) { 2457 2458 // Read the order parameter for this axis dimension and this axis value from the 2D graph component 2459 // ------------------------------------------------------------------------------------------------ 2460 2461 readParam(noAxis2 -1, valAxis2, 2); 2462 2463 cout << endl << endl << "\t\t"; 2464 2465 // For all 1D graphs embedded inside the 2D graph (component) 2466 // ---------------------------------------------------------- 2467 2468 for(int noComp1D = 0; noComp1D < innerComp[0][0][noComp2D][noAxis2].size(); noComp1D++) { 2469 2470 // For all moduls embedded in the 1D graph 2471 // --------------------------------------- 2472 2473 for(int noMod = 0; noMod < innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2474 2475 // Display the modul name as it appears in the description file 2476 // ------------------------------------------------------------ 2477 2478 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2479 2480 } 2481 } 2482 } 2483 2484 // If the second axis value is not defined in the 2D component graph 2485 // ----------------------------------------------------------------- 2486 2487 else { 2488 2489 // For all 1D graphs embedded inside the 2D graph (component) 2490 // ---------------------------------------------------------- 2491 2492 for(int noComp1D = 0; noComp1D < innerComp[0][0][noComp2D][noAxis2].size(); noComp1D++) { 2493 2494 // Get the axis number (dimension) for the second axis crossed in the order statement (information readen from the 1D graph component) 2495 // ----------------------------------------------------------------------------------------------------------------------------------- 2496 2497 noAxis2 = innerComp[0][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2498 2499 // Get the axis value for the second axis crossed in the order statement (information readen from the 1D graph component) 2500 // ----------------------------------------------------------------------------------------------------------------------- 2501 2502 valAxis2 = innerComp[0][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2503 2504 // Read the order parameter for this axis dimension and this axis value 2505 // -------------------------------------------------------------------- 2506 2507 readParam(noAxis2 -1, valAxis2, 2); 2508 2509 // For all moduls embedded in the 1D graph 2510 // --------------------------------------- 2511 2512 for(int noMod = 0; noMod < innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2513 2514 // Display the modul name as it appears in the description file 2515 // ------------------------------------------------------------ 2516 2517 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2518 2519 } 2520 } 2521 } 2522 2523 // Close the order statement 2524 // ------------------------- 2525 2526 readParam(0, 0, 0); 2527 2528 }; 2529 2530 2531 void Order::Read3D(int noComp3D) { 2532 2533 // Get the axis number (dimension) and the axis value of the first axis crossed in the order statement 2534 // --------------------------------------------------------------------------------------------------- 2535 2536 int noFixed1 = outerComp[noComp3D].cfcSign[0].first; int valFixed1 = outerComp[noComp3D].cfcSign[0].second; 2537 2538 // Get the axis number (dimension) and the axis value of the second axis crossed in the order statement (values with no fixed dimensions : ie 3D graphs) 2539 // ----------------------------------------------------------------------------------------------------------------------------------------------------- 2540 2541 int noAxis2 = outerComp[noComp3D].cfcSign[1].first; int valAxis2 = outerComp[noComp3D].cfcSign[1].second; 2542 2543 // Get the axis number (dimension) and the axis value of the third axis crossed in the order statement (values with no fixed dimensions : ie 3D graphs) 2544 // ---------------------------------------------------------------------------------------------------------------------------------------------------- 2545 2546 int noAxis3 = outerComp[noComp3D].cfcSign[2].first; int valAxis3 = outerComp[noComp3D].cfcSign[2].second; 2547 2548 // Read the parameter for the first axis (this one can not be undefined as it is the first axis crossed, the the reading can be performed) 2549 // --------------------------------------------------------------------------------------------------------------------------------------- 2550 2551 readParam(noFixed1, valFixed1, 1); 2552 2553 // If the second axis value is defined in the 3D graph 2554 // --------------------------------------------------- 2555 2556 if(valAxis2 != 2) { 2557 2558 // Read the parameter for the second axis directly from here (no need to get informations from any fixed graph) 2559 // ------------------------------------------------------------------------------------------------------------ 2560 2561 readParam(noAxis2, valAxis2, 2); 2562 2563 // If the third axis value is defined in the 3D graph 2564 // -------------------------------------------------- 2565 2566 if(valAxis3 != 2) { 2567 2568 // Read the parameter for the third axis directly from here (no need to get informations from any fixed graph) 2569 // ----------------------------------------------------------------------------------------------------------- 2570 2571 readParam(noAxis3, valAxis3, 3); 2572 2573 cout << endl << endl << "\t\t\t"; 2574 2575 // For all 2D graphs embedded in the current 3D graph (ie the fixed dimension is the first crossed in the order statement) 2576 // ----------------------------------------------------------------------------------------------------------------------- 2577 2578 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2579 2580 // Get the number of the second axis crossed in the order statement 2581 // ---------------------------------------------------------------- 2582 2583 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2584 2585 // For all 1D graphs embedded in the current 2D graph (ie the second dimension is the second crossed in the order statement) 2586 // ------------------------------------------------------------------------------------------------------------------------- 2587 2588 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2589 2590 // For all moduls embedded in the current 1D graph component 2591 // --------------------------------------------------------- 2592 2593 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2594 2595 // Display the modul name (that will appear after the order paramaters that have been read before) 2596 // ----------------------------------------------------------------------------------------------- 2597 2598 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2599 } 2600 } 2601 } 2602 } 2603 2604 // If the third axis value is not defined in the 2D graph 2605 2606 else { 2607 2608 // For all 2D graphs embedded in the current 3D graph (ie the fixed dimension is the first crossed in the order statement) 2609 // ----------------------------------------------------------------------------------------------------------------------- 2610 2611 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2612 2613 2614 // Get the number of the second axis crossed in the order statement 2615 // ---------------------------------------------------------------- 2616 2617 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2618 2619 // For all 1D graphs embedded in the current 2D graph (ie the second dimension is the second crossed in the order statement) 2620 // ------------------------------------------------------------------------------------------------------------------------- 2621 2622 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2623 2624 // Get the number of the third axis crossed in the order statement 2625 // --------------------------------------------------------------- 2626 2627 noAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2628 2629 // Get the value of the third axis crossed in the order statement 2630 // -------------------------------------------------------------- 2631 2632 valAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2633 2634 // Read the parameter for the third axis from the 1D component 2635 // ----------------------------------------------------------- 2636 2637 readParam(noAxis3, valAxis3, 3); 2638 2639 cout << endl << endl << "\t\t\t"; 2640 2641 // For all moduls embedded in the current 1D graph component 2642 // --------------------------------------------------------- 2643 2644 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2645 2646 // Display the modul name (that will appear after the order paramaters that have been read before) 2647 // ----------------------------------------------------------------------------------------------- 2648 2649 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2650 2651 } 2652 } 2653 } 2654 } 2655 2656 2657 } 2658 2659 // If the second axis value is not defined in the 3D graph 2660 // ------------------------------------------------------- 2661 2662 if(valAxis2 == 2) { 2663 2664 // For all 2D graphs embedded in the current 3D graph (ie the fixed dimension is the first crossed in the order statement) 2665 // ----------------------------------------------------------------------------------------------------------------------- 2666 2667 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2668 2669 // Get the number of the second axis crossed in the order statement 2670 // ---------------------------------------------------------------- 2671 2672 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2673 2674 // Get the value of the second axis crossed in the order statement 2675 // ---------------------------------------------------------------- 2676 2677 valAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].second; 2678 2679 // Get the number of the third axis crossed in the order statement (values with just one fixed dimensions : ie from 2D graphs) 2680 // --------------------------------------------------------------------------------------------------------------------------- 2681 2682 noAxis3 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].first; 2683 2684 // Get the value of the third axis crossed in the order statement (values with just one fixed dimensions : ie from 2D graphs) 2685 // -------------------------------------------------------------------------------------------------------------------------- 2686 2687 valAxis3 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].second; 2688 2689 // If the second axis value is defined in the 2D graph 2690 // --------------------------------------------------- 2691 2692 if(valAxis2 != 2) { 2693 2694 // Read the parameter for the second axis from the 2D component 2695 // ------------------------------------------------------------ 2696 2697 readParam(noAxis2, valAxis2, 2); 2698 2699 // If the third axis value is defined in the 2D graph 2700 // -------------------------------------------------- 2701 2702 if(valAxis3 != 2) { 2703 2704 // Read the parameter for the third axis from the 2D component 2705 // ----------------------------------------------------------- 2706 2707 readParam(noAxis3, valAxis3, 3); 2708 2709 cout << endl << endl << "\t\t\t"; 2710 2711 // For all 1D graph embedded in the current 2D graph (ie the second fixed dimension is the second crossed in the order statement) 2712 // ------------------------------------------------------------------------------------------------------------------------------ 2713 2714 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2715 2716 // For all moduls embedded in the current 1D graph component 2717 // --------------------------------------------------------- 2718 2719 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2720 2721 // Display the modul name (that will appear after the order paramaters that have been readen before) 2722 // ------------------------------------------------------------------------------------------------- 2723 2724 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2725 2726 } 2727 } 2728 } 2729 2730 // If the third axis value is not defined in the 2D graph 2731 // ------------------------------------------------------ 2732 2733 else { 2734 2735 // For all 1D graph embedded in the current 2D graph (ie the second fixed dimension is the second crossed in the order statement) 2736 // ------------------------------------------------------------------------------------------------------------------------------ 2737 2738 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2739 2740 // Get the number of the third axis crossed in the order statement 2741 // --------------------------------------------------------------- 2742 2743 noAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2744 2745 // Get the value of the third axis crossed in the order statement 2746 // --------------------------------------------------------------- 2747 2748 valAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2749 2750 // Read the parameter for the third axis from the 1D component 2751 // ----------------------------------------------------------- 2752 2753 readParam(noAxis3, valAxis3, 3); 2754 2755 cout << endl << endl << "\t\t\t"; 2756 2757 // For all moduls embedded in the current 1D graph component 2758 // --------------------------------------------------------- 2759 2760 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2761 2762 // Display the modul name (that will appear after the order paramaters that have been readen before) 2763 // ------------------------------------------------------------------------------------------------- 2764 2765 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2766 2767 } 2768 } 2769 } 2770 } 2771 } 2772 } 2773 2774 // Close the order statement 2775 // ------------------------- 2776 2777 readParam(0, 0, 0); 2141 2778 }; 2142 2779 … … 2144 2781 2145 2782 2146 void Order::Read1D(int noComp1D) { 2147 2148 int noAxis1 = innerComp[0][0][0][1][noComp1D].cfcSign[0].first; 2149 2150 int valAxis1 = innerComp[0][0][0][1][noComp1D].cfcSign[0].second; 2151 2152 readParam(noAxis1 -2, valAxis1, 1); 2153 2154 cout << endl << endl << "\t\t"; 2155 2156 for(int noMod = 0; noMod < innerComp[0][0][0][1][noComp1D].embeddedModuls.size(); noMod++) { 2157 2158 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][0][1][noComp1D].embeddedModuls[noMod]) << " "; 2159 2160 } 2161 2162 readParam(0, 0, 0); 2163 2164 }; 2165 2166 2167 void Order::Read2D(int noComp2D) { 2168 2169 2170 int noFixed1 = middleComp[0][0][noComp2D].cfcSign[0].first; int valFixed1 = middleComp[0][0][noComp2D].cfcSign[0].second; 2171 2172 int noAxis2 = middleComp[0][0][noComp2D].cfcSign[1].first; int valAxis2 = middleComp[0][0][noComp2D].cfcSign[1].second; 2173 2174 readParam(noFixed1 -1, valFixed1, 1); 2175 2176 if(valAxis2 != 2) { 2177 2178 readParam(noAxis2 -1, valAxis2, 2); 2179 2180 cout << endl << endl << "\t\t"; 2181 2182 for(int noComp1D = 0; noComp1D < innerComp[0][0][noComp2D][noAxis2].size(); noComp1D++) { 2183 2184 for(int noMod = 0; noMod < innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2185 2186 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2187 2188 } 2189 } 2190 } 2191 2192 else { 2193 2194 for(int noComp1D = 0; noComp1D < innerComp[0][0][noComp2D][noAxis2].size(); noComp1D++) { 2195 2196 noAxis2 = innerComp[0][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2197 2198 valAxis2 = innerComp[0][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2199 2200 readParam(noAxis2 -1, valAxis2, 2); 2201 2202 for(int noMod = 0; noMod < innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2203 2204 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[0][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2205 2206 } 2207 } 2208 } 2209 2210 readParam(0, 0, 0); 2211 2212 }; 2213 2214 2215 void Order::Read(int noComp3D) { 2216 2217 int noFixed1 = outerComp[noComp3D].cfcSign[0].first; int valFixed1 = outerComp[noComp3D].cfcSign[0].second; 2218 2219 int noAxis2 = outerComp[noComp3D].cfcSign[1].first; int valAxis2 = outerComp[noComp3D].cfcSign[1].second; 2220 2221 int noAxis3 = outerComp[noComp3D].cfcSign[2].first; int valAxis3 = outerComp[noComp3D].cfcSign[2].second; 2222 2223 readParam(noFixed1, valFixed1, 1); 2224 2225 if(valAxis2 != 2) { 2226 2227 readParam(noAxis2, valAxis2, 2); 2228 2229 if(valAxis3 != 2) { // cout << endl << "\t\t\t\t\t\tOK - OK - OK"; 2230 2231 readParam(noAxis3, valAxis3, 3); 2232 2233 cout << endl << endl << "\t\t\t"; 2234 2235 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2236 2237 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2238 2239 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2240 2241 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2242 2243 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2244 } 2245 } 2246 } 2247 } 2248 2249 else { 2250 2251 // cout << endl << "\t\t\t\t\t\tOK - OK - DEC"; 2252 2253 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2254 2255 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2256 2257 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2258 2259 noAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2260 2261 valAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2262 2263 readParam(noAxis3, valAxis3, 3); 2264 2265 cout << endl << endl << "\t\t\t"; 2266 2267 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2268 2269 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2270 2271 } 2272 } 2273 } 2274 } 2275 2276 2277 } 2278 2279 if(valAxis2 == 2) { 2280 2281 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2282 2283 noAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first; 2284 2285 valAxis2 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].second; 2286 2287 noAxis3 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].first; 2288 2289 valAxis3 = middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].second; 2290 2291 if(valAxis2 != 2) { 2292 2293 readParam(noAxis2, valAxis2, 2); 2294 2295 if(valAxis3 != 2) { // cout << endl << "\t\t\t\t\t\tOK - KO (OK - OK)"; 2296 2297 readParam(noAxis3, valAxis3, 3); 2298 2299 cout << endl << endl << "\t\t\t"; 2300 2301 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2302 2303 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2304 2305 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2306 2307 } 2308 } 2309 } 2310 2311 else { // cout << endl << "\t\t\t\t\t\tOK - KO (OK - KO)"; 2312 2313 for(int noComp1D= 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noAxis2].size(); noComp1D++) { 2314 2315 noAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2316 2317 valAxis3 = innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2318 2319 readParam(noAxis3, valAxis3, 3); 2320 2321 cout << endl << endl << "\t\t\t"; 2322 2323 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2324 2325 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2326 2327 } 2328 } 2329 } 2330 } 2331 } 2332 } 2333 2334 readParam(0, 0, 0); 2783 2784 int Order::getImposed(int fixedDim, int freeDim, int noComp, myGraphType& upperGraph) { 2785 2786 // Create a graph that will be fixed 2787 // --------------------------------- 2788 2789 myGraphType fixedGraph; 2790 2791 // Copy the informations of the graph given as parameter in the graph that will be fixed 2792 // ------------------------------------------------------------------------------------- 2793 2794 copyGraph(upperGraph, fixedGraph); 2795 2796 // Fix the dimension "fixedDim" given as parameter 2797 // ----------------------------------------------- 2798 2799 fixGraph(fixedGraph, fixedDim); 2800 2801 // Return the sign for the free dimension and the component given as parameter 2802 // --------------------------------------------------------------------------- 2803 2804 return(getCommonSign(freeDim, noComp, fixedGraph)); 2805 2335 2806 }; 2336 2807 2337 2808 2338 int Order::getImposed(int fixedDim, int freeDim, int noComp, myGraphType& upperGraph) { 2339 2340 myGraphType fixedGraph; 2341 2342 copyGraph(upperGraph, fixedGraph); 2343 2344 fixGraph(fixedGraph, fixedDim); 2345 2346 int valDim0 = 0; 2347 2348 for(tie(edgeIterOne, edgeIterTwo) = edges(fixedGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 2349 2350 if(get(boost::vertex_affected_comp_t(), fixedGraph, boost::source(*edgeIterOne, fixedGraph)) == noComp) { 2351 2352 if(get(boost::vertex_affected_comp_t(), fixedGraph, boost::target(*edgeIterOne, fixedGraph)) == noComp) { 2353 2354 int val0 = get(boost::edge_weight_d1_t(), fixedGraph, *edgeIterOne); 2355 int val1 = get(boost::edge_weight_d2_t(), fixedGraph, *edgeIterOne); 2356 int val2 = get(boost::edge_weight_d3_t(), fixedGraph, *edgeIterOne); 2357 2358 if(valDim0 != 2) { 2359 2360 switch(freeDim) { 2361 2362 case 0: if(val0 != 0) { if(valDim0 + val0 == 0) { valDim0 = 2; } else { valDim0 = val0; } } break; 2363 case 1: if(val1 != 0) { if(valDim0 + val1 == 0) { valDim0 = 2; } else { valDim0 = val1; } } break; 2364 case 2: if(val2 != 0) { if(valDim0 + val2 == 0) { valDim0 = 2; } else { valDim0 = val2; } } break; 2365 } 2366 } 2367 } 2368 } 2369 } 2370 2371 return(valDim0); 2809 2810 2811 bool Order::isToDecompose(int freeDim, myGraphType& upperGraph) { 2812 2813 2814 // A boolean value that will be set to true if the dimension have to be decomposed 2815 // ------------------------------------------------------------------------------- 2816 2817 bool toDecompose = false; 2818 2819 // Create a graph that will be fixed 2820 // --------------------------------- 2821 2822 myGraphType fixedGraph; 2823 2824 // Copy the informations of the graph given as parameter in the graph that will be fixed 2825 // ------------------------------------------------------------------------------------- 2826 2827 copyGraph(upperGraph, fixedGraph); 2828 2829 // Accordingly to the dimension sign that must be analyzed (free dimension), fix both of the two other dimensions 2830 // -------------------------------------------------------------------------------------------------------------- 2831 2832 if(freeDim == 0) { fixGraph(fixedGraph, 1); fixGraph(fixedGraph, 2); } // j == 0, k == 0 2833 if(freeDim == 1) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 2); } // i == 0, k == 0 2834 if(freeDim == 2) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 1); } // i == 0, j == 0 2835 2836 // If the sign of the remaining edges is not defined for the free dimension given as parameter, then the dimension have to be decomposed 2837 // ------------------------------------------------------------------------------------------------------------------------------------- 2838 2839 if(getCommonSign(freeDim, fixedGraph) == 2) toDecompose = true; 2840 2841 // Return the boolean information about decomposition of the dimension 2842 // ------------------------------------------------------------------- 2843 2844 return(toDecompose); 2845 2372 2846 }; 2373 2847 2374 2848 2375 /*2376 * Function used to know if the third axis have to be decomposed2377 * This function reduce two times the main graph then seek a common value on the remaining edges2378 * If there is no common value the axis have to be decomposed2379 * If there is a common value or if there is no remaining edges in the last fixed graph, then the axis does not have to be decomposed2380 */2381 2382 bool Order::isToDecompose(int fixedDimOne, int fixedDimTwo, int freeDim, myGraphType& upperGraph) {2383 2384 bool toDecompose = false;2385 2386 myGraphType fixedGraph;2387 2388 copyGraph(upperGraph, fixedGraph);2389 2390 fixGraph(fixedGraph, fixedDimOne);2391 2392 fixGraph(fixedGraph, fixedDimTwo);2393 2394 if(getCommonSign(freeDim, fixedGraph) == 2) toDecompose = true;2395 2396 return(toDecompose);2397 2398 };2399 2400 2849 2401 2850 int Order::getCommonSign(int noDim, int noComp, myGraphType& currentGraph) { … … 2403 2852 int valDim0 = 0; 2404 2853 2405 int nbEdges = 0; 2854 // For all edges in the current graph 2855 // ---------------------------------- 2406 2856 2407 2857 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 2408 2858 2859 // If the source modul of the edge is in the component given as paramater 2860 // ---------------------------------------------------------------------- 2861 2409 2862 if(get(boost::vertex_affected_comp_t(), currentGraph, boost::source(*edgeIterOne, currentGraph)) == noComp) { 2410 2863 2864 // If the target modul of the edge is in the component given as paramater 2865 // ---------------------------------------------------------------------- 2866 2411 2867 if(get(boost::vertex_affected_comp_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)) == noComp) { 2412 2868 2413 nbEdges++; 2869 // Get the dimension values for axis i, j and k 2870 // -------------------------------------------- 2414 2871 2415 2872 int val0 = get(boost::edge_weight_d1_t(), currentGraph, *edgeIterOne); … … 2417 2874 int val2 = get(boost::edge_weight_d3_t(), currentGraph, *edgeIterOne); 2418 2875 2876 // If the recorded value valDim0 is not equal to 2 (ie. if it is equal to 2, there is no need to go further in the sign analyzis) 2877 // ----------------------------------------------------------------------------------------------------------------------------- 2878 2419 2879 if(valDim0 != 2) { 2420 2880 2881 // The sign analyzis is performed for the dimension "noDim" given as parameter 2882 // --------------------------------------------------------------------------- 2883 2421 2884 switch(noDim) { 2885 2886 // If the current value is not null and valDim0 + the current value is equal to zero, it means there is a couple -1 an +1 and then no common sign 2887 // ---------------------------------------------------------------------------------------------------------------------------------------------- 2422 2888 2423 2889 case 0: if(val0 != 0) { if(valDim0 + val0 == 0) { valDim0 = 2; } else { valDim0 = val0; } } break; … … 2430 2896 } 2431 2897 2432 if(nbEdges == 0) valDim0 = 3; 2433 2434 return(valDim0); 2898 return(valDim0); 2899 2900 }; 2901 2902 2903 2904 2905 int Order::getImposed(int freeDim, int noComp, myGraphType& upperGraph) { 2906 2907 // Create a new graph that will be fixed 2908 2909 myGraphType fixedGraph; 2910 2911 // Copy the informations of the graph given as parameter in the graph that will be fixed 2912 // ------------------------------------------------------------------------------------- 2913 2914 copyGraph(upperGraph, fixedGraph); 2915 2916 // Accordingly to the dimension sign that must be analyzed (free dimension), fix both of the two other dimensions 2917 // -------------------------------------------------------------------------------------------------------------- 2918 2919 if(freeDim == 0) { fixGraph(fixedGraph, 1); fixGraph(fixedGraph, 2); } // j == 0, k == 0 2920 if(freeDim == 1) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 2); } // i == 0, k == 0 2921 if(freeDim == 2) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 1); } // i == 0, j == 0 2922 2923 // Return the sign for the free dimension and the component given as parameter 2924 // --------------------------------------------------------------------------- 2925 2926 return(getCommonSign(freeDim, noComp, fixedGraph)); 2435 2927 2436 2928 }; 2437 2929 2438 2930 2439 2440 2441 2442 2443 int Order::getImposed(int freeDim, int noComp, myGraphType& upperGraph) {2444 2445 myGraphType fixedGraph;2446 2447 copyGraph(upperGraph, fixedGraph);2448 2449 if(freeDim == 0) { fixGraph(fixedGraph, 1); fixGraph(fixedGraph, 2); } // j == 0, k == 02450 if(freeDim == 1) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 2); } // i == 0, k == 02451 if(freeDim == 2) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 1); } // i == 0, j == 02452 2453 int valDim0 = 0;2454 2455 for(tie(edgeIterOne, edgeIterTwo) = edges(fixedGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) {2456 2457 if(get(boost::vertex_affected_comp_t(), fixedGraph, boost::source(*edgeIterOne, fixedGraph)) == noComp) {2458 2459 if(get(boost::vertex_affected_comp_t(), fixedGraph, boost::target(*edgeIterOne, fixedGraph)) == noComp) {2460 2461 int val0 = get(boost::edge_weight_d1_t(), fixedGraph, *edgeIterOne);2462 int val1 = get(boost::edge_weight_d2_t(), fixedGraph, *edgeIterOne);2463 int val2 = get(boost::edge_weight_d3_t(), fixedGraph, *edgeIterOne);2464 2465 if(valDim0 != 2) {2466 2467 switch(freeDim) {2468 2469 case 0: if(val0 != 0) { if(valDim0 + val0 == 0) { valDim0 = 2; } else { valDim0 = val0; } } break;2470 case 1: if(val1 != 0) { if(valDim0 + val1 == 0) { valDim0 = 2; } else { valDim0 = val1; } } break;2471 case 2: if(val2 != 0) { if(valDim0 + val2 == 0) { valDim0 = 2; } else { valDim0 = val2; } } break;2472 }2473 }2474 }2475 }2476 }2477 2478 return(valDim0);2479 };2480 2481 2931 2482 2932 -
trunk/yao/src/YAOObjects/Order.hpp
r182 r187 417 417 * If there is no common value the axis have to be decomposed 418 418 * If there is a common value or if there is no remaining edges in the last fixed graph, then the axis does not have to be decomposed 419 * @param fixedDimOne an interger value indicating which is the first dimension that should be fixed420 * @param fixedDimTwo an interger value indicating which is the second dimension that should be fixed421 419 * @param freeDim an interger value indicating on which dimension the sign must be analyzed 422 420 * @param upperGraph a reference to the graph on which the operations have to be performed 423 421 */ 424 bool isToDecompose(int f ixedDimOne, int fixedDimTwo, int freeDim, myGraphType& upperGraph);422 bool isToDecompose(int freeDim, myGraphType& upperGraph); 425 423 426 424 /** … … 485 483 * @param noComp3D an integer value indicating from which 3D component the order have to be read 486 484 */ 487 void Read (int noComp3D);485 void Read3D(int noComp3D); 488 486 489 487 /**
Note: See TracChangeset
for help on using the changeset viewer.