Changeset 206
- Timestamp:
- 02/18/10 18:49:33 (14 years ago)
- Location:
- trunk/yao
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/yao/src/YAOObjects/Order.cpp
r202 r206 809 809 string spaceName = trajMap.find(spacesList[noTopo]) -> first; 810 810 811 // Show the modinspace line 812 // ------------------------ 813 814 cout << endl << endl << "order modinspace " << spaceName << endl; 815 811 816 // Dedicated light structures that will be used to create the main graph then populate its properties 812 817 // --------------------------------------------------------------------------------------------------- … … 915 920 } 916 921 } 917 } 922 } 918 923 919 924 // Get the number of dimensions on which tho moduls are defined … … 1001 1006 } 1002 1007 } 1008 1009 cout << endl << "forder"; 1003 1010 } 1004 1011 } … … 1018 1025 for(int noTraj = 0; noTraj < trajOrder.size(); noTraj++) { 1019 1026 1020 cout << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t";1027 cout << endl << endl << "order spaceintraj " << trajOrder[noTraj].second << endl << endl << "\t"; 1021 1028 1022 1029 // For all the space numbers … … 1041 1048 } 1042 1049 } 1050 1043 1051 1044 1052 // Close the current spaceintraj statement … … 1216 1224 void Order::setOuter() { 1217 1225 1218 // ***************************************************** 1219 // **** ****** 1220 // **** ETAPE 3 DE LA PROCEDURE A DEUX DIMENSION ****** 1221 // **** ****** 1222 // ***************************************************** 1226 // ETAPE 3 DE LA PROCEDURE A DEUX DIMENSION 1227 // ----------------------------------------- 1223 1228 1224 1229 std::vector<int> outerComponentsList; … … 1248 1253 outerComp.resize(nbComponents); 1249 1254 1250 // ***************************************************** 1251 // **** ****** 1252 // **** ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION ****** 1253 // **** ****** 1254 // ***************************************************** 1255 // ETAPE 5 DE LA PROCEDURE A DEUX DIMENSION 1256 // ---------------------------------------- 1255 1257 1256 1258 // 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 … … 1297 1299 outerComp[noComponent].cfcSign[2].second = getCommonSign(2, noComponent, myGraph); 1298 1300 1299 // Setting axis value to free (0) if there is just one vertice in the outer component1300 // ----------------------------------------------------------------------------------1301 1302 if(outerComp[noComponent].cfcSign[0].second == 3) outerComp[noComponent].cfcSign[0].second = 0;1303 if(outerComp[noComponent].cfcSign[1].second == 3) outerComp[noComponent].cfcSign[1].second = 0;1304 if(outerComp[noComponent].cfcSign[2].second == 3) outerComp[noComponent].cfcSign[2].second = 0;1305 1306 1301 // Detecting all possible axis combinations then setting the one corresponding to the current component 1307 1302 // ---------------------------------------------------------------------------------------------------- 1308 1309 int noConf = -1;1310 1303 1311 1304 int sign0 = outerComp[noComponent].cfcSign[0].second; … … 1313 1306 int sign2 = outerComp[noComponent].cfcSign[2].second; 1314 1307 1315 if(sign0 != 2 && sign1 != 2 && sign2 != 2) noConf = 0; // i -> j -> k (j and k free) 1316 if(sign0 != 2 && sign1 != 2 && sign2 == 2) noConf = 1; // i -> j -> k (j free) 1317 if(sign0 != 2 && sign1 == 2 && sign2 == 2) noConf = 2; // i -> j -> k 1318 if(sign0 != 2 && sign1 == 2 && sign2 != 2) noConf = 3; // i -> k -> j (k free) 1319 if(sign0 == 2 && sign1 != 2 && sign2 != 2) noConf = 4; // j -> i -> k (i free) 1320 if(sign0 == 2 && sign1 != 2 && sign2 == 2) noConf = 5; // j -> i -> k 1321 if(sign0 == 2 && sign1 == 2 && sign2 != 2) noConf = 6; // k -> i -> j 1322 if(sign0 == 2 && sign1 == 2 && sign2 == 2) noConf = 7; // Erreur 1323 1324 // Looking at combinations to set imposed values for the second axis (see "getImposed" comments) 1325 // --------------------------------------------------------------------------------------------- 1326 1327 if(noConf == 0 || noConf == 1 || noConf == 2) isImposed[noComponent][1] = getImposed(0, 1, noComponent, myGraph); 1328 if(noConf == 3) isImposed[noComponent][2] = getImposed(0, 2, noComponent, myGraph); 1329 if(noConf == 4) isImposed[noComponent][2] = getImposed(1, 2, noComponent, myGraph); 1330 if(noConf == 5) isImposed[noComponent][1] = getImposed(1, 0, noComponent, myGraph); 1331 if(noConf == 6) isImposed[noComponent][2] = getImposed(2, 0, noComponent, myGraph); 1332 1333 // Set imposed values for the third axis (see "getImposed" comments) 1334 // ---------------------------------------------------------------- 1335 1336 isImposed1D[noComponent][0] = getImposed(0, noComponent, myGraph); 1337 isImposed1D[noComponent][1] = getImposed(1, noComponent, myGraph); 1338 isImposed1D[noComponent][2] = getImposed(2, noComponent, myGraph); 1339 1340 1341 // Looking at combinations to : 1 - sort the axis (number and value) inside the "cfcSign" array 1342 // 2 - reset axis value if this one is free 1343 // 3 - reset axis value if this one is imposed 1344 // -------------------------------------------------------------------------------------------- 1345 1346 switch(noConf) { 1347 1348 case 0: 1349 1350 outerComp[noComponent].cfcSign[1].second = 0; // set j to free 1351 outerComp[noComponent].cfcSign[2].second = 0; // set k to free 1352 1353 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1354 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1355 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1356 1357 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1358 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1359 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1360 1361 // If the third axis does not have a common sign 1362 // If the second axis have a common sign 1363 // If it is not needed to decompose the third axis dimension (see "isToDecompose" comments) 1364 // Then set the axis value to 3 (means no common sign but no decomposition) 1365 1366 if(outerComp[noComponent].cfcSign[2].second == 2) 1367 if(outerComp[noComponent].cfcSign[1].second != 2) 1368 // if(!isToDecompose(0, 1, 2, myGraph)) 1369 if(!isToDecompose(2, myGraph)) 1308 // If there is no connection between the vertices of the component (ie single modul without reflexive edge) 1309 // -------------------------------------------------------------------------------------------------------- 1310 1311 bool isConnected = true; 1312 1313 if(sign0 == 3 && sign1 == 3 && sign2 == 3) { 1370 1314 1371 outerComp[noComponent].cfcSign[2].second = 3; 1372 1373 break; 1374 1375 case 1: 1376 1377 outerComp[noComponent].cfcSign[1].second = 0; 1378 1379 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1380 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1381 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1382 1383 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1384 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1385 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1386 1387 if(outerComp[noComponent].cfcSign[2].second == 2) 1388 if(outerComp[noComponent].cfcSign[1].second != 2) 1389 // if(!isToDecompose(0, 1, 2, myGraph)) 1390 if(!isToDecompose(2, myGraph)) 1391 1392 outerComp[noComponent].cfcSign[2].second = 3; 1393 1394 break; 1395 1396 case 2: 1397 1398 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1399 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1400 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1401 1402 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1403 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1404 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1405 1406 if(outerComp[noComponent].cfcSign[2].second == 2) 1407 if(outerComp[noComponent].cfcSign[1].second != 2) 1408 // if(!isToDecompose(0, 1, 2, myGraph)) 1409 if(!isToDecompose(2, myGraph)) 1315 outerComp[noComponent].cfcSign[0].second = 0; 1316 outerComp[noComponent].cfcSign[1].second = 0; 1317 outerComp[noComponent].cfcSign[2].second = 0; 1318 1319 isConnected = false; 1320 } 1321 1322 if(isConnected) { 1323 1324 // Detect the type of configuration of the component accordignly to its defined and not defined axis 1325 // ------------------------------------------------------------------------------------------------- 1326 1327 int noConf = -1; 1328 1329 if(sign0 != 2 && sign1 != 2 && sign2 != 2) noConf = 0; // i -> j -> k (j and k free) 1330 if(sign0 != 2 && sign1 != 2 && sign2 == 2) noConf = 1; // i -> j -> k (j free) 1331 if(sign0 != 2 && sign1 == 2 && sign2 == 2) noConf = 2; // i -> j -> k 1332 if(sign0 != 2 && sign1 == 2 && sign2 != 2) noConf = 3; // i -> k -> j (k free) 1333 if(sign0 == 2 && sign1 != 2 && sign2 != 2) noConf = 4; // j -> i -> k (i free) 1334 if(sign0 == 2 && sign1 != 2 && sign2 == 2) noConf = 5; // j -> i -> k 1335 if(sign0 == 2 && sign1 == 2 && sign2 != 2) noConf = 6; // k -> i -> j 1336 1337 // Detect the errors of the component accordignly to its defined and not defined axis and to the null values 1338 // --------------------------------------------------------------------------------------------------------- 1339 1340 if(sign0 == 2 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 1341 if(sign0 == 2 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 1342 if(sign0 == 2 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 1343 if(sign0 == 0 && sign1 == 2 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 1344 if(sign0 == 2 && sign1 == 0 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 1345 if(sign0 == 0 && sign1 == 2 && sign2 == 0) noConf = 7; // Error : there is no common value in any dimension 1346 if(sign0 == 0 && sign1 == 0 && sign2 == 2) noConf = 7; // Error : there is no common value in any dimension 1347 if(sign0 == 0 && sign1 == 0 && sign2 == 0) noConf = 8; // Error : cyclic dependency 1348 1349 // Looking at combinations to set imposed values for the second axis (see "getImposed" comments) 1350 // --------------------------------------------------------------------------------------------- 1351 1352 if(noConf == 0 || noConf == 1 || noConf == 2) isImposed[noComponent][1] = getImposed(0, 1, noComponent, myGraph); 1353 if(noConf == 3) isImposed[noComponent][2] = getImposed(0, 2, noComponent, myGraph); 1354 if(noConf == 4) isImposed[noComponent][2] = getImposed(1, 2, noComponent, myGraph); 1355 if(noConf == 5) isImposed[noComponent][1] = getImposed(1, 0, noComponent, myGraph); 1356 if(noConf == 6) isImposed[noComponent][2] = getImposed(2, 0, noComponent, myGraph); 1357 1358 // Set imposed values for the third axis (see "getImposed" comments) 1359 // ---------------------------------------------------------------- 1360 1361 isImposed1D[noComponent][0] = getImposed(0, noComponent, myGraph); 1362 isImposed1D[noComponent][1] = getImposed(1, noComponent, myGraph); 1363 isImposed1D[noComponent][2] = getImposed(2, noComponent, myGraph); 1364 1365 // Looking at combinations to : 1 - sort the axis (number and value) inside the "cfcSign" array 1366 // 2 - reset axis value if this one is free 1367 // 3 - reset axis value if this one is imposed 1368 // -------------------------------------------------------------------------------------------- 1369 1370 switch(noConf) { 1371 1372 case 0: 1373 1374 outerComp[noComponent].cfcSign[1].second = 0; // set j to free 1375 outerComp[noComponent].cfcSign[2].second = 0; // set k to free 1376 1377 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1378 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1379 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1380 1381 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1382 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1383 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1384 1385 // If the third axis does not have a common sign 1386 // If the second axis have a common sign 1387 // If it is not needed to decompose the third axis dimension (see "isToDecompose" comments) 1388 // Then set the axis value to 3 (means no common sign but no decomposition) 1389 1390 if(outerComp[noComponent].cfcSign[2].second == 2) 1391 if(outerComp[noComponent].cfcSign[1].second != 2) 1392 if(!isToDecompose(2, myGraph)) 1410 1393 1411 outerComp[noComponent].cfcSign[2].second = 3; 1412 1413 break; 1414 1415 case 3: 1416 1417 outerComp[noComponent].cfcSign[1].second = 0; 1418 outerComp[noComponent].cfcSign[2].second = 2; 1419 outerComp[noComponent].cfcSign[1].first = 2; 1420 outerComp[noComponent].cfcSign[2].first = 1; 1421 1422 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1423 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][2]; 1424 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 1425 1426 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1427 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][2]; 1428 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 1429 1430 if(outerComp[noComponent].cfcSign[1].second == 2) 1431 if(outerComp[noComponent].cfcSign[2].second != 2) 1432 // if(!isToDecompose(0, 2, 1, myGraph)) 1433 if(!isToDecompose(1, myGraph)) 1394 outerComp[noComponent].cfcSign[2].second = 3; 1395 1396 break; 1397 1398 case 1: 1399 1400 outerComp[noComponent].cfcSign[1].second = 0; 1401 1402 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1403 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1404 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1405 1406 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1407 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1408 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1409 1410 if(outerComp[noComponent].cfcSign[2].second == 2) 1411 if(outerComp[noComponent].cfcSign[1].second != 2) 1412 if(!isToDecompose(2, myGraph)) 1413 1414 outerComp[noComponent].cfcSign[2].second = 3; 1415 1416 break; 1417 1418 case 2: 1419 1420 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1421 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][1]; 1422 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1423 1424 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1425 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][1]; 1426 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1427 1428 if(outerComp[noComponent].cfcSign[2].second == 2) 1429 if(outerComp[noComponent].cfcSign[1].second != 2) 1430 if(!isToDecompose(2, myGraph)) 1431 1432 outerComp[noComponent].cfcSign[2].second = 3; 1433 1434 break; 1435 1436 case 3: 1437 1438 outerComp[noComponent].cfcSign[1].second = 0; 1439 outerComp[noComponent].cfcSign[2].second = 2; 1440 outerComp[noComponent].cfcSign[1].first = 2; 1441 outerComp[noComponent].cfcSign[2].first = 1; 1442 1443 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][0]; 1444 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][2]; 1445 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 1446 1447 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][0]; 1448 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][2]; 1449 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 1450 1451 if(outerComp[noComponent].cfcSign[1].second == 2) 1452 if(outerComp[noComponent].cfcSign[2].second != 2) 1453 if(!isToDecompose(1, myGraph)) 1434 1454 1435 outerComp[noComponent].cfcSign[1].second = 3; 1436 1437 break; 1438 1439 case 4: 1440 1441 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 1442 outerComp[noComponent].cfcSign[1].second = 0; 1443 1444 outerComp[noComponent].cfcSign[2].second = 2; 1445 outerComp[noComponent].cfcSign[0].first = 1; 1446 outerComp[noComponent].cfcSign[1].first = 0; 1447 outerComp[noComponent].cfcSign[2].first = 2; 1448 1449 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 1450 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1451 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1452 1453 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 1454 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1455 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1456 1457 if(outerComp[noComponent].cfcSign[0].second == 2) 1458 if(outerComp[noComponent].cfcSign[2].second != 2) 1459 // if(!isToDecompose(1, 2, 0, myGraph)) 1460 if(!isToDecompose(0, myGraph)) 1461 1462 outerComp[noComponent].cfcSign[0].second = 3; 1463 1464 break; 1465 1466 case 5: 1467 1468 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 1469 outerComp[noComponent].cfcSign[1].second = 2; 1470 outerComp[noComponent].cfcSign[2].second = 2; 1471 outerComp[noComponent].cfcSign[0].first = 1; 1472 outerComp[noComponent].cfcSign[1].first = 0; 1473 outerComp[noComponent].cfcSign[2].first = 2; 1474 1475 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 1476 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1477 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1478 1479 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 1480 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1481 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1482 1483 if(outerComp[noComponent].cfcSign[2].second == 2) 1484 if(outerComp[noComponent].cfcSign[0].second != 2) 1485 // if(!isToDecompose(1, 0, 2, myGraph)) 1486 if(!isToDecompose(2, myGraph)) 1487 1488 outerComp[noComponent].cfcSign[2].second = 3; 1455 outerComp[noComponent].cfcSign[1].second = 3; 1456 1457 break; 1458 1459 case 4: 1460 1461 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 1462 outerComp[noComponent].cfcSign[1].second = 0; 1463 1464 outerComp[noComponent].cfcSign[2].second = 2; 1465 outerComp[noComponent].cfcSign[0].first = 1; 1466 outerComp[noComponent].cfcSign[1].first = 0; 1467 outerComp[noComponent].cfcSign[2].first = 2; 1468 1469 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 1470 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1471 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1472 1473 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 1474 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1475 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1476 1477 if(outerComp[noComponent].cfcSign[0].second == 2) 1478 if(outerComp[noComponent].cfcSign[2].second != 2) 1479 if(!isToDecompose(0, myGraph)) 1480 1481 outerComp[noComponent].cfcSign[0].second = 3; 1482 1483 break; 1484 1485 case 5: 1486 1487 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[1].second; 1488 outerComp[noComponent].cfcSign[1].second = 2; 1489 outerComp[noComponent].cfcSign[2].second = 2; 1490 outerComp[noComponent].cfcSign[0].first = 1; 1491 outerComp[noComponent].cfcSign[1].first = 0; 1492 outerComp[noComponent].cfcSign[2].first = 2; 1493 1494 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][1]; 1495 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1496 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][2]; 1497 1498 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][1]; 1499 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1500 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][2]; 1501 1502 if(outerComp[noComponent].cfcSign[2].second == 2) 1503 if(outerComp[noComponent].cfcSign[0].second != 2) 1504 if(!isToDecompose(2, myGraph)) 1505 1506 outerComp[noComponent].cfcSign[2].second = 3; 1489 1507 1490 1508 1491 break;1492 1493 case 6:1509 break; 1510 1511 case 6: 1494 1512 1495 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[2].second; 1496 outerComp[noComponent].cfcSign[1].second = 2; 1497 outerComp[noComponent].cfcSign[2].second = 2; 1498 outerComp[noComponent].cfcSign[0].first = 2; 1499 outerComp[noComponent].cfcSign[1].first = 0; 1500 outerComp[noComponent].cfcSign[2].first = 1; 1501 1502 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][2]; 1503 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1504 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 1505 1506 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][2]; 1507 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1508 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 1509 1510 if(outerComp[noComponent].cfcSign[1].second == 2) 1511 if(outerComp[noComponent].cfcSign[0].second != 2) 1512 // if(!isToDecompose(2, 0, 1, myGraph)) 1513 if(!isToDecompose(1, myGraph)) 1514 1515 outerComp[noComponent].cfcSign[1].second = 3; 1516 1517 break; 1518 1513 outerComp[noComponent].cfcSign[0].second = outerComp[noComponent].cfcSign[2].second; 1514 outerComp[noComponent].cfcSign[1].second = 2; 1515 outerComp[noComponent].cfcSign[2].second = 2; 1516 outerComp[noComponent].cfcSign[0].first = 2; 1517 outerComp[noComponent].cfcSign[1].first = 0; 1518 outerComp[noComponent].cfcSign[2].first = 1; 1519 1520 if(isImposed[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed[noComponent][2]; 1521 if(isImposed[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed[noComponent][0]; 1522 if(isImposed[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed[noComponent][1]; 1523 1524 if(isImposed1D[noComponent][2] != 0) outerComp[noComponent].cfcSign[0].second = isImposed1D[noComponent][2]; 1525 if(isImposed1D[noComponent][0] != 0) outerComp[noComponent].cfcSign[1].second = isImposed1D[noComponent][0]; 1526 if(isImposed1D[noComponent][1] != 0) outerComp[noComponent].cfcSign[2].second = isImposed1D[noComponent][1]; 1527 1528 if(outerComp[noComponent].cfcSign[1].second == 2) 1529 if(outerComp[noComponent].cfcSign[0].second != 2) 1530 if(!isToDecompose(1, myGraph)) 1531 1532 outerComp[noComponent].cfcSign[1].second = 3; 1533 1534 break; 1535 1536 // ETAPE 4 DE LA PROCEDURE A DEUX DIMENSION (cf. docs) 1537 // --------------------------------------------------- 1538 1539 case 7: 1540 1541 cout << endl << "Error : no common value in a compnent including moduls "; 1542 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 1543 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 1544 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 1545 // SORTIE PROGRAMME 1546 1547 break; 1548 1549 case 8: 1550 1551 cout << endl << "Error : cyclic dependency in a compnent including moduls "; 1552 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) 1553 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) 1554 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 1555 // SORTIE PROGRAMME 1556 1557 break; 1558 1559 } 1560 1519 1561 } 1520 1562 1521 1563 } 1522 1564 1523 1565 1524 // ***************************************************** 1525 // **** ****** 1526 // **** ETAPE 4 DE LA PROCEDURE A DEUX DIMENSION ****** 1527 // **** ****** 1528 // ***************************************************** 1529 1530 1531 // Generate an error and stop the execution if there is no common value in a component 1532 // ----------------------------------------------------------------------------------- 1533 1534 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 1535 1536 int sign0 = getCommonSign(0, noComponent, myGraph); 1537 int sign1 = getCommonSign(1, noComponent, myGraph); 1538 int sign2 = getCommonSign(2, noComponent, myGraph); 1539 1540 if( (sign0 == 2 && sign1 == 2 && sign2 == 2) || (sign0 == 2 && sign1 == 2 && sign2 == 0) || (sign0 == 2 && sign1 == 0 && sign2 == 2) || (sign0 == 0 && sign1 == 2 && sign2 == 2) || 1541 (sign0 == 2 && sign1 == 0 && sign2 == 0) || (sign0 == 0 && sign1 == 2 && sign2 == 0) || (sign0 == 0 && sign1 == 0 && sign2 == 2) ) { 1542 1543 cout << endl << "Error : no common value in a compnent including moduls "; 1544 1545 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 1546 1547 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) { 1548 1549 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 1550 } 1551 } 1552 } // SORTIE PROGRAMME !!!!!!!!!! 1553 } 1554 1555 1556 // Generate an error and stop the execution if there is a cyclic dependency in a component 1557 // --------------------------------------------------------------------------------------- 1558 1559 for(int noComponent = 0; noComponent < nbComponents; noComponent++) { 1560 1561 if(getCommonSign(0, noComponent, myGraph) == 0 && getCommonSign(1, noComponent, myGraph) == 0 && getCommonSign(2, noComponent, myGraph) == 0) { 1562 1563 cout << endl << "Error : cyclic dependency in a compnent including moduls "; 1564 1565 for(tie(vertexIterOne, vertexIterTwo) = vertices(myGraph); vertexIterOne != vertexIterTwo; ++vertexIterOne) { 1566 1567 if(get(boost::vertex_affected_comp_t(), myGraph, *vertexIterOne) == noComponent) { 1568 1569 cout << get(boost::vertex_name_t(), myGraph, *vertexIterOne) << " "; 1570 1571 } 1572 } 1573 } // SORTIE PROGRAMME !!!!!!!!!! 1574 } 1575 1576 1577 // ***************************************************** 1578 // **** ****** 1579 // **** ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION ****** 1580 // **** ****** 1581 // ***************************************************** 1566 // ETAPE 6 DE LA PROCEDURE A DEUX DIMENSION 1567 // ---------------------------------------- 1582 1568 1583 1569 myGraphType cfcGraph; … … 1588 1574 reduceGraph(myGraph, cfcGraph, nbComponents); 1589 1575 1590 // ***************************************************** 1591 // **** ****** 1592 // **** ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION ****** 1593 // **** ****** 1594 // ***************************************************** 1576 // ETAPE 7 DE LA PROCEDURE A DEUX DIMENSION 1577 // ---------------------------------------- 1595 1578 1596 1579 std::deque<int> topoOrder; … … 1604 1587 boost::topological_sort(cfcGraph, std::front_inserter(topoOrder), boost::vertex_index_map(boost::identity_property_map())); 1605 1588 1606 // ***************************************************** 1607 // **** ****** 1608 // **** ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION ****** 1609 // **** ****** 1610 // ***************************************************** 1611 1589 // ETAPE 8 DE LA PROCEDURE A DEUX DIMENSION 1590 // ---------------------------------------- 1612 1591 1613 1592 // Sort the outer structure table elements (main graph components) accordignly to the sorting performed on the reduced graph … … 2965 2944 2966 2945 } 2967 }2968 2946 } 2947 } 2969 2948 } 2970 2949 … … 3169 3148 int valDim0 = 0; 3170 3149 3150 // A value that will set to true only if it exist an edge between the component vertices 3151 // ------------------------------------------------------------------------------------- 3152 3153 bool isConnected = false; 3154 3171 3155 // For all edges in the current graph 3172 3156 // ---------------------------------- … … 3183 3167 3184 3168 if(get(boost::vertex_affected_comp_t(), currentGraph, boost::target(*edgeIterOne, currentGraph)) == noComp) { 3169 3170 // Update isConnected as it exist a connexion inside the component 3171 // --------------------------------------------------------------- 3172 3173 isConnected = true; 3185 3174 3186 3175 // Get the dimension values for axis i, j and k … … 3213 3202 } 3214 3203 3215 return(valDim0); 3204 if(isConnected) return(valDim0); 3205 return(3); 3216 3206 3217 3207 };
Note: See TracChangeset
for help on using the changeset viewer.