- Timestamp:
- 04/15/10 14:14:11 (14 years ago)
- Location:
- trunk/yao/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/3D_EX1.d
r183 r310 27 27 ctin M4 1 from M3 2 i j k t 28 28 29 order modinspace Soce30 order YB131 M1 M232 forder33 forder34 35 36 order spaceintraj Toce37 Soce38 forder39 29 40 30 -
trunk/yao/src/YAOObjects/Order.cpp
r293 r310 1329 1329 1330 1330 1331 1332 1333 1334 1331 // ------------------------------------ DEBUT AJOUT CB - GENERATION AUTOMATIQUE DE L'ORDER ------------------------------------------- 1335 1332 … … 1337 1334 void Order::automaticOrderGenerator(string projectName, Table<Order>& theOrderTable, Table<Modul>& myModulTable, Table<Connection>& myConnectionTable, Table<Space>& mySpaceTable) { 1338 1335 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 theOrderTable.clear(); 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 hiddenFile.close(); 1368 1369 1336 vector<cfcStruct> outerComp; 1337 1338 middleCompType middleComp; 1339 1340 innerCompType innerComp; 1341 1342 myGraphType myGraph; 1343 1344 // As the orderTable should be empty (because the generator is called), this clearing is just relevant in the testing phase 1345 // ------------------------------------------------------------------------------------------------------------------------ 1346 1347 theOrderTable.clear(); 1348 1349 // Add a dot to the project name to hide the file 1350 // ----------------------------------------------- 1351 1352 theProject = "." + projectName; 1353 1354 // Create a output file stream object 1355 // ---------------------------------- 1356 1357 ofstream hiddenFile; 1358 1359 // Open and close the hidden file without append flag : delete the former hidden file if the project already have one (it should exist some more dedicated functions) 1360 // ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1361 1362 hiddenFile.open(theProject.c_str()); 1363 1364 hiddenFile.close(); 1365 1366 /* 1370 1367 * Get informations on the trajectories then map all the spaces with the trajectory in which they are included. 1371 1368 * As this information is not provided by the space (the space object have no information about the trajectories), … … 1421 1418 } 1422 1419 1423 1420 1424 1421 /* 1425 1422 * Set up a graph that will contain one vertex by space and one edge by pair of moduls connected from different spaces. … … 1542 1539 } 1543 1540 1544 1545 1546 1547 sort(trajOrder.begin(), trajOrder.end()); 1548 1549 1550 1551 1552 1553 1554 1541 // Sort the trajectories accordingly to their higher space order Id 1542 // ---------------------------------------------------------------- 1543 1544 sort(trajOrder.begin(), trajOrder.end()); 1545 1546 1547 /* 1548 * Launch the modinspace generating space by space in the order that have been defined in the spaceintraj generating step just below 1549 */ 1550 1551 // For all the sorted trajectories 1555 1552 // -------------------------------- 1556 1553 … … 1575 1572 // ------------------------------------------------------ 1576 1573 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 // ----------------------------------------------------------------------------------------------------------------------------- 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 this -> setName(spaceName); 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 }1649 }1650 } 1651 1652 1653 1654 1655 if(modulList.size() > 0) {1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 }1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 case 1 : 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 read2D(outerComp, middleComp, innerComp, myGraph); 1772 1773 1774 1775 1776 1777 break;1778 1779 case 3 : 1780 1781 resetGraph(myGraph); 1782 1783 // Create the main graph with the informations collectedby scanning YAO tables 1784 // --------------------------------------------------------------------------1785 1786 generateGraph(myGraph, valCi, valCj, valCk, modulList, edgeArray); 1787 1788 // Launch the main function that will create the vector 3D components, the vectors of 2D components then the vectors of 1D components 1789 // ----------------------------------------------------------------------------------------------------------------------------------1790 1791 setOuter(outerComp, middleComp, innerComp, myGraph); 1792 1793 // Read the vector of 3D components 1794 // -------------------------------- 1795 1796 read3D(outerComp, middleComp, innerComp, myGraph); 1797 1798 break; 1799 1800 } 1801 }1802 1803 hiddenFile.open(theProject.c_str(), ios::app); 1804 1805 // Close the current modinspace statement 1806 // --------------------------------------1807 1808 hiddenFile << endl << "forder"; 1809 1810 hiddenFile.close(); 1811 1812 // Insert in the order Table the current Order (which contain all informations on the current modinspace) 1813 // ------------------------------------------------------------------------------------------------------ 1814 1815 theOrderTable.push_back(*this); 1816 1817 } 1818 } 1819 } 1820 1821 1822 1574 string spaceName = trajMap.find(spacesList[noTopo]) -> first; 1575 1576 // Show the modinspace line 1577 // ------------------------ 1578 1579 hiddenFile.open(theProject.c_str(), ios::app); 1580 1581 hiddenFile << endl << endl << "order modinspace " << spaceName << endl; 1582 1583 hiddenFile.close(); 1584 1585 // The current object pointer is used here (more convenient) but it will maybe not be available when the function will be static 1586 // ----------------------------------------------------------------------------------------------------------------------------- 1587 1588 // Set the current phase (here for a modinspace) 1589 // --------------------------------------------- 1590 1591 this -> setOrderPhase(1); 1592 1593 // Set the current space name 1594 // -------------------------- 1595 1596 this -> setName(spaceName); 1597 1598 // Reset the orderTokens string vector 1599 // ----------------------------------- 1600 1601 this -> orderTokens.clear(); 1602 1603 // Dedicated light structures that will be used to create the main graph then populate its properties 1604 // --------------------------------------------------------------------------------------------------- 1605 1606 vector<edge> edgeArray; 1607 vector<string> modulList; 1608 vector<int> valCi, valCj, valCk; 1609 1610 // Array of boolean values that will be used to know the dimensions on which the moduls are defined 1611 // ------------------------------------------------------------------------------------------------ 1612 1613 bool *isDefinedOn = new bool[3]; 1614 1615 isDefinedOn[0] = false; 1616 isDefinedOn[1] = false; 1617 isDefinedOn[2] = false; 1618 1619 // Scan the table of moduls to get relevable informations for setting up the graph and get informations on dimensions 1620 // ------------------------------------------------------------------------------------------------------------------ 1621 1622 for(Table<Modul>::iterator tok_tab = myModulTable.begin(); tok_tab < myModulTable.end(); tok_tab++) { 1623 1624 // If the modul is in the current space 1625 // ------------------------------------ 1626 1627 if(tok_tab -> getSpaceOrOperator() == spaceName) { 1628 1629 // Select just the moduls not involved in noward 1630 // --------------------------------------------- 1631 1632 if(!tok_tab -> isNoward()) { 1633 1634 // Get informations on modul names then populate the modulList vector that will be used by Boost to register the vertex_name property 1635 // ---------------------------------------------------------------------------------------------------------------------------------- 1636 1637 modulList.push_back(tok_tab -> getName()); 1638 1639 // Get informations on dimensions where are defined the moduls then populate the isDefinedOn array 1640 // ----------------------------------------------------------------------------------------------- 1641 1642 if(tok_tab -> getYA(1) > 0) isDefinedOn[0] = true; 1643 if(tok_tab -> getYA(2) > 0) isDefinedOn[1] = true; 1644 if(tok_tab -> getYA(3) > 0) isDefinedOn[2] = true; 1645 } 1646 } 1647 } 1648 1649 // Avoid to work on an empty set 1650 // ----------------------------- 1651 1652 if(modulList.size() > 0) { 1653 1654 1655 // Scan the table of the connections to get all relevable informations for generating the order statement 1656 // ------------------------------------------------------------------------------------------------------ 1657 1658 for(Table<Connection>::iterator tok_tab = myConnectionTable.begin(); tok_tab < myConnectionTable.end(); tok_tab++) { 1659 1660 // Select just the dependencies defined on the current time 1661 // --------------------------------------------------------- 1662 1663 if(tok_tab -> getT() > -1) { 1664 1665 Table<Modul>::iterator itSource = getModule(tok_tab -> getOutModule(), myModulTable); 1666 Table<Modul>::iterator itTarget = getModule(tok_tab -> getInModule(), myModulTable); 1667 1668 1669 // If both source and target modules are in the current space 1670 // ---------------------------------------------------------- 1671 1672 if(itSource -> getSpaceOrOperator() == spaceName && itTarget -> getSpaceOrOperator() == spaceName) { 1673 1674 1675 // Select just the moduls not involved in noward (match the condition used to create the modulList vector) 1676 // ------------------------------------------------------------------------------------------------------- 1677 1678 if(!itSource -> isNoward() && !itTarget -> isNoward() ) { 1679 1680 string sourceName = itSource -> getName(); 1681 string targetName = itTarget -> getName(); 1682 1683 // Setting all pair of integer values that will be used by Boost to manage the edges 1684 // ---------------------------------------------------------------------------------- 1685 1686 int modPairOne = getModulIndex(itSource -> getName(), modulList, modulList.size()); 1687 int modPairTwo = getModulIndex(itTarget -> getName(), modulList, modulList.size()); 1688 1689 edgeArray.push_back(edge(modPairOne, modPairTwo)); 1690 1691 // Getting informations about spatial dependency between moduls for the dimension i then populate the dedicated vector 1692 // ------------------------------------------------------------------------------------------------------------------- 1693 1694 valCi.push_back(tok_tab -> getI()); 1695 1696 // Getting informations about spatial dependency between moduls for the dimension j then populate the dedicated vector 1697 // ------------------------------------------------------------------------------------------------------------------- 1698 1699 valCj.push_back(tok_tab -> getJ()); 1700 1701 // Getting informations about spatial dependency between moduls for the dimension k then populate the dedicated vector 1702 // ------------------------------------------------------------------------------------------------------------------- 1703 1704 valCk.push_back(tok_tab -> getK()); 1705 1706 } 1707 } 1708 } 1709 } 1710 1711 // Get the number of dimensions on which tho moduls are defined 1712 // ------------------------------------------------------------ 1713 1714 switch(isDefinedOn[0] + isDefinedOn[1] + isDefinedOn[2]) { 1715 1716 // If the moduls are defined on on dimension 1717 // ----------------------------------------- 1718 1719 case 1 : 1720 1721 // Modify the spatial dependencies vector to offset i dimension to the k dimension then set the dependencies to zero for i and j dimensions 1722 // ---------------------------------------------------------------------------------------------------------------------------------------- 1723 1724 to3D(1, valCi, valCj, valCk, edgeArray.size()); 1725 1726 1727 resetGraph(myGraph); 1728 1729 // Create the main graph with the informations collected (and modified for spatial dependencies) by scanning YAO tables 1730 // -------------------------------------------------------------------------------------------------------------------- 1731 1732 generateGraph(myGraph, valCi, valCj, valCk, modulList, edgeArray); 1733 1734 // Launch the main function that will create the vector 3D components, the vectors of 2D components then the vectors of 1D components 1735 // ---------------------------------------------------------------------------------------------------------------------------------- 1736 1737 setOuter(outerComp, middleComp, innerComp, myGraph); 1738 1739 // Read the vector of 1D components to display the order statement (the two first dimensions have dummy values, then the third one is read as the first one) 1740 // --------------------------------------------------------------------------------------------------------------------------------------------------------- 1741 1742 read1D(outerComp, middleComp, innerComp, myGraph); 1743 1744 break; 1745 1746 case 2 : 1747 1748 // Modify the spatial dependencies vector to offset i and j dimensions to k j and k dimensions then set the dependencies to zero for the i dimension 1749 // ------------------------------------------------------------------------------------------------------------------------------------------------- 1750 1751 to3D(2, valCi, valCj, valCk, edgeArray.size()); 1752 1753 resetGraph(myGraph); 1754 1755 // Create the main graph with the informations collected (and modified for spatial dependencies) by scanning YAO tables 1756 // -------------------------------------------------------------------------------------------------------------------- 1757 1758 generateGraph(myGraph, valCi, valCj, valCk, modulList, edgeArray); 1759 1760 // Launch the main function that will create the vector 3D components, the vectors of 2D components then the vectors of 1D components 1761 // ---------------------------------------------------------------------------------------------------------------------------------- 1762 1763 setOuter(outerComp, middleComp, innerComp, myGraph); 1764 1765 // Read the vector of 2D components to display the order statement (the first dimension have dummy value, then the second and third are read as the first and second) 1766 // ------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1767 1768 read2D(outerComp, middleComp, innerComp, myGraph); 1769 1770 break; 1771 1772 case 3 : 1773 1774 resetGraph(myGraph); 1775 1776 // Create the main graph with the informations collectedby scanning YAO tables 1777 // -------------------------------------------------------------------------- 1778 1779 generateGraph(myGraph, valCi, valCj, valCk, modulList, edgeArray); 1780 1781 // Launch the main function that will create the vector 3D components, the vectors of 2D components then the vectors of 1D components 1782 // ---------------------------------------------------------------------------------------------------------------------------------- 1783 1784 setOuter(outerComp, middleComp, innerComp, myGraph); 1785 1786 // Read the vector of 3D components 1787 // -------------------------------- 1788 1789 read3D(outerComp, middleComp, innerComp, myGraph); 1790 1791 break; 1792 1793 } 1794 } 1795 1796 hiddenFile.open(theProject.c_str(), ios::app); 1797 1798 // Close the current modinspace statement 1799 // -------------------------------------- 1800 1801 hiddenFile << endl << "forder"; 1802 1803 hiddenFile.close(); 1804 1805 // Insert in the order Table the current Order (which contain all informations on the current modinspace) 1806 // ------------------------------------------------------------------------------------------------------ 1807 1808 theOrderTable.push_back(*this); 1809 1810 } 1811 } 1812 } 1813 1814 1815 /* 1816 1817 1818 1819 /* 1823 1820 * Perform the spaceintraj writting. 1824 1821 * For each trajectory in the trajectories order that have been performed (maybe not needed). … … 1832 1829 for(int noTraj = 0; noTraj < trajOrder.size(); noTraj++) { 1833 1830 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 this -> setOrderPhase(2); 1844 1845 1846 1847 1848 this -> setName(trajOrder[noTraj].second); 1849 1850 1851 1852 1853 1831 ofstream hiddenFile; 1832 1833 hiddenFile.open(theProject.c_str(), ios::app); 1834 1835 hiddenFile << endl << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t"; 1836 1837 // Set the current phase (which is a spacintraj here) 1838 // -------------------------------------------------- 1839 1840 this -> setOrderPhase(2); 1841 1842 // Set the trajectory name 1843 // ----------------------- 1844 1845 this -> setName(trajOrder[noTraj].second); 1846 1847 // Clear the orderTokens vector of string 1848 // -------------------------------------- 1849 1850 this -> orderTokens.clear(); 1854 1851 1855 1852 … … 1872 1869 // ----------------------------------------- 1873 1870 1874 1875 1876 1877 1878 1879 1871 hiddenFile << trajMap.find(spacesList[noTopo]) -> first << " "; 1872 1873 // Insert the current trajectory name in the order tokens vector 1874 // ------------------------------------------------------------- 1875 1876 this -> orderTokens.push_back(trajMap.find(spacesList[noTopo]) -> first); 1880 1877 } 1881 1878 } … … 1885 1882 // --------------------------------------- 1886 1883 1887 1888 1889 1890 1891 1892 1893 1894 1884 hiddenFile << endl << endl << "forder"; 1885 1886 hiddenFile.close(); 1887 1888 // Insert in the Order table the current Order (which contain all informations on the current spaceintraj) 1889 // ------------------------------------------------------------------------------------------------------- 1890 1891 theOrderTable.push_back(*this); 1895 1892 1896 1893 } 1894 1895 cout << endl << "Order directive generated" << endl; 1897 1896 }; 1898 1897 … … 1903 1902 1904 1903 if(nbDim == 2) { for(int noEdge = 0; noEdge < nbEdges; noEdge++) { 1905 1906 1904 1905 valCk[noEdge] = valCj[noEdge]; 1907 1906 valCj[noEdge] = valCi[noEdge]; 1908 1907 valCi[noEdge] = 0; 1909 1910 1908 } 1909 } 1911 1910 1912 1911 if(nbDim == 1) { for(int noEdge = 0; noEdge < nbEdges; noEdge++) { 1913 1912 1914 1913 valCk[noEdge] = valCi[noEdge]; 1915 1914 valCj[noEdge] = 0; 1916 1915 valCi[noEdge] = 0; 1917 1918 1916 } 1917 } 1919 1918 }; 1920 1919 … … 1938 1937 put(get(boost::vertex_topo_order_t(), currentGraph), *vertexIterOne, -1); 1939 1938 put(get(boost::vertex_affected_comp_t(), currentGraph), *vertexIterOne, -1); 1940 put(get(boost::vertex_original_id_t(), currentGraph), *vertexIterOne, *vertexIterOne); 1939 put(get(boost::vertex_original_id_t(), currentGraph), *vertexIterOne, *vertexIterOne); 1941 1940 } 1942 1941 … … 1951 1950 1952 1951 }; 1953 1952 1954 1953 1955 1954 … … 2022 2021 2023 2022 2024 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].cfcSign[0].first : " 2025 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << ", second : "2026 2027 2028 2029 2030 2031 2032 2033 2034 2023 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].cfcSign[0].first : " 2024 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << ", second : " 2025 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second << ", modules : "; 2026 2027 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) { 2028 2029 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]) << " "; 2030 2031 } 2032 2033 cout << endl; 2035 2034 2036 2035 } … … 2040 2039 2041 2040 2042 2043 void Order::setOuter(cfcStructTableType& outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 2041 2042 void Order::setOuter(cfcStructTableType& outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 2044 2043 2045 2044 // ETAPE 3 DE LA PROCEDURE A DEUX DIMENSION 2046 2047 2048 2049 2050 2045 // ----------------------------------------- 2046 2047 std::vector<int> outerComponentsList; 2048 2049 outerComponentsList.resize(boost::num_vertices(myGraph)); 2051 2050 2052 2051 std::vector<vertexDescriptor> verticesDiscoverList(boost::num_vertices(myGraph)); 2053 2052 2054 2053 // Searching strong components in the main graph 2055 2054 // --------------------------------------------- 2056 2055 2057 2056 boost::strong_components(myGraph, &outerComponentsList[0], boost::root_map(&verticesDiscoverList[0])); 2058 2057 2059 2058 // Updating vertices properties of the graph : set a component Id on each vertex 2060 2059 // ----------------------------------------------------------------------------- 2061 2060 2062 2061 for(int i = 0; i < outerComponentsList.size(); i++) put(get(boost::vertex_affected_comp_t(), myGraph), i, outerComponentsList[i]); 2063 2062 2064 2063 // Setting the number of components that have been detected 2065 2064 // -------------------------------------------------------- 2066 2065 2067 2066 int nbComponents = *max_element(outerComponentsList.begin(), outerComponentsList.end()) + 1; 2068 2067 2069 2068 // Resetting the size of the outer structure table : one table entry for each detected component 2070 2071 2072 2069 // --------------------------------------------------------------------------------------------- 2070 2071 outerComp.resize(nbComponents); 2073 2072 2074 2073 // ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION 2075 2076 2077 2078 2079 2080 2081 2082 2074 // ---------------------------------------- 2075 2076 // For each component, set the sign for the first, second and third dimensions then register this sign in the cfcSign attribute of the component's table entry 2077 // ------------------------------------------------------------------------------------------------------------------------------------------------------------ 2078 2079 int **isImposed = new int*[nbComponents]; 2080 2081 int **isImposed1D = new int*[nbComponents]; 2083 2082 2084 2083 for(int i = 0; i < nbComponents; i++) isImposed[i] = new int[3]; 2085 2084 2086 2085 for(int i = 0; i < nbComponents; i++) isImposed1D[i] = new int[3]; 2087 2086 2088 2087 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 2089 2088 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 isImposed[noComponent][2] = 0; 2100 2101 2102 // ------------------------------------------ 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2089 isImposed1D[noComponent][0] = 0; 2090 isImposed1D[noComponent][1] = 0; 2091 isImposed1D[noComponent][2] = 0; 2092 2093 // Setting inial imposed values (0 mean not imposed) 2094 // ------------------------------------------------- 2095 2096 isImposed[noComponent][0] = 0; 2097 isImposed[noComponent][1] = 0; 2098 isImposed[noComponent][2] = 0; 2099 2100 // Setting initial size of the cfcSign vector 2101 // ------------------------------------------ 2102 2103 outerComp[noComponent].cfcSign.resize(3); 2104 2105 // Setting initial axis numbers (i -> j -> k) 2106 // ------------------------------------------ 2107 2108 outerComp[noComponent].cfcSign[0].first = 0; 2109 outerComp[noComponent].cfcSign[1].first = 1; 2110 outerComp[noComponent].cfcSign[2].first = 2; 2111 2112 // Getting the axis values (see getCommonSign comments) 2113 // ---------------------------------------------------- 2114 2115 outerComp[noComponent].cfcSign[0].second = getCommonSign(0, noComponent, myGraph); 2117 2116 outerComp[noComponent].cfcSign[1].second = getCommonSign(1, noComponent, myGraph); 2118 2117 outerComp[noComponent].cfcSign[2].second = getCommonSign(2, noComponent, myGraph); 2119 2118 2120 2121 2122 2123 2124 2125 2126 2127 2119 // Detecting all possible axis combinations then setting the one corresponding to the current component 2120 // ---------------------------------------------------------------------------------------------------- 2121 2122 int sign0 = outerComp[noComponent].cfcSign[0].second; 2123 int sign1 = outerComp[noComponent].cfcSign[1].second; 2124 int sign2 = outerComp[noComponent].cfcSign[2].second; 2125 2126 // If there is no connection between the vertices of the component (ie single modul without reflexive edge) 2128 2127 // -------------------------------------------------------------------------------------------------------- 2129 2128 2130 bool isConnected = true; 2131 2132 if(sign0 == 3 && sign1 == 3 && sign2 == 3) { 2133 2134 outerComp[noComponent].cfcSign[0].second = 0; 2135 outerComp[noComponent].cfcSign[1].second = 0; 2136 outerComp[noComponent].cfcSign[2].second = 0; 2137 2138 isConnected = false; 2139 } 2140 2141 if(isConnected) { 2142 2143 // Detect the type of configuration of the component accordignly to its defined and not defined axis 2144 // ------------------------------------------------------------------------------------------------- 2145 2146 int noConf = -1; 2147 2148 if(sign0 != 2 && sign1 != 2 && sign2 != 2) noConf = 0; // i -> j -> k (j and k free) 2149 if(sign0 != 2 && sign1 != 2 && sign2 == 2) noConf = 1; // i -> j -> k (j free) 2150 if(sign0 != 2 && sign1 == 2 && sign2 == 2) noConf = 2; // i -> j -> k 2151 if(sign0 != 2 && sign1 == 2 && sign2 != 2) noConf = 3; // i -> k -> j (k free) 2152 if(sign0 == 2 && sign1 != 2 && sign2 != 2) noConf = 4; // j -> i -> k (i free) 2153 if(sign0 == 2 && sign1 != 2 && sign2 == 2) noConf = 5; // j -> i -> k 2154 if(sign0 == 2 && sign1 == 2 && sign2 != 2) noConf = 6; // k -> i -> j 2155 2156 // Detect the errors of the component accordignly to its defined and not defined axis and to the null values 2157 // --------------------------------------------------------------------------------------------------------- 2158 2159 if(sign0 == 2 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2160 if(sign0 == 2 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2161 if(sign0 == 2 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2162 if(sign0 == 0 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2163 if(sign0 == 2 && sign1 == 0 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2164 if(sign0 == 0 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2165 if(sign0 == 0 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2166 if(sign0 == 0 && sign1 == 0 && sign2 == 0) noConf = 8; // Error : cyclic dependency 2167 2168 // Looking at combinations to set imposed values for the second axis (see "getImposed" comments) 2169 // --------------------------------------------------------------------------------------------- 2170 2171 if(noConf == 0 || noConf == 1 || noConf == 2) isImposed[noComponent][1] = getImposed(0, 1, noComponent, myGraph); 2172 if(noConf == 3) isImposed[noComponent][2] = getImposed(0, 2, noComponent, myGraph); 2173 if(noConf == 4) isImposed[noComponent][2] = getImposed(1, 2, noComponent, myGraph); 2174 if(noConf == 5) isImposed[noComponent][1] = getImposed(1, 0, noComponent, myGraph); 2175 if(noConf == 6) isImposed[noComponent][2] = getImposed(2, 0, noComponent, myGraph); 2176 2177 // Set imposed values for the third axis (see "getImposed" comments) 2178 // ---------------------------------------------------------------- 2179 2180 isImposed1D[noComponent][0] = getImposed(0, noComponent, myGraph); 2181 isImposed1D[noComponent][1] = getImposed(1, noComponent, myGraph); 2182 isImposed1D[noComponent][2] = getImposed(2, noComponent, myGraph); 2183 2184 // Looking at combinations to : 1 - sort the axis (number and value) inside the "cfcSign" array 2185 // 2 - reset axis value if this one is free 2186 // 3 - reset axis value if this one is imposed 2187 // -------------------------------------------------------------------------------------------- 2188 2189 switch(noConf) { 2190 2191 case 0: 2192 2193 outerComp[noComponent].cfcSign[1].second = 0; // set j to free 2194 outerComp[noComponent].cfcSign[2].second = 0; // set k to free 2195 2196 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2197 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2198 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2199 2200 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2201 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2202 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2203 2204 // If the third axis does not have a common sign 2205 // If the second axis have a common sign 2206 // If it is not needed to decompose the third axis dimension (see "isToDecompose" comments) 2207 // Then set the axis value to 3 (means no common sign but no decomposition) 2208 2209 if(outerComp[noComponent].cfcSign[2].second == 2) 2210 if(outerComp[noComponent].cfcSign[1].second != 2) 2211 if(!isToDecompose(2, myGraph)) 2212 2213 outerComp[noComponent].cfcSign[2].second = 3; 2214 2215 break; 2216 2217 case 1: 2218 2219 outerComp[noComponent].cfcSign[1].second = 0; 2220 2221 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2222 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2223 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2224 2225 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2226 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2227 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2228 2229 if(outerComp[noComponent].cfcSign[2].second == 2) 2230 if(outerComp[noComponent].cfcSign[1].second != 2) 2231 if(!isToDecompose(2, myGraph)) 2232 2233 outerComp[noComponent].cfcSign[2].second = 3; 2234 2235 break; 2236 2237 case 2: 2238 2239 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2240 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2241 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2242 2243 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2244 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2245 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2246 2247 if(outerComp[noComponent].cfcSign[2].second == 2) 2248 if(outerComp[noComponent].cfcSign[1].second != 2) 2249 if(!isToDecompose(2, myGraph)) 2250 2251 outerComp[noComponent].cfcSign[2].second = 3; 2252 2253 break; 2254 2255 case 3: 2256 2257 outerComp[noComponent].cfcSign[1].second = 0; 2258 outerComp[noComponent].cfcSign[2].second = 2; 2259 outerComp[noComponent].cfcSign[1].first = 2; 2260 outerComp[noComponent].cfcSign[2].first = 1; 2261 2262 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2263 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][2]; 2264 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 2265 2266 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2267 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][2]; 2268 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 2269 2270 if(outerComp[noComponent].cfcSign[1].second == 2) 2271 if(outerComp[noComponent].cfcSign[2].second != 2) 2272 if(!isToDecompose(1, myGraph)) 2273 2274 outerComp[noComponent].cfcSign[1].second = 3; 2275 2276 break; 2277 2278 case 4: 2279 2280 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 2281 outerComp[noComponent].cfcSign[1].second = 0; 2282 2283 outerComp[noComponent].cfcSign[2].second = 2; 2284 outerComp[noComponent].cfcSign[0].first = 1; 2285 outerComp[noComponent].cfcSign[1].first = 0; 2286 outerComp[noComponent].cfcSign[2].first = 2; 2287 2288 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 2289 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2290 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2291 2292 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 2293 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2294 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2295 2296 if(outerComp[noComponent].cfcSign[0].second == 2) 2297 if(outerComp[noComponent].cfcSign[2].second != 2) 2298 if(!isToDecompose(0, myGraph)) 2299 2300 outerComp[noComponent].cfcSign[0].second = 3; 2301 2302 break; 2303 2304 case 5: 2305 2306 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 2307 outerComp[noComponent].cfcSign[1].second = 2; 2308 outerComp[noComponent].cfcSign[2].second = 2; 2309 outerComp[noComponent].cfcSign[0].first = 1; 2310 outerComp[noComponent].cfcSign[1].first = 0; 2311 outerComp[noComponent].cfcSign[2].first = 2; 2312 2313 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 2314 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2315 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2316 2317 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 2318 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2319 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2320 2321 if(outerComp[noComponent].cfcSign[2].second == 2) 2322 if(outerComp[noComponent].cfcSign[0].second != 2) 2323 if(!isToDecompose(2, myGraph)) 2324 2325 outerComp[noComponent].cfcSign[2].second = 3; 2326 2327 2328 break; 2329 2330 case 6: 2331 2332 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[2].second; 2333 outerComp[noComponent].cfcSign[1].second = 2; 2334 outerComp[noComponent].cfcSign[2].second = 2; 2335 outerComp[noComponent].cfcSign[0].first = 2; 2336 outerComp[noComponent].cfcSign[1].first = 0; 2337 outerComp[noComponent].cfcSign[2].first = 1; 2338 2339 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][2]; 2340 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2341 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 2342 2343 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][2]; 2344 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2345 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 2346 2347 if(outerComp[noComponent].cfcSign[1].second == 2) 2348 if(outerComp[noComponent].cfcSign[0].second != 2) 2349 if(!isToDecompose(1, myGraph)) 2350 2351 outerComp[noComponent].cfcSign[1].second = 3; 2352 2353 break; 2354 2355 // ETAPE 4 DE LA PROCEDURE A DEUX DIMENSION (cf. docs) 2356 // --------------------------------------------------- 2357 2358 case 7: 2359 2360 cout << endl << "Error : no common value in the component including moduls "; 2361 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 2362 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 2363 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 2364 // SORTIE PROGRAMME 2365 2366 break; 2367 2368 case 8: 2369 2370 cout << endl << "Error : cyclic dependency in the component including moduls "; 2371 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 2372 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 2373 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 2374 // SORTIE PROGRAMME 2375 2376 break; 2377 2378 } 2379 2380 } 2381 2382 } 2129 bool isConnected = true; 2130 2131 if(sign0 == 3 && sign1 == 3 && sign2 == 3) { 2132 2133 outerComp[noComponent].cfcSign[0].second = 0; 2134 outerComp[noComponent].cfcSign[1].second = 0; 2135 outerComp[noComponent].cfcSign[2].second = 0; 2136 2137 isConnected = false; 2138 } 2139 2140 if(isConnected) { 2141 2142 // Detect the type of configuration of the component accordignly to its defined and not defined axis 2143 // ------------------------------------------------------------------------------------------------- 2144 2145 int noConf = -1; 2146 2147 if(sign0 != 2 && sign1 != 2 && sign2 != 2) noConf = 0; // i -> j -> k (j free and k free) 2148 if(sign0 != 2 && sign1 != 2 && sign2 == 2) noConf = 1; // i -> j -> k (j free) 2149 if(sign0 != 2 && sign1 == 2 && sign2 == 2) noConf = 2; // i -> j -> k (none free) 2150 if(sign0 != 2 && sign1 == 2 && sign2 != 2) noConf = 3; // i -> k -> j (k free) 2151 if(sign0 == 2 && sign1 != 2 && sign2 != 2) noConf = 4; // j -> k -> i (k free) - Changed from j -> i -> k (i free) 2152 if(sign0 == 2 && sign1 != 2 && sign2 == 2) noConf = 5; // j -> i -> k (none free) 2153 if(sign0 == 2 && sign1 == 2 && sign2 != 2) noConf = 6; // k -> i -> j (none free) 2154 2155 // Detect the errors of the component accordignly to its defined and not defined axis and to the null values 2156 // --------------------------------------------------------------------------------------------------------- 2157 2158 if(sign0 == 2 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2159 if(sign0 == 2 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2160 if(sign0 == 2 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2161 if(sign0 == 0 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2162 if(sign0 == 2 && sign1 == 0 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2163 if(sign0 == 0 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 2164 if(sign0 == 0 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 2165 if(sign0 == 0 && sign1 == 0 && sign2 == 0) noConf = 8; // Error : cyclic dependency 2166 2167 // Looking at combinations to set imposed values for the second axis (see "getImposed" comments) 2168 // --------------------------------------------------------------------------------------------- 2169 2170 if(noConf == 0 || noConf == 1 || noConf == 2) isImposed[noComponent][1] = getImposed(0, 1, noComponent, myGraph); 2171 if(noConf == 3) isImposed[noComponent][2] = getImposed(0, 2, noComponent, myGraph); 2172 if(noConf == 4) isImposed[noComponent][2] = getImposed(1, 2, noComponent, myGraph); 2173 if(noConf == 5) isImposed[noComponent][0] = getImposed(1, 0, noComponent, myGraph); // Changed from isImposed[noComponent][1] = getImposed(1, 0, noComponent, myGraph); 2174 if(noConf == 6) isImposed[noComponent][0] = getImposed(2, 0, noComponent, myGraph); // Changed from isImposed[noComponent][2] = getImposed(2, 0, noComponent, myGraph); 2175 2176 // Set imposed values for the third axis (see "getImposed" comments) 2177 // ---------------------------------------------------------------- 2178 2179 isImposed1D[noComponent][0] = getImposed(0, noComponent, myGraph); 2180 isImposed1D[noComponent][1] = getImposed(1, noComponent, myGraph); 2181 isImposed1D[noComponent][2] = getImposed(2, noComponent, myGraph); 2182 2183 2184 // Looking at combinations to : 1 - sort the axis (number and value) inside the "cfcSign" array 2185 // 2 - reset axis value if this one is free 2186 // 3 - reset axis value if this one is imposed 2187 // -------------------------------------------------------------------------------------------- 2188 2189 bool isNoError = true; 2190 2191 switch(noConf) { 2192 2193 case 0: 2194 2195 outerComp[noComponent].cfcSign[1].second = 0; // set j to free 2196 outerComp[noComponent].cfcSign[2].second = 0; // set k to free 2197 2198 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2199 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2200 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2201 2202 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2203 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2204 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2205 2206 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2207 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2208 2209 break; 2210 2211 case 1: 2212 2213 outerComp[noComponent].cfcSign[1].second = 0; 2214 2215 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2216 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2217 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2218 2219 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2220 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2221 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2222 2223 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2224 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2225 2226 2227 break; 2228 2229 case 2: 2230 2231 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2232 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 2233 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2234 2235 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2236 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 2237 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2238 2239 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2240 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2241 2242 2243 break; 2244 2245 case 3: 2246 2247 outerComp[noComponent].cfcSign[1].second = 0; 2248 outerComp[noComponent].cfcSign[2].second = 2; 2249 outerComp[noComponent].cfcSign[1].first = 2; 2250 outerComp[noComponent].cfcSign[2].first = 1; 2251 2252 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 2253 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][2]; 2254 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 2255 2256 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 2257 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][2]; 2258 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 2259 2260 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2261 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(0, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2262 2263 2264 break; 2265 2266 case 4: 2267 2268 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 2269 outerComp[noComponent].cfcSign[1].second = 0; 2270 2271 outerComp[noComponent].cfcSign[2].second = 2; 2272 outerComp[noComponent].cfcSign[0].first = 1; 2273 outerComp[noComponent].cfcSign[1].first = 0; 2274 outerComp[noComponent].cfcSign[2].first = 2; 2275 2276 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 2277 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2278 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2279 2280 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 2281 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2282 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2283 2284 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(1, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2285 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(1, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2286 2287 break; 2288 2289 case 5: 2290 2291 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 2292 outerComp[noComponent].cfcSign[1].second = 2; 2293 outerComp[noComponent].cfcSign[2].second = 2; 2294 outerComp[noComponent].cfcSign[0].first = 1; 2295 outerComp[noComponent].cfcSign[1].first = 0; 2296 outerComp[noComponent].cfcSign[2].first = 2; 2297 2298 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 2299 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2300 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 2301 2302 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 2303 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2304 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 2305 2306 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(1, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2307 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(1, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2308 2309 break; 2310 2311 case 6: 2312 2313 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[2].second; 2314 outerComp[noComponent].cfcSign[1].second = 2; 2315 outerComp[noComponent].cfcSign[2].second = 2; 2316 outerComp[noComponent].cfcSign[0].first = 2; 2317 outerComp[noComponent].cfcSign[1].first = 0; 2318 outerComp[noComponent].cfcSign[2].first = 1; 2319 2320 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][2]; 2321 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 2322 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 2323 2324 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][2]; 2325 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 2326 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 2327 2328 if(outerComp[noComponent].cfcSign[1].second == 2 && !isToDecompose2D(2, noComponent, myGraph)) outerComp[noComponent].cfcSign[1].second = 3; 2329 if(outerComp[noComponent].cfcSign[2].second == 2 && !isToDecompose2D(2, noComponent, myGraph)) outerComp[noComponent].cfcSign[2].second = 3; 2330 2331 break; 2332 2333 // ETAPE 4 DE LA PROCEDURE A DEUX DIMENSION (cf. docs) 2334 // --------------------------------------------------- 2335 2336 case 7: 2337 2338 isNoError = false; 2339 2340 cout << endl << "Error : dependencies between modules "; 2341 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 2342 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 2343 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 2344 cout << " can not be satisfied (no path found) => Order generation aborted" << endl << endl; 2345 2346 2347 break; 2348 2349 2350 case 8: 2351 2352 isNoError = false; 2353 2354 cout << endl << "Error : a cycle appear between modules "; 2355 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 2356 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 2357 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 2358 cout << " => Order generation aborted" << endl << endl; 2359 2360 break; 2361 2362 2363 } 2364 2365 ENFORCE(isNoError); 2366 2367 } 2368 2369 } 2383 2370 2384 2371 2385 2372 // ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION 2386 2387 2388 2389 2390 // Create a graph whose vertices are the components (reduced graph) 2391 2392 2393 reduceGraph(myGraph, cfcGraph, nbComponents); 2373 // ---------------------------------------- 2374 2375 myGraphType cfcGraph; 2376 2377 // Create a graph whose vertices are the components (reduced graph) 2378 // ---------------------------------------------------------------- 2379 2380 reduceGraph(myGraph, cfcGraph, nbComponents); 2394 2381 2395 2382 // ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION 2396 2397 2398 2399 2400 if(boost::num_vertices(cfcGraph) > 1) { 2383 // ---------------------------------------- 2384 2385 std::deque<int> topoOrder; 2386 2387 if(boost::num_vertices(cfcGraph) > 1) { 2401 2388 2402 2389 2403 2390 // Perform a topological sort on the reduced graph 2404 2391 // ----------------------------------------------- 2405 2392 2406 2393 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 2407 2394 2408 2395 // ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION 2409 2396 // ---------------------------------------- 2410 2397 2411 2398 // Sort the outer structure table elements (main graph components) accordignly to the sorting performed on the reduced graph 2412 // ------------------------------------------------------------------------------------------------------------------------- 2413 2414 int **sortedIsImposed = new int*[nbComponents]; 2415 2416 for(int i = 0; i < nbComponents; i++) sortedIsImposed[i] = new int[3]; 2417 2418 vector<cfcStruct> sortedOuterCfcStructTable; 2419 2420 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) { 2421 2422 sortedOuterCfcStructTable.push_back(outerComp[topoOrder[noComponent]]); 2423 2424 sortedIsImposed[noComponent][0] = isImposed[topoOrder[noComponent]][0]; 2425 sortedIsImposed[noComponent][1] = isImposed[topoOrder[noComponent]][1]; 2426 sortedIsImposed[noComponent][2] = isImposed[topoOrder[noComponent]][2]; 2427 2428 } 2429 2430 outerComp.clear(); 2431 2432 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) { 2433 2434 isImposed[noComponent][0] = sortedIsImposed[noComponent][0]; 2435 isImposed[noComponent][1] = sortedIsImposed[noComponent][1]; 2436 isImposed[noComponent][2] = sortedIsImposed[noComponent][2]; 2437 2438 outerComp.push_back(sortedOuterCfcStructTable[noComponent]); 2439 2440 } 2441 2442 } else { topoOrder[0] = 0; } // Added to avoid errors if there is just one vertex 2443 2444 2445 // Set de middle component (2D) array first dimension accordignly to the number of 3D components 2446 // --------------------------------------------------------------------------------------------- 2447 2448 middleComp = new cfcStructTableType*[outerComp.size()]; 2449 2450 // Set de inner component (1D) array first dimension accordignly to the number of 3D components 2451 // --------------------------------------------------------------------------------------------- 2452 2453 innerComp = new cfcStructTableType***[outerComp.size()]; 2454 2455 // Set the middle component (2D) array second dimension to 3 (one by first fixed dimension) 2456 // ---------------------------------------------------------------------------------------- 2457 2458 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) middleComp[noComp3D] = new cfcStructTableType[3]; 2459 2460 // Set the inner component (1D) array second dimension to 3 (one by first fixed dimension) 2461 // --------------------------------------------------------------------------------------- 2462 2463 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) innerComp[noComp3D] = new cfcStructTableType**[3]; 2464 2465 // For each 3D component 2466 // --------------------- 2467 2468 for(int noComp = 0; noComp < outerComp.size(); noComp++) { 2469 2470 // Create a graph that just contain vertices and edges included in the current 3D component (ie extract the current 3D component from the main graph) 2471 // -------------------------------------------------------------------------------------------------------------------------------------------------- 2472 2473 myGraphType outerGraph; 2474 2475 copyGraph(myGraph, outerGraph); 2476 2477 2478 // Create a graph that just keep the current 3D component egdes and vertices 2479 // ------------------------------------------------------------------------- 2480 2481 keepComponent(topoOrder[noComp], outerGraph); 2482 2483 2484 // Launch the functions for analizing 2D components included inside the current 3D component (see "setMiddle" comments) 2485 // -------------------------------------------------------------------------------------------------------------------- 2486 2487 if(boost::num_vertices(outerGraph) > 0) { 2488 2489 setMiddle(0, 1, 2, outerGraph, noComp, middleComp, innerComp); 2490 setMiddle(1, 0, 2, outerGraph, noComp, middleComp, innerComp); 2491 setMiddle(2, 0, 1, outerGraph, noComp, middleComp, innerComp); 2492 2493 } 2399 // ------------------------------------------------------------------------------------------------------------------------- 2400 2401 int **sortedIsImposed = new int*[nbComponents]; 2402 2403 for(int i = 0; i < nbComponents; i++) sortedIsImposed[i] = new int[3]; 2404 2405 vector<cfcStruct> sortedOuterCfcStructTable; 2406 2407 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) { 2408 2409 sortedOuterCfcStructTable.push_back(outerComp[topoOrder[noComponent]]); 2410 2411 sortedIsImposed[noComponent][0] = isImposed[topoOrder[noComponent]][0]; 2412 sortedIsImposed[noComponent][1] = isImposed[topoOrder[noComponent]][1]; 2413 sortedIsImposed[noComponent][2] = isImposed[topoOrder[noComponent]][2]; 2414 2415 } 2416 2417 outerComp.clear(); 2418 2419 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) { 2420 2421 isImposed[noComponent][0] = sortedIsImposed[noComponent][0]; 2422 isImposed[noComponent][1] = sortedIsImposed[noComponent][1]; 2423 isImposed[noComponent][2] = sortedIsImposed[noComponent][2]; 2424 2425 outerComp.push_back(sortedOuterCfcStructTable[noComponent]); 2426 2427 } 2428 2429 } else { topoOrder[0] = 0; } // Added to avoid errors if there is just one vertex 2430 2431 2432 // Set de middle component (2D) array first dimension accordignly to the number of 3D components 2433 // --------------------------------------------------------------------------------------------- 2434 2435 middleComp = new cfcStructTableType*[outerComp.size()]; 2436 2437 // Set de inner component (1D) array first dimension accordignly to the number of 3D components 2438 // --------------------------------------------------------------------------------------------- 2439 2440 innerComp = new cfcStructTableType***[outerComp.size()]; 2441 2442 // Set the middle component (2D) array second dimension to 3 (one by first fixed dimension) 2443 // ---------------------------------------------------------------------------------------- 2444 2445 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) middleComp[noComp3D] = new cfcStructTableType[3]; 2446 2447 // Set the inner component (1D) array second dimension to 3 (one by first fixed dimension) 2448 // --------------------------------------------------------------------------------------- 2449 2450 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) innerComp[noComp3D] = new cfcStructTableType**[3]; 2451 2452 // For each 3D component 2453 // --------------------- 2454 2455 for(int noComp = 0; noComp < outerComp.size(); noComp++) { 2456 2457 // Create a graph that just contain vertices and edges included in the current 3D component (ie extract the current 3D component from the main graph) 2458 // -------------------------------------------------------------------------------------------------------------------------------------------------- 2459 2460 myGraphType outerGraph; 2461 2462 copyGraph(myGraph, outerGraph); 2463 2464 2465 // Create a graph that just keep the current 3D component egdes and vertices 2466 // ------------------------------------------------------------------------- 2467 2468 keepComponent(topoOrder[noComp], outerGraph); 2469 2470 2471 // Launch the functions for analizing 2D components included inside the current 3D component (see "setMiddle" comments) 2472 // -------------------------------------------------------------------------------------------------------------------- 2473 2474 if(boost::num_vertices(outerGraph) > 0) { 2475 2476 setMiddle(outerComp[noComp].cfcSign[0].first, outerComp[noComp].cfcSign[1].first, outerComp[noComp].cfcSign[2].first, outerGraph, noComp, middleComp, innerComp); 2477 2478 /**** 2479 setMiddle(0, outerComp[noComp].cfcSign[1].first, outerComp[noComp].cfcSign[2].first, outerGraph, noComp, middleComp, innerComp); 2480 setMiddle(1, outerComp[noComp].cfcSign[1].first, outerComp[noComp].cfcSign[2].first, outerGraph, noComp, middleComp, innerComp); 2481 setMiddle(2, outerComp[noComp].cfcSign[1].first, outerComp[noComp].cfcSign[2].first, outerGraph, noComp, middleComp, innerComp); 2482 ****/ 2483 2484 2485 /***** 2486 setMiddle(0, 1, 2, outerGraph, noComp, middleComp, innerComp); 2487 setMiddle(0, 2, 1, outerGraph, noComp, middleComp, innerComp); // Bug of repeated axises 2488 setMiddle(1, 0, 2, outerGraph, noComp, middleComp, innerComp); 2489 setMiddle(1, 2, 0, outerGraph, noComp, middleComp, innerComp); // Bug of repeated axises 2490 setMiddle(2, 0, 1, outerGraph, noComp, middleComp, innerComp); 2491 setMiddle(2, 1, 0, outerGraph, noComp, middleComp, innerComp); // Bug of repeated axises 2492 ******/ 2493 2494 2495 2496 } 2494 2497 2495 2498 } // NEXT 3D COMPONENT 2496 2499 2497 2500 }; 2498 2499 2501 2500 2502 … … 2567 2569 2568 2570 2569 void Order::showMiddle(int noFixed1, cfcStructTableType& outerComp, middleCompType& middleComp, myGraphType& myGraph) { 2570 2571 2572 2573 2574 2575 2576 2577 cout << endl << "middleComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "].cfcSign[0].first : " 2571 void Order::showMiddle(int noFixed1, cfcStructTableType& outerComp, middleCompType& middleComp, myGraphType& myGraph) { 2572 2573 cout << endl << "showMiddle(" << noFixed1 << ")"; 2574 2575 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 2576 2577 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][noFixed1].size(); noComp2D++) { 2578 2579 cout << endl << "middleComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "].cfcSign[0].first : " 2578 2580 << middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].first << " , second : " << middleComp[noComp3D][noFixed1][noComp2D].cfcSign[0].second; 2579 2581 … … 2581 2583 << middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].first << " , second : " << middleComp[noComp3D][noFixed1][noComp2D].cfcSign[1].second; 2582 2584 2583 cout << endl; 2584 2585 2586 2587 2585 cout << endl; 2586 2587 for(int noMod = 0; noMod < middleComp[noComp3D][noFixed1][noComp2D].embeddedModuls.size(); noMod++) { 2588 2589 cout << endl << "middleComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "].EmbeddedModuls[" << noMod << "] : " 2588 2590 << get(boost::vertex_name_t(), myGraph, middleComp[noComp3D][noFixed1][noComp2D].embeddedModuls[noMod]) << " ==> NoMod : " << middleComp[noComp3D][noFixed1][noComp2D].embeddedModuls[noMod]; 2589 2591 2590 2591 2592 2593 2594 } 2595 2592 } 2593 2594 cout << endl; 2595 } 2596 } 2597 }; 2596 2598 2597 2599 … … 2605 2607 2606 2608 int recVal = 0; 2609 2610 // if(boost::num_edges(fixedGraph) == 0) recVal = 3; // ADDED BECAUSE OF A BUG 2607 2611 2608 2612 // For all edges of the graph … … 2729 2733 2730 2734 2731 void Order::showGraph( myGraphType& currentGraph, myGraphType& myGraph) { 2735 2736 2737 void Order::showGraph(myGraphType& currentGraph) { 2732 2738 2733 2739 cout << endl << "showGraph : " << endl << endl; … … 2745 2751 cout << endl << "Module " << cmptMod << ":\t" 2746 2752 2747 // Name of the modul as it appears in the description file2748 // -------------------------------------------------------2749 2750 << "Nom : " << get(boost::vertex_name_t(), myGraph, get(boost::vertex_original_id_t(), currentGraph, *vertexIterOne))2751 2752 2753 // Order affected to the modul in the current graph (iformation coming from the topological sort) 2753 2754 // ---------------------------------------------------------------------------------------------- … … 2808 2809 <<") ==> " << get(boost::vertex_name_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)); 2809 2810 cmptArc++; 2810 2811 2811 2812 } 2812 2813 }; 2813 2814 2814 2815 2815 2816 2817 2818 2816 2819 void Order::readParam(int noAxis, int valAxis, int noParam) { 2817 2820 2818 ofstream hiddenFile; 2819 2820 2821 ofstream hiddenFile; 2822 2823 hiddenFile.open(theProject.c_str(), ios::app); 2821 2824 2822 2825 … … 2854 2857 // ------------------------------------------------------------------------------------------------------- 2855 2858 2856 if(noParam == 3) hiddenFile << endl << endl << "\t\tforder";2859 if(noParam == 3) hiddenFile << endl << " forder"; 2857 2860 2858 2861 // If the current level is the second one, it means the order have to be closed with one tabulation offset 2859 2862 // ------------------------------------------------------------------------------------------------------- 2860 2863 2861 if(noParam == 2) hiddenFile << endl << endl << "\tforder";2864 if(noParam == 2) hiddenFile << endl << " forder"; 2862 2865 2863 2866 // If the current level is the first one, it means the order have to be closed without tabulation offset 2864 2867 // ----------------------------------------------------------------------------------------------------- 2865 2868 2866 if(noParam == 1) hiddenFile << endl << endl << "forder";2867 2868 2869 if(noParam == 1) hiddenFile << endl << "forder"; 2870 2871 this -> orderTokens.push_back("forder"); 2869 2872 2870 2873 break; … … 2878 2881 // --------------------------------------------------------------------------------------------------------------------------------------- 2879 2882 2880 if(noParam == 2) hiddenFile << endl << endl << "\t\tforder" << endl << "\tforder";2881 2883 if(noParam == 2) hiddenFile << endl << " forder" << endl << " forder"; 2884 2882 2885 2883 2886 // If the current parameter is the first one, the order statement have to be closed with one tabulation offset then no offset 2884 2887 // --------------------------------------------------------------------------------------------------------------------------- 2885 2888 2886 if(noParam == 1) hiddenFile << endl << endl << "\tforder" << endl << "forder";2887 2888 2889 if(noParam == 1) hiddenFile << endl << " forder" << endl << "forder"; 2890 2891 this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); 2889 2892 2890 2893 break; … … 2898 2901 // ---------------------------------------------------------------------------------------------------------------------------------------- 2899 2902 2900 hiddenFile << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder";2901 2902 2903 hiddenFile << endl << " forder" << endl << " forder" << endl << "forder"; 2904 2905 this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); 2903 2906 2904 2907 break; … … 2915 2918 // ------------------------------------------------------- 2916 2919 2917 case 1: hiddenFile << endl << endl; break;2920 case 1: hiddenFile << endl; break; 2918 2921 2919 2922 // If the parameter is the second, then one offset is needed 2920 2923 // --------------------------------------------------------- 2921 2924 2922 case 2: hiddenFile << endl << endl << "\t"; break;2925 case 2: hiddenFile << endl << " "; break; 2923 2926 2924 2927 // If the parameter is the third, then two offsets are needed 2925 2928 // ---------------------------------------------------------- 2926 2929 2927 case 3: hiddenFile << endl << endl << "\t\t"; break;2930 case 3: hiddenFile << endl << " "; break; 2928 2931 } 2929 2932 … … 2931 2934 // ------------------------------------------------------- 2932 2935 2933 stringstream valParam; 2934 2935 2936 stringstream valParam; 2937 2938 this -> orderTokens.push_back("order"); 2936 2939 2937 2940 switch(valAxis) { … … 2940 2943 // ------------------------------------------------------------------------------------------------------------ 2941 2944 2942 case 0: hiddenFile << "order " << " \t" << "Y." << noAxis + 1; valParam << "YA"; break;2945 case 0: hiddenFile << "order " << " " << "Y." << noAxis + 1; valParam << "YA"; break; 2943 2946 2944 2947 // If the axis value is set to 3 (no edges), then the dimension can be crossed both way (free) 2945 2948 // ------------------------------------------------------------------------------------------- 2946 2949 2947 case 3: hiddenFile << "order " << " \t" << "Y." << noAxis + 1; valParam << "YA"; break;2950 case 3: hiddenFile << "order " << " " << "Y." << noAxis + 1; valParam << "YA"; break; 2948 2951 2949 2952 // If the axis value is set to -1, then the dimension must be crossed increasingly 2950 2953 // ------------------------------------------------------------------------------- 2951 2954 2952 case -1: hiddenFile << "order " << " \t" << "YA" << noAxis + 1; valParam << "YA"; break;2955 case -1: hiddenFile << "order " << " " << "YA" << noAxis + 1; valParam << "YA"; break; 2953 2956 2954 2957 // If the axis value is set to +1, then the dimension must be crossed decreasingly 2955 2958 // ------------------------------------------------------------------------------- 2956 2959 2957 case 1: hiddenFile << "order " << " \t" << "YB" << noAxis + 1; valParam << "YB"; break;2960 case 1: hiddenFile << "order " << " " << "YB" << noAxis + 1; valParam << "YB"; break; 2958 2961 2959 2962 // If the axis value is set to 2 (no common value), then the dimension can be crossed both way (free) 2960 2963 // -------------------------------------------------------------------------------------------------- 2961 2964 2962 case 2: hiddenFile << "order " << " \t" << "Y." << noAxis + 1; valParam << "YA"; break; // A VOIR !!!!2965 case 2: hiddenFile << "order " << " " << "Y." << noAxis + 1; valParam << "YA"; break; // A VOIR !!!! 2963 2966 } 2964 2967 2965 valParam << noAxis + 1; 2966 2967 2968 valParam << noAxis + 1; 2969 2970 this -> orderTokens.push_back(valParam.str()); 2968 2971 2969 2972 } … … 2977 2980 // --------------------------------------------------------------------------------------------------------------------------------- 2978 2981 2979 if(lastParam == 3) { hiddenFile << endl << endl << "\t\tforder" << endl << endl << "\tforder" << endl << "forder" << endl << endl;2980 2981 this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); } 2982 2982 if(lastParam == 3) { hiddenFile << endl << " forder" << endl << " forder" << endl << "forder" << endl; 2983 2984 this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); } 2985 2983 2986 2984 2987 // If the last parameter was the second in the order statement, then two parameters have to be closed (one for each open parameter) 2985 2988 // -------------------------------------------------------------------------------------------------------------------------------- 2986 2989 2987 if(lastParam == 2) { hiddenFile << endl << endl << "\tforder" << endl << "forder" << endl<< endl;2988 2989 2990 2990 if(lastParam == 2) { hiddenFile << endl << " forder" << endl << "forder" << endl; 2991 2992 this -> orderTokens.push_back("forder"); this -> orderTokens.push_back("forder"); } 2993 2991 2994 2992 2995 // If the last parameter was the first in the order statement, then one parameter have to be closed 2993 2996 // ------------------------------------------------------------------------------------------------ 2994 2997 2995 if(lastParam == 1) { hiddenFile << endl << endl << "forder" << endl << endl; this -> orderTokens.push_back("forder"); }2996 2997 2998 2999 3000 lastParam = 0; 2998 if(lastParam == 1) { hiddenFile << endl << "forder" << endl; this -> orderTokens.push_back("forder"); } 2999 3000 // Reset the lastParam static value to avoid a closing order at the beginning of the next order statement 3001 // ------------------------------------------------------------------------------------------------------- 3002 3003 lastParam = 0; 3001 3004 } 3002 3005 … … 3008 3011 void Order::setInner(int noComp3D, int noFixed1, int noComp2D, int noFixed2, int freeDim, myGraphType& upperGraph, innerCompType& innerComp) { 3009 3012 3010 3013 myGraphType currentGraph; 3011 3014 3012 3015 copyGraph(upperGraph, currentGraph); … … 3015 3018 3016 3019 // ETAPE 1 DE LA PROCEDURE A UNE DIMENSION 3017 3020 // --------------------------------------- 3018 3021 3019 3022 // Create data structures used by the component search algorithm 3020 3023 // ------------------------------------------------------------- 3021 3024 3022 3025 std::vector<int> fixedComponentsList(boost::num_vertices(currentGraph)); … … 3025 3028 3026 3029 // Perform the 1D component search 3027 3030 // -------------------------------- 3028 3031 3029 3032 boost::strong_components(currentGraph, &fixedComponentsList[0], boost::root_map(&fixedVerticesDiscoverList[0])); 3030 3033 3031 3032 3034 // Resetting all vertices'affected component 3035 // ----------------------------------------- 3033 3036 3034 3037 for(tie(vertexIterOne, vertexIterTwo) = vertices(currentGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 3035 3036 3037 3038 3038 3039 put(get(boost::vertex_affected_comp_t(), currentGraph), *vertexIterOne, -1); 3040 3041 } 3039 3042 3040 3043 // Populate the vertices property of the graph (set for each vertex its component Id) 3041 3044 // ---------------------------------------------------------------------------------- 3042 3045 3043 3046 for(int i = 0; i < fixedComponentsList.size(); i++) put(get(boost::vertex_affected_comp_t(), currentGraph), i, fixedComponentsList[i]); 3044 3047 3045 3048 // Get the number of 1D components detected 3046 3049 // ---------------------------------------- 3047 3050 3048 3051 int nbFixedComponents = *max_element(fixedComponentsList.begin(), fixedComponentsList.end()) + 1; … … 3050 3053 3051 3054 // ETAPE 5.1 DE LA PROCEDURE A UNE DIMENSION 3052 3055 // ----------------------------------------- 3053 3056 3054 3057 // update the innerComp array to allow this structure to register informations on all the 1D components detected for the dimension 3055 // ------------------------------------------------------------------------------------------------------------------------------- 3056 3057 innerComp[noComp3D][noFixed1][noComp2D][noFixed2].resize(nbFixedComponents); 3058 3059 // Array that will register imposed path on the 3060 // -------------------------------------------- 3061 3062 int *imposedPath = new int[nbFixedComponents]; 3058 // ------------------------------------------------------------------------------------------------------------------------------- 3059 3060 innerComp[noComp3D][noFixed1][noComp2D][noFixed2].resize(nbFixedComponents); 3061 3062 // Array that will register imposed path on the 3063 // -------------------------------------------- 3064 3065 int *imposedPath = new int[nbFixedComponents]; 3066 3067 for(int noComp1D = 0; noComp1D <nbFixedComponents; noComp1D++) imposedPath[noComp1D] = 0; 3068 3069 3070 // reset all the structure attributes 3071 // ---------------------------------- 3072 3073 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) { 3074 3075 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign.resize(1); 3076 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = 0; 3077 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.resize(0); 3078 } 3079 3080 3081 // For each component, insert in the inner struct table element the embebbed moduls 3082 // -------------------------------------------------------------------------------- 3083 3084 for(int i = 0; i < fixedComponentsList.size(); i++) { 3085 3086 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][fixedComponentsList[i]].embeddedModuls.push_back(boost::get(boost::vertex_original_id_t(), currentGraph, i)); 3087 3088 } 3089 3090 3091 // ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION 3092 // ----------------------------------------- 3093 3094 // ETAPE 2 DE LA PROCEDURE A UNE DIMENSION 3095 // --------------------------------------- 3096 3097 // Get the common size of the component for the current dimension then store the information on the structure 3098 // ---------------------------------------------------------------------------------------------------------- 3099 3100 for(int noComp1D = 0; noComp1D < nbFixedComponents; noComp1D++) { 3101 3102 imposedPath[noComp1D] = getCommonFixedSign(freeDim, noComp1D, currentGraph); 3103 3104 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = 0; 3105 3106 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = freeDim; 3107 3108 // *** SUPER GROSSE MODIF innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSignInner(noFixed2, freeDim, currentGraph); 3109 3110 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSign(freeDim, noComp1D, currentGraph); 3111 3112 /* LA VALEUR NE DOIT PAS POUVOIR ETRE 2, ET SI ELLE EST ZERO QUEL PROBLEME ??? 3113 if(innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 0 || 3114 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 2) { 3115 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonFixedSign(freeDim, noComp1D, currentGraph); 3116 } 3117 */ 3118 3119 } 3120 3121 // ETAPE 3 DE LA PROCEDURE A UNE DIMENSION 3122 // --------------------------------------- 3123 3124 fixGraph(currentGraph, freeDim); 3125 3126 // ETAPE 4 DE LA PROCEDURE A UNE DIMENSION 3127 // --------------------------------------- 3128 3129 // Perform a topological sort on the graph 3130 3131 std::deque<int> topoOrder; 3132 3133 boost::topological_sort(currentGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 3134 3135 for(int i = 0; i < topoOrder.size(); i++) put(get(boost::vertex_topo_order_t(), currentGraph), topoOrder[i], i); 3136 3137 // ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION 3138 // ----------------------------------------- 3139 3140 // Sort the moduls inside the components (internal sort) 3141 // ----------------------------------------------------- 3142 3143 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) { 3144 3145 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) { 3146 3147 for(int noMod2 = noMod + 1; noMod2 < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod2++) { 3148 3149 if(get(boost::vertex_topo_order_t(), currentGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]) > 3150 get(boost::vertex_topo_order_t(), currentGraph , innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2])) { 3151 3152 int recMod = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]; 3153 3154 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod] = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2]; 3155 3156 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2] = recMod; 3157 } 3158 } 3159 } 3160 } 3161 3063 3162 3064 for(int noComp1D = 0; noComp1D <nbFixedComponents; noComp1D++) imposedPath[noComp1D] = 0; 3065 3066 3067 // reset all the structure attributes 3068 // ---------------------------------- 3069 3070 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) { 3071 3072 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign.resize(1); 3073 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = 0; 3074 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.resize(0); 3163 3164 // ETAPE 5.3 DE LA PROCEDURE A UNE DIMENSION 3165 // ----------------------------------------- 3166 3167 // Create a reduced graph whose vertices are the components of the current graph 3168 // ----------------------------------------------------------------------------- 3169 3170 myGraphType cfcGraph; 3171 3172 reduceGraph(currentGraph, cfcGraph, nbFixedComponents); 3173 3174 if(boost::num_vertices(cfcGraph) > 1) { 3175 3176 std::deque<int> reducedTopoOrder; 3177 3178 // Perform a topological sort on the reduced graph 3179 // ----------------------------------------------- 3180 3181 boost::topological_sort(cfcGraph, std::front_inserter(reducedTopoOrder), boost::vertex_index_map(boost::identity_property_map())); 3182 3183 // Sort the inner structure table elements accordignly to the sorting performed on the reduced graph 3184 // ------------------------------------------------------------------------------------------------- 3185 3186 vector<cfcStruct> sortedCfcStructTable; 3187 3188 for(int noComponent = 0; noComponent < reducedTopoOrder.size(); noComponent++) sortedCfcStructTable.push_back(innerComp[noComp3D][noFixed1][noComp2D][noFixed2][reducedTopoOrder[noComponent]]); 3189 3190 innerComp[noComp3D][noFixed1][noComp2D][noFixed2].clear(); 3191 3192 for(int noComponent = 0; noComponent < reducedTopoOrder.size(); noComponent++) innerComp[noComp3D][noFixed1][noComp2D][noFixed2].push_back(sortedCfcStructTable[noComponent]); 3193 3075 3194 } 3076 3077 3078 // For each component, insert in the inner struct table element the embebbed moduls3079 // --------------------------------------------------------------------------------3080 3081 for(int i = 0; i < fixedComponentsList.size(); i++) {3082 3083 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][fixedComponentsList[i]].embeddedModuls.push_back(boost::get(boost::vertex_original_id_t(), currentGraph, i));3084 3085 }3086 3087 3088 // ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION3089 // -----------------------------------------3090 3091 // ETAPE 2 DE LA PROCEDURE A UNE DIMENSION3092 // ---------------------------------------3093 3094 // Get the common size of the component for the current dimension then store the information on the structure3095 // ----------------------------------------------------------------------------------------------------------3096 3097 for(int noComp1D = 0; noComp1D < nbFixedComponents; noComp1D++) {3098 3099 imposedPath[noComp1D] = getCommonFixedSign(freeDim, noComp1D, currentGraph);3100 3101 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = 0;3102 3103 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = freeDim;3104 3105 // *** SUPER GROSSE MODIF innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSignInner(noFixed2, freeDim, currentGraph);3106 3107 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSign(freeDim, noComp1D, currentGraph);3108 3109 /* LA VALEUR NE DOIT PAS POUVOIR ETRE 2, ET SI ELLE EST ZERO QUEL PROBLEME ???3110 if(innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 0 ||3111 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 2) {3112 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonFixedSign(freeDim, noComp1D, currentGraph);3113 }3114 */3115 3116 }3117 3118 // ETAPE 3 DE LA PROCEDURE A UNE DIMENSION3119 // ---------------------------------------3120 3121 fixGraph(currentGraph, freeDim);3122 3123 // ETAPE 4 DE LA PROCEDURE A UNE DIMENSION3124 // ---------------------------------------3125 3126 // Perform a topological sort on the graph3127 3128 std::deque<int> topoOrder;3129 3130 boost::topological_sort(currentGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map()));3131 3132 for(int i = 0; i < topoOrder.size(); i++) put(get(boost::vertex_topo_order_t(), currentGraph), topoOrder[i], i);3133 3134 // ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION3135 // -----------------------------------------3136 3137 // Sort the moduls inside the components (internal sort)3138 // -----------------------------------------------------3139 3140 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][noFixed1][noComp2D][noFixed2].size(); noComp1D++) {3141 3142 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) {3143 3144 for(int noMod2 = noMod + 1; noMod2 < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod2++) {3145 3146 if(get(boost::vertex_topo_order_t(), currentGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]) >3147 get(boost::vertex_topo_order_t(), currentGraph , innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2])) {3148 3149 int recMod = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod];3150 3151 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod] = innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2];3152 3153 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod2] = recMod;3154 }3155 }3156 }3157 }3158 3159 // ETAPE 5.3 DE LA PROCEDURE A UNE DIMENSION3160 // -----------------------------------------3161 3162 // Create a reduced graph whose vertices are the components of the current graph3163 // -----------------------------------------------------------------------------3164 3165 myGraphType cfcGraph;3166 3167 reduceGraph(currentGraph, cfcGraph, nbFixedComponents);3168 3169 if(boost::num_vertices(cfcGraph) > 1) {3170 3171 std::deque<int> reducedTopoOrder;3172 3173 // Perform a topological sort on the reduced graph3174 // -----------------------------------------------3175 3176 boost::topological_sort(cfcGraph, std::front_inserter(reducedTopoOrder), boost::vertex_index_map(boost::identity_property_map()));3177 3178 // Sort the inner structure table elements accordignly to the sorting performed on the reduced graph3179 // -------------------------------------------------------------------------------------------------3180 3181 vector<cfcStruct> sortedCfcStructTable;3182 3183 for(int noComponent = 0; noComponent < reducedTopoOrder.size(); noComponent++) sortedCfcStructTable.push_back(innerComp[noComp3D][noFixed1][noComp2D][noFixed2][reducedTopoOrder[noComponent]]);3184 3185 innerComp[noComp3D][noFixed1][noComp2D][noFixed2].clear();3186 3187 for(int noComponent = 0; noComponent < reducedTopoOrder.size(); noComponent++) innerComp[noComp3D][noFixed1][noComp2D][noFixed2].push_back(sortedCfcStructTable[noComponent]);3188 3189 }3190 3195 3191 3196 }; … … 3256 3261 3257 3262 3258 3259 3263 // Create a graph that only keep zero valuated edges for the 3D fixed dim, this graph will be the 2D graph 3264 // ------------------------------------------------------------------------------------------------------- 3260 3265 3261 3266 myGraphType fixedGraph; 3262 3267 3263 copyGraph(currentGraph, fixedGraph); 3264 3265 3268 copyGraph(currentGraph, fixedGraph); 3269 3270 fixGraph(fixedGraph, fixedDim); 3266 3271 3267 3272 // ETAPE 3 DE LA PROCEDURE A DEUX DIMENSION 3268 3269 3270 3271 3273 // ---------------------------------------- 3274 3275 // Create data structures used by boost to perform the strong component search 3276 // --------------------------------------------------------------------------- 3272 3277 3273 3278 std::vector<int> middleComponentsList(boost::num_vertices(fixedGraph)); 3274 3279 3275 3280 std::vector<vertexDescriptor> verticesDiscoverList(boost::num_vertices(fixedGraph)); 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 innerComp[noComp][fixedDim] = new cfcStructTableType*[nbComponents]; 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = getCommonSign(dimOne, noComponent, fixedGraph); 3342 3343 3344 3345 3346 3347 3348 int axis1 = dimTwo; 3349 3350 3351 3352 3353 3281 3282 // Resetting all vertices'affected component of the 2D graph 3283 // --------------------------------------------------------- 3284 3285 for(tie(vertexIterOne, vertexIterTwo) = vertices(fixedGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) put(get(boost::vertex_affected_comp_t(), fixedGraph), *vertexIterOne, -1); 3286 3287 // Perform a strong components search on the 2D graph 3288 // -------------------------------------------------- 3289 3290 boost::strong_components(fixedGraph, &middleComponentsList[0], boost::root_map(&verticesDiscoverList[0])); 3291 3292 // Update vertices properties of the 2D graph : set a component Id on each vertex 3293 // ------------------------------------------------------------------------------ 3294 3295 for(int i = 0; i < middleComponentsList.size(); i++) put(get(boost::vertex_affected_comp_t(), fixedGraph), i, middleComponentsList[i]); 3296 3297 // Setting the number of components that have been detected 3298 // -------------------------------------------------------- 3299 3300 int nbComponents = *max_element(middleComponentsList.begin(), middleComponentsList.end()) + 1; 3301 3302 // Setting the third dimension size of innerComp array 3303 // --------------------------------------------------- 3304 3305 innerComp[noComp][fixedDim] = new cfcStructTableType*[nbComponents]; 3306 3307 // Setting the fourth dimension size of the innerComp array 3308 // -------------------------------------------------------- 3309 3310 for(int noCompD2 = 0; noCompD2 < nbComponents; noCompD2++) innerComp[noComp][fixedDim][noCompD2] = new cfcStructTableType[3]; 3311 3312 // ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION 3313 // ---------------------------------------- 3314 3315 // Resize the middleComp array with the size of 2D components that have been detected 3316 // ---------------------------------------------------------------------------------- 3317 3318 middleComp[noComp][fixedDim].resize(nbComponents); 3319 3320 // Set up the array that will be used to register the informations about imposed values for the axis 3321 // ------------------------------------------------------------------------------------------------- 3322 3323 int ** isImposed2D = new int*[nbComponents]; 3324 3325 for(int i = 0; i < nbComponents; i++) isImposed2D[i] = new int[2]; 3326 3327 // For each component, set the sign for the first and second dimensions then register this sign in the cfcSign attribute 3328 // --------------------------------------------------------------------------------------------------------------------- 3329 3330 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 3331 3332 // Setting inial imposed values (0 mean no imposed) 3333 // ------------------------------------------------ 3334 3335 isImposed2D[noComponent][0] = 0; 3336 isImposed2D[noComponent][1] = 0; 3337 3338 middleComp[noComp][fixedDim][noComponent].cfcSign.resize(2); 3339 3340 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = dimOne; 3341 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = dimTwo; 3342 3343 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = 0; 3344 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 3345 3346 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = getCommonSign(dimOne, noComponent, fixedGraph); 3347 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = getCommonSign(dimTwo, noComponent, fixedGraph); 3348 3349 int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 3350 int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 3351 3352 int axis0 = dimOne; 3353 int axis1 = dimTwo; 3354 3355 // If there is just one vertex in the component without reflexive edge 3356 // ------------------------------------------------------------------- 3357 3358 bool isConnected = true; 3354 3359 3355 3360 if(sign0 == 3 && sign1 == 3) { … … 3361 3366 } 3362 3367 3363 if(isConnected) { 3364 3365 // Detecting all possible axis combinations 3366 // ---------------------------------------- 3367 3368 int noConf = -1; 3369 3370 if(sign0 != 2 && sign1 != 2) noConf = 0; // axis0 -> axis1 (axis1 free) 3371 if(sign0 != 2 && sign1 == 2) noConf = 1; // axis0 -> axis1 3372 if(sign0 == 2 && sign1 == 2) noConf = 2; // axis0 -> axis1 3373 if(sign0 == 2 && sign1 != 2) noConf = 3; // axis1 -> axis0 3374 3375 // Looking at combinations to set imposed values for the second axis 3376 // ----------------------------------------------------------------- 3377 3378 if(noConf < 3) isImposed2D[noComponent][1] = getImposed(axis1, noComponent, fixedGraph); 3379 3380 if(noConf == 3) isImposed2D[noComponent][1] = getImposed(axis0, noComponent, fixedGraph); 3381 3382 // Sort the axis then set their values accordignly to the combination available for the current 2D component 3383 // --------------------------------------------------------------------------------------------------------- 3384 3385 if(noConf == 0) { 3386 3387 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 3388 3389 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 3390 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3391 } 3392 3393 if(noConf > 0 && noConf < 3) { 3394 3395 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 3396 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3397 } 3398 3399 if(noConf == 3) { 3400 3401 int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 3402 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 3403 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = tmpVal; 3404 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = axis1; 3405 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 3406 3407 // if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0]; 3408 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3409 } 3410 } 3411 3412 // If the last axis value is not defined 3413 3414 if(middleComp[noComp][fixedDim][noComponent].cfcSign[1].second == 2) { 3415 3416 // If no decomposition is not needed, then set the value to zero to avoid decomposition 3417 3418 if(!isToDecompose(middleComp[noComp][fixedDim][noComponent].cfcSign[1].first, fixedGraph)) { 3419 3420 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 3421 3422 } 3423 } 3424 } 3425 3426 3427 // ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION 3428 // ------------------------------------- 3429 3430 myGraphType cfcGraph; 3431 3432 reduceGraph(fixedGraph, cfcGraph, nbComponents); 3433 3434 // ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION 3435 // ---------------------------------------- 3436 3437 std::deque<int> topoOrder; 3438 3439 if(boost::num_vertices(cfcGraph) > 1) { 3440 3441 // Perform a topological sort on the graph whose vertices are the components (reduced graph) 3442 // ----------------------------------------------------------------------------------------- 3443 3444 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 3445 3446 // ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION 3447 // ---------------------------------------- 3448 3449 // Sort the middle structure table elements (2D graph components) accordignly to the sorting performed on the reduced graph 3450 // ------------------------------------------------------------------------------------------------------------------------ 3451 3452 vector<cfcStruct> sortedCfcStructTable; 3453 3454 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) sortedCfcStructTable.push_back(middleComp[noComp][fixedDim][topoOrder[noComponent]]); 3455 3456 middleComp[noComp][fixedDim].clear(); 3457 3458 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) middleComp[noComp][fixedDim].push_back(sortedCfcStructTable[noComponent]); 3459 3460 } 3461 3462 else { topoOrder[0] = 0; } 3463 3464 3465 // ETAPE 9 DE LA PROCEDURE A DEUX DIMENSION 3466 // ---------------------------------------- 3467 3468 // Create a graph that just keep the current 2D component egdes and vertices 3469 // ------------------------------------------------------------------------- 3470 3471 for(int noComp2D = 0; noComp2D < nbComponents; noComp2D++) { 3472 3473 myGraphType outputGraph; 3474 3475 copyGraph(fixedGraph, outputGraph); 3476 3477 keepComponent(topoOrder[noComp2D], outputGraph); 3478 3479 3480 // Create the two 1D component vectors corresponding to the two third dimensions availables 3481 // ---------------------------------------------------------------------------------------- 3482 3483 switch(fixedDim) { 3484 3485 case 0: 3486 3487 setInner(noComp, fixedDim, noComp2D, 1, 2, outputGraph, innerComp); // jk 3488 3489 setInner(noComp, fixedDim, noComp2D, 2, 1, outputGraph, innerComp); // kj 3490 3491 break; 3492 3493 case 1: 3494 3495 setInner(noComp, fixedDim, noComp2D, 0, 2, outputGraph, innerComp); // ik 3496 3497 setInner(noComp, fixedDim, noComp2D, 2, 0, outputGraph, innerComp); // ki 3498 3499 break; 3500 3501 case 2: 3502 3503 setInner(noComp, fixedDim, noComp2D, 0, 1, outputGraph, innerComp); // ij 3504 3505 setInner(noComp, fixedDim, noComp2D, 1, 0, outputGraph, innerComp); // ji 3506 3507 break; 3508 } 3509 } 3510 }; 3511 3512 3513 3514 void Order::read1D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 3515 3516 ofstream hiddenFile; 3517 3518 // For all the components embedded in the 3D graph 3519 // ----------------------------------------------- 3520 3521 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 3522 3523 // For all the components embedded in the 2D graph coming from the current 3D component 3524 // ------------------------------------------------------------------------------------ 3525 3526 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++) { 3527 3528 // For all the components embedded in the 1D graph coming from the current 2D component 3529 // ------------------------------------------------------------------------------------ 3530 3531 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][1].size(); noComp1D++) { 3532 3533 // Get the value of the first axis (third in the data structure as it is a 3D data structure, no need to get the number of the axis as there is only one) 3534 // ------------------------------------------------------------------------------------------------------------------------------------------------------ 3535 3536 int valAxis1 = innerComp[noComp3D][0][noComp2D][1][noComp1D].cfcSign[0].second; 3537 3538 // Read the order paramater for this axis value (axis number and parameter number are fixed as there is just one dimension) 3539 // ------------------------------------------------------------------------------------------------------------------------ 3540 3541 readParam(0, valAxis1, 1); 3542 3543 hiddenFile.open(theProject.c_str(), ios::app); 3544 3545 hiddenFile << endl << endl << "\t\t"; 3546 3547 // For all the modules embedded in the current 1D component 3548 // -------------------------------------------------------- 3549 3550 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls.size(); noMod++) { 3551 3552 // Insert the modules after the paramaters 3553 // --------------------------------------- 3554 3555 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod]) << " "; 3556 3557 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod])); 3558 3559 } 3560 3561 hiddenFile.close(); 3368 /**** 3369 3370 3371 if(!isConnected) { 3372 3373 cout << endl << "NOT CONNECTED"; 3374 3375 if(sign0 == 2 && sign1 == 2) cout << endl << "oConf 222 : "; 3376 } 3377 3378 ****/ 3379 3380 3381 if(isConnected) { 3382 3383 // Detecting all possible axis combinations 3384 // ---------------------------------------- 3385 3386 int noConf = -1; 3387 3388 if(sign0 != 2 && sign1 != 2) noConf = 0; // axis0 -> axis1 (axis1 free) 3389 if(sign0 != 2 && sign1 == 2) noConf = 1; // axis0 -> axis1 3390 if(sign0 == 2 && sign1 == 2) noConf = 2; // axis0 -> axis1 3391 if(sign0 == 2 && sign1 != 2) noConf = 3; // axis1 -> axis0 3392 3393 // Looking at combinations to set imposed values for the second axis 3394 // ----------------------------------------------------------------- 3395 3396 if(noConf < 3) isImposed2D[noComponent][1] = getImposed(axis1, noComponent, fixedGraph); 3397 3398 if(noConf == 3) isImposed2D[noComponent][1] = getImposed(axis0, noComponent, fixedGraph); 3399 3400 // Sort the axis then set their values accordignly to the combination available for the current 2D component 3401 // --------------------------------------------------------------------------------------------------------- 3402 3403 if(noConf == 0) { 3404 3405 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 3406 3407 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 3408 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3409 } 3410 3411 if(noConf > 0 && noConf < 3) { 3412 3413 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = isImposed2D[noComponent][0]; 3414 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3415 } 3416 3417 if(noConf == 3) { 3418 3419 int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 3420 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 3421 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = tmpVal; 3422 middleComp[noComp][fixedDim][noComponent].cfcSign[0].first = axis1; 3423 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 3424 3425 // if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0]; 3426 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 3427 } 3428 } 3429 3430 // If the last axis value is not defined 3431 3432 if(middleComp[noComp][fixedDim][noComponent].cfcSign[1].second == 2) { 3433 3434 // If no decomposition is not needed, then set the value to zero to avoid decomposition 3435 3436 if(!isToDecompose(middleComp[noComp][fixedDim][noComponent].cfcSign[1].first, fixedGraph)) { 3437 3438 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 3439 3562 3440 } 3563 3441 } 3564 3442 } 3565 3443 3444 3445 // ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION 3446 // ------------------------------------- 3447 3448 myGraphType cfcGraph; 3449 3450 reduceGraph(fixedGraph, cfcGraph, nbComponents); 3451 3452 // ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION 3453 // ---------------------------------------- 3454 3455 std::deque<int> topoOrder; 3456 3457 if(boost::num_vertices(cfcGraph) > 1) { 3458 3459 // Perform a topological sort on the graph whose vertices are the components (reduced graph) 3460 // ----------------------------------------------------------------------------------------- 3461 3462 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 3463 3464 // ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION 3465 // ---------------------------------------- 3466 3467 // Sort the middle structure table elements (2D graph components) accordignly to the sorting performed on the reduced graph 3468 // ------------------------------------------------------------------------------------------------------------------------ 3469 3470 vector<cfcStruct> sortedCfcStructTable; 3471 3472 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) sortedCfcStructTable.push_back(middleComp[noComp][fixedDim][topoOrder[noComponent]]); 3473 3474 middleComp[noComp][fixedDim].clear(); 3475 3476 for(int noComponent = 0; noComponent < topoOrder.size(); noComponent++) middleComp[noComp][fixedDim].push_back(sortedCfcStructTable[noComponent]); 3477 3478 } 3479 3480 else { topoOrder[0] = 0; } 3481 3482 3483 // ETAPE 9 DE LA PROCEDURE A DEUX DIMENSION 3484 // ---------------------------------------- 3485 3486 // Create a graph that just keep the current 2D component egdes and vertices 3487 // ------------------------------------------------------------------------- 3488 3489 for(int noComp2D = 0; noComp2D < nbComponents; noComp2D++) { 3490 3491 myGraphType outputGraph; 3492 3493 copyGraph(fixedGraph, outputGraph); 3494 3495 keepComponent(topoOrder[noComp2D], outputGraph); 3496 3497 3498 // Create the two 1D component vectors corresponding to the two third dimensions availables 3499 // ---------------------------------------------------------------------------------------- 3500 3501 3502 setInner(noComp, fixedDim, noComp2D, middleComp[noComp][fixedDim][noComp2D].cfcSign[0].first, middleComp[noComp][fixedDim][noComp2D].cfcSign[1].first, outputGraph, innerComp); 3503 3504 /******** 3505 3506 switch(fixedDim) { 3507 3508 case 0: 3509 3510 3511 setInner(noComp, fixedDim, noComp2D, 1, 2, outputGraph, innerComp); // jk 3512 3513 setInner(noComp, fixedDim, noComp2D, 2, 1, outputGraph, innerComp); // kj 3514 3515 break; 3516 3517 case 1: 3518 3519 setInner(noComp, fixedDim, noComp2D, 0, 2, outputGraph, innerComp); // ik 3520 3521 setInner(noComp, fixedDim, noComp2D, 2, 0, outputGraph, innerComp); // ki 3522 3523 break; 3524 3525 case 2: 3526 3527 setInner(noComp, fixedDim, noComp2D, 0, 1, outputGraph, innerComp); // ij 3528 3529 setInner(noComp, fixedDim, noComp2D, 1, 0, outputGraph, innerComp); // ji 3530 3531 break; 3532 } 3533 3534 **********/ 3535 3536 } 3537 }; 3538 3539 3540 3541 void Order::read1D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 3542 3543 ofstream hiddenFile; 3544 3545 // For all the components embedded in the 3D graph 3546 // ----------------------------------------------- 3547 3548 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 3549 3550 // For all the components embedded in the 2D graph coming from the current 3D component 3551 // ------------------------------------------------------------------------------------ 3552 3553 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++) { 3554 3555 // For all the components embedded in the 1D graph coming from the current 2D component 3556 // ------------------------------------------------------------------------------------ 3557 3558 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][1].size(); noComp1D++) { 3559 3560 // Get the value of the first axis (third in the data structure as it is a 3D data structure, no need to get the number of the axis as there is only one) 3561 // ------------------------------------------------------------------------------------------------------------------------------------------------------ 3562 3563 int valAxis1 = innerComp[noComp3D][0][noComp2D][1][noComp1D].cfcSign[0].second; 3564 3565 // Read the order paramater for this axis value (axis number and parameter number are fixed as there is just one dimension) 3566 // ------------------------------------------------------------------------------------------------------------------------ 3567 3568 readParam(0, valAxis1, 1); 3569 3570 hiddenFile.open(theProject.c_str(), ios::app); 3571 3572 hiddenFile << endl << " "; 3573 3574 // For all the modules embedded in the current 1D component 3575 // -------------------------------------------------------- 3576 3577 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls.size(); noMod++) { 3578 3579 // Insert the modules after the paramaters 3580 // --------------------------------------- 3581 3582 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod]) << " "; 3583 3584 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][1][noComp1D].embeddedModuls[noMod])); 3585 3586 } 3587 3588 hiddenFile.close(); 3589 } 3590 } 3591 } 3592 3566 3593 // Close the order statement 3567 3594 // ------------------------- … … 3575 3602 void Order::read2D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 3576 3603 3577 3578 3579 3580 3604 ofstream hiddenFile; 3605 3606 // For all 3D components in the main graph 3607 // ---------------------------------------- 3581 3608 3582 3609 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 3583 3610 3584 3585 3611 // For all components in the 2D graph coming from the current 3D component with the first axis fixed 3612 // ------------------------------------------------------------------------------------------------- 3586 3613 3587 3614 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++) { 3588 3615 3589 3590 3616 // Get the the the first axis dimension (second in the data structure as it is a 3D data structure) 3617 // ------------------------------------------------------------------------------------------------ 3591 3618 3592 3619 int noFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 3593 3594 3595 3620 3621 // Get the first axis value (second in the data structure as it is a 3D data structure) 3622 // ------------------------------------------------------------------------------------ 3596 3623 3597 3624 int valFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].second; 3625 3626 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as it is just the first parameter) 3627 // -------------------------------------------------------------------------------------------------------------------------------- 3628 3629 readParam(noFixed1 -1, valFixed1, 1); 3630 3631 // Get the second axis dimension (third in the data structure as it is a 3D data structure) 3632 // ---------------------------------------------------------------------------------------- 3633 3634 int noAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 3635 3636 // Get the second axis value (third in the data structure as it is a 3D data structure) 3637 // ------------------------------------------------------------------------------------ 3638 3639 int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 3640 3641 // If the second axis value is defined 3642 // ----------------------------------- 3643 3644 if(valAxis2 != 2) { 3645 3646 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 3647 // ---------------------------------------------------------------------------------------------------------------------------- 3648 3649 readParam(noAxis2 -1, valAxis2, 2); 3650 3651 hiddenFile.open(theProject.c_str(), ios::app); 3652 3653 hiddenFile << endl << " "; 3654 3655 // For all components in the 1D graph coming from the current 2D component with the two first axis fixed 3656 // ----------------------------------------------------------------------------------------------------- 3657 3658 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noFixed1].size(); noComp1D++) { 3659 3660 // For all the moduls embedded in the current 1D component 3661 // ------------------------------------------------------- 3662 3663 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls.size(); noMod++) { 3664 3665 // Insert the modul name in the current order parameter 3666 // ---------------------------------------------------- 3667 3668 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls[noMod]) << " "; 3669 3670 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls[noMod])); 3671 3672 } 3673 3674 } 3675 3676 hiddenFile.close(); 3677 } 3678 3679 // If the second axis value is not defined 3680 // --------------------------------------- 3681 3682 else { 3683 3684 // For all components in the 1D graph coming from the current 2D component with the first axis fixed 3685 // ------------------------------------------------------------------------------------------------- 3686 3687 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noFixed1].size(); noComp1D++) { 3688 3689 // Get the second axis dimension (third in the data structure as it is a 3D data structure) 3690 // ---------------------------------------------------------------------------------------- 3691 3692 int noAxis3 = innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].cfcSign[0].first; 3598 3693 3599 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as it is just the first parameter) 3600 // -------------------------------------------------------------------------------------------------------------------------------- 3601 3602 readParam(noFixed1 -1, valFixed1, 1); 3603 3604 hiddenFile.open(theProject.c_str(), ios::app); 3605 3606 hiddenFile << endl << endl << "\t\t"; 3607 3608 hiddenFile.close(); 3609 3610 // Get the second axis dimension (third in the data structure as it is a 3D data structure) 3611 // ---------------------------------------------------------------------------------------- 3612 3613 int noAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 3614 3615 // Get the second axis value (third in the data structure as it is a 3D data structure) 3616 // ------------------------------------------------------------------------------------ 3617 3618 int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 3619 3620 // If the second axis value is defined 3621 // ----------------------------------- 3622 3623 if(valAxis2 != 2) { 3624 3625 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 3626 // ---------------------------------------------------------------------------------------------------------------------------- 3627 3628 readParam(noAxis2 -1, valAxis2, 2); 3629 3630 hiddenFile.open(theProject.c_str(), ios::app); 3631 3632 hiddenFile << endl << endl << "\t\t"; 3633 3634 // For all components in the 1D graph coming from the current 2D component with the two first axis fixed 3635 // ----------------------------------------------------------------------------------------------------- 3636 3637 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 3638 3639 // For all the moduls embedded in the current 1D component 3640 // ------------------------------------------------------- 3641 3642 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 3643 3644 // Insert the modul name in the current order parameter 3645 // ---------------------------------------------------- 3646 3647 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 3648 3649 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3650 3651 } 3652 3653 } 3654 3655 hiddenFile.close(); 3656 } 3657 3658 // If the second axis value is not defined 3659 // --------------------------------------- 3660 3661 else { 3662 3663 // For all components in the 1D graph coming from the current 2D component with the first axis fixed 3664 // ------------------------------------------------------------------------------------------------- 3665 3666 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 3667 3668 // Get the second axis dimension (third in the data structure as it is a 3D data structure) 3669 // ---------------------------------------------------------------------------------------- 3670 3671 int noAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 3672 3673 // Get the second axis value (third in the data structure as it is a 3D data structure) 3674 // ------------------------------------------------------------------------------------ 3675 3676 int valAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 3677 3678 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 3679 // ---------------------------------------------------------------------------------------------------------------------------- 3680 3681 readParam(noAxis3 -1, valAxis3, 2); 3682 3683 hiddenFile.open(theProject.c_str(), ios::app); 3684 3685 hiddenFile << endl << endl << "\t\t"; 3686 3687 // For all the moduls embedded in the current 1D component 3688 // ------------------------------------------------------- 3689 3690 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 3691 3692 // Insert the modul name in the current order parameter 3693 // ---------------------------------------------------- 3694 3695 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 3696 3697 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3698 3699 } 3700 3701 hiddenFile.close(); 3702 } 3703 } 3694 // Get the second axis value (third in the data structure as it is a 3D data structure) 3695 // ------------------------------------------------------------------------------------ 3696 3697 int valAxis3 = innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].cfcSign[0].second; 3698 3699 // Read the order parameter for this dimension and this axis (decrease the axis dimension number as there is just 2 dimensions) 3700 // ---------------------------------------------------------------------------------------------------------------------------- 3701 3702 readParam(noAxis3 -1, valAxis3, 2); 3703 3704 hiddenFile.open(theProject.c_str(), ios::app); 3705 3706 hiddenFile << endl << " "; 3707 3708 // For all the moduls embedded in the current 1D component 3709 // ------------------------------------------------------- 3710 3711 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls.size(); noMod++) { 3712 3713 // Insert the modul name in the current order parameter 3714 // ---------------------------------------------------- 3715 3716 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls[noMod]) << " "; 3717 3718 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noFixed1][noComp1D].embeddedModuls[noMod])); 3719 3720 } 3721 3722 hiddenFile.close(); 3723 } 3724 } 3704 3725 } 3705 3726 } 3706 3707 3708 3727 3728 // Close the order statement 3729 // ------------------------- 3709 3730 3710 3731 readParam(0, 0, 0); … … 3717 3738 void Order::read3D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph) { 3718 3739 3719 3720 3721 3740 ofstream hiddenFile; 3741 3742 // For all the components embedded in the 3D graph 3722 3743 // ----------------------------------------------- 3723 3744 … … 3764 3785 readParam(noAxis3, valAxis3, 3); 3765 3786 3766 3767 3768 hiddenFile << endl << endl << "\t\t\t";3787 hiddenFile.open(theProject.c_str(), ios::app); 3788 3789 hiddenFile << endl << " "; 3769 3790 3770 3791 // For all 2D graphs embedded in the current 3D graph (ie the fixed dimension is the first crossed in the order statement) … … 3791 3812 // ----------------------------------------------------------------------------------------------- 3792 3813 3793 3794 3795 3796 3814 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 3815 3816 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3817 3797 3818 } 3798 3819 } 3799 3820 } 3800 3821 3801 3822 hiddenFile.close(); 3802 3823 } 3803 3824 … … 3836 3857 3837 3858 readParam(noAxis3, valAxis3, 3); 3838 3839 3840 3841 hiddenFile << endl << endl << "\t\t\t";3859 3860 hiddenFile.open(theProject.c_str(), ios::app); 3861 3862 hiddenFile << endl << " "; 3842 3863 3843 3864 // For all moduls embedded in the current 1D graph component … … 3849 3870 // ----------------------------------------------------------------------------------------------- 3850 3871 3851 3852 3853 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3872 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 3873 3874 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3854 3875 3855 3876 } 3856 3877 3857 3878 hiddenFile.close(); 3858 3879 } 3859 3880 } … … 3913 3934 readParam(noAxis3, valAxis3, 3); 3914 3935 3915 3916 3917 hiddenFile << endl << endl << "\t\t\t";3936 hiddenFile.open(theProject.c_str(), ios::app); 3937 3938 hiddenFile << endl << " "; 3918 3939 3919 3940 // For all 1D graph embedded in the current 2D graph (ie the second fixed dimension is the second crossed in the order statement) … … 3930 3951 // ------------------------------------------------------------------------------------------------- 3931 3952 3932 3933 3934 3935 3953 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 3954 3955 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3956 3936 3957 } 3937 3958 } 3938 3959 3939 3960 hiddenFile.close(); 3940 3961 } 3941 3962 … … 3965 3986 readParam(noAxis3, valAxis3, 3); 3966 3987 3967 hiddenFile.open(theProject.c_str(), ios::app); 3968 3969 hiddenFile << endl << endl << "\t\t\t";3988 hiddenFile.open(theProject.c_str(), ios::app); 3989 3990 hiddenFile << endl << " "; 3970 3991 3971 3992 // For all moduls embedded in the current 1D graph component … … 3977 3998 // ------------------------------------------------------------------------------------------------- 3978 3999 3979 3980 3981 4000 hiddenFile << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 4001 4002 this -> orderTokens.push_back(boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])); 3982 4003 3983 4004 } 3984 4005 3985 4006 hiddenFile.close(); 3986 4007 } 3987 4008 } … … 3990 4011 } 3991 4012 3992 4013 } 3993 4014 3994 4015 // Close the order statement … … 4022 4043 // ------------------------------------------------------------------------------------------------------------------------------------------- 4023 4044 4024 4025 4026 4027 4028 4045 int value = getCommonSign(freeDim, noComp, fixedGraph); 4046 4047 if(value == 3) value = 0; 4048 4049 // Return the sign for the free dimension and the component given as parameter 4029 4050 // --------------------------------------------------------------------------- 4030 4051 … … 4032 4053 4033 4054 }; 4055 4056 4057 bool Order::isToDecompose2D(int fixedDim, int noComponent, myGraphType& upperGraph) { 4058 4059 bool toDecompose = true; 4060 4061 myGraphType fixedGraph, fixedGraphDim1, fixedGraphDim2; 4062 4063 // Fix the graph for the axis that is the first one of the order statement 4064 // ----------------------------------------------------------------------- 4065 4066 copyGraph(upperGraph, fixedGraph); 4067 4068 fixGraph(fixedGraph, fixedDim); 4069 4070 copyGraph(fixedGraph, fixedGraphDim1); 4071 4072 copyGraph(fixedGraph, fixedGraphDim2); 4073 4074 int freeDim1, freeDim2; 4075 4076 if(fixedDim== 0) { freeDim1 = 1; freeDim2 = 2; } 4077 4078 if(fixedDim== 1) { freeDim1 = 0; freeDim2 = 2; } 4079 4080 if(fixedDim== 2) { freeDim1 = 0; freeDim2 = 1; } 4081 4082 fixGraph(fixedGraphDim1, freeDim1); 4083 4084 fixGraph(fixedGraphDim2, freeDim2); 4085 4086 // If there is a common value in one of the two remaining dimension of the fixed graph, then no decomposition is needed 4087 // -------------------------------------------------------------------------------------------------------------------- 4088 4089 if(getCommonSign(freeDim1, noComponent, fixedGraph) != 2 || getCommonSign(freeDim2, noComponent, fixedGraph) != 2) toDecompose = false; 4090 4091 if(getCommonSign(freeDim1, noComponent, fixedGraphDim2) == 2 || getCommonSign(freeDim2, noComponent, fixedGraphDim1) == 2) toDecompose = true; 4092 4093 return(toDecompose); 4094 4095 }; 4034 4096 4035 4097 … … 4078 4140 int valDim0 = 0; 4079 4141 4080 4081 4142 // For all the vertices 4143 // -------------------- 4082 4144 4083 4145 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { … … 4126 4188 int valDim0 = 0; 4127 4189 4128 4129 4130 4131 bool isConnected = false; 4132 4190 // A value that will set to true only if it exist an edge between the component vertices 4191 // ------------------------------------------------------------------------------------- 4192 4193 bool isConnected = false; 4194 4133 4195 // For all edges in the current graph 4134 4196 // ---------------------------------- … … 4136 4198 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 4137 4199 4200 // *** cout << endl << boost::source(*edgeIterOne, currentGraph) << " ==> " << boost::target(*edgeIterOne, currentGraph); 4201 4138 4202 // If the source modul of the edge is in the component given as paramater 4139 4203 // ---------------------------------------------------------------------- … … 4146 4210 if(get(boost::vertex_affected_comp_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)) == noComp) { 4147 4211 4148 4149 4150 4151 4212 // Update isConnected as it exist a connexion inside the component 4213 // --------------------------------------------------------------- 4214 4215 isConnected = true; 4152 4216 4153 4217 // Get the dimension values for axis i, j and k … … 4180 4244 } 4181 4245 4182 if(isConnected) return(valDim0); 4183 return(3); 4246 // ***** cout << endl << "isConnected : " << isConnected; 4247 4248 if(isConnected) return(valDim0); 4249 return(3); 4184 4250 }; 4185 4251 … … 4205 4271 if(freeDim == 2) { fixGraph(fixedGraph, 0); fixGraph(fixedGraph, 1); } // i == 0, j == 0 4206 4272 4207 4273 // If there is just one vertex without reflexive edge in the component, then hide the returned value by setting it as free (ie 0 instead of 3) 4208 4274 // ------------------------------------------------------------------------------------------------------------------------------------------- 4209 4275 … … 4215 4281 // --------------------------------------------------------------------------- 4216 4282 4217 4283 return(value); 4218 4284 4219 4285 }; 4220 4286 4221 4287 4222 4288 void Order::resetGraph(myGraphType& currentGraph) { … … 4271 4337 4272 4338 void Order::showTokens(Table<Order>& theOrderTable) { 4273 for(Table<Order>::iterator tok_tab = theOrderTable.begin(); tok_tab < theOrderTable.end(); tok_tab++) { 4274 4275 cout << endl << tok_tab -> getName(); 4276 4277 4278 for(vector<string>::iterator tok_str = tok_tab -> orderTokens.begin(); tok_str < tok_tab -> orderTokens.end(); tok_str++) { 4279 4280 4281 4339 for(Table<Order>::iterator tok_tab = theOrderTable.begin(); tok_tab < theOrderTable.end(); tok_tab++) { 4340 4341 cout << endl << tok_tab -> getName(); 4342 cout << endl << tok_tab -> getOrderPhase(); 4343 4344 for(vector<string>::iterator tok_str = tok_tab -> orderTokens.begin(); tok_str < tok_tab -> orderTokens.end(); tok_str++) { 4345 cout << endl << "\t" << *tok_str; 4346 } 4347 } 4282 4348 }; 4283 4349 … … 4289 4355 4290 4356 4357 -
trunk/yao/src/YAOObjects/Order.hpp
r293 r310 220 220 boost::property<boost::vertex_topo_order_t, int, 221 221 boost::property<boost::vertex_affected_comp_t, int, 222 223 224 // Definition of the edges properties embedded in the graph type that will be used in all the order generation functions. 225 typedef boost::property<boost::edge_weight_d1_t, int, 226 boost::property<boost::edge_weight_d2_t, int, 227 222 boost::property<boost::vertex_original_id_t, int > > > > verticesProperties; 223 224 // Definition of the edges properties embedded in the graph type that will be used in all the order generation functions. 225 typedef boost::property<boost::edge_weight_d1_t, int, 226 boost::property<boost::edge_weight_d2_t, int, 227 boost::property<boost::edge_weight_d3_t, int > > > edgesPorperties; 228 228 229 229 // Definition of the graph type that will be used in all the order generation functions. … … 239 239 typedef vector<cfcStruct> cfcStructTableType; 240 240 241 typedef cfcStructTableType** middleCompType; 241 typedef cfcStructTableType** middleCompType; 242 242 243 243 typedef cfcStructTableType**** innerCompType; 244 244 245 245 // Graph iterators and descriptors that are used all along the program (declared here to avoid several decalarations inside the source code). 246 246 … … 256 256 257 257 string theProject; 258 258 259 259 public: 260 260 261 262 263 264 265 266 261 /** 262 * Get informations on connections, modules and spaces then launch all the procedures used to generate the order statments. 263 * The relevant informations are extracted from the existing tables then integrated in dedicated light structures. 264 * The dedicated structures are declared as global datas then accessed and updated by the functions. 265 */ 266 void automaticOrderGenerator(string projectName, Table<Order>& theOrderTable, Table<Modul>& myModulTable, Table<Connection>& myConnectionTable, Table<Space>& mySpaceTable); 267 267 268 268 private: 269 269 270 271 272 270 // -- Functions that build and populate the data structures -- 271 272 /** 273 273 * Function that manage the 3D components by performing the following tasks : 274 274 * - get all the components from the main graph (tarjan component search) … … 285 285 void setOuter(cfcStructTableType& outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph); 286 286 287 287 /** 288 288 * Function that manage the 2D components by performing the following tasks : 289 289 * - get a 3D component graph from setOuter(), this one is given as a parameter … … 306 306 void setMiddle(int fixedDim, int dimOne, int dimTwo, myGraphType& currentGraph, int noComp, middleCompType& middleComp, innerCompType& innerComp); 307 307 308 308 /** 309 309 * Function that manage the 1D components by performing the following tasks : 310 310 * - get a 2D component graph from setMiddle() … … 327 327 void setInner(int noComp3D, int noFixed1, int noComp2D, int noFixed2, int freeDim, myGraphType& upperGraph, innerCompType& innerComp); 328 328 329 330 331 329 // -- Functions for managing the graphs -- 330 331 /** 332 332 * Function for setting up the main graph. 333 333 * This function create a graph then populate its properties accordignly to the boost API. 334 334 * @param currentGraph a reference on the graph that should be created. 335 336 337 338 339 335 * @param valCi a vector of integer that register the connection values for the i dimension. 336 * @param valCj a vector of integer that register the connection values for the j dimension. 337 * @param valCk a vector of integer that register the connection values for the k dimension. 338 * @param modulList a vector of strings that regster the modul names. 339 * @param edgeArray a vector of edges that register the source modul and the target modul of each edge (connection). 340 340 */ 341 341 void generateGraph(myGraphType& currentGraph, const vector<int>& valCi, const vector<int>& valCj, const vector<int>& valCk, const vector<string>& modulList, const vector<edge>& edgeArray); 342 342 343 343 /** 344 344 * Function that make a deep copy from the graph upperGraph to the graph outGraph 345 345 * The function is void and the graph outGraph have to be given as a parameter because there is some problems in getting a graph from a function … … 348 348 * @param outGraph a reference to the graph that must receive all its informations from the copied graph 349 349 */ 350 351 352 350 void copyGraph(myGraphType& upperGraph, myGraphType& outGraph); 351 352 /** 353 353 * Function that keep only the edges with zero value for the dimension given as a parameter 354 354 * As a result of this fixation, whe know that remaining connected vertices (moduls in YAO) are linked on the same node for the fixed dimension … … 356 356 * @param noFixedDim an integer value indicating which dimension have to be fixed 357 357 */ 358 359 360 358 void fixGraph(myGraphType& currentGraph, int noFixedDim); 359 360 /** 361 361 * Function that create a graph which vertices are the components of another graph 362 362 * @param nbComp the number of components included in the innerGraph … … 364 364 * @param outerGraph the reduced graph, which vertices are the components coming from the graph innerGraph 365 365 */ 366 367 368 366 void reduceGraph(myGraphType innerGraph, myGraphType& outerGraph, int nbComp); 367 368 /** 369 369 * Function that is used to extract a component from a graph 370 370 * This function create a subset graph that just include vertices (and edges) from the "noComp" component … … 374 374 void keepComponent(int noComp, myGraphType& upperGraph); 375 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 376 /** 377 * Function that reset the main graph and all its properties. 378 * This function make a tabula rasa of the graph that have been created for the latest space 379 * and allow it to register informations on the space that is currently analyzed. 380 * As informations on the graph are just used to create the current modinspace statement, there 381 * is no need to keep those informations from space to space. 382 * As as the main graph (myGraph) is a global data, it is very important to perform this operation. 383 * @currentGraph a reference to the graph that must be resetted 384 */ 385 void resetGraph(myGraphType& currentGraph); 386 387 388 // -- Functions for managing axis (sign and ordering) -- 389 390 /** 391 391 * Function that perform an offset on the the data structures Ci, Cj and Ck before to create the main graph. 392 392 * This offset tend to treat all the main graphs as 3D ones (and then to use the same entry function for both). … … 405 405 void to3D(int nbDim, vector<int>& valCi, vector<int>& valCj, vector<int>& valCk, int nbEdges); 406 406 407 407 /** 408 408 * Function that fix a dimension of a graph then perform a sign analysis after fixation 409 409 * The fixation of the dimension "fixedDim" from the setOuter() function act as a forward checking on 2D components … … 414 414 * @param upperGraph a reference to the graph on which the function must work 415 415 */ 416 417 418 416 int getImposed(int fixedDim, int freeDim, int noComp, myGraphType& upperGraph); 417 418 /** 419 419 * Function that fix two dimensions of a graph then perform a sign analysis after fixations 420 420 * The fixation of the dimensions "fixedDimOne" and "fixedDimTwo" from the setOuter() function act as a forward checking on 1D components … … 426 426 int getImposed(int freeDim, int noComp, myGraphType& upperGraph); 427 427 428 428 /** 429 429 * Function used to know if the third axis have to be decomposed 430 430 * This function reduce two times the main graph then seek a common value on the remaining edges … … 436 436 bool isToDecompose(int freeDim, myGraphType& upperGraph); 437 437 438 /** 438 bool isToDecompose2D(int fixedDim, int noComponent, myGraphType& upperGraph); 439 440 /** 439 441 * Function that get the axis sign for the dimension "noDim" on the edes of the component "noComp" in the graph "currentGraph" 440 442 * return 0 if there is no edges, -1 or 1 if there is a common sign and -2 if there is no common sign … … 445 447 int getCommonSign(int noDim, int noComp, myGraphType& currentGraph); 446 448 447 448 449 450 451 452 453 454 455 456 449 /** 450 * Function that get the axis sign for the dimension "noDim" in the graph "currentGraph" 451 * return 0 if there is no edges, -1 or 1 if there is a common sign and -2 if there is no common sign 452 * This function bring the same information than getCommonSign() with three parameters except it does not seek a special component 453 * @param noAxis an interger value indicating the dimension on which the sign must be analyzed 454 * @param cfixedGraph a reference to the graph on which the sign must be analyzed 455 */ 456 int getCommonSign(int noAxis, myGraphType& fixedGraph); 457 458 /** 457 459 * Function that get the axis sign for the dimension "noFree" in the graph "currentGraph" 458 460 * return 0 if there is no edges, -1 or 1 if there is a common sign and -2 if there is no common sign … … 472 474 473 475 474 476 // -- Functions that create the hidden file and populate the order Table by reading the data structures -- 475 477 476 478 /* … … 482 484 void readParam(int noAxis, int valAxis, int noParam); 483 485 484 486 /** 485 487 * Function that perform the reading of all the order statement the same way that in the read() function 486 488 * The difference is that, as the first and second axis are dummies, just one component of the 3D components vector … … 489 491 * for the axis number that have an offset because axis "k" is in reality "i" (cf. to3D() function). 490 492 */ 491 492 493 493 void read1D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph); 494 495 /** 494 496 * Function that perform the reading of all the order statement the same way that in the read() function 495 497 * The difference is that, as the first axis is dummy, just one component of the 3D components vector is considered. … … 497 499 * for the axis number that have an offset because "j" and "k" axis are in reality "i" and "j" axis (cf. to3D() function). 498 500 */ 499 500 501 501 void read2D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph); 502 503 /** 502 504 * Function that read the three structures ("outerComp", "middleComp" and "innerComp") then display all the order 503 505 * statement accordignly to the values read in the "cfcSign" attributes of the components structures … … 509 511 * read them and the moduls from the 1D component vector (innerComp). 510 512 */ 511 512 513 514 515 513 void read3D(cfcStructTableType outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph); 514 515 // -- Functions that display data structures -- 516 517 /** 516 518 * Function that show vertices and edges of a graph and their attributes 517 519 * @param currentGraph a reference to the graph on which informations have to be shown 518 520 */ 519 void showGraph(myGraphType& currentGraph, myGraphType& myGraph);520 521 521 void showGraph(myGraphType& currentGraph); 522 523 /** 522 524 * Function that show the 3D components vector 523 525 * Informations displayed are the "cfcSign" attributes (axis number and axis direction) … … 525 527 void showOuter(cfcStructTableType& outerComp); 526 528 527 529 /** 528 530 * Fonction permettant de visualiser le tableau de vecteurs contenant les composantes à 2 dimensions 529 531 * Funtion that show the array of 2D components vectors … … 534 536 void showMiddle(int noFixed1, cfcStructTableType& outerComp, middleCompType& middleComp, myGraphType& myGraph); 535 537 536 538 /** 537 539 * Fonction permettant de visualiser le tableau de vecteurs contenant les composantes à une dimension 538 540 * Function that show the array of 1D components vectors … … 545 547 void showInner(int noFixed1, int noFixed2, int freeDim, cfcStructTableType& outerComp, middleCompType& middleComp, innerCompType& innerComp, myGraphType& myGraph); 546 548 547 548 549 549 // -- Tool functions -- 550 551 /** 550 552 * Function for getting the index number of the module which name is given as a parameter (tool function). 551 553 * @param mod a string containing the modul name. … … 554 556 * @return an index on the modul number. 555 557 */ 556 557 558 559 560 561 562 563 void showTokens(Table<Order>& theOrderTable); 564 565 566 567 568 569 570 571 572 573 558 int getModulIndex(string mod, const vector<string>& tab, int index); 559 560 /* 561 * Function that allow to see what is inside the orderTable given as a parameter 562 * This function is just usefull for testing the result of the generation, so it is temporary 563 * @param theOrderTable a reference to a vector of Order objects 564 */ 565 void showTokens(Table<Order>& theOrderTable); 566 567 /* 568 * Check if a modul is integrated in an order statement 569 * Function added since isCounterOrder() seems to have changed its behavior 570 * @param nom the name of the modul that have to be seeked 571 * @param theOrderTable a reference on the order table in which the modul has to be seeked 572 * @return a boolean value set to true if the module if the modul is integrated in an order statement 573 */ 574 bool isInOrder(string nom, Table<Order>& theOrderTable); 575 574 576 575 577
Note: See TracChangeset
for help on using the changeset viewer.