Changeset a6d6356 in git


Ignore:
Timestamp:
Jan 21, 2015, 6:25:42 PM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
584649e7d56725619ab0a2ed50ec5fd4f180e711
Parents:
0cf4e11fc56e44e8ce67684afe4a45479455ea583176e6e1402d3ad808ee0b00f1589716317afe8f
Message:
Merge pull request #638 from surface-smoothers/fix.unit.and.zero.primary.decomposition

fixed some bugs for zero and patch for unit ideal decomposition
fix for this merge follows.
Files:
8 added
15 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gradedModules.lib

    r3176e6 ra6d6356  
    55LIBRARY: gradedModules.lib     Operations with graded modules/matrices/resolutions
    66AUTHOR:  Oleksandr Motsak <U@D>, where U={motsak}, D={mathematik.uni-kl.de}
     7         Hanieh Keneshlou <hkeneshlou@yahoo.com>
    78KEYWORDS: graded modules, graded homomorphisms, syzygies
    89OVERVIEW:
    910    @* The library contains several procedures for operations with graded modules/matrices/resolutions
    10 
     11    @* TODO!
    1112NOTE:       
    12     @* try @code{example TestGRRes;} from examples
     13    @* try @code{example TestGRRes; example grsum; } from examples
    1314PROCEDURES:
    14        
     15
     16    grzero()        presentation of basering(0)^1
     17    grobj(M,w)      construct a graded module object
     18    grshift(M,d)    shift graded module M by d
     19    grtwist(r,d)    presentation of basering(d)^r
     20    grsum(M,N)      direct sum of two graded modules M \oplus N
     21    grpower(M,p)    direct p-th power of graded module M
    1522    grview(M)       view the graded structure of M
    1623    grdeg(M)        compute graded degrees of M   
     
    2229@*
    2330[MO]   Motsak, O.: Non-commutative Computer Algebra with applications: Graded commutative algebra and related
    24        structures in Singular with applications, Ph.D. thesis, TU Kaiserslautern, 2010?
     31       structures in Singular with applications, Ph.D. thesis, TU Kaiserslautern, 2010 TODO!?
    2532";
    26 
    2733
    2834//////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    3541static proc pad(int m, string s, string c){ string r = s; while( size(r) < m ){ r = c + r; } return(r); }
    3642static proc mstring( int m, string c){ if( m < 0 ) { return (c); }; return (string(m)); }
     43static proc zstring( int m, int b, string c){ if(b) { return (c); }; return (string(m)); }
    3744// view helper
    38 static proc draw ( intmat D, int d )
     45static proc draw ( intmat D, intvec zc, int d )
    3946{
    4047//  print(D); return ();
     
    4855  {
    4956    head = head + pad(max, string(D[1 , c]), " ") + " ";
    50     foot = foot + pad(max, string(D[nr, c]), " ") + " ";
     57    foot = foot + pad(max, zstring(D[nr, c], zc[c - d], "?"), " ") + " ";
    5158  }
    5259  // last head/foot enties:
    53   head = head + pad(max, string(D[1 , nc-d]), " ");
    54   foot = foot + pad(max, string(D[nr, nc-d]), " ");
     60  head = head + pad(max, string(D[1 , c]), " ");
     61  foot = foot + pad(max, zstring(D[nr, c], zc[c-d], "?"), " ");
    5562  // head/foot dash lines:
    5663  string dash  = repeat( (max + 1) * (nc - 2*d) , "-");
     
    7784"
    7885{
    79   if( size(N) == 0 ) { return (); }
     86//  if( size(N) == 0 ) { return (); }
    8087 
    8188  if( typeof( N ) == "list" )
     
    102109 
    103110  module L = module(N); L = lead(L); vector v;
    104   int m = 1 + nvars(basering);
     111  int m = 1 + nvars(basering);
     112  intvec zc = 0:nc;
    105113  for( c = nc; c > 0; c-- )
    106114  {
    107115    D[1, c+d] = c; // top row indeces
    108116    v = L[c];
    109     D[nr+2*d, c+d] = deg(v) + gr[ leadexp(v)[m] ]; // bottom row with computed column induced degrees
     117    if( v != 0 )
     118    {
     119      D[nr+2*d, c+d] = deg(v) + gr[ leadexp(v)[m] ]; // bottom row with computed column induced degrees
     120    } else
     121    {
     122//      D[nr+2*d, c+d] = 0; // TODO: 0/-1 is valid :(
     123      zc[c] = 1;
     124    }
    110125  }
    111126 
     
    115130    for( c = nc; c > 0; c-- )
    116131    {
    117       D[r+d, c+d] = deg(M[r, c]); // central block with degrees
    118 //      if( D[r+d, c+d] < 0 ) { D[r+d, c+d] = 0; }
     132      D[r+d, c+d] = deg(M[r, c]); // central block with degrees (-1 means zero entry)
    119133    }
    120134    D[r+d, nc+2*d] = r; // right-most block with indeces
    121135  }
    122   draw(D, d); // print it nicely!
     136  draw(D, zc, d); // print it nicely!
    123137}
    124138
     
    126140static proc issorted( intvec g, int s )
    127141{
     142  g = s * g; //  "g: ", g;
    128143  int i = size(g);
    129144
    130145  for(; i > 1; i--)
    131146  {
    132     if( s*(g[i] - g[i-1]) < 0 )
     147    if( (g[i] - g[i-1]) < 0 )
    133148    {
    134149      return (0);
     
    144159"
    145160{
     161  gr = s * gr;
    146162  int m = size(gr);
    147 
    148163  intvec pivot;
    149164
     
    162177    for(Bn=1; Bn <= (m-Bi); Bn++)
    163178    {
    164       D = s*(gr[pivot[Bn]] - gr[pivot[Bn+1]]); // sort gr
     179      D = (gr[pivot[Bn]] - gr[pivot[Bn+1]]); // sort gr
    165180      P = (D > 0) or ( (D == 0) && ((pivot[Bn]-pivot[Bn+1]) > 0) ); // stability!?
    166181      if(P)
     
    175190  }
    176191
    177   ASSUME(1, issorted(gr, s));
    178192
    179193  if( flag && 0 ) // output details in case of non-identical permutation?
    180194  {
    181195    // grades & ordering permutation : gr[pivot] should be sorted:
    182     "";
     196    "s: ", s;
     197    "gr: ", gr;
    183198    "pivot: ",    pivot;
    184     "";
    185   }
     199  }
     200
     201  ASSUME(1, issorted(intvec(gr[pivot]), 1));
    186202
    187203  return (pivot);
     
    217233  def w = attrib(M, "isHomog"); // grading weights?
    218234  ASSUME(0, /* input must be correctly graded! */ nrows(M) == size(w) );   
    219  
     235
     236  if( size(M) == 0 )  {    return (w);  } // TODO???
     237
    220238  int m = ncols(M); // m > 0 in Singular!
    221   int n = nvars(basering) + 1; // index of mod. column in the leadexp 
     239  int n = nvars(basering) + 1; // index of mod. column in the leadexp
    222240
    223241  module L = lead(M[1..m]); // leading module-terms for input column vectors
    224   intvec d = deg(L[1..m]); // their degrees
     242  intvec d = deg(L[1..m]); // their degrees 
    225243  intvec c = leadexp(L[1..m])[n]; // their module-components
    226   intvec gr = w[c]; // weights
     244 
     245  w = intvec(-6665, w); // 0?????
     246  intvec gr = w[1+c]; // weights
    227247 
    228248  gr = gr + d; // finally we compute their graded degrees
     
    286306
    287307  // grades & ordering permutation for N.  d[p] should be sorted!
    288 
    289   def N = module(M[p]);  // reorder the starting ideal/module
    290 
    291   attrib( N, "isHomog", w ); // set the grading
     308 
     309  def N = grobj(module(M[p]), w);  // reorder the starting ideal/module
    292310
    293311  d = d[p];
     
    401419//      grview(M[i]);
    402420      L[j] = grtranspose(M[i]);
    403       if( i > 1 )
     421//      grview(L[j]);
     422
     423      if( (i > 1) && (j > 0) )
    404424      {
    405         ASSUME(2, size( module( matrix(L[j+1])*matrix(L[j]) ) ) == 0 );
     425//        grview(L[j+1]);
     426        ASSUME(2, size( module( matrix(L[j])*matrix(L[j+1]) ) ) == 0 );
    406427      };
    407428//      grview(L[j]);
     
    421442 else              { (N,d) = reorder(M, -1); }
    422443
    423  kill M; module M = transpose(N);
    424  attrib( M, "isHomog", -d ); // set the grading
     444 kill M; module M = grobj(transpose(N), -d);
    425445
    426446// "b";  grview(M);
     
    429449 // reverse order:
    430450 (N,d) = reorder(M, 1); kill M;
    431 
    432 /*
    433  module M = transpose(N);
    434  attrib( M, "isHomog", -d ); // set the grading
    435 
    436 // "c";  grview(M);
    437  
    438  kill N,d; module N; intvec d;
    439  // reverse order:
    440  (N,d) = reorder(M, -1); kill M;
    441  module M = transpose(N);
    442  attrib( M, "isHomog", -d ); // set the grading
    443 
    444 // "d";  grview(M);
    445  
    446  kill N,d; module N; intvec d;
    447  // reverse order:
    448  (N,d) = reorder(M, 1);
    449  
    450  kill M;
    451 */
    452451
    453452// "e"; grview( N );
     
    506505  if( size(#) > 0 ) { (N,d) = reorder(M, 1, #[1]); }
    507506  else              { (N,d) = reorder(M, 1); } 
    508   kill M; module M = transpose(N);
    509   attrib( M, "isHomog", -d ); // set the grading
     507  kill M; module M = grobj(transpose(N), -d);
    510508
    511509// "b";  grview(M);
     
    515513  (N,d) = reorder(M, -1); kill M;
    516514 
    517   module M = transpose(N);
    518   attrib( M, "isHomog", -d ); // set the grading
     515  module M = grobj(transpose(N), -d);
    519516
    520517// "c";  grview(M);
     
    561558}
    562559example
    563 { "EXAMPLE:"; echo = 2; int assumeLevel = 5;
     560{ "EXAMPLE:"; echo = 2;
     561  if( defined(assumeLevel) ){ int assumeLevel0 = assumeLevel; } else { int assumeLevel; export(assumeLevel); }  // store the state of aL
     562  assumeLevel = 5;
    564563
    565564  string Name = "castelnuovo"; int @p=31991; ring R = (@p),(x,y,z,u,v), dp;ideal I = 5153xy2-98/23y3-101/51xyz+33/41y2z+99/79xz2+7136yz2-106/111z3+119/53xyu+34/57y2u-77/92xzu+84/73yzu-109/78z2u-27/56xu2+10023yu2+82/103zu2-34/25u3+3/2xyv-68/25y2v+12721xzv+4/63yzv-73/21z2v-7291xuv-91/53yuv-4/79zuv-34/91u2v-122/53xv2+123/70yv2-64/73zv2+44/65uv2+14/31v3,xy2-15202y3+10613xyz+13640y2z-107/103xz2+5292yz2+19/119z3-10042xyu+2770y2u+7957xzu+14008yzu+92/121z2u-92/51xu2+1178yu2+1/117zu2-12726u3+82/101xyv-92/17y2v-107/56xzv+14233yzv+79/28z2v+51/50xuv-31/5yuv+95/91zuv+19/108u2v+12151xv2-69/110yv2+37/89zv2-63/116uv2-88/23v3,-5153x2+37/23xy+8706y2-13160xz+68/115yz+5548z2-22/61xu-113/98yu+11818zu+2114u2-101/97xv+89/22yv-3355zv-113/5uv-5521v2;TestGRRes(Name, 2, I); kill R, Name, @p;  "";
     
    582581
    583582  string Name = "rat.d10.g9.quart2"; int @p=31991; ring R = (@p),(x,y,z,u,v), dp;ideal I = x3yu2-48/11x2y2u2-8356xy3u2+35/121y4u2+31/66x3zu2-54/83x2yzu2-61/18xy2zu2+11526y3zu2+7372x2z2u2-91/60xyz2u2-95/97y2z2u2-45/71xz3u2+71/115yz3u2+25/54z4u2-61/102x3u3-12668x2yu3+6653xy2u3+41/54y3u3+87/50x2zu3-5004xyzu3+13924y2zu3+2310xz2u3-93/14yz2u3-2/93z3u3-97/125x2u4-58/11xyu4+46/73y2u4-4417xzu4+60/101yzu4+56/75z2u4-113/118xu5+115/4yu5-40zu5-8554u6-54/83x3yuv-9770x2y2uv-590xy3uv+15/49y4uv+94/69x3zuv+121/105x2yzuv+95/88xy2zuv+3186y3zuv+11/6x2z2uv-44/81xyz2uv+637y2z2uv+109/121xz3uv-33yz3uv-94/115z4uv-49/95x3u2v-11/109x2yu2v+45/113xy2u2v+97/84y3u2v+5257x2zu2v+99/49xyzu2v+12584y2zu2v-4294xz2u2v+1137yz2u2v-58/69z3u2v-4749x2u3v+120/97xyu3v-31/103y2u3v+62/97xzu3v-107/74yzu3v+53/59z2u3v+91/33xu4v+1291yu4v+23/34zu4v+58/77u5v+16/17x3yv2-750x2y2v2+86/89xy3v2+123/46y4v2+53/123x3zv2-61/99x2yzv2+12389xy2zv2+10419y3zv2+43/11x2z2v2-146xyz2v2-116/51y2z2v2+13/62xz3v2-5524yz3v2-111/118z4v2-56/55x3uv2-3038x2yuv2+14/27xy2uv2-43/64y3uv2+3385x2zuv2+25/11xyzuv2+92/41y2zuv2+28/113xz2uv2-2049yz2uv2+89/37z3uv2-13094x2u2v2-2774xyu2v2+15474y2u2v2-15791xzu2v2-71/116yzu2v2+77/41z2u2v2-83/68xu3v2-33/106yu3v2+71/37zu3v2-41/17u4v2+12052x3v3+1906x2yv3+13825xy2v3+80/7y3v3-125/96x2zv3-9661xyzv3+85/116y2zv3-72/91xz2v3+13/112yz2v3-126/97z3v3-1637x2uv3+34/103xyuv3+3844y2uv3+77/10xzuv3+6359yzuv3-11185z2uv3-124/121xu2v3+66/91yu2v3-14636zu2v3-1051u3v3+9/64x2v4-12924xyv4-119/41y2v4+74/23xzv4+1622yzv4+73/37z2v4-60/101xuv4+111/22yuv4-45/124zuv4+59/37u2v4-66/37xv5-71/99yv5+12409zv5-113/64uv5-5267v6,-x4y-22/79x3y2-125/42x2y3-116/7xy4+98/111y5-31/66x4z-118/75x3yz+110/93x2y2z-43/92xy3z-788y4z-7372x3z2-2701x2yz2-67/124xy2z2-117/62y3z2+45/71x2z3-8396xyz3-10343y2z3-25/54xz4+30/59yz4+61/102x4u+11736x3yu+12726x2y2u+41/118xy3u-15832y4u-87/50x3zu-130x2yzu+41/8xy2zu-10300y3zu-2310x2z2u-101/5xyz2u+6205y2z2u+2/93xz3u+8679yz3u+97/125x3u2-43/37x2yu2-39/80xy2u2+12139y3u2+4417x2zu2+4294xyzu2+11/58y2zu2-56/75xz2u2+8338yz2u2+113/118x2u3-10190xyu3-37/16y2u3+40xzu3+74/23yzu3+8554xu4+115/22yu4-39/79x4v+61/72x3yv+8048x2y2v-9201xy3v+16/121y4v+113/93x3zv+109/75x2yzv+12700xy2zv-10607y3zv+50/11x2z2v+1223xyz2v-103/79y2z2v-123/58xz3v+31/26yz3v-15/122z4v+122/25x3uv-99/17x2yuv+1723xy2uv-38/121y3uv+11016x2zuv-25/102xyzuv-14970y2zuv-61/6xz2uv-14981yz2uv+15900z3uv+3268x2u2v-75/19xyu2v-1436y2u2v-1764xzu2v-57/41yzu2v+12741z2u2v-14615xu3v+119/61yu3v-115/119zu3v+10501u4v-8502x3v2-51/76x2yv2-6281xy2v2+17/49y3v2-106/7x2zv2+63/101xyzv2-27/95y2zv2-1606xz2v2+9245yz2v2+1912z3v2+11155x2uv2+223xyuv2-13/18y2uv2+110/43xzuv2+76/81yzuv2-6291z2uv2+1400xu2v2-95/23yu2v2-9701zu2v2+106/105u3v2+72/47x2v3-13118xyv3+14409y2v3+37/86xzv3+44/69yzv3-325z2v3+113/71xuv3+16/81yuv3+6/19zuv3-119/39u2v3-89/9xv4+72/53yv4+112/55zv4-8587uv4-6604v5,-x3y2+48/11x2y3+8356xy4-35/121y5-12750x3yz+100/111x2y2z+45/74xy3z+99/74y4z-6/7x3z2-47/67x2yz2+11465xy2z2-11865y3z2+7776x2z3+124/45xyz3-98/115y2z3+117/85xz4-59/120yz4-8748z5+61/102x3yu+12668x2y2u-6653xy3u-41/54y4u+13408x3zu-2185x2yzu-1240xy2zu+1161y3zu+44/27x2z2u-11164xyz2u-13388y2z2u-107/13xz3u+90/71yz3u+4204z4u+97/125x2yu2+58/11xy2u2-46/73y3u2+55/48x2zu2+121/31xyzu2+126/61y2zu2-55/69xz2u2+5988yz2u2+3755z3u2+113/118xyu3-115/4y2u3+3390xzu3-5762yzu3+30/61z2u3+8554yu4-14317zu4+99/116x3yv-113/119x2y2v+50/23xy3v-37/79y4v-8668x3zv+14049x2yzv+111/35xy2zv+61/28y3zv-10171x2z2v+68/21xyz2v+2023y2z2v-9/109xz3v+8520yz3v-2683z4v-13547x3uv+28/65x2yuv-5988xy2uv+61/111y3uv+12314x2zuv+29/44xyzuv+6141y2zuv+11280xz2uv+79/22yz2uv-38/111z3uv+19/51x2u2v+5093xyu2v-10291y2u2v-5009xzu2v-111/49yzu2v+3813z2u2v-61/37xu3v+15914yu3v-3218zu3v-12915u4v-118/101x3v2-7/57x2yv2+13128xy2v2+11606y3v2+42/101x2zv2-54/17xyzv2-43/49y2zv2-119/110xz2v2+9742yz2v2-43/4z3v2-55/8x2uv2-29/88xyuv2+12042y2uv2+101/37xzuv2-57/62yzuv2+106/97z2uv2+38/83xu2v2+8152yu2v2-5492zu2v2-47/79u3v2+15112x2v3+69/44xyv3-6/71y2v3+113/54xzv3-13210yzv3-707z2v3-119/8xuv3+3845yuv3-19/20zuv3+4852u2v3+15761xv4-12372yv4+74/69zv4-2100uv4-12833v5,-x3yz+48/11x2y2z+8356xy3z-35/121y4z-31/66x3z2+54/83x2yz2+61/18xy2z2-11526y3z2-7372x2z3+91/60xyz3+95/97y2z3+45/71xz4-71/115yz4-25/54z5+15/52x3yu+6039x2y2u+74/99xy3u-17/40y4u+29/50x3zu-7775x2yzu+6368xy2zu+14170y3zu+52/41x2z2u+7003xyz2u-5787y2z2u-101/37xz3u-23/28yz3u-20/63z4u+41/77x3u2+8650x2yu2-15922xy2u2-16/83y3u2+7278x2zu2+31/30xyzu2-2/107y2zu2+35/122xz2u2+85/58yz2u2-757z3u2+2/101x2u3+86/17xyu3+95/59y2u3+123/22xzu3-6869yzu3-9311z2u3-105/97xu4+5699yu4+15925zu4+13528u5-154x3yv+4187x2y2v+56/107xy3v-15932y4v-5137x3zv-37/56x2yzv+9401xy2zv+92/123y3zv-79/97x2z2v+9201xyz2v+19/53y2z2v+107/20xz3v+17/77yz3v-15306z4v+3215x3uv-79/117x2yuv-9/76xy2uv-6352y3uv+93/13x2zuv-65/89xyzuv-115/4y2zuv-34/57xz2uv+39/107yz2uv+31/9z3uv+107/48x2u2v+2632xyu2v+29/96y2u2v-125/89xzu2v+29/113yzu2v+3940z2u2v-116/111xu3v+6145yu3v-105/62zu3v+101/17u4v-9281x3v2-49/107x2yv2-12154xy2v2+4/19y3v2-114/71x2zv2-15/118xyzv2+4372y2zv2+45/121xz2v2+46/111yz2v2+6614z3v2+17x2uv2+10806xyuv2-10617y2uv2-25/111xzuv2-116/27yzuv2-7/58z2uv2-686xu2v2+3/13yu2v2-17/49zu2v2-40/107u3v2+47/90x2v3-83/43xyv3-6326y2v3+49/64xzv3+113/76yzv3-122/73z2v3+10232xuv3-116/109yuv3-1990zuv3+70/51u2v3-118/19xv4-27/55yv4+21/19zv4-23/57uv4-11721v5,-3399x4y+1849x3y2-3/29x2y3+28/87xy4+10/29y5-9788x4z-49/73x3yz+13829x2y2z+118/73xy3z+13129y4z-618x3z2+92/13x2yz2+101/117xy2z2-162y3z2+24/5x2z3-29/74xyz3+2687y2z3-74/39xz4+2/57yz4+68/73x4u-13787x3yu-11659x2y2u+14729xy3u+92/53y4u+15/71x3zu-62/15x2yzu+21/85xy2zu+4938y3zu-120/37x2z2u-77/102xyz2u-4785y2z2u-83/70xz3u-12128yz3u-13592z4u-123/20x3u2+2607x2yu2+40/19xy2u2+6361y3u2-3091x2zu2+89/113xyzu2+149y2zu2-2890xz2u2-8374yz2u2+11886z3u2-49/43x2u3-9854xyu3-6943y2u3+10743xzu3-122/45yzu3-13902z2u3-103/19xu4-48/59yu4+27/86zu4+46/35u5-117/17x4v-15/7x3yv+8409x2y2v-83/28xy3v+86/35y4v+37/45x3zv+4/3x2yzv+35/38xy2zv+4015y3zv-49/111x2z2v-1260xyz2v-25/33y2z2v+116/19xz3v+93/8yz3v+5755z4v-25/89x3uv-11669x2yuv-64/107xy2uv+2993y3uv+7767x2zuv-17/95xyzuv-103/80y2zuv-14576xz2uv+80/47yz2uv+25/107z3uv+103/2x2u2v+125/117xyu2v-2/89y2u2v-5298xzu2v-50/27yzu2v-71/53z2u2v+2652xu3v+15761yu3v+2124zu3v+11/82u4v+100/63x3v2+4180x2yv2+11/39xy2v2-1221y3v2+108/125x2zv2+97/126xyzv2-7698y2zv2+13984xz2v2+1342yz2v2-84/121z3v2-26/73x2uv2-14/15xyuv2-22/37y2uv2-71/82xzuv2+12430yzuv2+103/52z2uv2-13095xu2v2+10114yu2v2-8/73zu2v2-33/97u3v2+83/105x2v3+22/45xyv3-7961y2v3-9654xzv3-54/55yzv3-3/71z2v3-10148xuv3-117/98yuv3+101/102zuv3-606u2v3+97/43xv4-68/21yv4+63/16zv4+42/17uv4+5834v5,-3399x3y2-32/113x2y3+14/99xy4+15001y5-121/115x3yz+4604x2y2z+7/2xy3z+9532y4z-3267x3z2+97/118x2yz2-14238xy2z2-80/21y3z2-12332x2z3-19/69xyz3+116/15y2z3-103/32xz4+15340yz4+10509z5+112/109x3yu-97x2y2u-40/11xy3u+90/29y4u-95/106x3zu-114/67x2yzu+113/48xy2zu+12080y3zu-44x2z2u+18/17xyz2u-4814y2z2u-103/100xz3u-96/61yz3u-205z4u-87/82x3u2-97/108x2yu2+3230xy2u2+104/83y3u2+41/86x2zu2+116/49xyzu2-59/110y2zu2+14/59xz2u2-6962yz2u2-2185z3u2+59/91x2u3+2497xyu3+3/37y2u3-13010xzu3+6/83yzu3-11448z2u3+13/72xu4-69/62yu4-2869zu4+23/73u5-20/43x3yv+5074x2y2v+28/125xy3v-2706y4v+13010x3zv-17/109x2yzv+21/4xy2zv+59/93y3zv-2406x2z2v+117/11xyz2v-14978y2z2v+70/89xz3v-33/7yz3v-13676z4v-13690x3uv+9825x2yuv-117/107xy2uv+12760y3uv-93/98x2zuv-113/64xyzuv+113/103y2zuv-9748xz2uv+11016yz2uv-10729z3uv+90/13x2u2v-13/47xyu2v-11/39y2u2v+20/69xzu2v+5531yzu2v+125/49z2u2v-11025xu3v-9621yu3v+113/109zu3v+4710u4v-107/7x3v2+110/119x2yv2-10025xy2v2-6644y3v2-5041x2zv2+5/96xyzv2+11472y2zv2-5128xz2v2+2927yz2v2+121/18z3v2-125/89x2uv2+12936xyuv2-71/47y2uv2+34/47xzuv2-75/103yzuv2-2654z2uv2-2350xu2v2-7707yu2v2+47/72zu2v2-952u3v2-21/67x2v3+58/37xyv3-8757y2v3+3615xzv3+44/123yzv3-13027z2v3-9/10xuv3+75/43yuv3+115/18zuv3+8071u2v3-26/3xv4-67/65yv4+14186zv4-41/122uv4+33/28v5,-3399x3yz-32/113x2y2z+14/99xy3z+15001y4z-9788x3z2+37/96x2yz2+7743xy2z2+31/55y3z2-618x2z3-8171xyz3+82/109y2z3+24/5xz4+88/85yz4-74/39z5-13165x3yu+3407x2y2u-12509xy3u-23/45y4u-11774x3zu-10/67x2yzu+69/79xy2zu-10/123y3zu-7636x2z2u+83/32xyz2u+51/112y2z2u+19/8xz3u+9309yz3u-44/49z4u+4089x3u2-374x2yu2-919xy2u2+98/107y3u2+2776x2zu2+85/26xyzu2+31/13y2zu2-103/82xz2u2+35/76yz2u2+59/45z3u2+2950x2u3+27/44xyu3+88/71y2u3+7/114xzu3-72/77yzu3+12917z2u3-34/67xu4-85/82yu4-55/84zu4+4690u5+11/42x3yv-19/125x2y2v-8288xy3v+9199y4v-12929x3zv+13357x2yzv-4903xy2zv-584y3zv-10/33x2z2v+59/113xyz2v+103/92y2z2v+101/69xz3v+8708yz3v-8/7z4v+13560x3uv-43/49x2yuv-121/98xy2uv+75/79y3uv-39x2zuv-88/69xyzuv-89/78y2zuv+110/67xz2uv+61/4yz2uv-98/45z3uv+82/7x2u2v-85/41xyu2v+6548y2u2v+9367xzu2v-59/81yzu2v-14408z2u2v+2363xu3v-80/11yu3v-50/17zu3v-14799u4v-53/21x3v2+9437x2yv2-117/80xy2v2+81/85y3v2-8/45x2zv2-6428xyzv2+15126y2zv2+68/89xz2v2+7/122yz2v2+9639z3v2+113/4x2uv2-8678xyuv2-104/45y2uv2-79/90xzuv2+39/101yzuv2-7234z2uv2-28/43xu2v2+1251yu2v2-97/56zu2v2+17/41u3v2+107/24x2v3+2747xyv3+9933y2v3-4199xzv3+53/83yzv3+6364z2v3-5456xuv3+618yuv3-123/55zuv3+2375u2v3+63/76xv4-115/106yv4-8811zv4-31/75uv4+10/109v5,13/89x4y+77/31x3y2+36/83x2y3-11411xy4+6936y5-12223x4z+7400x3yz+33/118x2y2z-12146xy3z+108/79y4z+82/99x3z2-9877x2yz2-79/70xy2z2-19/123y3z2-1491x2z3+7953xyz3-43/126y2z3+60/17xz4+98/57yz4-13317x4u-77/27x3yu-6811x2y2u-69/61xy3u+6144y4u+5404x3zu+121/120x2yzu-91/23xy2zu-71/106y3zu+1435x2z2u-120/13xyz2u-12019y2z2u-68/7xz3u-113/82yz3u+11526z4u-8706x3u2-89/53x2yu2-14804xy2u2+120/107y3u2+71/94x2zu2-1/70xyzu2+1532y2zu2+4470xz2u2+13/60yz2u2-115/102z3u2-82/21x2u3+27/121xyu3-4439y2u3-101/47xzu3-3186yzu3-106/101z2u3-10169xu4+19/58yu4-96/73zu4-7959u5-10526x4v-107/92x3yv+47/6x2y2v-23/43xy3v-69/62y4v+59/65x3zv-28/95x2yzv+5479xy2zv-39/77y3zv+11/69x2z2v-11713xyz2v+43/79y2z2v-15602xz3v+16/73yz3v-13952z4v+61/82x3uv-2219x2yuv-91/106xy2uv+5/37y3uv-148x2zuv+31/51xyzuv+18/101y2zuv+97/68xz2uv-73/32yz2uv+47/2z3uv+2/41x2u2v-13009xyu2v-7/60y2u2v+15779xzu2v+72/7yzu2v-11/73z2u2v-119/44xu3v-9067yu3v+3249zu3v+61/51u4v+12525x3v2-118/9x2yv2-3270xy2v2-4/25y3v2-5075x2zv2+77/40xyzv2-89/65y2zv2+17/58xz2v2-15609yz2v2+95/54z3v2-75/79x2uv2-4907xyuv2+12418y2uv2-57/17xzuv2-8746yzuv2+13/95z2uv2-124/67xu2v2+16/13yu2v2+28/23zu2v2-10847u3v2-645x2v3+106/75xyv3+6/115y2v3-8495xzv3+58/35yzv3-9398z2v3-101/72xuv3-71/20yuv3-124/65zuv3-8971u2v3+27/28xv4+12/29yv4-4276zv4+10858uv4+29/12v5,13/89x3y2+12068x2y3-15543xy4-77/79y5+6626x3yz+64/53x2y2z-6/23xy3z-47/125y4z+14403x3z2-43/78x2yz2-31/115xy2z2+94/59y3z2-118/117x2z3-11229xyz3+2268y2z3-116/85xz4+25/58yz4+3085z5+59/27x3yu+67/82x2y2u+11/6xy3u+103/47y4u-63/80x3zu-81/47x2yzu+7760xy2zu-115/56y3zu-10/17x2z2u+101/5xyz2u+15634y2z2u+1/107xz3u-9282yz3u+43/62z4u+62/55x3u2+100/113x2yu2-9205xy2u2-46/13y3u2+43/96x2zu2+10159xyzu2+692y2zu2+859xz2u2-19/74yz2u2+123/47z3u2-9/20x2u3-11391xyu3-2375y2u3+109/24xzu3-57/53yzu3-925z2u3-82/45xu4+97/34yu4+13/82zu4-108/29u5+63/10x3yv+38/17x2y2v-19/115xy3v+3150y4v+22/69x3zv+26/57x2yzv+110/27xy2zv+87/77y3zv+85/18x2z2v+39/47xyz2v-48/17y2z2v-7/27xz3v-13/100yz3v-11662z4v-17/8x3uv+37/11x2yuv+29/11xy2uv-109/88y3uv-2817x2zuv-61/44xyzuv+10/31y2zuv+10010xz2uv+51/86yz2uv-97/83z3uv-89/96x2u2v+4030xyu2v-58/77y2u2v-114/43xzu2v-37/10yzu2v-2011z2u2v+14483xu3v-109/101yu3v+121/102zu3v-79/92u4v+15113x3v2+10781x2yv2-14259xy2v2-113/48y3v2-7/94x2zv2-17/74xyzv2-5/117y2zv2-59/75xz2v2+13188yz2v2+103/43z3v2+4/125x2uv2-52/59xyuv2+85/92y2uv2-1/46xzuv2-9106yzuv2-83/11z2uv2-23/94xu2v2+6742yu2v2-35/107zu2v2-14596u3v2-117/43x2v3+1026xyv3+90/19y2v3+14671xzv3-101/100yzv3+6962z2v3+61/68xuv3+108/37yuv3-4157zuv3-3974u2v3+15677xv4+8661yv4+8459zv4-16/23uv4-37/119v5,13/89x3yz+12068x2y2z-15543xy3z-77/79y4z-12223x3z2-13941x2yz2+115/84xy2z2+13/98y3z2+82/99x2z3+7751xyz3+122/17y2z3-1491xz4+1327yz4+60/17z5+15363x3yu+9780x2y2u+19/117xy3u-1924y4u-14600x3zu+46/41x2yzu-5466xy2zu-73/12y3zu+10838x2z2u-8302xyz2u-89/113y2z2u+53/69xz3u-9224yz3u+47/33z4u-7399x3u2+89/77x2yu2+9312xy2u2-41/80y3u2-732x2zu2-6781xyzu2-8608y2zu2-9270xz2u2-117/58yz2u2-115/68z3u2-48/31x2u3-9067xyu3+97/107y2u3+73/57xzu3-2719yzu3-110/59z2u3-37/86xu4-15796yu4-61/4zu4-115/72u5+6161x3yv+4134x2y2v+677xy3v-8375y4v+1150x3zv+1551x2yzv+4157xy2zv+112/87y3zv+8171x2z2v+6040xyz2v+15651y2z2v-7/66xz3v-47/61yz3v+77/64z4v+14848x3uv+48/119x2yuv-9534xy2uv-117/95y3uv+5/4x2zuv+122xyzuv+90/31y2zuv-41/26xz2uv+31/30yz2uv-10428z3uv-9896x2u2v-71/21xyu2v-55/38y2u2v-29/22xzu2v-11092yzu2v+39/122z2u2v+93/73xu3v+22/49yu3v-21/106zu3v+56u4v+8565x3v2-1695x2yv2+2/17xy2v2+1/78y3v2-113/71x2zv2-41/100xyzv2+55/14y2zv2+15286xz2v2+17/53yz2v2+126/71z3v2-79/87x2uv2+109/97xyuv2-28/31y2uv2-6533xzuv2+22/5yzuv2-10449z2uv2+10830xu2v2-15516yu2v2+28/57zu2v2-81/22u3v2+4198x2v3+5667xyv3-7133y2v3-8408xzv3+11066yzv3-26/125z2v3-808xuv3+95/54yuv3-64/17zuv3-5267u2v3-15333xv4+42/89yv4+63/85zv4+119/113uv4-2011v5,5583x4y+1725x3y2-8652x2y3-91/25xy4-8495x4z-13731x3yz+9298x2y2z-41/111xy3z-15503y4z-13805x3z2+3962x2yz2-2/63xy2z2+3314y3z2+2522x2z3-10/87xyz3-408y2z3+7/16xz4+69/22yz4-7254z5-59/21x4u+115/7x3yu-1718x2y2u+7851xy3u+2632y4u-82/3x3zu+37/86x2yzu+101/113xy2zu+6747y3zu-109/113x2z2u+7399xyz2u+24/103y2z2u+89/9xz3u-14630yz3u+15066z4u-12561x3u2+113/115x2yu2+87/97xy2u2-126/67y3u2-48/7x2zu2+123/103xyzu2-11/107y2zu2-2747xz2u2+8158yz2u2-3/107z3u2+41/6x2u3+12767xyu3+3873y2u3+74/83xzu3-55/119yzu3-24/83z2u3+55xu4-7/95yu4+57/44zu4+2/101u5-6928x4v-121/57x3yv+111/104x2y2v+946xy3v-29y4v+3057x3zv-14/25x2yzv+43/31xy2zv-105/2y3zv+2336x2z2v+61/77xyz2v-7880y2z2v+5/58xz3v+10593yz3v+7094z4v+63/59x3uv-5/69x2yuv-11/81xy2uv-4157y3uv+73/65x2zuv-1676xyzuv-2376y2zuv-85/63xz2uv-95/2yz2uv-14903z3uv-119/110x2u2v-115/24xyu2v+125/9y2u2v+106/87xzu2v-13/12yzu2v-4/19z2u2v+7838xu3v-43/111yu3v+7/113zu3v-12500u4v+7743x3v2-2023x2yv2-85/83xy2v2+49/41y3v2+20/87x2zv2+3932xyzv2-77/6y2zv2+47/90xz2v2-15580yz2v2+39/4z3v2-61/8x2uv2+2518xyuv2+29/98y2uv2+11057xzuv2-18/107yzuv2+708z2uv2+14720xu2v2-3175yu2v2-113/59zu2v2-14735u3v2+7/69x2v3-4029xyv3+54/91y2v3+12372xzv3+67/2yzv3+8856z2v3-2178xuv3+995yuv3+64/95zuv3+4039u2v3-37/44xv4+23/17yv4-3035zv4-103/124uv4+69/64v5,-5583x3y2-1725x2y3+8652xy4+91/25y5+6201x3yz-73/49x2y2z-3844xy3z+10548y4z-11057x3z2-105/122x2yz2+31/53xy2z2+79/89y3z2-24/101x2z3+107/119xyz3-126y2z3+8164xz4+2/77yz4-51/8z5-14941x3yu-106x2y2u+8695xy3u+125/62y4u+4328x3zu+29/117x2yzu-6249xy2zu-2791y3zu+67/49x2z2u-38/29xyz2u+122/41y2z2u+10603xz3u-3029yz3u+5578z4u+14754x3u2-108/79x2yu2+4408xy2u2-12401y3u2-1426x2zu2-1741xyzu2-83/86y2zu2+79/95xz2u2+122/121yz2u2+81/2z3u2-1172x2u3-41/68xyu3-70/3y2u3+24/107xzu3+120/79yzu3+18/119z2u3-65/122xu4+1018yu4+22/107zu4+15189u5+5/8x3yv-12060x2y2v+3/62xy3v-227y4v+60/41x3zv-123/115x2yzv+110/123xy2zv+12864y3zv-86/121x2z2v-69/94xyz2v+14/79y2z2v+118/45xz3v+10842yz3v-37/58z4v+100/69x3uv-47/65x2yuv-7/67xy2uv-93/100y3uv-6262x2zuv-4/75xyzuv+2082y2zuv-9117xz2uv+12450yz2uv-84/67z3uv+123/26x2u2v-51/89xyu2v+19/74y2u2v-104/77xzu2v+318yzu2v+12402z2u2v+95/8xu3v-81/26yu3v-4486zu3v+3872u4v+72/91x3v2-83/63x2yv2+93/92xy2v2-15924y3v2-53/62x2zv2+6046xyzv2+1408y2zv2+60/107xz2v2-1150yz2v2-126/19z3v2-7429x2uv2+2554xyuv2+3602y2uv2+10738xzuv2-57/64yzuv2+86/69z2uv2+8172xu2v2+91/113yu2v2+92/65zu2v2+118/37u3v2+47/83x2v3+12750xyv3+10851y2v3+4216xzv3+6/101yzv3-108z2v3+2920xuv3-101/102yuv3-157zuv3+7742u2v3-7234xv4-2/111yv4+59/33zv4-93/91uv4+24/19v5,1592x4y+75/121x3y2+40/19x2y3-2651xy4+9934x4z+245x3yz+11665x2y2z+30/41xy3z+1823y4z+89/88x3z2-105/46x2yz2+79/58xy2z2-4191y3z2-76/61x2z3-21/32xyz3-9516y2z3-14896xz4-85/77yz4+51/109z5+61/30x4u-10/101x3yu+11796x2y2u+76/101xy3u+123/88y4u-5932x3zu-11857x2yzu+7128xy2zu-45/79y3zu+119/18x2z2u+9/74xyz2u+7042y2z2u-1114xz3u-11/82yz3u-1466z4u-6/85x3u2+27/106x2yu2+14246xy2u2-6216y3u2+47/6x2zu2-45/59xyzu2+89/41y2zu2+41/80xz2u2-7583yz2u2-75/113z3u2-14808x2u3-10873xyu3-90/67y2u3-11081xzu3-7369yzu3-7131z2u3-1402xu4-15386yu4-108/73zu4-5039u5+120/113x4v+10617x3yv-50/87x2y2v-2395xy3v-20/69y4v-8587x3zv+12960x2yzv-41/50xy2zv-13844y3zv-65/32x2z2v-77/122xyz2v-85/66y2z2v+13/100xz3v-20/51yz3v-13676z4v+76/97x3uv+1046x2yuv-8059xy2uv-117/59y3uv-29/105x2zuv+7287xyzuv-107/119y2zuv-35/118xz2uv+79/86yz2uv-2211z3uv+5448x2u2v+62/35xyu2v-2275y2u2v+29/121xzu2v-1674yzu2v-56/43z2u2v-3377xu3v-43/110yu3v+23/10zu3v-24/61u4v+121/53x3v2-4745x2yv2-57/64xy2v2+9554y3v2-12741x2zv2+10449xyzv2+37/108y2zv2+8621xz2v2-11/57yz2v2+1566z3v2+125/49x2uv2-121/118xyuv2+109/84y2uv2-335xzuv2+10167yzuv2-59/109z2uv2-103/119xu2v2+43/13yu2v2-73/87zu2v2+2037u3v2+13002x2v3+83/48xyv3-10713y2v3+1026xzv3-105/64yzv3-37/6z2v3+14779xuv3-6448yuv3+19/69zuv3-1/110u2v3+10010xv4+79/12yv4+12/19zv4-35/61uv4-11/57v5,-1592x3y2-75/121x2y3-40/19xy4+2651y5+39/121x3yz+122/77x2y2z-114/31xy3z+1544y4z+2/3x3z2-10271x2yz2-8373xy2z2+56/61y3z2+55/48x2z3-116xyz3-25/7y2z3-108/113xz4-34/53yz4+5548z5-122x3yu-9690x2y2u+43/87xy3u-5/19y4u+97/54x3zu-17/19x2yzu+4355xy2zu+12/5y3zu-1/100x2z2u+12754xyz2u+13600y2z2u+17/45xz3u-12091yz3u+5145z4u-63/64x3u2-84/31x2yu2-97/41xy2u2+7/13y3u2-79/62x2zu2-80/103xyzu2-69/14y2zu2+119/4xz2u2-35/87yz2u2-13840z3u2+14101x2u3+7952xyu3-1857y2u3-9861xzu3+3180yzu3+75/107z2u3-250xu4-15134yu4+4717zu4-2/41u5+22/27x3yv-8983x2y2v+10520xy3v-113/2y4v+10/73x3zv-1986x2yzv-110/13xy2zv+1550y3zv+32/111x2z2v-111/35xyz2v+101/98y2z2v+8045xz3v-2/89yz3v+2924z4v-79/11x3uv-15178x2yuv+10874xy2uv+54/11y3uv-8950x2zuv+70/53xyzuv-2403y2zuv-8249xz2uv+6935yz2uv+20/89z3uv+885x2u2v-76/71xyu2v-4/17y2u2v-31/52xzu2v-4/99yzu2v+10333z2u2v-93/104xu3v+82/101yu3v-71/37zu3v+9397u4v-15/112x3v2-6614x2yv2+119/2xy2v2+88/119y3v2+306x2zv2+2790xyzv2+10992y2zv2-115/74xz2v2-14711yz2v2+11612z3v2-1788x2uv2-75/97xyuv2+79/30y2uv2+99/59xzuv2-11439yzuv2-121/113z2uv2+108/37xu2v2+37/36yu2v2-3/65zu2v2-55/42u3v2+13/100x2v3-209xyv3-1272y2v3-117/68xzv3+63/94yzv3+32/59z2v3+1013xuv3-3463yuv3+6946zuv3-37/86u2v3+67/117xv4+85/28yv4-3024zv4-82/9uv4-32/65v5,-35/52x4y-12140x3y2+23/83x2y3+69/5xy4-80/79y5+120/43x4z-11865x3yz-3487x2y2z+53/59xy3z+53/102y4z-14083x3z2-14430x2yz2-2442xy2z2-33/104y3z2-91/38x2z3+4/87xyz3-26/57y2z3+4097xz4-9/122yz4+6364z5+9634x4u-97/95x3yu-46/99x2y2u+3847xy3u+121/106y4u+12765x3zu-5292x2yzu+1607xy2zu-67/121y3zu-12/35x2z2u+4/55xyz2u-17/27y2z2u+91/122xz3u-23/31yz3u+65/49z4u+73/46x3u2-124/27x2yu2-9933xy2u2+46/75y3u2+53/114x2zu2+3503xyzu2-14147y2zu2-11283xz2u2+11889yz2u2+99/104z3u2+3117x2u3+12624xyu3-10060y2u3+2193xzu3-80/47yzu3-77/13z2u3+11/31xu4-47/90yu4+49/48zu4-2/105u5-92/61x4v+7443x3yv+35/76x2y2v+114/67xy3v-73/126y4v+97/107x3zv+9464x2yzv+10869xy2zv+15718y3zv-37/33x2z2v+124/13xyz2v-11/26y2z2v-61/40xz3v+91/100yz3v-18/103z4v+60/29x3uv+21/125x2yuv-11117xy2uv+11748y3uv-16/117x2zuv+18/103xyzuv-1711y2zuv+1872xz2uv-109/123yz2uv-18/113z3uv-26/103x2u2v+14140xyu2v+11065y2u2v+8686xzu2v-5/111yzu2v+30/101z2u2v-10501xu3v-36/113yu3v-73/74zu3v+12753u4v-43/52x3v2-76/15x2yv2-5793xy2v2+18/13y3v2+1/79x2zv2+84/23xyzv2-172y2zv2+86/77xz2v2+15/37yz2v2+11835z3v2-6482x2uv2+94/113xyuv2+10727y2uv2-102/41xzuv2+15914yzuv2-12973z2uv2-9038xu2v2-13107yu2v2+1533zu2v2+12549u3v2-13528x2v3+903xyv3+23/114y2v3-123/64xzv3-81/5yzv3+111/103z2v3+4734xuv3-33/20yuv3-7954zuv3-2478u2v3+15518xv4-6723yv4-14/31zv4-3482uv4+10919v5,-3/94x4y-12936x3y2+2/11x2y3+32/23xy4-15921y5+61/93x4z+82/111x3yz-93/2x2y2z-6659xy3z-97/90y4z+402x3z2-14586x2yz2-121/39xy2z2+68/7y3z2+1212x2z3-2980xyz3+49/52y2z3-72/89xz4+92/47yz4+8478z5+2733x4u-103/89x3yu+1166x2y2u-7/53xy3u-106/23y4u+677x3zu+907x2yzu+7891xy2zu-9014y3zu+76/47x2z2u+49/116xyz2u-49/78y2z2u+12261xz3u+118/105yz3u-126/13z4u-8812x3u2-97/120x2yu2-9534xy2u2+92/5y3u2-54/71x2zu2+94/103xyzu2+2256y2zu2+4182xz2u2-5798yz2u2-31/115z3u2-73/98x2u3+15822xyu3+1004y2u3-578xzu3+9494yzu3-6779z2u3+14506xu4+10/121yu4+58/27zu4-2817u5-19/119x4v+7128x3yv+75/64x2y2v-65/109xy3v+5129y4v-53/55x3zv+54/125x2yzv-3009xy2zv+6144y3zv+15601x2z2v+123/55xyz2v-58/77y2z2v-56/61xz3v+121/10yz3v-103/86z4v-93/25x3uv+94/123x2yuv-25/107xy2uv+14807y3uv+65/7x2zuv+87/44xyzuv+6605y2zuv+23/99xz2uv-413yz2uv-17/15z3uv-79/46x2u2v+15240xyu2v-42/67y2u2v+8932xzu2v-5888yzu2v-4204z2u2v+7002xu3v-36/97yu3v-1634zu3v+61/102u4v-14/33x3v2-6520x2yv2+9004xy2v2-67/36y3v2-7/8x2zv2-24/11xyzv2-9373y2zv2+1556xz2v2-79/74yz2v2-6691z3v2+108x2uv2-76/61xyuv2+220y2uv2-1191xzuv2-4/9yzuv2+4546z2uv2+12205xu2v2+9/22yu2v2+64/93zu2v2-44/125u3v2+292x2v3+41/74xyv3+16/79y2v3-15892xzv3+5733yzv3+6796z2v3-42/55xuv3+71/79yuv3-19/104zuv3-38/15u2v3+6436xv4+28/15yv4+87/55zv4+2270uv4-30/41v5,-117/4x3y+97/122x2y2-3618xy3+6566y4+97/113x3z-12634x2yz+9865xy2z-1764y3z+114/31x2z2+5006xyz2+7/44y2z2-15040xz3+8/125yz3+11134z4-12980x3u-79/41x2yu-79/98xy2u+89/65y3u-1217x2zu+89/87xyzu+83/66y2zu+115/11xz2u+123/107yz2u+10920z3u-86/73x2u2-11/94xyu2-14054y2u2+6752xzu2-123/124yzu2+12129z2u2-13310xu3-52/63yu3+12847zu3-1545u4-11064x3v+11499x2yv-37/64xy2v+50/103y3v+123/94x2zv-126xyzv-111/44y2zv+95/14xz2v+113/83yz2v-77/103z3v+41/64x2uv+91/90xyuv-4932y2uv+103/31xzuv+62/63yzuv+1161z2uv-99/106xu2v-3181yu2v-11741zu2v-33/8u3v-3/118x2v2-9369xyv2+527y2v2-113/39xzv2-88/49yzv2-113/101z2v2+95/68xuv2-5930yuv2-20/43zuv2+7/41u2v2+109/93xv3-107/61yv3-8352zv3-5255uv3+12021v4,-2159x4-94/3x3y-4602x2y2+1609xy3+10721y4+28/9x3z-99/35x2yz+1/110xy2z+113/114y3z-118/75x2z2-103/93xyz2-68/67y2z2+13687xz3-1531yz3+61/107z4+6076x3u+9004x2yu+2211xy2u+110/53y3u+47/102x2zu+8495xyzu-9238y2zu+57/121xz2u-8543yz2u+8/19z3u-13527x2u2-13293xyu2+1138y2u2+26/115xzu2+78/53yzu2-12556z2u2+7299xu3+70/19yu3-14687zu3+13559u4+113/9x3v-85/126x2yv-83/3xy2v-3/46y3v+1814x2zv+28/79xyzv+103/51y2zv+78/31xz2v-14387yz2v+1/88z3v+116/75x2uv-101/59xyuv-70/3y2uv+109/71xzuv+13/88yzuv-147z2uv-113/76xu2v-9661yu2v+13855zu2v-6162u3v-1857x2v2-8208xyv2-4634y2v2-6178xzv2-7352yzv2-8247z2v2-113/15xuv2+99/40yuv2+21/97zuv2+11/37u2v2-6605xv3+8964yv3+35/121zv3+8543uv3-6008v4;TestGRRes(Name, 2, I); kill R, Name, @p; "";
    584 }
    585 
     583
     584  if( defined(assumeLevel0) ){ assumeLevel = assumeLevel0; } else { kill assumeLevel; } // restore the state of aL
     585}
     586
     587/////////////////////////////////////////////////////////
     588
     589// ????
     590proc grzero()
     591"presentation of S(0)^1
     592TODO: can we return this as an undefined value?????
     593"
     594{
     595 module Z = 0;
     596 return ( grobj(Z,intvec(0)) );
     597}
     598
     599proc grpower(def A, int p)
     600"
     601compute A \oplus ... \opuls A (p-times)
     602"
     603{
     604  if(p==0){ return ( grzero() ); } // just ERROR ???
     605
     606  ASSUME(0, p > 0);
     607
     608  if(p==1){ return(A); }
     609
     610  def N = grsum(A,A);
     611
     612  if(p==2){ return(N); }
     613
     614  // TODO: replace recursion with a loop!
     615  // see http://en.wikipedia.org/wiki/Exponentiation_by_squaring
     616  if((p%2)==0)
     617    { return ( grpower(N, p div 2) ); }
     618  else
     619    { return ( grsum( A, grpower(N, (p-1) div 2) )); }
     620
     621 
     622
     623proc grsum(def A,def B)
     624"
     625direct sum of graded modules
     626"
     627{
     628  intvec a = attrib(A, "isHomog");
     629  intvec b = attrib(B, "isHomog");
     630  intvec c = a,b;                       
     631  int r = nrows(A);
     632 
     633  ASSUME( 0, r == size(a) );
     634 
     635  module T; T[r] = 0; T = T, module(transpose(B));
     636  module AB = module(A), transpose(T);
     637 
     638  return(grobj(AB, c));
     639}
     640example
     641{ "EXAMPLE:"; echo = 2;
     642
     643  if( defined(assumeLevel) ){ int assumeLevel0 = assumeLevel; } else { int assumeLevel; export(assumeLevel); }  // store the state of aL
     644  assumeLevel = 5;
     645 
     646  ring r=32003,(x,y,z),dp;
     647
     648  grview(grpower( grshift(grzero(), 10), 5 ) );
     649 
     650  module A = grobj( module([x+y, x, 0, 0], [0, x+y, y, 0]), intvec(0,0,0,1) ); 
     651  grview(A);
     652 
     653  module B = grobj( module([0,x,y]), intvec(15,1,1) );
     654  grview(B);
     655
     656  module C = grsum(A,B);
     657
     658  print(C);
     659  homog(C);
     660  grview(C);
     661
     662  module D = grsum(
     663     grsum(grpower(A,2), grtwist(1,1)),
     664     grsum(grtwist(1,2), grpower(B,2))
     665     );
     666
     667  print(D);
     668  homog(D);
     669  grview(D);
     670
     671  module D10 = grshift(D, 10);
     672
     673  print(D10);
     674  homog(D10);
     675  grview(D10);
     676
     677  module DD = grorder(D10);
     678
     679  print(DD);
     680  homog(DD);
     681  grview(DD);
     682
     683  module TTT = grtranspose(DD);
     684
     685  print(TTT);
     686  homog(TTT);
     687  grview(TTT);
     688
     689  module F = grobj( module([x,y,0]), intvec(1,1,5) );
     690  grview(B);
     691 
     692  module T = grsum( F, grsum( grtwist(1, 10), B ) );
     693  grview(T);
     694
     695  if( defined(assumeLevel0) ){ assumeLevel = assumeLevel0; } else { kill assumeLevel; } // restore the state of aL
     696}
     697
     698proc grshift( def M, int d)
     699"
     700shift graded module M by delta so that 1 is in M_d
     701"
     702{
     703  intvec a = attrib(M, "isHomog");
     704  return (grobj(M, intvec( a - intvec(d:size(a))) ));
     705}
     706
     707proc grisequal (def A, def B)
     708"TODO"
     709{
     710  return (1==1); // TODO!
     711}
     712
     713proc grtwist(int a, int d)
     714"
     715matrix presentation for twisted polynomial ring S(d)^a
     716"
     717{
     718  module Z; Z[a] = 0;
     719  Z = grobj(Z, -intvec(d:a));
     720
     721  ASSUME(2, grisequal(Z, grpower( grshift(grzero(), -d), a ) )); // optional check
     722  return(Z);
     723}
     724
     725proc grobj(module M, intvec w)
     726""
     727{
     728  attrib(M, "isHomog", w);
     729  attrib(M, "rank", size(w));
     730  return (M);
     731}
  • Singular/LIB/primdec.lib

    r0cf4e1 ra6d6356  
    2626
    2727PROCEDURES:
    28  Ann(M);           annihilator of R^n/M, R=basering, M in R^n
    29  primdecGTZ(I);    complete primary decomposition via Gianni,Trager,Zacharias
    30  primdecSY(I...);  complete primary decomposition via Shimoyama-Yokoyama
    31  minAssGTZ(I);     the minimal associated primes via Gianni,Trager,Zacharias (with modifications by Laplagne)
    32  minAssChar(I...); the minimal associated primes using characteristic sets
    33  testPrimary(L,k); tests the result of the primary decomposition
    34  radical(I);       computes the radical of I via Krick/Logar (with modifications by Laplagne) and Kemper
    35  radicalEHV(I);    computes the radical of I via Eisenbud,Huneke,Vasconcelos
    36  equiRadical(I);   the radical of the equidimensional part of the ideal I
    37  prepareAss(I);    list of radicals of the equidimensional components of I
    38  equidim(I);       weak equidimensional decomposition of I
    39  equidimMax(I);    equidimensional locus of I
    40  equidimMaxEHV(I); equidimensional locus of I via Eisenbud,Huneke,Vasconcelos
    41  zerodec(I);       zerodimensional decomposition via Monico
    42  absPrimdecGTZ(I); the absolute prime components of I
    43  sep(f,k);         the separabel part of f as polynomial in Fp(t1,...,tm)
     28 Ann(M);            annihilator of R^n/M, R=basering, M in R^n
     29 primdecGTZ(I);     (deprecated) complete primary decomposition via Gianni,Trager,Zacharias
     30 primdecGTZE(I);    complete primary decomposition via Gianni,Trager,Zacharias. Returns empty list for the unit ideal
     31 primdecSY(I...);   (deprecated) complete primary decomposition via Shimoyama-Yokoyama
     32 primdecSYE(I,..);  complete primary decomposition via Shimoyama-Yokoyama. Returns empty list for the unit ideal
     33 minAssGTZ(I);      (deprecated) the minimal associated primes via Gianni,Trager,Zacharias (with modifications by Laplagne)
     34 minAssGTZE(I);     the minimal associated primes via Gianni,Trager,Zacharias. Returns empty list for unit ideal
     35 minAssChar(I...);  (deprecated) the minimal associated primes using characteristic sets
     36 minAssCharE(I..);  the minimal associated primes using characteristic sets. Returns empty list for unit ideal
     37 testPrimary(L,k);  (deprecated) tests the result of the primary decomposition
     38 testPrimaryE(L,k); tests the result of the primary decomposition. Handles also empty list L.
     39 radical(I);        computes the radical of I via Krick/Logar (with modifications by Laplagne) and Kemper
     40 radicalEHV(I);     computes the radical of I via Eisenbud,Huneke,Vasconcelos
     41 equiRadical(I);    the radical of the equidimensional part of the ideal I
     42 prepareAss(I);     list of radicals of the equidimensional components of I
     43 equidim(I);        weak equidimensional decomposition of I
     44 equidimE(I);       equidimE returns empty list for unit ideal
     45 equidimMax(I);     equidimensional locus of I
     46 equidimMaxEHV(I);  equidimensional locus of I via Eisenbud,Huneke,Vasconcelos
     47 zerodec(I);        zerodimensional decomposition via Monico
     48 absPrimdecGTZ(I);  (deprecated) the absolute prime components of I
     49 absPrimdecGTZE(I); the absolute prime components of I. Assumes I is not unit ideal.
     50 sep(f,k);          the separabel part of f as polynomial in Fp(t1,...,tm)
    4451";
     52
     53
    4554
    4655LIB "general.lib";
     
    5867//
    5968///////////////////////////////////////////////////////////////////////////////
     69
    6070
    6171static proc sat1 (ideal id, poly p)
     
    463473      if(e mod char(basering)==0)
    464474      {
    465         if ( voice >=15 )
     475        if ( voice >=16 )
    466476        {
    467477          "// WARNING: The characteristic is perhaps too small to use";
     
    10141024  }
    10151025
    1016   if((voice>=6)&&(char(basering)<=181))
     1026  if((voice>=7)&&(char(basering)<=181))
    10171027  {
    10181028    primary=splitCharp(primary);
    10191029  }
    10201030
    1021   if((@wr==2)&&(npars(basering)>0)&&(voice>=6)&&(char(basering)>0))
     1031  if((@wr==2)&&(npars(basering)>0)&&(voice>=7)&&(char(basering)>0))
    10221032  {
    10231033  //the prime decomposition of Yokoyama in characteristic p
     
    10291039      if(size(primary[2*@k])==0)
    10301040      {
    1031         ek=insepDecomp(primary[2*@k-1]);
     1041        ek=insepDecomp_i( int(1), primary[2*@k-1] );
    10321042        primary=delete(primary,2*@k);
    10331043        primary=delete(primary,2*@k-1);
     
    10431053  }
    10441054
    1045   if(voice>=8){primary=extF(primary);};
     1055  if(voice>=9){primary=extF(primary);};
    10461056
    10471057//test whether all ideals in the decomposition are primary and
     
    10491059//if not after a random coordinate transformation of the last
    10501060//variable the corresponding ideal is decomposed again.
    1051   if((npars(basering)>0)&&(voice>=8))
     1061  if((npars(basering)>0)&&(voice>=9))
    10521062  {
    10531063    poly randp;
     
    10871097      jmap2=maxideal(1);
    10881098      @qht=primary[2*@k-1];
    1089       if((npars(basering)>0)&&(voice>=10))
     1099      if((npars(basering)>0)&&(voice>=11))
    10901100      {
    10911101        jmap[size(jmap)]=randp;
     
    15421552///////////////////////////////////////////////////////////////////////////////
    15431553
    1544 proc insepDecomp(ideal i)
     1554
     1555proc insepDecomp_i(int patchPrimaryDecomposition, ideal i)
    15451556{
    15461557//decomposes i into special ideals
    15471558//computes the prime decomposition of the special ideals
    15481559//and transforms it back to a decomposition of i
     1560// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     1561// since the unit ideal it is not prime!
    15491562
    15501563  ASSUME(0, hasFieldCoefficient(basering) );
     
    15691582    }
    15701583    phi=R,m;
    1571     qr=decomp(wo[1],2);
     1584    qr = decomp_i(patchPrimaryDecomposition,wo[1],2);
    15721585
    15731586    option(redSB);
     
    15791592      re[size(re)+1]=zeroRad(K);
    15801593    }
    1581     option(noredSB);
     1594    option(set,op);
    15821595  }
    15831596  option(set,op);
     
    17141727}
    17151728
    1716 static proc teilt(intvec a, intvec b)
     1729static proc teilt(intvec aba, intvec bab)
    17171730{
    17181731  int i;
    1719   for(i=1;i<=size(a);i++)
    1720   {
    1721     if(a[i]>b[i]){return(0);}
     1732  for(i=1;i<=size(aba);i++)
     1733  {
     1734    if(aba[i]>bab[i]){return(0);}
    17221735  }
    17231736  return(1);
     
    19351948
    19361949
    1937 proc minAssPrimesold(ideal i, list #)
    1938 "USAGE:   minAssPrimes(i); i ideal
    1939          minAssPrimes(i,1); i ideal  (to use also the factorizing Groebner)
    1940 RETURN:  list = the minimal associated prime ideals of i
    1941 EXAMPLE: example minAssPrimes; shows an example
     1950 proc minAssPrimesoldE(ideal I, list #)
     1951"USAGE:   minAssPrimesoldE(I); I ideal
     1952         minAssPrimesold(I,1); I ideal  (to use also the factorizing Groebner)
     1953RETURN:  list = the minimal associated prime ideals of I
     1954EXAMPLE: example minAssPrimesoldE; shows an example
    19421955"
    19431956{
     1957    return(minAssPrimesold_i(int(1),I,#));
     1958}
     1959example
     1960{ "EXAMPLE:"; echo = 2;
     1961   ring  r = 32003,(x,y,z),lp;
     1962   poly  p = z2+1;
     1963   poly  q = z4+2;
     1964   ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     1965   list pr= minAssPrimesoldE(i);  pr;
     1966
     1967   minAssPrimesoldE(i,1);
     1968}
     1969
     1970proc minAssPrimesold(ideal I, list #)
     1971"USAGE:   minAssPrimesold(I); I ideal
     1972         minAssPrimesold(i,1); I ideal  (to use also the factorizing Groebner)
     1973RETURN:  list = the minimal associated prime ideals of I. In case I is unit ideal, returns list(ideal(1));
     1974NOTE:    deprecated. Use 'minAssPrimesoldE()'
     1975EXAMPLE: example minAssPrimesold; shows an example
     1976"
     1977{
     1978    return(minAssPrimesold_i(int(0),I,#));
     1979}
     1980example
     1981{ "EXAMPLE:"; echo = 2;
     1982   ring  r = 32003,(x,y,z),lp;
     1983   poly  p = z2+1;
     1984   poly  q = z4+2;
     1985   ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     1986   list pr= minAssPrimesold(i);  pr;
     1987
     1988   minAssPrimesold(i,1);
     1989}
     1990
     1991static proc minAssPrimesold_i(int patchPrimaryDecomposition, ideal i, list #)
     1992{
     1993//
     1994// parameter patchPrimaryDecomposition : if = 1, patch the decomposition( drop unit ideal in the decomposition),
     1995//                                 : if = 0, taken no special action in case the unit ideal is in the decomposition
     1996// for other parameters see minAssPrimesold, minAssPrimesoldE
     1997
    19441998   ASSUME(1, hasFieldCoefficient(basering) );
    19451999   ASSUME(0, not isQuotientRing(basering) ) ;
    19462000   ASSUME(0, hasGlobalOrdering(basering) ) ;
    19472001   def @P=basering;
    1948    if(size(i)==0){return(list(ideal(0)));}
     2002   if(size(i)==0) { return(list(ideal(0))); }
    19492003   list qr=simplifyIdeal(i);
    19502004   map phi=@P,qr[2];
     
    19592013      int @wr;
    19602014      list tluser,@res;
    1961       list primary=decomp(i,2);
     2015      list primary=decomp_i(patchPrimaryDecomposition,i,2);
    19622016
    19632017      @res[1]=primary;
    19642018
    19652019      tluser=union(@res);
    1966       setring @P;
    1967       list @res=imap(gnir,tluser);
    1968       return(phi(@res));
     2020
     2021      if (size(tluser)>0)
     2022      {
     2023          setring @P;
     2024          list @res=imap(gnir,tluser);
     2025          return(phi(@res));
     2026      }
     2027      else
     2028      {
     2029          setring @P;
     2030          return(tluser);
     2031      }
    19692032   }
    19702033   list @res,empty;
     
    20282091        if(pos[j]!=1)
    20292092        {
    2030             @res[j]=decomp(@pr[j],2);
     2093            @res[j]=decomp_i(patchPrimaryDecomposition,@pr[j],2);
    20312094        }
    20322095        else
     
    20432106//@pr[j];
    20442107//pause();
    2045         @res[j]=decomp(@pr[j],2);
    2046 //       @res[j]=decomp(@pr[j],2,@pr[j],ser);
     2108        @res[j]=decomp_i(patchPrimaryDecomposition,@pr[j],2);
     2109//       @res[j]=decomp_i(patchPrimaryDecomposition,@pr[j],2,@pr[j],ser);
    20472110//       for(k=1;k<=size(@res[j]);k++)
    20482111//       {
     
    20572120   return(phi(@res));
    20582121}
    2059 example
    2060 { "EXAMPLE:"; echo = 2;
    2061    ring  r = 32003,(x,y,z),lp;
    2062    poly  p = z2+1;
    2063    poly  q = z4+2;
    2064    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    2065    list pr= minAssPrimes(i);  pr;
    2066 
    2067    minAssPrimes(i,1);
    2068 }
     2122
    20692123
    20702124static proc primT(ideal i)
     
    20902144}
    20912145
    2092 static proc minAssPrimes(ideal i, list #)
    2093 "USAGE:   minAssPrimes(i); i ideal
     2146
     2147static proc minAssPrimesE(ideal I, list #)
     2148"USAGE:   minAssPrimesE(I); I ideal
    20942149      Optional parameters in list #: (can be entered in any order)
    20952150      0, "facstd"   ->   uses facstd to first decompose the ideal
     
    20972152      "SL" ->     the new algorithm is used (default)
    20982153      "GTZ" ->     the old algorithm is used
    2099 RETURN:  list = the minimal associated prime ideals of i
     2154RETURN:  list = the minimal associated prime ideals of I
     2155EXAMPLE: example minAssPrimesE; shows an example
     2156"
     2157{
     2158    return(minAssPrimes_i(int(1),I,#));
     2159}
     2160example
     2161{ "EXAMPLE:"; echo = 2;
     2162   ring  r = 32003,(x,y,z),lp;
     2163   poly  p = z2+1;
     2164   poly  q = z4+2;
     2165   ideal I = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     2166   list pr= minAssPrimesE(I);  pr;
     2167
     2168   minAssPrimesE(I,1);
     2169}
     2170
     2171static proc minAssPrimes(ideal I, list #)
     2172"USAGE:   minAssPrimes(I); I ideal
     2173      Optional parameters in list #: (can be entered in any order)
     2174      0, "facstd"   ->   uses facstd to first decompose the ideal
     2175      1, "noFacstd" ->  does not use facstd (default)
     2176      "SL" ->     the new algorithm is used (default)
     2177      "GTZ" ->     the old algorithm is used
     2178RETURN:  list = the minimal associated prime ideals of I. If I is the unit ideal returns list(ideal(1)) ;
     2179NOTE:    deprecated. Use 'minAssPrimesE()'
    21002180EXAMPLE: example minAssPrimes; shows an example
    21012181"
    21022182{
     2183    return(minAssPrimes_i(int(0),I,#));
     2184}
     2185example
     2186{ "EXAMPLE:"; echo = 2;
     2187   ring  r = 32003,(x,y,z),lp;
     2188   poly  p = z2+1;
     2189   poly  q = z4+2;
     2190   ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     2191   list pr= minAssPrimes(i);  pr;
     2192
     2193   minAssPrimes(i,1);
     2194}
     2195
     2196
     2197static proc minAssPrimes_i(int patchPrimaryDecomposition, ideal i, list #)
     2198{
     2199// parameter  patchPrimaryDecomposition:  1 to patch( remove unit ideal from the decomposition) ,
     2200//                                        0 for no special action on unit ideal.
     2201// for other parameters see 'minAssPrimes', 'minAssPrimesE'
    21032202  ASSUME(1, hasFieldCoefficient(basering) );
    21042203  ASSUME(1, not isQuotientRing(basering) ) ;
    21052204  ASSUME(1, hasGlobalOrdering(basering) ) ;
    2106 
    2107   if(size(i) == 0){return(list(ideal(0)));}
     2205  if (size(i) == 0)  {  return(list(ideal(0)));  }
     2206
     2207  intvec origOp = option(get);
     2208
    21082209  string algorithm;    // Algorithm to be used
    21092210  string facstdOption;    // To uses proc facstd
     
    21602261  list result;
    21612262
    2162   if(npars(P) == 0){option(redSB);}
    2163 
    2164   if(attrib(i,"isSB")!=1)
     2263  if(npars(P) == 0)  { option(redSB); }
     2264
     2265  if (attrib(i,"isSB")!=1)
    21652266  {
    21662267    i=groebner(q[1]);
     
    21702271    for(j=1;j<=nvars(basering);j++)
    21712272    {
    2172       if(q[2][j]!=var(j)){k=1;break;}
     2273      if (q[2][j]!=var(j)) {k=1;break;}
    21732274    }
    21742275    if(k)
     
    21762277      i=groebner(q[1]);
    21772278    }
     2279  }
     2280  if(size(i)==1)
     2281  {
     2282      if ( deg(lead(i[1]))==0 ) // we have the unit ideal.
     2283      {
     2284          setring P0;
     2285          option( set,origOp );
     2286          if (patchPrimaryDecomposition==1)
     2287          {
     2288
     2289             return( list() );
     2290          }
     2291          else
     2292          {
     2293               return( list(ideal(1)) );
     2294          }
     2295      }
    21782296  }
    21792297
     
    21822300    option( set,op );
    21832301    setring P0;
     2302    option( set,origOp );
    21842303    return( ideal(1) );
    21852304  }
     
    22122331        if (algorithm == "GTZ")
    22132332        {
    2214           qr = decomp(pr[k], 2);
     2333          qr = decomp_i(patchPrimaryDecomposition,pr[k], 2);
    22152334        }
    22162335        else
     
    22302349    setring(P0);
    22312350    list re=imap(P,re);
     2351    option( set,origOp );
    22322352    return(re);
    22332353  }
     
    22382358    if (algorithm == "GTZ")
    22392359    {
    2240       re[1] = decomp(i, 2);
     2360      re[1] = decomp_i(patchPrimaryDecomposition,i, 2);
    22412361    }
    22422362    else
     
    22482368    re=phi(re);
    22492369    setring(P0);
     2370    option( set,origOp );
    22502371    list re=imap(P,re);
    22512372    return(re);
     
    22822403    if (algorithm == "GTZ")
    22832404    {
    2284       re[j] = decomp(q[j], 2);
     2405      re[j] = decomp_i(patchPrimaryDecomposition,q[j], 2);
    22852406    }
    22862407    else
     
    22962417  setring(P0);
    22972418  list re=imap(P,re);
     2419  option( set,origOp );
    22982420  return(re);
    22992421}
    2300 example
    2301 { "EXAMPLE:"; echo = 2;
    2302    ring  r = 32003,(x,y,z),lp;
    2303    poly  p = z2+1;
    2304    poly  q = z4+2;
    2305    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    2306    list pr= minAssPrimes(i);  pr;
    2307 
    2308    minAssPrimes(i,1);
    2309 }
     2422
    23102423
    23112424static proc union(list li)
     
    23152428  def P=basering;
    23162429
     2430  int liSize=size(li);
     2431  int li1Size=0;
     2432  if (size(li)>0)
     2433  {
     2434     li1Size=size(li[1]);
     2435  }
    23172436  def ir=changeordTo(basering,"lp");
    23182437  setring ir;
    2319   list l=fetch(P,li);
     2438  list l;
     2439  if ( liSize > 0)
     2440  {
     2441     if (li1Size > 0)
     2442     {
     2443         l = fetch(P,li);
     2444     }
     2445     else
     2446     {
     2447         ASSUME(1, size(li)==1);
     2448         l[1] = list();
     2449     }
     2450  }
    23202451  list @erg;
    23212452
     
    23752506     }
    23762507  }
    2377   if(deg(@erg[size(@erg)][1])!=0)
    2378   {
    2379      @wos[size(@wos)+1]=@erg[size(@erg)];
    2380   }
     2508  if (size(@erg)>0)
     2509  {
     2510     if(deg(@erg[size(@erg)][1])!=0)
     2511     {
     2512        @wos[size(@wos)+1]=@erg[size(@erg)];
     2513     }
     2514  }
     2515  int @wosSize = size(@wos);
    23812516  setring P;
    2382   list @ser=fetch(ir,@wos);
     2517  list @ser;
     2518  if (@wosSize>0)
     2519  {
     2520      @ser=fetch(ir,@wos);
     2521  }
    23832522  return(@ser);
    23842523}
    2385 ///////////////////////////////////////////////////////////////////////////////
     2524
     2525
     2526
     2527
    23862528proc equidim(ideal i,list #)
    2387 "USAGE:  equidim(i) or equidim(i,1) ; i ideal
     2529"USAGE:  equidim(I) or equidim(I,1) ; I ideal
    23882530RETURN: list of equidimensional ideals a[1],...,a[s] with:
    2389         - a[s] the equidimensional locus of i, i.e. the intersection
    2390           of the primary ideals of dimension of i
     2531        - a[s] the equidimensional locus of I, i.e. the intersection
     2532          of the primary ideals of dimension of I, except I is unit ideal.
    23912533        - a[1],...,a[s-1] the lower dimensional equidimensional loci.
    2392 NOTE:    An embedded component q (primary ideal) of i can be replaced in the
     2534         If I is the unit ideal, a list containing the unit ideal as a[1] is returned.
     2535NOTE:    An embedded component q (primary ideal) of I can be replaced in the
    23932536         decomposition by a primary ideal q1 with the same radical as q. @*
    2394          @code{equidim(i,1)} uses the algorithm of Eisenbud/Huneke/Vasconcelos.
     2537         @code{equidim(I,1)} uses the algorithm of Eisenbud/Huneke/Vasconcelos.
    23952538
    23962539EXAMPLE:example equidim; shows an example
     
    24052548      );
    24062549  }
    2407 
    24082550  intvec op ;
    24092551  def  P = basering;
     
    26352777}
    26362778///////////////////////////////////////////////////////////////////////////////
    2637 
    2638 proc algeDeco(ideal i, int w)
    2639 {
     2779//w=0: GTZ
     2780//w=1: SY
     2781//w=2: minAss
     2782proc algeDecoE(ideal I, int w)
     2783{//reduces primery decomposition over algebraic extensions to
     2784//the other cases
     2785    return( algeDeco_i( int(1), I, int w) );
     2786}
     2787
     2788//w=0: GTZ
     2789//w=1: SY
     2790//w=2: minAss
     2791// deprecated. use 'algeDecoE()'
     2792proc algeDeco(ideal I, int w)
     2793{//reduces primery decomposition over algebraic extensions to
     2794//the other cases
     2795    return( algeDeco_i(int(0), I, int w));
     2796}
     2797
     2798
     2799//w=0: GTZ
     2800//w=1: SY
     2801//w=2: minAss
     2802static proc algeDeco_i(int patchPrimaryDecomposition, ideal i, int w)
     2803{//reduces primery decomposition over algebraic extensions to
     2804//the other cases
     2805// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     2806// since the unit ideal it is not prime, otherwise take no special action.
     2807
    26402808   ASSUME(0, hasFieldCoefficient(basering) );
    26412809   ASSUME(0, not isQuotientRing(basering) ) ;
     
    26552823   if((size(i)==2) && (w==2))
    26562824   {
     2825      //treats a special case separately which would otherwise take a lot longer in factorization
    26572826      option( redSB );
    26582827      ideal J = std(i);
    2659       option( noredSB );
     2828      option( set, op );
     2829      if(size(J)==1)
     2830      {
     2831         if ( deg(lead(J[1]))==0 ) // we have the unit ideal
     2832         {
     2833            if (patchPrimaryDecomposition==1)
     2834            {
     2835                return( list() );
     2836            }
     2837            else
     2838            {
     2839                return( list( ideal(1) ) );
     2840            }
     2841         }
     2842      }
    26602843      if ((size(J)==2)&&(deg(J[1])==1))
    26612844      {
     2845         // minAssPrimes correspond to factorization of J[2]
    26622846         ideal keep;
    26632847         poly f;
     
    27222906   if(w==0)
    27232907   {
    2724       pr=decomp(i);
     2908      pr=decomp_i(patchPrimaryDecomposition,i);
    27252909   }
    27262910   if(w==1)
    27272911   {
    2728       pr=prim_dec(i,1);
     2912      pr=prim_dec_i(patchPrimaryDecomposition,i,1);
    27292913      pr=reconvList(pr);
    27302914   }
    27312915   if(w==2)
    27322916   {
    2733       pr=minAssPrimes(i);
     2917      pr=minAssPrimes_i(patchPrimaryDecomposition,i);
    27342918   }
     2919
     2920   int sizepr = size(pr);
    27352921
    27362922   if(n<nvars(basering))
     
    27412927      R_l[3]=list(list("dp",1:n),list("lp",1:(nvars(basering)-n)),list("C",0));
    27422928      def RS=ring(R_l); kill R_l; setring RS;
    2743       list pr=imap(RH,pr);
     2929      if (sizepr>0) {    list  pr=imap(RH,pr); ASSUME(1, sizepr == size(pr)); }
    27442930      ideal K;
    2745       for(j=1;j<=size(pr);j++)
     2931      for(j=1;j<=sizepr;j++)
    27462932      {
    27472933         K=groebner(pr[j]);
    2748          K=K[2..size(K)];
     2934         if (size(K)>1)
     2935         {
     2936             K = K[2..size(K)];
     2937         }
    27492938         pr[j]=K;
    27502939      }
    27512940      setring R;
    2752       list pr=imap(RS,pr);
     2941      if (sizepr>0) {  list pr=imap(RS,pr); }
    27532942   }
    27542943   else
    27552944   {
    27562945      setring R;
    2757       list pr=imap(RH,pr);
     2946      if (sizepr>0)  { list pr=imap(RH,pr); }
    27582947   }
    27592948
     
    27882977}
    27892978///////////////////////////////////////////////////////////////////////////////
    2790 static proc decomp(ideal i,list #)
    2791 "USAGE:  decomp(i); i ideal  (for primary decomposition)   (resp.
    2792          decomp(i,1);        (for the associated primes of dimension of i) )
    2793          decomp(i,2);        (for the minimal associated primes) )
    2794          decomp(i,3);        (for the absolute primary decomposition) )
     2979
     2980static proc decompE(ideal I,list #)
     2981"USAGE:  decompE(I); I ideal  (for primary decomposition)   (resp.
     2982         decompE(I,1);        (for the associated primes of dimension of I) )
     2983         decompE(I,2);        (for the minimal associated primes) )
     2984         decompE(I,3);        (for the absolute primary decomposition) )
    27952985RETURN:  list = list of primary ideals and their associated primes
    27962986         (at even positions in the list)
    27972987         (resp. a list of the minimal associated primes)
     2988         if I is unit ideal, returns emtpy list
    27982989NOTE:    Algorithm of Gianni/Trager/Zacharias
     2990EXAMPLE: example decompE; shows an example
     2991"
     2992{
     2993    return(decomp_i(int(1),I,#));
     2994}
     2995example
     2996{ "EXAMPLE:"; echo = 2;
     2997   ring  r = 32003,(x,y,z),lp;
     2998   poly  p = z2+1;
     2999   poly  q = z4+2;
     3000   ideal I = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     3001   list pr= decompE(I);
     3002   pr;
     3003   testPrimary( pr, I);
     3004}
     3005
     3006static proc decomp(ideal I,list #)
     3007"USAGE:  decomp(I); I ideal  (for primary decomposition)   (resp.
     3008         decomp(I,1);        (for the associated primes of dimension of I) )
     3009         decomp(I,2);        (for the minimal associated primes) )
     3010         decomp(I,3);        (for the absolute primary decomposition) )
     3011RETURN:  list = list of primary ideals and their associated primes
     3012         (at even positions in the list)
     3013         (resp. a list of the minimal associated primes)
     3014         if I is unit ideal, returns list(ideal(1),ideal(1)) ( resp. list(ideal(1)))
     3015NOTE:    deprecated. Use 'decompE()'
    27993016EXAMPLE: example decomp; shows an example
    28003017"
    28013018{
     3019    return(decomp_i(int(0),I,#));
     3020}
     3021example
     3022{ "EXAMPLE:"; echo = 2;
     3023   ring  r = 32003,(x,y,z),lp;
     3024   poly  p = z2+1;
     3025   poly  q = z4+2;
     3026   ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     3027   list pr= decomp(i);
     3028   pr;
     3029   testPrimary( pr, i);
     3030}
     3031
     3032static proc decomp_i(int patchPrimaryDecomposition, ideal i,list #)
     3033{
     3034// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     3035// since the unit ideal it is not prime, otherwise take no special action.
     3036// for other parameters see 'decomp' or 'decompE'
    28023037  ASSUME(1, hasFieldCoefficient(basering) );
    28033038  ASSUME(1, not isQuotientRing(basering) ) ;
    28043039  ASSUME(1, hasGlobalOrdering(basering) ) ;
    2805 
    2806   intvec op,@vv;
     3040  intvec initialOp,op,@vv;
     3041  initialOp = option(get);
    28073042  def  @P = basering;
    28083043  list primary,indep,ltras;
     
    28133048  int isS=(attrib(i,"isSB")==1);
    28143049
    2815 
    28163050  if(size(#)>0)
    28173051  {
     
    28453079      //ltras=mstd(i);
    28463080      tras=groebner(i);
    2847       ltras=tras,tras;
    2848       attrib(ltras[1],"isSB",1);
    28493081    }
    28503082    else
    2851     {
    2852       ltras=i,i;
    2853       attrib(ltras[1],"isSB",1);
    2854     }
     3083    {
     3084      tras=i;
     3085    }
     3086    ltras = tras,tras;
     3087    attrib( ltras[1], "isSB", 1);
     3088
     3089    if (size(ltras[1])>0)
     3090    {
     3091        if ( deg(lead(ltras[1]))==0 ) // we have the unit ideal.
     3092        {
     3093          option(set,initialOp);
     3094          if (patchPrimaryDecomposition==1)
     3095          {
     3096             if (abspri) { return(prepare_absprimdec(list()));  }
     3097             return( list() );
     3098          }
     3099          else
     3100          {
     3101            primary[1]=ideal(1);
     3102            primary[2]=ideal(1);
     3103                if (abspri) { return(prepare_absprimdec(primary));}
     3104             return( primary );
     3105          }
     3106        }
     3107    }
     3108
    28553109    tras=ltras[1];
    28563110    attrib(tras,"isSB",1);
     
    28593113      primary[1]=ltras[2];
    28603114      primary[2]=maxideal(1);
     3115      option(set,initialOp);
    28613116      if(@wr>0)
    28623117      {
     
    28823137  if(size(i)==0)
    28833138  {
     3139    option(set,initialOp);
    28843140    primary=ideal(0),ideal(0);
    28853141    if (abspri) { return(prepare_absprimdec(primary));}
     
    29233179      ideal @j=groebner(fetch(@P,i));
    29243180    }
     3181    if(size(@j)==1)
     3182    {
     3183        if ( deg( lead(@j[1]) )==0 ) // we have the unit ideal.
     3184        {
     3185            setring @P;
     3186            option(set,initialOp);
     3187            if (patchPrimaryDecomposition==1)
     3188            {
     3189                 return( list() );
     3190            }
     3191            else
     3192            {
     3193               return( list(ideal(1),ideal(1)) );
     3194            }
     3195        }
     3196    }
    29253197  }
    29263198  option(set,op);
     
    29493221    {
    29503222      setring @P;
     3223      option(set,initialOp);
    29513224      primary[1]=i;
    29523225      primary[2]=i;
     
    29903263      @j=std(@j);
    29913264
    2992       list pr=decomp(@j);
     3265      list pr=decomp_i(patchPrimaryDecomposition,@j);
     3266      if (size(pr)==0)
     3267      {     
     3268            setring @P;
     3269            option(set,initialOp);
     3270            if (abspri) { return(prepare_absprimdec(list()));}
     3271            return(list());
     3272      }
     3273     
    29933274      setring gnir;
    29943275      list pr=imap(@deirf,pr);
     
    29993280      }
    30003281      setring @P;
     3282      option(set,initialOp);
    30013283      primary=imap(gnir,pr);
    30023284      if (abspri) { return(prepare_absprimdec(primary));}
     
    30113293  {
    30123294    setring @P;
     3295    option(set,initialOp);
    30133296    primary=ideal(1),ideal(1);
    30143297    if (abspri) { return(prepare_absprimdec(primary));}
     
    30383321    }
    30393322    setring @P;
     3323    option(set,initialOp);
    30403324    primary=fetch(gnir,gprimary);
    3041 
    30423325//HIER
     3326
    30433327    if (abspri) { return(prepare_absprimdec(primary));}
    30443328    return(primary);
     
    30993383      primary=imap(gnir,primary);
    31003384    }
    3101     option(set,op);
     3385    option(set,initialOp);
    31023386    return(primary);
    31033387  }
     
    37254009        if(@wr>0)
    37264010        {
    3727           htprimary=decomp(@j,@wr,peek,ser);
     4011          htprimary=decomp_i(patchPrimaryDecomposition, @j,@wr,peek,ser);
    37284012        }
    37294013        else
    37304014        {
    3731           htprimary=decomp(@j,peek,ser);
     4015          htprimary=decomp_i(patchPrimaryDecomposition,@j,peek,ser);
    37324016        }
    37334017        // here we collect now both results primary(sat(j,gh))
     
    37604044  //---------------------------------------------------------------------------
    37614045  setring @P;
     4046  option(set,initialOp);
    37624047  primary=imap(gnir,quprimary);
    37634048  if(!abspri)
     
    37744059
    37754060
    3776 example
    3777 { "EXAMPLE:"; echo = 2;
    3778    ring  r = 32003,(x,y,z),lp;
    3779    poly  p = z2+1;
    3780    poly  q = z4+2;
    3781    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    3782    list pr= decomp(i);
    3783    pr;
    3784    testPrimary( pr, i);
    3785 }
     4061
    37864062
    37874063///////////////////////////////////////////////////////////////////////////////
     
    42914567//////////////////////////////////////////////////////
    42924568
    4293 
    4294 static proc min_ass_prim_charsets (ideal PS, int cho)
    4295 {
    4296   if((cho<0) and (cho>1))
     4569static proc min_ass_prim_charsets_i (int patchPrimaryDecomposition, ideal PS, int cho)
     4570{
     4571// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     4572// since the unit ideal it is not prime, otherwise take no special action.
     4573  ASSUME(1, hasFieldCoefficient(basering) );
     4574  ASSUME(1, hasGlobalOrdering(basering) ) ;
     4575  ASSUME(1, not isQuotientRing(basering) ) ;
     4576
     4577  if((cho<0) or (cho>1))
    42974578  {
    42984579    ERROR("<int> must be 0 or 1");
     
    43034584  if(cho==0)
    43044585  {
    4305     L=min_ass_prim_charsets0(PS);
     4586    L=min_ass_prim_charsets0_i(patchPrimaryDecomposition,PS);
    43064587  }
    43074588  else
    43084589  {
    4309     L=min_ass_prim_charsets1(PS);
     4590    L=min_ass_prim_charsets1_i(patchPrimaryDecomposition,PS);
    43104591  }
    43114592  option(set,saveopt);
     
    43214602
    43224603
    4323 static proc min_ass_prim_charsets0 (ideal PS)
    4324 {
     4604static proc min_ass_prim_charsets0_i (int patchPrimaryDecomposition, ideal PS)
     4605{
     4606// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     4607// since the unit ideal it is not prime, otherwise take no special action.
    43254608  ASSUME(1, hasFieldCoefficient(basering) );
    43264609  ASSUME(1, not isQuotientRing(basering) ) ;
     
    43284611
    43294612  intvec op;
     4613  if (size(PS)==0) { return( list(ideal(0))); }
    43304614  matrix m=char_series(PS);  // We compute an irreducible
    43314615                             // characteristic series
     
    43344618  && (m[1,1]==1)) // in case of an empty series: min_ass_prim_charsets1
    43354619  {
    4336     return min_ass_prim_charsets1(PS);
     4620    return (min_ass_prim_charsets1_i(patchPrimaryDecomposition,PS));
    43374621  }
    43384622  int i,j,k;
     
    44124696    }
    44134697  }
     4698  if(size(PSI)==1)
     4699  {
     4700    if (idealsEqual( PSI[1], ideal(1) ))
     4701    {
     4702      if (patchPrimaryDecomposition==1)
     4703      {
     4704        return( list() );
     4705      }
     4706      else
     4707      {
     4708        return( list(ideal(1)) );
     4709      }
     4710    }
     4711  }
    44144712  return (PSI);
    44154713}
     
    44264724
    44274725
    4428 static proc min_ass_prim_charsets1 (ideal PS)
    4429 {
     4726static proc min_ass_prim_charsets1_i (int patchPrimaryDecomposition, ideal PS)
     4727{
     4728// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     4729// since the unit ideal it is not prime, otherwise take no special action.
    44304730  ASSUME(1, hasFieldCoefficient(basering) );
    44314731  ASSUME(1, not isQuotientRing(basering) ) ;
     
    44344734  intvec op;
    44354735  def oldring=basering;
     4736  if (size(PS)==0) { return( list(ideal(0))); }
    44364737  string n=system("neworder",PS);
    44374738  execute("ring r=("+charstr(oldring)+"),("+n+"),dp;");
     
    44664767      I=I,ini_mod(PHI[i][j]);
    44674768    }
    4468     I=I[2..ncols(I)];
     4769    if (ncols(I)>1)
     4770    {
     4771      I=I[2..ncols(I)];
     4772    }
    44694773    ITPHI[i]=I;
    44704774  }
     
    45444848    }
    45454849  }
     4850  if(size(PSI)==1)
     4851  {
     4852    if (idealsEqual( PSI[1], ideal(1) ))
     4853    {
     4854      if (patchPrimaryDecomposition==1)
     4855      {
     4856        return( list() );
     4857      }
     4858      else
     4859      {
     4860        return( list(ideal(1)) );
     4861      }
     4862    }
     4863  }
     4864
    45464865  return (PSI);
    45474866}
     
    45684887//////////////////////////////////////////////////////////
    45694888
    4570 
    4571 static proc prim_dec(ideal I, int choose)
    4572 {
     4889static proc prim_dec_i(int patchPrimaryDecomposition, ideal I, int choose)
     4890{
     4891// if patchPrimaryDecomposition=1,  drop unit ideal in the decomposition,
     4892// since the unit ideal it is not prime, otherwise take no special action.
    45734893  ASSUME(1, hasFieldCoefficient(basering) );
    45744894  ASSUME(1, not isQuotientRing(basering) ) ;
    45754895  ASSUME(1, hasGlobalOrdering(basering) ) ;
    4576 
    45774896  if((choose<0) or (choose>3))
    45784897  {
     
    46084927  if(SI[1]==1)  // primdecSY(ideal(1))
    46094928  {
    4610     return(list());
     4929          ASSUME(1, ncols(SI)==1);
     4930          if (patchPrimaryDecomposition==1)
     4931          {
     4932             return( list() );
     4933          }
     4934          else
     4935          {
     4936               return( list(list(ideal(1),ideal(1))) );
     4937          }
    46114938  }
    46124939  intvec save=option(get);
     
    47125039      if (V[2]==3) // pseudo_prim_dec_special is needed
    47135040      {
    4714         QQ,SRest=pseudo_prim_dec_special_charsets(V[1],V[6],choose);
     5041        QQ,SRest=pseudo_prim_dec_special_charsets_i(patchPrimaryDecomposition,V[1],V[6],choose);
    47155042                         // QQ = quadruples:
    47165043                         // standard basis of pseudo-primary component,
     
    47235050      else     // V is the root, pseudo_prim_dec is needed
    47245051      {
    4725         QQ,SRest=pseudo_prim_dec_charsets(I,SI,choose);
     5052        QQ,SRest=pseudo_prim_dec_charsets_i(patchPrimaryDecomposition,I,SI,choose);
    47265053                         // QQ = quadruples:
    47275054                         // standard basis of pseudo-primary component,
     
    47965123
    47975124
    4798 static proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo)
    4799 {
     5125static proc pseudo_prim_dec_charsets_i(int patchPrimaryDecomposition, ideal I, ideal SI, int choo)
     5126{
     5127// if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     5128// since the unit ideal it is not prime, otherwise take no special action.
    48005129  ASSUME(1, hasFieldCoefficient(basering) );
    48015130  ASSUME(1, not isQuotientRing(basering) ) ;
     
    48065135  if((choo==0) or (choo==1))
    48075136  {
    4808     L=min_ass_prim_charsets(I,choo);
     5137    L=min_ass_prim_charsets_i(patchPrimaryDecomposition,I,choo);
    48095138  }
    48105139  else
     
    48125141    if(choo==2)
    48135142    {
    4814       L=minAssPrimes(I);
     5143      L=minAssPrimes_i(patchPrimaryDecomposition,I);
    48155144    }
    48165145    else
    48175146    {
    4818       L=minAssPrimes(I,1);
     5147      L=minAssPrimes_i(patchPrimaryDecomposition,I,1);
    48195148    }
    48205149    for(int i=size(L);i>=1;i--)
     
    48235152    }
    48245153  }
    4825   return (pseudo_prim_dec_i(SI,L));
     5154  return (pseudo_prim_dec_i_i(patchPrimaryDecomposition,SI,L));
    48265155}
    48275156
     
    48495178////////////////////////////////////////////////////////////////
    48505179
    4851 
    4852 static proc pseudo_prim_dec_special_charsets (ideal SI,list V6, int choo)
    4853 {
     5180static proc pseudo_prim_dec_special_charsets_i (int patchPrimaryDecomposition, ideal SI,list V6, int choo)
     5181{
     5182// if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     5183// since the unit ideal it is not prime, otherwise take no special action.
    48545184  ASSUME(1, hasFieldCoefficient(basering) );
    48555185  ASSUME(1, not isQuotientRing(basering) ) ;
    48565186  ASSUME(1, hasGlobalOrdering(basering) ) ;
    4857 
    48585187  int i,j,l;
    48595188  list m;
     
    48755204        if((choo==0) or (choo==1))
    48765205        {
    4877           m=min_ass_prim_charsets(SP,choo);  // a list of SB
     5206          m=min_ass_prim_charsets_i(patchPrimaryDecomposition,SP,choo);  // a list of SB
    48785207        }
    48795208        else
     
    48815210          if(choo==2)
    48825211          {
    4883             m=minAssPrimes(SP);
     5212            m=minAssPrimes_i(patchPrimaryDecomposition,SP);
    48845213          }
    48855214          else
    48865215          {
    4887             m=minAssPrimes(SP,1);
     5216            m=minAssPrimes_i(patchPrimaryDecomposition,SP,1);
    48885217          }
    48895218          for(j=size(m);j>=1;j--)
     
    49345263    }
    49355264  }
    4936   return (pseudo_prim_dec_i(SI,L));
     5265  return (pseudo_prim_dec_i_i(patchPrimaryDecomposition,SI,L));
    49375266}
    49385267
    49395268
    49405269////////////////////////////////////////////////////////////////
    4941 // proc pseudo_prim_dec_i
     5270// proc pseudo_prim_dec_i_i
    49425271// input: A standard basis of an arbitrary ideal I, and standard bases
    49435272// of the minimal associated primes of I
     
    49515280////////////////////////////////////////////////////////////////
    49525281
    4953 
    4954 static proc pseudo_prim_dec_i (ideal SI, list L)
    4955 {
     5282static proc pseudo_prim_dec_i_i (int patchPrimaryDecomposition, ideal SI, list L)
     5283{
     5284// if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     5285// since the unit ideal it is not prime, otherwise take no special action.
    49565286  ASSUME(1, hasFieldCoefficient(basering) );
    49575287  ASSUME(1, not isQuotientRing(basering) ) ;
    49585288  ASSUME(1, hasGlobalOrdering(basering) ) ;
    4959 
    49605289  list Q;
    49615290  if (size(L)==1)               // one minimal associated prime only
     
    53565685//
    53575686///////////////////////////////////////////////////////////////////////////////
    5358 
    5359 proc primdecGTZ(ideal i, list #)
    5360 "USAGE:   primdecGTZ(i); i ideal
    5361 RETURN:  a list pr of primary ideals and their associated primes:
     5687proc primdecGTZE(ideal I, list #)
     5688"USAGE:   primdecGTZE(I); i ideal
     5689RETURN:  a list pr of primary ideals and their associated primes for a proper ideal, and an empty list for the unit ideal.
    53625690@format
    53635691   pr[i][1]   the i-th primary component,
     
    53725700           corresponding global ring is returned if the string 'global'
    53735701           is specified as second argument
     5702EXAMPLE: example primdecGTZE; shows an example
     5703"
     5704{
     5705    return (primdecGTZ_i(int(1),I,  #));     
     5706}
     5707example
     5708{ "EXAMPLE:";  echo = 2;
     5709   ring  r = 0,(x,y,z),lp;
     5710   poly  p = z2+1;
     5711   poly  q = z3+2;
     5712   ideal I = p*q^2,y-z2;
     5713   list pr = primdecGTZE(I);
     5714   pr;
     5715   ideal J = 1;
     5716   list prempty = primdecGTZE(J);
     5717   prempty;
     5718}
     5719
     5720proc primdecGTZ(ideal I, list #)
     5721"USAGE:   primdecGTZ(I); I ideal
     5722RETURN:  a list pr of primary ideals and their associated primes for a proper ideal I, otherwise pr = list( list( ideal(1), ideal(1) )
     5723@format
     5724   pr[i][1]   the i-th primary component,
     5725   pr[i][2]   the i-th prime component.
     5726@end format
     5727NOTE:      deprecated. use 'primdecGTZE()'
     5728         - Algorithm of Gianni/Trager/Zacharias.
     5729         - Designed for characteristic 0, works also in char k > 0, if it
     5730           terminates (may result in an infinite loop in small characteristic!)
     5731         - For local orderings, the result is considered in the localization
     5732           of the polynomial ring, not in the power series ring
     5733         - For local and mixed orderings, the decomposition in the
     5734           corresponding global ring is returned if the string 'global'
     5735           is specified as second argument
    53745736EXAMPLE: example primdecGTZ; shows an example
    53755737"
    53765738{
     5739    return (primdecGTZ_i(int(0), I , #));
     5740}
     5741example
     5742{ "EXAMPLE:";  echo = 2;
     5743   ring  r = 0,(x,y,z),lp;
     5744   poly  p = z2+1;
     5745   poly  q = z3+2;
     5746   ideal i = p*q^2,y-z2;
     5747   list pr = primdecGTZ(i);
     5748   pr;
     5749}
     5750
     5751static proc primdecGTZ_i(int patchPrimaryDecomposition,ideal i, list #)
     5752{
     5753// if parameter patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     5754//           since the unit ideal it is not prime, otherwise take no special action.
     5755// For other parameters see 'primdecGTZ' or 'primdecGTZE'.
    53775756   ASSUME(0, hasFieldCoefficient(basering) );
    53785757   ASSUME(0, not isQuotientRing(basering) ) ;
     
    53905769      ideal i=imap(r,i);
    53915770// decompose and go back
    5392       list li=primdecGTZ(i);
     5771      list li=primdecGTZ_i(patchPrimaryDecomposition,i);
     5772      int sizeli = size(li);
    53935773      setring r;
     5774      if (sizeli==0) 
     5775      {
     5776          return ( list() );
     5777      }
    53945778      def li=imap(s,li);
    53955779// clean up
     
    54105794   if(minpoly!=0)
    54115795   {
    5412       return(algeDeco(i,0));
     5796      return(algeDeco_i(patchPrimaryDecomposition,i,0));
    54135797      ERROR(
    54145798      "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
    54155799      );
    54165800   }
    5417   return(convList(decomp(i)));
     5801  return(convList(decomp_i(patchPrimaryDecomposition,i)));
     5802}
     5803
     5804///////////////////////////////////////////////////////////////////////////////
     5805proc absPrimdecGTZE(ideal I, list #)
     5806"USAGE:   absPrimdecGTZE(I); I ideal
     5807ASSUME:  Ground field has characteristic 0.
     5808RETURN:  a ring containing two lists: @code{absolute_primes}, the absolute
     5809         prime components of I, and @code{primary_decomp}, the output of
     5810         @code{primdecGTZ(I)}. Will fail for unit ideal.
     5811         The list absolute_primes has to be interpreted as follows:
     5812         each entry describes a class of conjugated absolute primes,
     5813@format
     5814   absolute_primes[i][1]   the absolute prime component,
     5815   absolute_primes[i][2]   the number of conjugates.
     5816@end format
     5817         The first entry of @code{absolute_primes[i][1]} is the minimal
     5818         polynomial of a minimal finite field extension over which the
     5819         absolute prime component is defined.
     5820         For local orderings, the result is considered in the localization
     5821         of the polynomial ring, not in the power series ring.
     5822         For local and mixed orderings, the decomposition in the
     5823         corresponding global ring is returned if the string 'global'
     5824         is specified as second argument
     5825NOTE:    Algorithm of Gianni/Trager/Zacharias combined with the
     5826         @code{absFactorize} command.
     5827SEE ALSO: primdecGTZ; absFactorize
     5828EXAMPLE: example absPrimdecGTZE; shows an example
     5829"
     5830{
     5831     return(absPrimdecGTZ_i(int(1),I,#));
    54185832}
    54195833example
     
    54225836   poly  p = z2+1;
    54235837   poly  q = z3+2;
    5424    ideal i = p*q^2,y-z2;
    5425    list pr = primdecGTZ(i);
    5426    pr;
    5427 }
    5428 ///////////////////////////////////////////////////////////////////////////////
     5838   ideal I = p*q^2,y-z2;
     5839   def S = absPrimdecGTZE(I);
     5840   setring S;
     5841   absolute_primes;
     5842}
     5843
    54295844proc absPrimdecGTZ(ideal I, list #)
    54305845"USAGE:   absPrimdecGTZ(I); I ideal
     
    54475862         corresponding global ring is returned if the string 'global'
    54485863         is specified as second argument
    5449 NOTE:    Algorithm of Gianni/Trager/Zacharias combined with the
     5864NOTE:    deprecated. Use 'absPrimdecGTZE()'.
     5865         Algorithm of Gianni/Trager/Zacharias combined with the
    54505866         @code{absFactorize} command.
    54515867SEE ALSO: primdecGTZ; absFactorize
     
    54535869"
    54545870{
     5871 
     5872    return(absPrimdecGTZ_i(int(0),I,#));
     5873}
     5874example
     5875{ "EXAMPLE:";  echo = 2;
     5876   ring  r = 0,(x,y,z),lp;
     5877   poly  p = z2+1;
     5878   poly  q = z3+2;
     5879   ideal i = p*q^2,y-z2;
     5880   def S = absPrimdecGTZ(i);
     5881   setring S;
     5882   absolute_primes;
     5883}
     5884
     5885
     5886
     5887static proc absPrimdecGTZ_i(int patchPrimaryDecomposition, ideal I, list #)
     5888{
     5889// if parameter patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     5890//           since the unit ideal it is not prime, otherwise take no special action.
     5891// For other parameters see 'absPrimdecGTZ' or 'absPrimdecGTZE'.
    54555892  ASSUME(0, hasFieldCoefficient(basering) );
    54565893  ASSUME(0, not isQuotientRing(basering) ) ;
     
    54755912      setring s;
    54765913      def I=imap(r,I);
    5477       def S=absPrimdecGTZ(I);
     5914      def S=absPrimdecGTZ_i(patchPrimaryDecomposition,I);
    54785915      setring S;
    54795916      ring r1=char(basering),var(nvars(r)+1),dp;
     
    55145951  if(minpoly!=0)
    55155952  {
    5516     //return(algeDeco(i,0));
     5953    //return(algeDeco_i(patchPrimaryDecomposition,I,0));
    55175954    ERROR(
    55185955      "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"
     
    55215958  def R=basering;
    55225959  int n=nvars(R);
    5523   list L=decomp(I,3);
     5960  list L=decomp_i(patchPrimaryDecomposition,I,3);
     5961  if (patchPrimaryDecomposition && size(L)==0 )
     5962  {
     5963     ERROR("will not handle case with unit ideal");
     5964  }
    55245965  string newvar=L[1][3];
    55255966  int k=find(newvar,",",find(newvar,",")+1);
     
    55786019  export(absolute_primes);
    55796020  setring R;
    5580   dbprint( printlevel-voice+3,"
     6021  dbprint( printlevel-voice+4,"
    55816022// 'absPrimdecGTZ' created a ring, in which two lists absolute_primes (the
    55826023// absolute prime components) and primary_decomp (the primary and prime
     
    55886029  return(Rz);
    55896030}
    5590 example
    5591 { "EXAMPLE:";  echo = 2;
    5592    ring  r = 0,(x,y,z),lp;
    5593    poly  p = z2+1;
    5594    poly  q = z3+2;
    5595    ideal i = p*q^2,y-z2;
    5596    def S = absPrimdecGTZ(i);
    5597    setring S;
    5598    absolute_primes;
    5599 }
     6031
    56006032
    56016033///////////////////////////////////////////////////////////////////////////////
    5602 
    5603 proc primdecSY(ideal i, list #)
    5604 "USAGE:   primdecSY(I, c); I ideal, c int (optional)
     6034proc primdecSYE(ideal I, list #)
     6035"USAGE:   primdecSYE(I, c); I ideal, c int (optional)
    56056036RETURN:  a list pr of primary ideals and their associated primes:
    56066037@format
     
    56086039   pr[i][2]   the i-th prime component.
    56096040@end format
     6041If I is the unit ideal returns an empty list.
    56106042NOTE:    Algorithm of Shimoyama/Yokoyama.
    56116043@format
     
    56236055"
    56246056{
     6057     return (primdecSY_i(int(1),I,#));
     6058}
     6059example
     6060{ "EXAMPLE:";  echo = 2;
     6061   ring  r = 0,(x,y,z),lp;
     6062   poly  p = z2+1;
     6063   poly  q = z3+2;
     6064   ideal I = p*q^2,y-z2;
     6065   list pr = primdecSYE(I);
     6066   pr;
     6067   ideal J = x;
     6068   list prUnit = primdecSYE(J);
     6069   prUnit;
     6070}
     6071
     6072proc primdecSY( ideal I, list #)
     6073"USAGE:   primdecSY(I, c); I ideal, c int (optional)
     6074RETURN:  a list pr of primary ideals and their associated primes for proper ideal I, otherwise pr[1] is list( ideal(1),ideal(1) )'
     6075@format
     6076   pr[i][1]   the i-th primary component,
     6077   pr[i][2]   the i-th prime component.
     6078@end format
     6079NOTE:    deprecated. Use 'primdecSYE()'.
     6080         Algorithm of Shimoyama/Yokoyama.
     6081@format
     6082   if c=0,  the given ordering of the variables is used,
     6083   if c=1,  minAssChar tries to use an optimal ordering (default),
     6084   if c=2,  minAssGTZ is used,
     6085   if c=3,  minAssGTZ and facstd are used.
     6086@end format
     6087         For local orderings, the result is considered in the localization
     6088         of the polynomial ring, not in the power series ring.
     6089         For local and mixed orderings, the decomposition in the
     6090         corresponding global ring is returned if the string 'global'
     6091         is specified as third argument
     6092EXAMPLE: example primdecSY; shows an example
     6093"
     6094{
     6095    return (primdecSY_i(int(0),I,#));
     6096}
     6097example
     6098{ "EXAMPLE:";  echo = 2;
     6099   ring  r = 0,(x,y,z),lp;
     6100   poly  p = z2+1;
     6101   poly  q = z3+2;
     6102   ideal i = p*q^2,y-z2;
     6103   list pr = primdecSY(i);
     6104   pr;
     6105}
     6106
     6107
     6108static proc primdecSY_i(int patchPrimaryDecomposition, ideal i, list #)
     6109{
     6110//           if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     6111//           since the unit ideal it is not prime, otherwise take no special action.
     6112//           For other paremetes see 'primdecSY' or 'primdecSYE'
    56256113   ASSUME(0, hasFieldCoefficient(basering) );
    56266114   ASSUME(0, not isQuotientRing(basering) ) ;
     
    56386126      ideal i=imap(r,i);
    56396127// decompose and go back
    5640       list li=primdecSY(i);
     6128      list li=primdecSY_i(patchPrimaryDecomposition,i);
     6129      int sizeli = size(li);
    56416130      setring r;
     6131      if (sizeli==0)  { return ( list() ); }
    56426132      def li=imap(s,li);
    56436133// clean up
     
    56566146   }
    56576147   i=simplify(i,2);
    5658    if ((i[1]==0)||(i[1]==1))
     6148
     6149   //if ((i[1]==0)||(i[1]==1)) // would not work anyway, since i cannot be assumed to be in standard basis form;
     6150   //                          // but why return list(1,1) in case i=1 ??
     6151   if ( (i[1]==0) )
     6152
    56596153   {
    5660      list L=list(ideal(i[1]),ideal(i[1]));
     6154     list L = list(ideal(i[1]), ideal(i[1]) );
    56616155     return(list(L));
    56626156   }
     
    56646158   if(minpoly!=0)
    56656159   {
    5666       return(algeDeco(i,1));
     6160      return(algeDeco_i(patchPrimaryDecomposition,i,1));
    56676161   }
    56686162   if (size(#)!=0)
    5669    { return(prim_dec(i,#[1])); }
     6163   { return(prim_dec_i(patchPrimaryDecomposition,i,#[1])); }
    56706164   else
    5671    { return(prim_dec(i,1)); }
    5672 }
    5673 example
    5674 { "EXAMPLE:";  echo = 2;
    5675    ring  r = 0,(x,y,z),lp;
    5676    poly  p = z2+1;
    5677    poly  q = z3+2;
    5678    ideal i = p*q^2,y-z2;
    5679    list pr = primdecSY(i);
    5680    pr;
    5681 }
    5682 ///////////////////////////////////////////////////////////////////////////////
    5683 proc minAssGTZ(ideal i,list #)
    5684 "USAGE:    minAssGTZ(I[, l]); I ideal, l list (optional)
     6165   { return(prim_dec_i(patchPrimaryDecomposition,i,1)); }
     6166}
     6167
     6168
     6169
     6170proc minAssGTZE(ideal I,list #)
     6171"USAGE:    minAssGTZE(I[, l]); I ideal, l list (optional)
    56856172   @* Optional parameters in list l (can be entered in any order):
    56866173   @* 0, \"facstd\" -> uses facstd to first decompose the ideal (default)
     
    56976184           corresponding global ring is returned if the string 'global'
    56986185           is specified as second argument
     6186EXAMPLE: example minAssGTZE; shows an example
     6187"
     6188{
     6189    list result = minAssGTZ_i(int(1),I,#);
     6190    return(result);
     6191     
     6192}
     6193example
     6194{ "EXAMPLE:";  echo = 2;
     6195   ring  r = 0,(x,y,z),dp;
     6196   poly  p = z2+1;
     6197   poly  q = z3+2;
     6198   ideal I = p*q^2,y-z2;
     6199   list pr = minAssGTZE(I);
     6200   pr;
     6201   ideal J = 1;
     6202   list prempty = minAssGTZE(J);
     6203   prempty;
     6204
     6205}
     6206
     6207
     6208proc minAssGTZ(ideal I,list #)
     6209"USAGE:    minAssGTZ(I[, l]); I ideal, l list (optional)
     6210   @* Optional parameters in list l (can be entered in any order):
     6211   @* 0, \"facstd\" -> uses facstd to first decompose the ideal (default)
     6212   @* 1, \"noFacstd\" -> does not use facstd
     6213   @* \"GTZ\" -> the original algorithm by Gianni, Trager and Zacharias is used
     6214   @* \"SL\" -> GTZ algorithm with modificiations by Laplagne is used (default)
     6215
     6216RETURN:  a list, the minimal associated prime ideals of proper ideal I, otherwise ideal(1)
     6217NOTE:    deprecated. Use 'minAssGTZE()'.
     6218         - Designed for characteristic 0, works also in char k > 0 based
     6219           on an algorithm of Yokoyama
     6220         - For local orderings, the result is considered in the localization
     6221           of the polynomial ring, not in the power series ring
     6222         - For local and mixed orderings, the decomposition in the
     6223           corresponding global ring is returned if the string 'global'
     6224           is specified as second argument
    56996225EXAMPLE: example minAssGTZ; shows an example
    57006226"
    57016227{
     6228    list result = minAssGTZ_i(int(0),I,#);
     6229    return(result);
     6230}
     6231example
     6232{ "EXAMPLE:";  echo = 2;
     6233   ring  r = 0,(x,y,z),dp;
     6234   poly  p = z2+1;
     6235   poly  q = z3+2;
     6236   ideal i = p*q^2,y-z2;
     6237   list pr = minAssGTZ(i);
     6238   pr;
     6239}
     6240
     6241
     6242///////////////////////////////////////////////////////////////////////////////
     6243static proc minAssGTZ_i(int patchPrimaryDecomposition, ideal i,list #)
     6244 {
     6245//           if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     6246//           since the unit ideal it is not prime, otherwise take no special action.
     6247//           For other parameters see 'minAssGTZ' or 'minAssGTZE'
    57026248   ASSUME(0, hasFieldCoefficient(basering) );
    57036249   ASSUME(0, not isQuotientRing(basering) ) ;
     
    57166262      ideal i=imap(r,i);
    57176263// decompose and go back
    5718       list li=minAssGTZ(i);
     6264      list li=minAssGTZ_i(patchPrimaryDecomposition,i);
     6265      int sizeli = size(li);
    57196266      setring r;
     6267      if (sizeli==0) { return(list()); }
    57206268      def li=imap(s,li);
    57216269// clean up
     
    57756323  if(minpoly!=0)
    57766324  {
    5777     return(algeDeco(i,2));
    5778   }
    5779 
    5780   list result = minAssPrimes(i, facstdOption, algorithm);
     6325    return(algeDeco_i(patchPrimaryDecomposition,i,2));
     6326  }
     6327
     6328  list result = minAssPrimes_i(patchPrimaryDecomposition,i, facstdOption, algorithm);
    57816329  return(result);
     6330}
     6331
     6332
     6333///////////////////////////////////////////////////////////////////////////////
     6334proc minAssCharE(ideal I, list #)
     6335"USAGE:   minAssCharE(I[,c]); i ideal, c int (optional).
     6336RETURN:  list, the minimal associated prime ideals of I. If I is the unit ideal returns an empty list.
     6337NOTE:    If c=0, the given ordering of the variables is used. @*
     6338         Otherwise, the system tries to find an optimal ordering,
     6339         which in some cases may considerably speed up the algorithm. @*
     6340         For local orderings, the result is considered in the localization
     6341         of the polynomial ring, not in the power series ring
     6342         For local and mixed orderings, the decomposition in the
     6343         corresponding global ring is returned if the string 'global'
     6344         is specified as third argument
     6345EXAMPLE: example minAssCharE; shows an example
     6346"
     6347{
     6348    return(minAssChar_i(int(1),I,#));
    57826349}
    57836350example
     
    57866353   poly  p = z2+1;
    57876354   poly  q = z3+2;
    5788    ideal i = p*q^2,y-z2;
    5789    list pr = minAssGTZ(i);
     6355   ideal I = p*q^2,y-z2;
     6356   list pr = minAssCharE(I);
    57906357   pr;
    5791 }
    5792 
    5793 ///////////////////////////////////////////////////////////////////////////////
    5794 proc minAssChar(ideal i, list #)
     6358   ideal J = 5;
     6359   list prempty = minAssCharE(J);
     6360   prempty;
     6361}
     6362
     6363proc minAssChar(ideal I, list #)
    57956364"USAGE:   minAssChar(I[,c]); i ideal, c int (optional).
    5796 RETURN:  list, the minimal associated prime ideals of i.
    5797 NOTE:    If c=0, the given ordering of the variables is used. @*
     6365RETURN:  list, the minimal associated prime ideals of I. If I is the unit ideal returns list( ideal(1) )
     6366NOTE:    deprecated. Use 'minAssCharE'.
     6367         If c=0, the given ordering of the variables is used. @*
    57986368         Otherwise, the system tries to find an optimal ordering,
    57996369         which in some cases may considerably speed up the algorithm. @*
     
    58056375EXAMPLE: example minAssChar; shows an example
    58066376"
    5807 {
     6377
     6378    return(minAssChar_i(int(0),I,#));
     6379}
     6380example
     6381{ "EXAMPLE:";  echo = 2;
     6382   ring  r = 0,(x,y,z),dp;
     6383   poly  p = z2+1;
     6384   poly  q = z3+2;
     6385   ideal i = p*q^2,y-z2;
     6386   list pr = minAssChar(i);
     6387   pr;
     6388}
     6389
     6390proc minAssChar_i(int patchPrimaryDecomposition, ideal i, list #)
     6391{
     6392//           if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     6393//           since the unit ideal it is not prime, otherwise take no special action.
     6394//           For other parameters see 'minAssChar' or 'minAssCharE'
    58086395   ASSUME(0, hasFieldCoefficient(basering) );
    58096396   ASSUME(0, not isQuotientRing(basering) ) ;
     6397   ASSUME(0,size(#)<3);
    58106398   if(size(#)>1)
    58116399   {
     
    58216409      ideal i=imap(r,i);
    58226410// decompose and go back
    5823       list li=minAssChar(i);
     6411      list li=minAssChar_i(patchPrimaryDecomposition,i);
     6412      int sizeli = size(li);
    58246413      setring r;
     6414      if (sizeli==0) { return(list()); }
    58256415      def li=imap(s,li);
    58266416// clean up
     
    58396429   }
    58406430   if (size(#)>0)
    5841    { return(min_ass_prim_charsets(i,#[1])); }
     6431   { return(min_ass_prim_charsets_i(patchPrimaryDecomposition,i,#[1])); }
    58426432   else
    5843    { return(min_ass_prim_charsets(i,1)); }
    5844 }
    5845 example
    5846 { "EXAMPLE:";  echo = 2;
    5847    ring  r = 0,(x,y,z),dp;
    5848    poly  p = z2+1;
    5849    poly  q = z3+2;
    5850    ideal i = p*q^2,y-z2;
    5851    list pr = minAssChar(i);
    5852    pr;
    5853 }
     6433   { return(min_ass_prim_charsets_i(patchPrimaryDecomposition,i,1)); }
     6434}
     6435
    58546436///////////////////////////////////////////////////////////////////////////////
    58556437proc equiRadical(ideal i)
     
    64797061// Given an ideal I and an ideal P (intersection of some minimal prime ideals
    64807062// associated to I), it calculates the intersection of new minimal prime ideals
    6481 // associated to I which where not used to calculate P.
     7063// associated to I which where not used to calculate P. P = 1 represents empty intersection.
    64827064// This version uses ZD Radical in the zerodimensional case.
    64837065static proc radicalSLIteration (ideal I, ideal P);
     
    67467328}
    67477329
     7330
     7331proc testPrimaryE(list pr, ideal k)
     7332"USAGE:   testPrimaryE(pr,k); pr a list, k an ideal.
     7333ASSUME:  pr is the result of a primary decomposition and may be empty ( for the unit ideal)
     7334RETURN:  int, 1 if the intersection of the ideals in pr is k, 0 if not
     7335EXAMPLE: example testPrimaryE; shows an example
     7336"
     7337{
     7338    return(testPrimary_i(int(1),pr,k));
     7339}
     7340example
     7341{ "EXAMPLE:";  echo = 2;
     7342   ring  r = 32003,(x,y,z),dp;
     7343   poly  p = z2+1;
     7344   poly  q = z4+2;
     7345   ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     7346   list pr = primdecGTZ(i);
     7347   testPrimaryE(pr,i);
     7348}
     7349
    67487350proc testPrimary(list pr, ideal k)
    67497351"USAGE:   testPrimary(pr,k); pr a list, k an ideal.
    67507352ASSUME:  pr is the result of primdecGTZ(k) or primdecSY(k).
    67517353RETURN:  int, 1 if the intersection of the ideals in pr is k, 0 if not
     7354NOTE:    deprecated. Use 'testPrimaryE()'
    67527355EXAMPLE: example testPrimary; shows an example
    67537356"
    67547357{
    6755    ASSUME(0, hasFieldCoefficient(basering) );
    6756    ASSUME(0, not isQuotientRing(basering) ) ;
    6757 
    6758    int i;
    6759    pr=reconvList(pr);
    6760    ideal j=pr[1];
    6761    for (i=2;i<=size(pr) div 2;i++)
    6762    {
    6763        j=intersect(j,pr[2*i-1]);
    6764    }
    6765    return(idealsEqual(j,k));
     7358    return(testPrimary_i(int(0),pr,k));
    67667359}
    67677360example
     
    67747367   testPrimary(pr,i);
    67757368}
     7369
     7370
     7371static proc testPrimary_i(int patchPrimaryDecomposition,list pr, ideal k)
     7372{
     7373//           if patchPrimaryDecomposition=1,  handle the case of an empty decomposition list.
     7374//           For other parameters see 'testPrimary'
     7375   ASSUME(0, hasFieldCoefficient(basering) );
     7376   ASSUME(0, not isQuotientRing(basering) ) ;
     7377
     7378   int i;
     7379   pr=reconvList(pr);
     7380   if (patchPrimaryDecomposition==1)
     7381   {
     7382       if (idealsEqual( k, ideal(1)) )
     7383       {
     7384          return( size(pr)==0 ); //list expected to be empty.
     7385       }
     7386   }
     7387   ideal j=pr[1];
     7388 
     7389
     7390   for (i=2;i<=size(pr) div 2;i++)
     7391   {
     7392       j=intersect(j,pr[2*i-1]);
     7393   }
     7394   return(idealsEqual(j,k));
     7395}
     7396
    67767397
    67777398///////////////////////////////////////////////////////////////////////////////
     
    67907411  ASSUME(0, hasFieldCoefficient(basering) );
    67917412  ASSUME(0, not isQuotientRing(basering) ) ;
     7413  ASSUME(2, dim(groebner(I))==1 );
    67927414  if(attrib(basering,"global")!=1)
    67937415  {
     
    68927514   pr;
    68937515}
     7516
     7517
     7518static proc newDecompStepE(ideal I, list #)
     7519{
     7520   return(newDecompStep_i(int(1),I,#));
     7521}
     7522
     7523static proc newDecompStep(ideal I, list #)
     7524{
     7525    return(newDecompStep_i(int(0),I,#));
     7526}
     7527
    68947528///////////////////////////////////////////////////////////////////////////////
    6895 static proc newDecompStep(ideal i, list #)
    6896 "USAGE:  newDecompStep(i); i ideal  (for primary decomposition)
    6897          newDecompStep(i,1);        (for the associated primes of dimension of i)
    6898          newDecompStep(i,2);        (for the minimal associated primes)
    6899          newDecompStep(i,3);        (for the absolute primary decomposition (not tested!))
     7529static proc newDecompStep_i(int patchPrimaryDecomposition, ideal i, list #)
     7530"USAGE:  newDecompStep_i(patchPrimaryDecomposition, I); I ideal  (for primary decomposition)
     7531         newDecompStep_i(patchPrimaryDecomposition, I,1);        (for the associated primes of dimension of i)
     7532         newDecompStep_i(patchPrimaryDecomposition, I,2);        (for the minimal associated primes)
     7533         newDecompStep_i(patchPrimaryDecomposition, I,3);        (for the absolute primary decomposition (not tested!))
    69007534         "oneIndep";        (for using only one max indep set)
    69017535         "intersect";        (returns alse the intersection of the components founded)
     
    69057539         (resp. a list of the minimal associated primes)
    69067540NOTE:    Algorithm of Gianni/Trager/Zacharias
     7541         if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     7542         since the unit ideal it is not prime, otherwise take no special action.
    69077543EXAMPLE: example newDecompStep; shows an example
    69087544"
     
    71457781      @j=simplify(@j, 2);
    71467782      attrib(@j,"isSB",1);
    7147       result = newDecompStep(@j, indepOption, intersectOption, @wr);
     7783      result = newDecompStep_i(patchPrimaryDecomposition, @j, indepOption, intersectOption, @wr);
    71487784      if (intersectOption == "intersect")
    71497785      {
     
    77538389           {
    77548390              // The following line was dropped to avoid the recursion step:
    7755               //htprimary=newDecompStep(@j,@wr,peek,ser);
     8391              //htprimary=newDecompStep_i(patchPrimaryDecomposition, @j,@wr,peek,ser);
    77568392              htprimary = list();
    77578393           }
     
    77598395           {
    77608396              // The following line was dropped to avoid the recursion step:
    7761               //htprimary=newDecompStep(@j,peek,ser);
     8397              //htprimary=newDecompStep_i(patchPrimaryDecomposition,@j,peek,ser);
    77628398              htprimary = list();
    77638399           }
     
    78108446   poly  p = z2+1;
    78118447   poly  q = z4+2;
    7812    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    7813    list pr= newDecompStep(i);
     8448   ideal I = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     8449   int patchDecomposition = 1;
     8450   list pr = newDecompStep_i(patchDecomposition, I);
    78148451   pr;
    7815    testPrimary( pr, i);
     8452   testPrimary( pr, I);
    78168453}
    78178454
     
    80908727///////////////////////////////////////////////////////////////////////////////
    80918728// Based on minAssGTZ
    8092 
    8093 proc minAss(ideal i,list #)
    8094 "USAGE:   minAss(I[, l]); i ideal, l list (optional) of parameters, same as minAssGTZ
     8729proc minAssE(ideal I,list #)
     8730"USAGE:   minAssE(I[, l]); I ideal, l list (optional) of parameters, same as minAssGTZ
    80958731RETURN:  a list, the minimal associated prime ideals of I.
    80968732NOTE:    Designed for characteristic 0, works also in char k > 0 based
    80978733         on an algorithm of Yokoyama
     8734EXAMPLE: example minAssE; shows an example
     8735"
     8736{
     8737 return(minAss_i(int(1),I,#));
     8738}
     8739example
     8740{ "EXAMPLE:";  echo = 2;
     8741   ring  r = 0, (x, y, z), dp;
     8742   poly  p = z2 + 1;
     8743   poly  q = z3 + 2;
     8744   ideal i = p * q^2, y - z2;
     8745   list pr = minAssE(i);
     8746   pr;
     8747   ideal j = 1;
     8748   list prempty = minAssE(j);
     8749   prempty;
     8750}
     8751
     8752proc minAss(ideal I,list #)
     8753"USAGE:   minAss(I[, l]); I ideal, l list (optional) of parameters, same as minAssGTZ
     8754RETURN:  a list, the minimal associated prime ideals of I. If I is the unit ideal, returns list(ideal(1));
     8755NOTE:    deprecated. Use 'minAssE()'.
     8756         Designed for characteristic 0, works also in char k > 0 based
     8757         on an algorithm of Yokoyama
    80988758EXAMPLE: example minAss; shows an example
    80998759"
    81008760{
    8101   return(minAssGTZ(i,#));
     8761    return(minAss_i(int(0),I,#));
    81028762}
    81038763example
     
    81118771}
    81128772
     8773static proc minAss_i(int patchPrimaryDecomposition,ideal I,list #)
     8774{
     8775//         if patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     8776//         since the unit ideal it is not prime, otherwise take no special action.
     8777//         For other parameters see 'minAss' or 'minAssE'
     8778  return(minAssGTZ_i(patchPrimaryDecomposition,I,#));
     8779}
     8780
     8781
    81138782
    81148783///////////////////////////////////////////////////////////////////////////////
     
    81658834// Given an ideal I and an ideal P (intersection of some minimal prime ideals
    81668835// associated to I), it calculates new minimal prime ideals associated to I
    8167 // which were not used to calculate P.
     8836// which were not used to calculate P. P = 1 represents empty intersetion.
    81688837// This version uses Primary Decomposition in the zerodimensional case.
    81698838static proc minAssSLIteration(ideal I, ideal P);
     
    81998868  dbprint(printlevel - voice, "// We do the reduction to the zerodimensional case, via decomp.");
    82008869
    8201   primaryDec = newDecompStep(J, "oneIndep", "intersect", 2);
     8870  primaryDec = newDecompStep_i( int(1), J, "oneIndep", "intersect", 2);
    82028871  // Debug
    82038872  dbprint(printlevel - voice, "// Proc decomp has found", size(primaryDec) div 2, "new primary components.");
     
    83499018  if (dim(j)>0)
    83509019  {
     9020    ERROR("dim(j)>0 . Please send the failing example to the authors");
    83519021    primary[1]=ideal(1);
    83529022    primary[2]=ideal(1);
     
    84049074    if((size(ser)>0)&&(size(reduce(ser,j,1))==0))
    84059075    {
     9076       ERROR("dim(j)==-1 unexpected. Please send the failing example to the authors");
    84069077      primary[1]=ideal(1);
    84079078      primary[2]=ideal(1);
     
    84109081    if(dim(j)==-1)
    84119082    {
     9083      ERROR("dim(j)==-1 unexpected. Please send the failing example to the authors");
    84129084      primary[1]=ideal(1);
    84139085      primary[2]=ideal(1);
     
    84289100  else
    84299101  {
     9102    ERROR("failure in newZero_decomp. Please send the failing example to the authors");
    84309103    primary[1]=ideal(1);
    84319104    primary[2]=ideal(1);
     
    84399112    if(size(#)>1)
    84409113    {
     9114      ERROR("failure in newZero_decomp. Please send the failing example to the authors");
    84419115      primary[1]=ideal(1);
    84429116      primary[2]=ideal(1);
     
    84929166  }
    84939167
    8494   if((voice>=6)&&(char(basering)<=181))
     9168  if((voice>=7)&&(char(basering)<=181))
    84959169  {
    84969170    primary=splitCharp(primary);
    84979171  }
    84989172
    8499   if((@wr==2)&&(npars(basering)>0)&&(voice>=6)&&(char(basering)>0))
     9173  if((@wr==2)&&(npars(basering)>0)&&(voice>=7)&&(char(basering)>0))
    85009174  {
    85019175  //the prime decomposition of Yokoyama in characteristic p
     
    85079181      if(size(primary[2*@k])==0)
    85089182      {
    8509         ek=insepDecomp(primary[2*@k-1]);
     9183        ek=insepDecomp_i(int(1), primary[2*@k-1]);
    85109184        primary=delete(primary,2*@k);
    85119185        primary=delete(primary,2*@k-1);
  • Singular/LIB/ring.lib

    r3176e6 ra6d6356  
    3333 isQuotientRing(rng)      ring is a qotient ring
    3434 isSubModule(I,J)         check if I is in J as submodule
     35
     36 changeordTo(r,o)         change the ordering of a ring to a simple one
     37 addvarsTo(r,vars,i)      add variables to a ring
     38 addNvarsTo(r,N,name,i)   add N variables to a ring
    3539";
    3640
     
    11131117
    11141118proc changeordTo(def r,string o)
     1119"USAGE:  changeordTo(ring, string s);
     1120RETURN:  a ring with the oderinging changed to the (simple) ordering s
     1121EXAMPLE: example changeordTo(); shows an example
     1122"
    11151123{
    11161124  list rl=ringlist(r);
     
    11211129example
    11221130{
     1131  "EXAMPLE:"; echo = 2;
    11231132  ring r=0,(x,y),lp;
    1124   def rr=changeordToCdp(r,"dp");
     1133  def rr=changeordTo(r,"dp");
    11251134  rr;
    11261135}
    11271136
     1137proc addvarsTo(def r,list vars,int blockorder)
     1138"USAGE:  addvarsTo(ring,list_of_strings, int);
     1139         int may be: 0:ordering: dp
     1140                     1:ordering dp,dp
     1141                     2:oring.ordering,dp
     1142RETURN:  a ring with the addtional variables
     1143EXAMPLE: example addvarsTo(); shows an example
     1144"
     1145{
     1146  list rl=ringlist(r);
     1147  int n=nvars(r);
     1148  rl[2]=rl[2]+vars;
     1149  if (blockorder==0)
     1150  {
     1151    rl[3]=list(list("C",0),list("dp",1:(nvars(r)+size(vars))));
     1152  }
     1153  else
     1154  {
     1155    if (blockorder==2)
     1156    {
     1157      rl[3]=rl[3]+list(list("dp",1:size(vars)));
     1158    }
     1159    else
     1160    {
     1161      rl[3]=list(list("C",0),list("dp",1:nvars(r)),list("dp",1:size(vars)));
     1162    }
     1163  }
     1164  def rr=ring(rl);
     1165  return(rr);
     1166}
     1167example
     1168{
     1169  "EXAMPLE:"; echo = 2;
     1170  ring r=0,(x,y),lp;
     1171  def rr=addvarsTo(r,list("a","b"),0);
     1172  rr; kill rr;
     1173  def rr=addvarsTo(r,list("a","b"),1);
     1174  rr; kill rr;
     1175  def rr=addvarsTo(r,list("a","b"),2);
     1176  rr;
     1177}
     1178proc addNvarsTo(def r,int N,string n,int blockorder)
     1179"USAGE:  addNvarsTo(ring,int N, string name, int b);
     1180         b may be: 0:ordering: dp
     1181                   1:ordering dp,dp
     1182                   2:oring.ordering,dp
     1183RETURN:  a ring with N addtional variables
     1184EXAMPLE: example addNvarsTo(); shows an example
     1185"
     1186{
     1187  list v;
     1188  for(int i=N;i>0;i--) { v[i]=n+"("+string(i)+")"; }
     1189  return(addvarsTo(r,v,blockorder));
     1190}
     1191example
     1192{
     1193  "EXAMPLE:"; echo = 2;
     1194  ring r=0,(x,y),lp;
     1195  def rr=addNvarsTo(r,2,"@",0);
     1196  rr; kill rr;
     1197  def rr=addNvarsTo(r,2,"@",1);
     1198  rr; kill rr;
     1199  def rr=addNvarsTo(r,2,"@",2);
     1200  rr;
     1201}
  • Singular/LIB/rinvar.lib

    r3176e6 ra6d6356  
    3434LIB "elim.lib";
    3535LIB "zeroset.lib";
     36LIB "ring.lib";
    3637
    3738///////////////////////////////////////////////////////////////////////////////
     
    286287  int i, dbPrt, nrNewVars;
    287288  intvec wt, wth, hs1;
    288   string ringSTR1, ringSTR2, order;
    289 
    290289  def RARB = basering;
    291   nrNewVars = size(F);
     290  nrNewVars = ncols(F);
    292291
    293292  dbPrt = printlevel-voice+2;
     
    299298
    300299  string @mPoly = string(minpoly);
    301   order = "(dp(" + string(nvars(basering)) + "), dp);";
    302   ringSTR1 = "ring RAR1 = (" + charstr(basering) + "), (" + varstr(basering) + ", Y(1.." + string(nrNewVars) + ")), " + order;
    303   ringSTR2 = "ring RAR2 = (" + charstr(basering) + "), Y(1.." + string(nrNewVars) + "), dp;";
    304   execute(ringSTR1);
    305   execute("minpoly = number(" + @mPoly + ");");
     300  def RAR1=addNvarsTo(basering,nrNewVars,"Y",1); setring RAR1;
     301  string ringSTR2 = "ring RAR2 = (" + charstr(basering) + "), Y(1.." + string(nrNewVars) + "), dp;";
    306302
    307303  ideal I, J1, J2, Fm;
  • Singular/LIB/sagbi.lib

    r3176e6 ra6d6356  
    3131LIB "toric.lib";
    3232LIB "algebra.lib";
     33LIB "ring.lib";
    3334//////////////////////////////////////////////////////////////////////////////
    3435
     
    11111112
    11121113    //------------- change the basering bsr to bsr[@(0),...,@(z)] ----------
    1113     execute("ring s=("+charstr(basering)+"),("+varstr(basering)+",@(0..z)),dp;");
     1114    def s=addNvarsTo(basering,z+1,,"@",0); setring s;
    11141115    // Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend
    11151116    // geaendert werden:
  • Singular/LIB/solve.lib

    r3176e6 ra6d6356  
    2323
    2424LIB "triang.lib";    // needed for triang_solve
     25LIB "ring.lib";      // needed for changeordTo
    2526
    2627///////////////////////////////////////////////////////////////////////////////
     
    692693    if (sb==0)
    693694    {
    694       execute("ring dphom=("+charstr(rin)+"),("+
    695       varstr(rin)+"),dp;");
     695      def dphom=changeordTo(rin,"dp"); setring dphom;
    696696      ideal G = std(imap(rin,G));
    697697      if (dim(G)!=0){ERROR("ideal not zero-dimensional");}
     
    736736    if (sb==0)
    737737    {
    738       execute("ring dphilb=("+charstr(rin)+"),("+ varstr(rin)+"),dp;");
     738      def dphilb=changeordTo(rin,"dp"); setring dphilb;
    739739      ideal G = imap(rin,G);
    740740      G = std(G);
     
    747747      attrib(G,"isSB",1);
    748748    }
    749     execute("ring lexhilb=("+charstr(rin)+"),("+ varstr(rin)+"),lp;");
     749    def lexhilb=changeordTo(rin,"lp"); setring lexhilb;
    750750    option(redTail);
    751751    ideal H = fglm(dphilb,G);
     
    755755    else
    756756    {
    757       execute("ring lplex=("+charstr(rin)+"),("+varstr(rin)+"),lp;");
     757      def lplex=changeordTo(rin,"lp"); setring lplex;
    758758    }
    759759    ideal H = imap(lexhilb,H);
  • Singular/subexpr.cc

    r3176e6 ra6d6356  
    18071807    else
    18081808    {
    1809       sleftv tmp;
     1809      sleftv tmp; tmp.Init();
    18101810      int toktype=iiTokType(d->op);
    18111811      if ((toktype==CMD_M)
  • Tst/Short.lst

    r0cf4e1 ra6d6356  
    275275Short/string.tst
    276276Short/test_c_dp.tst
     277Short/test_unit_ideal_decomposition.tst
     278Short/test_zero_ideal_decomposition.tst
    277279Short/triang_s.tst
    278280; Short/tropical.tst ;; too long ?
  • Tst/Short/bug_529.res.gz.uu

    r0cf4e1 ra6d6356  
    1 begin 640 bug_529.res.gz
    2 M'XL("-2^1U0``V)U9U\U,CDN<F5S`'5276O",!1][Z^XZ!X2UU53=7YA<9LO
    3 MA3$$!SZ(2&VC9-.T)I&5C?WW7:NV=6R!)">Y'^?<Y$Y?Q_X+`#`/GOU'J!AM
    4 MG*U850;6]&QQ/<#+I9#"$#JPCCMX'JP.FV7;[3F2?SC:!";W;WJ0XY8#<6)$
    5 M+,E'H"0MDK8S.E))E-A%/,PH2^;[4HZ.`XF*0]@)^:#U!`.XGI&(K\&GN5/7
    6 M@:_\T'-P`<7-04DR.3'T^^5XXE.@D/,QYL!W?G`+<M8\DV.58Q[&NV1J>#(C
    7 M(N+!%H0-6Z$-5',=K%72P=I_ZKA*17R[>BVE4Y;2+4G!JI20&U`XAZ1!;9*&
    8 M=KJQTSW"*"%-:C\53^@V/#BI]&$(Z1X]"QM^]J^"?(RLUZ%6`R%#Q0/-S]$,
    9 M[CQP\18N8ZT$C^9:?'*207K+%L/1VWSTOAA8<[;H6^BT1#!,]R?H(MQ8N/UG
    10 MNNC"E[_^Y0X=@)4%L-RIU%]NT5\RONXPMWUJVV-K'C1AF.C&^@%^+>\)[0(`
    11 !````
     1begin 644 bug_529.res.gz
     2M'XL(",S/5U0``V)U9U\U,CDN<F5S`'526VO",!1^[Z\XZ!X2UU53[;QA<9LO
     3MA3$$!SZ(B+91LFE:D\C*QO[[CK=>QA9(\B7G\GTG.9/74?`"`,R'Y^`1*D8;
     4M9RM6E;XUN5A<'_!R(:0PA/:MXPZ^#ZO#9N&Y74?R#T>;I<G\FSYDN.5`G!@1
     5M2_*Q5)+F2;T3':DD2NPB'IXH"^;[0HZV`XF*0]@)^:#U&`.XGI*(KR&@F5/'
     6M@:_LT'5P`<7-04DR/C/T>L5X$E"@D/$QYL!W=G!S<M:\D&.5(Q[&NV1B>#(E
     7M(N+++0@;MD(;J&8Z6*N@@WE_ZBBE(H%=+4MI%Z5T"E*P*B7D!A3.`6E0FZ2A
     8MG6[L=(\P2DB3VD_Y$[H-'\XJ`QA`ND?/W(:?_:N@`"/K=:C50,A0\:7FEV@&
     9M=SZX>`O7L5:"1S,M/CDY07K+YH/AVVSX/N];,S;O6>BT0#!(]V?H(MQ8N/UG
     10MNNK"ER__<IOVH9R39<Z%/G/S/I-QN=-<[]R^QQ8]:,(PX8WU`\[8'TSU`@``
    1211`
    1312end
  • Tst/Short/bug_529.stat

    r0cf4e1 ra6d6356  
    1 1 >> tst_memory_0 :: 1407244027:4.0.0, 64 bit:4.0.0:x86_64-Linux:nepomuck:292608
    2 1 >> tst_memory_1 :: 1407244027:4.0.0, 64 bit:4.0.0:x86_64-Linux:nepomuck:2326528
    3 1 >> tst_memory_2 :: 1407244027:4.0.0, 64 bit:4.0.0:x86_64-Linux:nepomuck:2379776
    4 1 >> tst_timer_1 :: 1407244027:4.0.0, 64 bit:4.0.0:x86_64-Linux:nepomuck:2
     11 >> tst_memory_0 :: 1408579461:4.0.0, 32 bit:4.0.0:i686-Linux:vogon.jeltz:259776
     21 >> tst_memory_1 :: 1408579461:4.0.0, 32 bit:4.0.0:i686-Linux:vogon.jeltz:2338816
     31 >> tst_memory_2 :: 1408579461:4.0.0, 32 bit:4.0.0:i686-Linux:vogon.jeltz:2387344
     41 >> tst_timer_1 :: 1408579461:4.0.0, 32 bit:4.0.0:i686-Linux:vogon.jeltz:4
  • Tst/Short/ok_s.lst

    r3176e6 ra6d6356  
    3030bug_tr671
    3131bug_tr679
     32bug_tr686
    3233bug_genus_etc
    3334facstd
  • libpolys/coeffs/longrat.cc

    r3176e6 ra6d6356  
    345345  if ( SR_HDL(n) & SR_INT )
    346346  {
    347     int nn=SR_TO_INT(n);
    348     if ((long)nn==SR_TO_INT(n))
    349        term = nn;
    350     else
    351     {
    352         mpz_t dummy;
    353         mpz_init_set_si(dummy, SR_TO_INT(n));
    354         term = make_cf(dummy);
    355     }
     347    long nn=SR_TO_INT(n);
     348    term = nn;
    356349  }
    357350  else
  • libpolys/coeffs/rintegers.cc

    r3176e6 ra6d6356  
    161161number nrzCopy(number a, const coeffs)
    162162{
     163  if (a==NULL) return NULL;
    163164  mpz_ptr erg = (mpz_ptr) omAllocBin(gmp_nrz_bin);
    164165  mpz_init_set(erg, (mpz_ptr) a);
  • libpolys/polys/clapsing.cc

    r3176e6 ra6d6356  
    154154  if (g == NULL)
    155155  {
    156     res= p_Copy (f,r);
    157     p_Delete (&f, r);
     156    res= f;
    158157    f=p_One (r);
    159158    return res;
     
    161160  if (f==NULL)
    162161  {
    163     res= p_Copy (g,r);
    164     p_Delete (&g, r);
     162    res= g;
    165163    g=p_One (r);
    166164    return res;
     
    172170  {
    173171    bool b1=isOn(SW_USE_EZGCD_P);
    174     setCharacteristic( rChar(r) );
    175172    F=convSingPFactoryP( f,r );
    176173    G=convSingPFactoryP( g,r );
Note: See TracChangeset for help on using the changeset viewer.