Changeset bdc1cf in git


Ignore:
Timestamp:
Oct 29, 2017, 12:28:52 PM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
f5e3fb2de3c8c481bf0f0323aa618d52b7e39a66
Parents:
b028fdafc3c7db1ac2c259ea22d70ac64bfb497e
Message:
Fix standard word computation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    rb028fd rbdc1cf  
    882882{
    883883  int n = size(P);
    884   if (n <= 0) {return(1);}
     884  if (n <= 0 || P == 0) {return(1);}
    885885  if (size(I) < n) {return(0);}
    886886  intvec IP = I[1..n];
     
    892892"
    893893PURPOSE:
    894 checks, if a word P is a suffix of another word I
     894checks, if a word S is a suffix of another word I
    895895"
    896896{
    897897  int n = size(S);
    898   if (n <= 0) {return(1);}
     898  if (n <= 0 || S == 0) {return(1);}
    899899  int m = size(I);
    900900  if (m < n) {return(0);}
     
    913913  int m = size(I);
    914914
    915   if (n <= 0) {
    916     return(1);
    917   }
    918   if (m < n) {
    919     return(0);
    920   }
     915  if (n <= 0 || IF == 0) {return(1);}
     916  if (m < n) {return(0);}
    921917
    922918  for (int i = 0; (n + i) <= m; i++){
     
    14911487}
    14921488
    1493 static proc ivStandardWords(list G, int length) {
     1489static proc ivStandardWords(list G, int length)
     1490"ASSUME: G is simplified
     1491"
     1492{
    14941493  if (length == 0) {
    1495     return (0); // iv = 0 means monom = 1
     1494    list words;
     1495    if (!ivdivides(G,0)) {
     1496      words[1] = 0; // iv = 0 means monom = 1
     1497    }
     1498    return (words); // no standard words
    14961499  }
    14971500  int lV = attrib(basering, "lV"); // variable count
     
    15071510      }
    15081511    }
     1512  }
     1513  return (words);
     1514}
     1515
     1516static proc ivStandardWordsUpToLength(list G, int length)
     1517"ASSUME: G is simplified
     1518"
     1519{
     1520  list words = ivStandardWords(G,0);
     1521  if (size(words) == 0) {return (words)}
     1522  for (int i = 1; i <= length; i++) {
     1523    words = words + ivStandardWords(G, i);
    15091524  }
    15101525  return (words);
Note: See TracChangeset for help on using the changeset viewer.