Changeset b41ecb in git


Ignore:
Timestamp:
Jun 10, 2010, 5:29:35 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
d68d3048996d31d47c0ed73b4ac2d83e0661878a
Parents:
604d8bb038d7aa985d50d55053096e60b087e614
Message:
fix zerosets use of primitiv.lib

git-svn-id: file:///usr/local/Singular/svn/trunk@12851 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primitiv.lib

    r604d8b rb41ecb  
    165165{
    166166 def altring=basering;
    167  int grad1,grad2=deg(i[1]),deg(jet(i[2],0,intvec(1,0)));
     167 int grad1=deg(i[1]);
     168 int grad2=deg(jet(i[2],0,intvec(1,0)));
     169 if (grad2==0) { ERROR("i[2] is not monic"); }
    168170 int countx,countz;
     171  if (size(variables(i[1]))!=1) { ERROR("i[1] must be poly in x"); }
     172  if (size(variables(i[2]))!=2) { ERROR("i[2] must be poly in x,a"); }
     173  if (variables(i[2])[2]!=a) { ERROR("i[2] must be poly in x,a"); }
    169174 ring deglexring=char(altring),(x,y,z),dp;
    170175 map transfer=altring,x,z;
    171176 ideal i=transfer(i);
    172  if (size(i)!=2) {
    173    "//** Error -- either wrong number of given minimal polynomials";
    174    "//**          or wrong choice of ring variables (must use the first two)";
    175    setring altring;
    176    return(ideal(0));
     177 if (size(i)!=2)
     178 {
     179   ERROR("either wrong number of given minimal polynomials"+newline+
     180   "or wrong choice of ring variables (must use the first two)");
    177181 }
    178182 matrix mat;
     
    189193 //---------------- Schleife zum Finden des primitiven Elements ---------------
    190194 //--- Schleife ist so angordnet, dass g in Charakteristik 0 linear bleibt ----
    191  while (found==0) {
     195 while (found==0)
     196 {
    192197   j=eliminate(i+ideal(g-y),z);
    193198   setring deglex2ring;
     
    195200   setring lexring;
    196201   j=fglm(deglex2ring,j);
    197    if (size(j)==2) {
    198      if (deg(j[1])==grad1*grad2) {
     202   if (size(j)==2)
     203   {
     204     if (deg(j[1])==grad1*grad2)
     205     {
    199206       j[2]=j[2]/leadcoef(j[2]);    // Normierung
    200        if (lead(j[2])==x) {         // Alles ok
     207       if (lead(j[2])==x)
     208       {         // Alles ok
    201209          found=1;
    202210       }
     
    204212   }
    205213   setring deglexring;
    206    if (found==0) {
     214   if (found==0)
     215   {
    207216 //------------------ waehle ein neues Polynom g ------------------------------
    208217     dbprint("Still searching for primitive element...");
    209218     countx=0;
    210219     countz=0;
    211      while (found==0) {
     220     while (found==0)
     221     {
    212222      countx++;
    213       if (countx>=grad1) {
     223      if (countx>=grad1)
     224      {
    214225        countx=0;
    215226        countz++;
    216         if (countz>=grad2) {
    217          "//** Error: No primitive element found!! This should NEVER happen!";
    218          setring altring;
    219          return(ideal(0));
    220         }
     227        if (countz>=grad2)
     228        { ERROR("No primitive element found!! This should NEVER happen!"); }
    221229      }
    222230      g = g +x^countx *z^countz;
    223231      mat=coeffs(g,z);
    224       if (size(mat)>countz) {
     232      if (size(mat)>countz)
     233      {
    225234        mat=coeffs(mat[countz+1,1],x);
    226         if (size(mat)>countx) {
    227           if (mat[countx+1,1] != 0) {
     235        if (size(mat)>countx)
     236        {
     237          if (mat[countx+1,1] != 0)
     238          {
    228239            found=1;         // d.h. hier: neues g gefunden
    229240      }}}
  • Singular/LIB/zeroset.lib

    r604d8b rb41ecb  
    9898  int dbPrt = printlevel-voice+3;
    9999
     100  ideal fff=sqrfree(f);
     101  f=fff[1];
     102  for(int iii=2;iii<ncols(fff);iii++) { f=f*fff[iii]; }
    100103  // create a new ring where par(1) is replaced by the variable
    101104  // with the same name or, if basering does not contain a parameter,
     
    225228  Xchange[2] = var(1);      // for the use of 'primitive'
    226229
    227   if(nlinFactors == 1) {            // one nl factor
    228 
     230  if(nlinFactors == 1)             // one nl factor
     231  {
    229232    // compute the roots of the nonlinear (irreducible, monic) factor f1 of f
    230233    // by extending the basefield by a' with minimal polynomial f1
     
    232235
    233236    f1 = nlFactors[1];
    234     if(mpoly[1] != 0) {
     237    if(mpoly[1] != 0)
     238    {
    235239      mp = mpoly[1];
    236240      minPolys = Xchange(mp), Xchange(f1);
    237       primElem = primitive_extra(minPolys);  // no random coord. change
     241      if (deg(jet(minPolys[2],0,intvec(1,0)))==0)
     242      { primElem = primitive(minPolys); } // random coord. change
     243      else
     244      { primElem = primitive_extra(minPolys); } // no random coord. change
    238245      mpoly = std(primElem[1]);
    239246      F = basering, maxideal(1);
Note: See TracChangeset for help on using the changeset viewer.