Changeset b4ee8d in git


Ignore:
Timestamp:
Nov 27, 2017, 3:35:27 PM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5482cda1add93a178960d9c5cb78caabd603c0fc
Parents:
927cae09bf14e3dc0a1f6d1af5bfc39a666fd51f
Message:
Fix indentation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    r927cae rb4ee8d  
    12431243    if (G[v,w] == 1) {
    12441244      if (visited[w] == 1) {
    1245         // new cycle
    1246         if (v == w) {
    1247           for (int u = 1; u <= ncols(G); u++) {
    1248             if (G[v,u] && u != v) {
    1249               outFlag = 2;
    1250             }
    1251             if (G[u,v] && u != v) {
    1252               inFlag = 1;
    1253             }
    1254           }
    1255         } else {
    1256           for (int i = size(path); i >= 1; i--) { // for each vertex in the path
    1257             // check for neighbors not directly next or prev in cycle
    1258             for (int u = 1; u <= ncols(G); u++) {
    1259               if (G[path[i],u] == 1) { // there is an edge to u
    1260                 if (path[i] != v) {
    1261                   if (u != path[i+1]) { // and u is not the next element in the cycle
    1262                     outFlag = 2;
    1263                   }
    1264                 } else {
    1265                   if (u != w) {
    1266                     outFlag = 2;
    1267                   }
    1268                 }
    1269               }
    1270               if (G[u,path[i]] == 1) { // there is an edge from u
    1271                 if (path[i] != w) {
    1272                   if (u != path[i-1]) { // and u is not the previous element in the cylce
    1273                     inFlag = 1;
    1274                   }
    1275                 } else {
    1276                   if (u != v) {
    1277                     inFlag = 1;
    1278                   }
    1279                 }
    1280               }
    1281             }
    1282             if (path[i] == w) {
    1283               break;
    1284             }
    1285           }
    1286         }
     1245        // new cycle
     1246        if (v == w) {
     1247          for (int u = 1; u <= ncols(G); u++) {
     1248            if (G[v,u] && u != v) {
     1249              outFlag = 2;
     1250            }
     1251            if (G[u,v] && u != v) {
     1252              inFlag = 1;
     1253            }
     1254          }
     1255        } else {
     1256          for (int i = size(path); i >= 1; i--) { // for each vertex in the path
     1257            // check for neighbors not directly next or prev in cycle
     1258            for (int u = 1; u <= ncols(G); u++) {
     1259              if (G[path[i],u] == 1) { // there is an edge to u
     1260                if (path[i] != v) {
     1261                  if (u != path[i+1]) { // and u is not the next element in the cycle
     1262                    outFlag = 2;
     1263                  }
     1264                } else {
     1265                  if (u != w) {
     1266                    outFlag = 2;
     1267                  }
     1268                }
     1269              }
     1270              if (G[u,path[i]] == 1) { // there is an edge from u
     1271                if (path[i] != w) {
     1272                  if (u != path[i-1]) { // and u is not the previous element in the cylce
     1273                    inFlag = 1;
     1274                  }
     1275                } else {
     1276                  if (u != v) {
     1277                    inFlag = 1;
     1278                  }
     1279                }
     1280              }
     1281            }
     1282            if (path[i] == w) {
     1283              break;
     1284            }
     1285          }
     1286        }
    12871287      } else {
    1288         int inOutFlags = inOrOutCommingEdgeInCycle(G, w, visited, path);
    1289         if (inOutFlags == 1) {
    1290           inFlag = 1;
    1291         }
    1292         if (inOutFlags == 2) {
    1293           outFlag = 2;
    1294         }
    1295         if (inOutFlags == 3) {
    1296           inFlag = 1;
    1297           outFlag = 2;
    1298         }
     1288        int inOutFlags = inOrOutCommingEdgeInCycle(G, w, visited, path);
     1289        if (inOutFlags == 1) {
     1290          inFlag = 1;
     1291        }
     1292        if (inOutFlags == 2) {
     1293          outFlag = 2;
     1294        }
     1295        if (inOutFlags == 3) {
     1296          inFlag = 1;
     1297          outFlag = 2;
     1298        }
    12991299      }
    13001300    }
Note: See TracChangeset for help on using the changeset viewer.