Changeset 208


Ignore:
Timestamp:
02/22/10 11:15:22 (14 years ago)
Author:
bernard
Message:

change in setInner() : use of the generic function getCommonSign() instead of the dedicated function getSommonSignInner(). Changes in setMiddle() : correction of a bug in the imposed path setting for the third configuration then suppression of a unrelevant test

Location:
trunk/yao/src/YAOObjects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yao/src/YAOObjects/Order.cpp

    r207 r208  
    11771177void Order::showInner(int noFixed1, int noFixed2, int freeDim) { 
    11781178 
    1179         cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl; 
     1179        // ***** cout << endl << "PROTOTYPE : innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D]" << endl; 
    11801180 
    11811181        //  For all 3D component embedded in the vector outerComp 
     
    11981198 
    11991199 
    1200         cout    << endl << "innerComp[" << noComp3D << "][" << noFixed1 << "][" << noComp2D << "][" << noFixed2 << "][" << noComp1D << "] Dim1 : " << 
     1200cout << 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 
     1204for(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 
     1210cout << endl; 
     1211/* 
     1212 
     1213 Dim1 : " << 
    12011214                            innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first << " , second : " << innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].second; 
    12021215 
     1216*/ 
     1217 
     1218/* 
    12031219        cout << endl; 
    12041220 
     
    12151231 
    12161232                        cout << endl; 
     1233 
     1234                        ******/ 
    12171235 
    12181236                        } 
     
    21602178        fixGraph(currentGraph, noFixed2); 
    21612179 
    2162         // ***************************************************** 
    2163         // ****                                           ****** 
    2164         // ****  ETAPE 1 DE LA PROCEDURE A UNE DIMENSION  ****** 
    2165         // ****                                           ****** 
    2166         // ***************************************************** 
     2180        // ETAPE 1 DE LA PROCEDURE A UNE DIMENSION  
     2181        // --------------------------------------- 
    21672182 
    21682183        // Create data structures used by the component search algorithm 
     
    21972212        int nbFixedComponents = *max_element(fixedComponentsList.begin(), fixedComponentsList.end()) + 1; 
    21982213 
    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        // ----------------------------------------- 
    22042217 
    22052218        // update the innerComp array to allow this structure to register informations on all the 1D components detected for the dimension  
     
    22072220 
    22082221        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 
    22092230 
    22102231        // reset all the structure attributes  
     
    22292250         
    22302251 
    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        // --------------------------------------- 
    22422257 
    22432258        // Get the common size of the component for the current dimension then store the information on the structure 
     
    22462261        for(int noComp1D = 0; noComp1D < nbFixedComponents; noComp1D++) { 
    22472262 
     2263                imposedPath[noComp1D] = getCommonFixedSign(freeDim, noComp1D, currentGraph); 
     2264 
    22482265                innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first = 0; 
    22492266 
    22502267                innerComp[noComp3D][noFixed1][noComp2D][noFixed2][noComp1D].cfcSign[0].first  = freeDim; 
    22512268 
    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                */ 
    22532279 
    22542280        } 
     
    24802506                middleComp[noComp][fixedDim][noComponent].cfcSign[1].second = getCommonSign(dimTwo, noComponent, fixedGraph); 
    24812507 
    2482  
    24832508                int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 
    24842509                int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 
     
    25062531 
    25072532                        int noConf = -1; 
    2508  
    2509                         // int sign0 = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 
    2510                         // int sign1 = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second;  
    25112533 
    25122534                        if(sign0 != 2 && sign1 != 2)  noConf = 0;       // axis0 -> axis1 (axis1 free) 
     
    25402562 
    25412563                        if(noConf == 3) {  
    2542  
     2564         
    25432565                                int tmpVal = middleComp[noComp][fixedDim][noComponent].cfcSign[0].second; 
    25442566                                middleComp[noComp][fixedDim][noComponent].cfcSign[0].second = middleComp[noComp][fixedDim][noComponent].cfcSign[1].second; 
     
    25472569                                middleComp[noComp][fixedDim][noComponent].cfcSign[1].first = axis0; 
    25482570 
    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];  
    25512573                        } 
    25522574                }  
     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                } 
    25532588        } 
    2554  
    25552589 
    25562590 
     
    26972731void Order::read2D() { 
    26982732 
    2699  
    2700         // For all the components embedded in the 3D graph 
    2701         // ----------------------------------------------- 
    2702  
    27032733        for(int noComp3D = 0; noComp3D < outerComp.size(); noComp3D++) { 
    2704  
    2705                 // For all the components embedded in the 2D graph coming from the current 3D component 
    2706                 // ------------------------------------------------------------------------------------ 
    2707  
    27082734                for(int noComp2D = 0; noComp2D < middleComp[noComp3D][0].size(); noComp2D++)  { 
    2709  
    2710                         // Getting the axis number of the parameter  
    2711                         // ---------------------------------------- 
    2712  
    27132735                        int noFixed1  = middleComp[noComp3D][0][noComp2D].cfcSign[0].first; 
    2714  
    2715                         // Getting the axis value of the parameter 
    2716                         // --------------------------------------- 
    2717  
    27182736                        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  
    27232737                        readParam(noFixed1 -1, valFixed1, 1); 
    2724  
    2725                         // Getting the axis number of the remaining parameter  
    2726                         // -------------------------------------------------- 
    2727  
     2738                        cout << endl << endl << "\t\t"; 
    27282739                        int noAxis2  = middleComp[noComp3D][0][noComp2D].cfcSign[1].first; 
    2729  
    2730                         // Getting the axis value of the remaining parameter  
    2731                         // ------------------------------------------------- 
    2732  
    27332740                        int valAxis2 = middleComp[noComp3D][0][noComp2D].cfcSign[1].second; 
    2734  
    2735                         // If the third axis value is defined inside the current 2D component 
    2736                         // ------------------------------------------------------------------ 
    2737  
    27382741                        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                        }  
    27682750                        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                       } 
    28052763                } 
    28062764        } 
    2807  
    2808         // Close the order statement 
    2809         // ------------------------- 
    2810  
    28112765        readParam(0, 0, 0); 
    2812  
    28132766}; 
    28142767 
     
    31463099 
    31473100        return(toDecompose); 
     3101 
     3102}; 
     3103 
     3104 
     3105int 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); 
    31483148 
    31493149}; 
     
    32113211        if(isConnected) return(valDim0);  
    32123212        return(3);  
    3213  
    32143213}; 
    32153214 
  • trunk/yao/src/YAOObjects/Order.hpp

    r203 r208  
    552552        void readParam(int noAxis, int valAxis, int noParam); 
    553553 
    554   
     554 
     555        int getCommonFixedSign(int noDim, int noComp, myGraphType& currentGraph);  
    555556 
    556557 // ------------- FIN AJOUT CB GENERATION AUTOMATIQUE DE L'ORDER --------------- // 
Note: See TracChangeset for help on using the changeset viewer.