Changeset e39e193 in git


Ignore:
Timestamp:
Nov 14, 2018, 5:40:40 PM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
93386435caf06320aebf4d6af894bff6839db8b4
Parents:
ecdeb553994eac8047af1b1065f7154fe0c5a0c5
Message:
Move divides and varAt to freegb
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpaprops.lib

    recdeb5 re39e193  
    767767        w_overlap = w_overlap[1 .. (l-2)*lV];
    768768      }
    769       if (v_overlap == w_overlap && !lpdivides(G, v * lpVarAt(w, l - 1))) {
     769      if (v_overlap == w_overlap && !lpLmDivides(G, v * lpVarAt(w, l - 1))) {
    770770        UG[i,j] = 1;
    771771      }
     
    808808}
    809809
    810 static proc lpVarAt(poly p, int pos) {
    811   return (system("lpVarAt", p, pos));
    812 }
    813 
    814810static proc lpStandardWords(ideal G, int length)
    815811"ASSUME: G is simplified
     
    822818  ideal words = maxideal(length);
    823819  for (int i = ncols(words); i >= 1; i--) {
    824     if (lpdivides(G, words[i])) {
     820    if (lpLmDivides(G, words[i])) {
    825821      words = delete(words, i);
    826822    }
     
    867863  } kill i;
    868864  return (words);
    869 }
    870 
    871 proc lpdivides(ideal I, poly p) {
    872   for (int i = 1; i <= ncols(I); i++) {
    873     if (system("lpdivides", I[i], p)) {
    874       return (1);
    875     }
    876   } kill i;
    877   return (0);
    878865}
    879866
  • Singular/LIB/freegb.lib

    recdeb5 re39e193  
    3232
    3333isVar(p);                        check whether p is a power of a single variable
     34
     35lpLmDivides(ideal I, poly p)     tests if there is a polynomial q in I with LM(q)|LM(p)
     36lpVarAt(poly p, int pos)         returns the variable (as a poly) at position pos of the poly p
    3437
    3538SEE ALSO: fpadim_lib, fpaprops_lib, fpalgebras_lib, LETTERPLACE
     
    354357  poly i = 1;
    355358  isVar(i);
     359}
     360
     361proc lpLmDivides(ideal I, poly p)
     362"USAGE: lpLmDivides(I); I an ideal
     363RETURN: boolean
     364ASSUME: basering is a Letterplace ring
     365PURPOSE: tests if there is a polynomial q in I with LM(q)|LM(p)
     366EXAMPLE: example lpLmDivides; shows examples
     367"
     368{
     369  for (int i = 1; i <= ncols(I); i++) {
     370    if (system("lpLmDivides", I[i], p)) {
     371      return (1);
     372    }
     373  } kill i;
     374  return (0);
     375}
     376example
     377{
     378  "EXAMPLE:"; echo = 2;
     379  ring r = 0,(x,y),dp;
     380  def R = makeLetterplaceRing(5);
     381  setring R;
     382  poly p = x*y*y;
     383  lpLmDivides(y*y, p);
     384  lpLmDivides(y*x, p);
     385  lpLmDivides(ideal(y*y, y*x), p);
     386}
     387
     388proc lpVarAt(poly p, int pos)
     389"USAGE: lpVarAt(p, pos); p a poly, pos an int
     390RETURN: poly
     391ASSUME: basering is a Letterplace ring
     392PURPOSE: returns the variable (as a poly) at position pos of the poly p
     393EXAMPLE: example lpVarAt; shows examples
     394"
     395{
     396  return (system("lpVarAt", p, pos));
     397}
     398example
     399{
     400  "EXAMPLE:"; echo = 2;
     401  ring r = 0,(x,y),dp;
     402  def R = makeLetterplaceRing(5);
     403  setring R;
     404  poly p = y*y*x;
     405  lpVarAt(p, 3);
    356406}
    357407
  • Singular/extra.cc

    recdeb5 re39e193  
    12111211  /*==================== divide-test for freeGB  =================*/
    12121212  #ifdef HAVE_SHIFTBBA
    1213     if (strcmp(sys_cmd, "lpdivides") == 0)
     1213    if (strcmp(sys_cmd, "lpLmDivides") == 0)
    12141214    {
    12151215      const short t[]={2,POLY_CMD,POLY_CMD};
Note: See TracChangeset for help on using the changeset viewer.