Changeset 437cdbc in git


Ignore:
Timestamp:
Jul 3, 2017, 1:12:20 PM (7 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d2096d80b66af9a0624c996b1dea2e23bb741ee2
Parents:
23f6f42c45f6eb83ed89c5915c3b9001438f2c86
Message:
Fix UfGkDim when longest word in G has length 1 or 0
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    r23f6f4 r437cdbc  
    11381138proc lpUfGkDim(ideal G)
    11391139{
     1140  G = lead(G);
     1141
     1142  int l = 0;
     1143  for (int i = 1; i <= size(G); i++) {
     1144    // find the max degree in G
     1145    int d = deg(G[i]);
     1146    if (d > l) {
     1147      l = d;
     1148    }
     1149
     1150    // also if G is the whole ring return minus infinity
     1151    if (leadmonom(G[i]) == 1) {
     1152      return(-2); // minus infinity
     1153    }
     1154  }
     1155  // if longet word has length 1 we handle it as a special case
     1156  if (l == 1) {
     1157    int n = attrib(basering, "lV"); // variable count
     1158    int k = size(G);
     1159    if (k == n) {
     1160      return(0);
     1161    }
     1162    if (k == n-1) {
     1163      return(1);
     1164    }
     1165    if (k <= n-2) {
     1166      return(-1);
     1167    }
     1168  }
     1169
     1170  // otherwise count cycles in the Ufnarovskij Graph
    11401171  return(UfGraphGrowth(lpUfGraph(G)));
    11411172}
Note: See TracChangeset for help on using the changeset viewer.