Changeset b41ecb in git for Singular/LIB/primitiv.lib


Ignore:
Timestamp:
Jun 10, 2010, 5:29:35 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '73c62e0961bcfc8f1a00420b41eec2ea3c0ef6e9')
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
File:
1 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      }}}
Note: See TracChangeset for help on using the changeset viewer.