Changeset 208
- Timestamp:
- 02/22/10 11:15:22 (14 years ago)
- Location:
- trunk/yao/src/YAOObjects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/YAOObjects/Order.cpp
r207 r208 1177 1177 void Order::showInner(int noFixed1, int noFixed2, int freeDim) { 1178 1178 1179 cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl;1179 // ***** cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl; 1180 1180 1181 1181 // For all 3D component embedded in the vector outerComp … … 1198 1198 1199 1199 1200 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "] Dim1 : " << 1200 cout << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "].cfcSign[0].first : " 1201 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << ", second : " 1202 << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second << ", modules : "; 1203 1204 for(int noMod = 0; noMod < innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls.size(); noMod++) { 1205 1206 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].embeddedModuls[noMod]) << " "; 1207 1208 } 1209 1210 cout << endl; 1211 /* 1212 1213 Dim1 : " << 1201 1214 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << " , second : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second; 1202 1215 1216 */ 1217 1218 /* 1203 1219 cout << endl; 1204 1220 … … 1215 1231 1216 1232 cout << endl; 1233 1234 ******/ 1217 1235 1218 1236 } … … 2160 2178 fixGraph(currentGraph, noFixed2); 2161 2179 2162 // ***************************************************** 2163 // **** ****** 2164 // **** ETAPE 1 DE LA PROCEDURE A UNE DIMENSION ****** 2165 // **** ****** 2166 // ***************************************************** 2180 // ETAPE 1 DE LA PROCEDURE A UNE DIMENSION 2181 // --------------------------------------- 2167 2182 2168 2183 // Create data structures used by the component search algorithm … … 2197 2212 int nbFixedComponents = *max_element(fixedComponentsList.begin(), fixedComponentsList.end()) + 1; 2198 2213 2199 // ***************************************************** 2200 // **** **** 2201 // **** ETAPE 5.1 DE LA PROCEDURE A UNE DIMENSION **** 2202 // **** **** 2203 // ***************************************************** 2214 2215 // ETAPE 5.1 DE LA PROCEDURE A UNE DIMENSION 2216 // ----------------------------------------- 2204 2217 2205 2218 // update the innerComp array to allow this structure to register informations on all the 1D components detected for the dimension … … 2207 2220 2208 2221 innerComp[noComp3D][noFixed1][noComp2D][noFixed2].resize(nbFixedComponents); 2222 2223 // Array that will register imposed path on the 2224 // -------------------------------------------- 2225 2226 int *imposedPath = new int[nbFixedComponents]; 2227 2228 for(int noComp1D = 0; noComp1D <nbFixedComponents; noComp1D++) imposedPath[noComp1D] = 0; 2229 2209 2230 2210 2231 // reset all the structure attributes … … 2229 2250 2230 2251 2231 // ******************************************************* 2232 // **** ****** 2233 // **** ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION ****** 2234 // **** ****** 2235 // ******************************************************* 2236 2237 // ******************************************************* 2238 // **** ****** 2239 // **** ETAPE 2 DE LA PROCEDURE A UNE DIMENSION ****** 2240 // **** ****** 2241 // ******************************************************* 2252 // ETAPE 5.2 DE LA PROCEDURE A UNE DIMENSION 2253 // ----------------------------------------- 2254 2255 // ETAPE 2 DE LA PROCEDURE A UNE DIMENSION 2256 // --------------------------------------- 2242 2257 2243 2258 // Get the common size of the component for the current dimension then store the information on the structure … … 2246 2261 for(int noComp1D = 0; noComp1D < nbFixedComponents; noComp1D++) { 2247 2262 2263 imposedPath[noComp1D] = getCommonFixedSign(freeDim, noComp1D, currentGraph); 2264 2248 2265 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = 0; 2249 2266 2250 2267 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = freeDim; 2251 2268 2252 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSignInner(noFixed2, freeDim, currentGraph); 2269 // *** SUPER GROSSE MODIF innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSignInner(noFixed2, freeDim, currentGraph); 2270 2271 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonSign(freeDim, noComp1D, currentGraph); 2272 2273 /* LA VALEUR NE DOIT PAS POUVOIR ETRE 2, ET SI ELLE EST ZERO QUEL PROBLEME ??? 2274 if(innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 0 || 2275 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second == 2) { 2276 innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second = getCommonFixedSign(freeDim, noComp1D, currentGraph); 2277 } 2278 */ 2253 2279 2254 2280 } … … 2480 2506 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = getCommonSign(dimTwo, noComponent, fixedGraph); 2481 2507 2482 2483 2508 int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 2484 2509 int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; … … 2506 2531 2507 2532 int noConf = -1; 2508 2509 // int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second;2510 // int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second;2511 2533 2512 2534 if(sign0 != 2 && sign1 != 2) noConf = 0; // axis0 -> axis1 (axis1 free) … … 2540 2562 2541 2563 if(noConf == 3) { 2542 2564 2543 2565 int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 2544 2566 middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; … … 2547 2569 middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 2548 2570 2549 if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0];2550 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[ 0].second = isImposed2D[noComponent][1];2571 // if(isImposed2D[noComponent][0] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][0]; 2572 if(isImposed2D[noComponent][1] != 0) middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = isImposed2D[noComponent][1]; 2551 2573 } 2552 2574 } 2575 2576 // If the last axis value is not defined 2577 2578 if(middleComp[noComp][fixedDim][noComponent].cfcSign[1].second == 2) { 2579 2580 // If no decomposition is not needed, then set the value to zero to avoid decomposition 2581 2582 if(!isToDecompose(middleComp[noComp][fixedDim][noComponent].cfcSign[1].first, fixedGraph)) { 2583 2584 middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = 0; 2585 2586 } 2587 } 2553 2588 } 2554 2555 2589 2556 2590 … … 2697 2731 void Order::read2D() { 2698 2732 2699 2700 // For all the components embedded in the 3D graph2701 // -----------------------------------------------2702 2703 2733 for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 2704 2705 // For all the components embedded in the 2D graph coming from the current 3D component2706 // ------------------------------------------------------------------------------------2707 2708 2734 for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++) { 2709 2710 // Getting the axis number of the parameter2711 // ----------------------------------------2712 2713 2735 int noFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 2714 2715 // Getting the axis value of the parameter2716 // ---------------------------------------2717 2718 2736 int valFixed1 = middleComp[noComp3D][0][noComp2D].cfcSign[0].second; 2719 2720 // Read the order paramater for this axis number and this axis value (axis number is decreased as there is just two dimensions : the second axis become the first one)2721 // -------------------------------------------------------------------------------------------------------------------------------------------------------------------2722 2723 2737 readParam(noFixed1 -1, valFixed1, 1); 2724 2725 // Getting the axis number of the remaining parameter 2726 // -------------------------------------------------- 2727 2738 cout << endl << endl << "\t\t"; 2728 2739 int noAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 2729 2730 // Getting the axis value of the remaining parameter2731 // -------------------------------------------------2732 2733 2740 int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 2734 2735 // If the third axis value is defined inside the current 2D component2736 // ------------------------------------------------------------------2737 2738 2741 if(valAxis2 != 2) { 2739 2740 // Read the order paramater for this axis number and this axis value (axis number is decreased as there is just two dimensions : the third axis become the second one) 2741 // ------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2742 2743 readParam(noAxis2 -1, valAxis2, 2); 2744 2745 cout << endl << endl << "\t\t"; 2746 2747 // For all the components embedded in the 1D graph coming from the current 2D component 2748 2749 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2750 2751 // For all the modules embedded in the current 1D component 2752 // -------------------------------------------------------- 2753 2754 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2755 2756 // Insert the moduls after the parameters 2757 // -------------------------------------- 2758 2759 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2760 2761 } 2762 } 2763 } 2764 2765 // If the third axis value is not defined inside the current 2D component 2766 // ---------------------------------------------------------------------- 2767 2742 readParam(noAxis2 -1, valAxis2, 2); 2743 cout << endl << endl << "\t\t"; 2744 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2745 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2746 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2747 } 2748 } 2749 } 2768 2750 else { 2769 2770 // For all the components embedded in the 1D graph coming from the current 2D component 2771 // ------------------------------------------------------------------------------------ 2772 2773 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2774 2775 // Getting the axis number of the remaining parameter 2776 // -------------------------------------------------- 2777 2778 noAxis2 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2779 2780 // Getting the axis value of the remaining parameter 2781 // ------------------------------------------------- 2782 2783 valAxis2 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2784 2785 // Read the order paramater for this axis number and this axis value (axis number is decreased as there is just two dimensions : the third axis become the second one) 2786 // ------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2787 2788 readParam(noAxis2 -1, valAxis2, 2); 2789 2790 cout << endl << endl << "\t\t"; 2791 2792 // For all the modules embedded in the current 1D component 2793 // -------------------------------------------------------- 2794 2795 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2796 2797 // Insert the moduls after the parameter 2798 // ------------------------------------- 2799 2800 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod]) << " "; 2801 2802 } 2803 } 2804 } 2751 noAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 2752 2753 for(int noComp1D = 0; noComp1D < innerComp[noComp3D][0][noComp2D][noAxis2].size(); noComp1D++) { 2754 int noAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].first; 2755 int valAxis3 = innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].cfcSign[0].second; 2756 readParam(noAxis3 -1, valAxis3, 2); 2757 cout << endl << endl << "\t\t"; 2758 for(int noMod = 0; noMod < innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls.size(); noMod++) { 2759 cout << boost::get(boost::vertex_name_t(), myGraph, innerComp[noComp3D][0][noComp2D][noAxis2][noComp1D].embeddedModuls[noMod])<< " "; 2760 } 2761 } 2762 } 2805 2763 } 2806 2764 } 2807 2808 // Close the order statement2809 // -------------------------2810 2811 2765 readParam(0, 0, 0); 2812 2813 2766 }; 2814 2767 … … 3146 3099 3147 3100 return(toDecompose); 3101 3102 }; 3103 3104 3105 int Order::getCommonFixedSign(int noDim, int noComp, myGraphType& currentGraph) { 3106 3107 int valDim0 = 0; 3108 3109 // For all the vertices 3110 // -------------------- 3111 3112 for(tie(edgeIterOne, edgeIterTwo) = edges(currentGraph); edgeIterOne != edgeIterTwo; ++edgeIterOne) { 3113 3114 // If the source modul of the edge is in the component given as paramater 3115 // ---------------------------------------------------------------------- 3116 3117 if(get(boost::vertex_affected_comp_t(), currentGraph, boost::source(*edgeIterOne, currentGraph)) == noComp) { 3118 3119 // Get the dimension values for axis i, j and k 3120 // -------------------------------------------- 3121 3122 int val0 = get(boost::edge_weight_d1_t(), currentGraph, *edgeIterOne); 3123 int val1 = get(boost::edge_weight_d2_t(), currentGraph, *edgeIterOne); 3124 int val2 = get(boost::edge_weight_d3_t(), currentGraph, *edgeIterOne); 3125 3126 // If the recorded value valDim0 is not equal to 2 (ie. if it is equal to 2, there is no need to go further in the sign analyzis) 3127 // ----------------------------------------------------------------------------------------------------------------------------- 3128 3129 if(valDim0 != 2) { 3130 3131 // The sign analyzis is performed for the dimension "noDim" given as parameter 3132 // --------------------------------------------------------------------------- 3133 3134 switch(noDim) { 3135 3136 // If the current value is not null and valDim0 + the current value is equal to zero, it means there is a couple -1 an +1 and then no common sign 3137 // ---------------------------------------------------------------------------------------------------------------------------------------------- 3138 3139 case 0: if(val0 != 0) { if(valDim0 + val0 == 0) { valDim0 = 2; } else { valDim0 = val0; } } break; 3140 case 1: if(val1 != 0) { if(valDim0 + val1 == 0) { valDim0 = 2; } else { valDim0 = val1; } } break; 3141 case 2: if(val2 != 0) { if(valDim0 + val2 == 0) { valDim0 = 2; } else { valDim0 = val2; } } break; 3142 3143 } 3144 } 3145 } 3146 } 3147 return(valDim0); 3148 3148 3149 3149 }; … … 3211 3211 if(isConnected) return(valDim0); 3212 3212 return(3); 3213 3214 3213 }; 3215 3214 -
trunk/yao/src/YAOObjects/Order.hpp
r203 r208 552 552 void readParam(int noAxis, int valAxis, int noParam); 553 553 554 554 555 int getCommonFixedSign(int noDim, int noComp, myGraphType& currentGraph); 555 556 556 557 // ------------- FIN AJOUT CB GENERATION AUTOMATIQUE DE L'ORDER --------------- //
Note: See TracChangeset
for help on using the changeset viewer.