Changeset e57255 in git for Singular/LIB/tropical.lib


Ignore:
Timestamp:
Dec 16, 2013, 3:12:47 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
d186d3baff30f2e6e96b2a354ff156ec286fcb4ef24b9c65dd9d2b3d937e5841295580dedc2f7412
Parents:
27877c10cae6d5eb945d62a27d66dfdf8a5a47849e8ae12733559521215c7641624da588f2d8cdf3
Message:
Merge pull request #429 from YueRen/polymakelib

Polymakelib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/tropical.lib

    r27877c re57255  
    1 ///////////////////////////////////////////////////////////
    2 version="version tropical.lib 4.0.0.0 Jun_2013 "; // $Id$
     1//
     2version="$Id$";
    33category="Tropical Geometry";
    44info="
     
    650650          // pass first to a ring where a and @a
    651651          // are variables in order to use maps
    652           string @mp= string(minpoly);
     652          poly mp=minpoly;
    653653          ring INTERRING=char(LIFTRING),(t,@a,a),dp;
    654           execute("poly mp=" + @mp + ";");
     654          poly mp=imap(LIFTRING,mp);
    655655          ideal LIFT=imap(LIFTRING,LIFT);
    656656          kill LIFTRING;
     
    10121012  {
    10131013    def GLOBALRING=basering;
    1014     string @mp= string(minpoly);
     1014    number mp=minpoly;
    10151015    execute("ring LOCALRING=("+charstr(basering)+"),("+varstr(basering)+"),ds;");
    1016     execute("minpoly= " + @mp + ";");
    10171016    poly f=imap(GLOBALRING,f);
     1017    minpoly=imap(GLOBALRING,mp);
    10181018  }
    10191019  // check if a substitution is necessary
     
    10491049    if (minpoly!=0)
    10501050    {
    1051       string @mp= string(minpoly);
     1051      poly mp=minpoly;
    10521052      def OLDRING=basering;
    10531053      execute("ring NEWRING=0,("+varstr(basering)+","+parstr(basering)+"),ds;");
    1054       execute("ideal I = " + @mp + ";");
    1055       I = I,imap(OLDRING,f);
     1054      ideal I=imap(OLDRING,mp),imap(OLDRING,f);
    10561055    }
    10571056    else
     
    10651064      w=NewtP[jj]-NewtP[jj+1];
    10661065      ggteiler=gcd(w[1],w[2]);
    1067       zw=w[1]/ggteiler;
    1068       w[1]=w[2]/ggteiler;
     1066      zw=w[1] div ggteiler;
     1067      w[1]=w[2] div ggteiler;
    10691068      w[2]=zw;
    10701069      // if we have introduced a third variable for the parameter, then w needs a third component
     
    11341133    else
    11351134    {
    1136       string @mp= string(minpoly);
     1135      poly mp=minpoly;
    11371136      ring degreering=0,a,dp;
    1138       execute("poly mp=" + @mp + ";");
     1137      poly mp=imap(countring,mp);
    11391138      numberofbranchesfound=numberofbranchesfound+deg(mp);
    11401139      setring countring;
     
    11581157   ring r=0,(x,y),ds;
    11591158   poly f=x2-y4+x5y7;
    1160    puiseuxExpansion(puiseuxExpansion(f,3));
     1159   puiseuxExpansion(f,3,"subst");
     1160   displayPuiseuxExpansion(puiseuxExpansion(f,3));
    11611161}
    11621162
     
    15401540      ggt=gcd(normalvector[1],normalvector[2]);   // the gcd of the entries
    15411541      zw=normalvector[2];    // create the outward pointing normal vector
    1542       normalvector[2]=-normalvector[1]/ggt;
    1543       normalvector[1]=zw/ggt;
     1542      normalvector[2]=-normalvector[1] div ggt;
     1543      normalvector[1]=zw div ggt;
    15441544      if (size(#)==0) // we are computing w.r.t. minimum
    15451545      {
     
    27182718        if(k<>j)  // except the unit vector of the non-zero component
    27192719        {
    2720           intvec u; u[size(w)]=0; u[k]=1;
    2721           O[r,1..size(w)]=u; r=r+1;
     2720          intvec u;
     2721          u[size(w)]=0;
     2722          u[k]=1;
     2723          O[r,1..size(w)]=u;
     2724          r=r+1;
     2725          kill u;
    27222726        }
    27232727      }
     
    47084712        wneu=NewtP[1]-NewtP[2];
    47094713        int ggteiler=gcd(wneu[1],wneu[2]);
    4710         wneu[1]=-wneu[1]/ggteiler;
    4711         wneu[2]=wneu[2]/ggteiler;
     4714        wneu[1]=-wneu[1] div ggteiler;
     4715        wneu[2]=wneu[2] div ggteiler;
    47124716        if (wneu[1]>0)
    47134717        {
     
    48074811  for (jj=1;jj<=anzahlvariablen+numberdeletedvariables-1;jj++)
    48084812  {
    4809     PARA[jj]=(PARA[jj]+a[jj+1])*t^(tw[jj+1]*tweight/ww[1]);
     4813    PARA[jj]=(PARA[jj]+a[jj+1])*t^(tw[jj+1]*tweight div ww[1]);
    48104814  }
    48114815  // if we have reached the stop-level, i.e. either
     
    53535357    if (koeffizienten[j-ord(p)+1]!=0)
    53545358    {
    5355       if ((j-(N*wj)/w1)==0)
     5359      if ((j-(N*wj) div w1)==0)
    53565360      {
    53575361        dp=dp+displaycoef(koeffizienten[j-ord(p)+1]);
    53585362      }
    5359       if (((j-(N*wj)/w1)==1) and (N!=1))
     5363      if (((j-(N*wj) div w1)==1) and (N!=1))
    53605364      {
    53615365        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^(1/"+string(N)+")";
    53625366      }
    5363       if (((j-(N*wj)/w1)==1) and (N==1))
     5367      if (((j-(N*wj) div w1)==1) and (N==1))
    53645368      {
    53655369        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t";
    53665370      }
    5367       if (((j-(N*wj)/w1)==-1) and (N==1))
     5371      if (((j-(N*wj) div w1)==-1) and (N==1))
    53685372      {
    53695373        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t";
    53705374      }
    5371       if (((j-(N*wj)/w1)==-1) and (N!=1))
     5375      if (((j-(N*wj) div w1)==-1) and (N!=1))
    53725376      {
    53735377        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^(1/"+string(N)+")";
    53745378      }
    5375       if (((j-(N*wj)/w1)>1) and (N==1))
    5376       {
    5377         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^"+string(j-(N*wj)/w1);
    5378       }
    5379       if (((j-(N*wj)/w1)>1) and (N!=1))
    5380       {
    5381         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^("+string(j-(N*wj)/w1)+"/"+string(N)+")";
    5382       }
    5383       if (((j-(N*wj)/w1)<-1) and (N==1))
     5379      if (((j-(N*wj) div w1)>1) and (N==1))
     5380      {
     5381        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^"+string(j-(N*wj) div w1);
     5382      }
     5383      if (((j-(N*wj) div w1)>1) and (N!=1))
     5384      {
     5385        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*t^("+string(j-(N*wj) div w1)+"/"+string(N)+")";
     5386      }
     5387      if (((j-(N*wj) div w1)<-1) and (N==1))
    53845388      {
    53855389        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^"+string(wj-j);
    53865390      }
    5387       if (((j-(N*wj)/w1)<-1) and (N!=1))
    5388       {
    5389         dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^("+string((N*wj)/w1-j)+"/"+string(N)+")";
     5391      if (((j-(N*wj) div w1)<-1) and (N!=1))
     5392      {
     5393        dp=dp+displaycoef(koeffizienten[j-ord(p)+1])+"*1/t^("+string((N*wj) div w1-j)+"/"+string(N)+")";
    53905394      }
    53915395      if (j<deg(p))
     
    54955499    {
    54965500      setring LIFTRing;
    5497       string @mp= string(minpoly);
     5501      poly mp=minpoly;
    54985502      execute("ring TESTRing=("+charstr(LIFTRing)+"),("+varstr(BASERING)+"),dp;");
    5499       execute("minpoly= " + @mp + ";");
     5503      minpoly=number(imap(LIFTRing,mp));
    55005504      ideal i=imap(BASERING,i);
    55015505    }
     
    57695773              wneu=NewtP[jjj]-NewtP[jjj+1];
    57705774              int ggteiler=gcd(wneu[1],wneu[2]);
    5771               wneu[1]=-wneu[1]/ggteiler;
    5772               wneu[2]=wneu[2]/ggteiler;
     5775              wneu[1]=-wneu[1] div ggteiler;
     5776              wneu[2]=wneu[2] div ggteiler;
    57735777              if (wneu[1]>0)
    57745778              {
     
    58695873        {
    58705874          execute("ring PARARing=("+string(char(basering))+",@a),t,ls;");
    5871           minpoly=number(imap(PREGFANRING,m)); // ?
     5875          minpoly=number(imap(PREGFANRING,m));
    58725876        }
    58735877        else
     
    59085912        for (jjj=1;jjj<=anzahlvariablen+numberdeletedvariables-1;jjj++)
    59095913        {
    5910           PARA[jjj]=(PARA[jjj]+zeros[size(zeros)][jjj+1])*t^(ww[jjj+1]*tweight/ww[1]);
     5914          PARA[jjj]=(PARA[jjj]+zeros[size(zeros)][jjj+1])*t^(ww[jjj+1]*tweight div ww[1]);
    59115915        }
    59125916        // delete the last entry in zero, since that one has
     
    60336037    {
    60346038      I=subst(i,var(lastvar),0);
    6035       while (subst(I[1],t,0)==0)
     6039      while ((I[1]!=0) and (subst(I[1],t,0)==0))
    60366040      {
    60376041        I[1]=I[1]/t;
     
    78147818    poly denom=delta*hn^5;
    78157819    poly ggt=gcd(num,denom);
    7816     num=num/ggt;
    7817     denom=denom/ggt;
     7820    num=num div ggt;
     7821    denom=denom div ggt;
    78187822    setring BASERING;
    78197823    poly num=imap(TRING,num);
Note: See TracChangeset for help on using the changeset viewer.