Changeset c0631ae in git
- Timestamp:
- Apr 16, 2018, 1:37:27 PM (5 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- fba1c3965fbbe8b7c8b52cb5e07338d93c09aab4
- Parents:
- 3d9a641dcde94d8e4816289e70f2242501f5fd27
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpaprops.lib
r3d9a64 rc0631ae 37 37 @* 2 right Noetherian 38 38 @* 3 Noetherian 39 @* 4 weak Noetherian (TODO)39 @* 4 weak Noetherian 40 40 PURPOSE: Check whether the monomial algebra A/<LM(G)> is (left/right) noetherian 41 41 ASSUME: - basering is a Letterplace ring … … 98 98 intvec visited; 99 99 visited[ncols(UG)] = 0; 100 int inFlag, outFlag ;100 int inFlag, outFlag, inOutFlag; 101 101 for (int v = 1; v <= ncols(UG) && (inFlag + outFlag) != 3; v++) { 102 int inOutFlags = inO rOutCommingEdgeInCycle(UG, v, visited, 0);102 int inOutFlags = inOutCommingEdgesInCycles(UG, v, visited, 0); 103 103 if (inOutFlags == 1) { 104 104 inFlag = 1; 105 105 } 106 106 if (inOutFlags == 2) { 107 outFlag = 2;107 outFlag = 1; 108 108 } 109 109 if (inOutFlags == 3) { 110 110 inFlag = 1; 111 outFlag = 2; 111 outFlag = 1; 112 } 113 if (inOutFlags == 4) { 114 inOutFlag = 1; 115 } 116 if (inOutFlags == 5) { 117 inFlag = 1; 118 inOutFlag = 1; 119 } 120 if (inOutFlags == 6) { 121 outFlag = 1; 122 inOutFlag = 1; 123 } 124 if (inOutFlags == 7) { 125 inFlag = 1; 126 outFlag = 1; 127 inOutFlag = 1; 112 128 } 113 129 kill inOutFlags; 114 130 } kill v; 115 return (3 - inFlag - outFlag); 131 int noetherian = 3 - 1*inFlag - 2*outFlag; 132 if (noetherian == 0) { 133 return (4 - 4*inOutFlag); // weak noetherian 134 } 135 return (noetherian); 116 136 } 117 137 example … … 125 145 } 126 146 127 static proc inO rOutCommingEdgeInCycle(intmat G, int v, intvec visited, intvec path) {147 static proc inOutCommingEdgesInCycles(intmat G, int v, intvec visited, intvec path) { 128 148 // Mark the current vertex as visited 129 149 visited[v] = 1; … … 136 156 } 137 157 138 int inFlag, outFlag ;158 int inFlag, outFlag, inOutFlag; 139 159 140 160 for (int w = 1; w <= ncols(G) && (inFlag + outFlag) != 3; w++) { 141 161 if (G[v,w] == 1) { 142 if (visited[w] == 1) { 143 // new cycle 144 if (v == w) { 162 if (visited[w] == 1) { // new cycle 163 int tmpInFlag; 164 int tmpOutFlag; 165 if (v == w) { // cycle is a loop 145 166 for (int u = 1; u <= ncols(G); u++) { 146 167 if (G[v,u] && u != v) { 147 outFlag = 2; 168 outFlag = 1; 169 tmpOutFlag = 1; 148 170 } 149 171 if (G[u,v] && u != v) { 150 172 inFlag = 1; 173 tmpInFlag = 1; 151 174 } 152 175 } kill u; … … 158 181 if (path[i] != v) { 159 182 if (u != path[i+1]) { // and u is not the next element in the cycle 160 outFlag = 2; 183 outFlag = 1; 184 tmpOutFlag = 1; 161 185 } 162 186 } else { 163 187 if (u != w) { 164 outFlag = 2; 188 outFlag = 1; 189 tmpOutFlag = 1; 165 190 } 166 191 } … … 170 195 if (u != path[i-1]) { // and u is not the previous element in the cylce 171 196 inFlag = 1; 197 tmpInFlag = 1; 172 198 } 173 199 } else { 174 200 if (u != v) { 175 201 inFlag = 1; 202 tmpInFlag = 1; 176 203 } 177 204 } … … 183 210 } kill i; 184 211 } 212 if (tmpInFlag > 0 && tmpOutFlag > 0) { 213 // there are both in and outcomming edges in this cycle 214 inOutFlag = 1; 215 } 216 kill tmpInFlag; 217 kill tmpOutFlag; 185 218 } else { 186 int inOutFlags = inO rOutCommingEdgeInCycle(G, w, visited, path);219 int inOutFlags = inOutCommingEdgesInCycles(G, w, visited, path); 187 220 if (inOutFlags == 1) { 188 221 inFlag = 1; 189 222 } 190 223 if (inOutFlags == 2) { 191 outFlag = 2;224 outFlag = 1; 192 225 } 193 226 if (inOutFlags == 3) { 194 227 inFlag = 1; 195 outFlag = 2; 228 outFlag = 1; 229 } 230 if (inOutFlags == 4) { 231 inOutFlag = 1; 232 } 233 if (inOutFlags == 5) { 234 inFlag = 1; 235 inOutFlag = 1; 236 } 237 if (inOutFlags == 6) { 238 outFlag = 1; 239 inOutFlag = 1; 240 } 241 if (inOutFlags == 7) { 242 inFlag = 1; 243 outFlag = 1; 244 inOutFlag = 1; 196 245 } 197 246 kill inOutFlags; … … 200 249 } kill w; 201 250 202 return ( inFlag + outFlag);251 return (1*inFlag + 2*outFlag + 4*inOutFlag); 203 252 } 204 253
Note: See TracChangeset
for help on using the changeset viewer.