Changeset 103e30 in git


Ignore:
Timestamp:
Feb 8, 2023, 9:35:06 AM (15 months ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0d7ffeded36f5660db047d76670b184bc97cecd3
Parents:
c987db42cd2ec943b97ac5746c99892ceddf909c
Message:
fix: prefix variable names with @ in primdec.lib::absPrimdecGTZ_i

(see https://github.com/oscar-system/Oscar.jl/issues/1905)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdec.lib

    rc987db r103e30  
    57595759
    57605760
    5761 static proc absPrimdecGTZ_i(int patchPrimaryDecomposition, ideal I, list #)
     5761static proc absPrimdecGTZ_i(int @patchPrimaryDecomposition, ideal @I, list #)
    57625762{
    57635763// if parameter patchPrimaryDecomposition=1,  drop the unit ideal in the decomposition,
     
    57745774  if(size(#)>0)
    57755775  {
    5776      int keep_comp=1;
     5776     int @keep_comp=1;
    57775777  }
    57785778
     
    57815781// algorithm automatically passes to the global case
    57825782// hence prepare to go back to an appropriate new ring
    5783       def r=basering;
    5784       ideal max_of_r=maxideal(1);
    5785       def s=changeord(list(list("dp",1:nvars(basering))));
    5786       setring s;
    5787       def I=imap(r,I);
    5788       def S=absPrimdecGTZ_i(patchPrimaryDecomposition,I);
    5789       setring S;
    5790       ring r1=char(basering),var(nvars(r)+1),dp;
    5791       def rS=r+r1;
     5783      def @r=basering;
     5784      ideal @max_of_r=maxideal(1);
     5785      def @s=changeord(list(list("dp",1:nvars(basering))));
     5786      setring @s;
     5787      def @I=imap(@r,@I);
     5788      def @S=absPrimdecGTZ_i(@patchPrimaryDecomposition,@I);
     5789      setring @S;
     5790      ring @r1=char(basering),var(nvars(@r)+1),dp;
     5791      def @rS=@r+@r1;
    57925792// move objects to appropriate ring and clean up
    5793       setring rS;
    5794       def max_of_r=imap(r,max_of_r);
    5795       attrib(max_of_r,"isSB",1);
    5796       def absolute_primes=imap(S,absolute_primes);
    5797       def primary_decomp=imap(S,primary_decomp);
    5798       if(!defined(keep_comp))
    5799       {
    5800          ideal tempid;
    5801          for(int k=size(absolute_primes);k>=1;k--)
     5793      setring @rS;
     5794      def @max_of_r=imap(@r,@max_of_r);
     5795      attrib(@max_of_r,"isSB",1);
     5796      def absolute_primes=imap(@S,absolute_primes);
     5797      def primary_decomp=imap(@S,primary_decomp);
     5798      if(!defined(@keep_comp))
     5799      {
     5800         ideal @tempid;
     5801         for(int @k=size(absolute_primes);@k>=1;@k--)
    58025802         {
    5803             tempid=absolute_primes[k][1];
    5804             tempid[1]=0;                  // ignore minimal polynomial
    5805             if(size(reduce(lead(tempid),max_of_r,5))!=0)
     5803            @tempid=absolute_primes[k][1];
     5804            @tempid[1]=0;                  // ignore minimal polynomial
     5805            if(size(reduce(lead(@tempid),@max_of_r,5))!=0)
    58065806            {
    58075807// 1 contained in ideal, i.e. component does not meet origin in local ordering
    5808                absolute_primes=delete(absolute_primes,k);
     5808               absolute_primes=delete(absolute_primes,@k);
    58095809            }
    58105810         }
    5811          for(k=size(primary_decomp);k>=1;k--)
     5811         for(@k=size(primary_decomp);@k>=1;@k--)
    58125812         {
    5813             if(mindeg(std(lead(primary_decomp[k][2]))[1])==0)
     5813            if(mindeg(std(lead(primary_decomp[@k][2]))[1])==0)
    58145814            {
    58155815// 1 contained in ideal, i.e. component does not meet origin in local ordering
    5816                primary_decomp=delete(primary_decomp,k);
     5816               primary_decomp=delete(primary_decomp,@k);
    58175817            }
    58185818         }
    5819          kill tempid;
     5819         kill @tempid;
    58205820      }
    58215821      export(primary_decomp);
    58225822      export(absolute_primes);
    5823       return(rS);
     5823      return(@rS);
    58245824  }
    58255825  if(minpoly!=0)
     
    58305830    );
    58315831  }
    5832   def R=basering;
    5833   int n=nvars(R);
    5834   list L=decomp_i(patchPrimaryDecomposition,I,3);
    5835   if (patchPrimaryDecomposition && size(L)==0 )
     5832  def @R=basering;
     5833  int @n=nvars(@R);
     5834  list @L=decomp_i(@patchPrimaryDecomposition,@I,3);
     5835  if (@patchPrimaryDecomposition && size(@L)==0 )
    58365836  {
    58375837     "// will not handle case with unit ideal";
    58385838  }
    5839   string newvar=L[1][3];
    5840   int k=find(newvar,",",find(newvar,",")+1);
    5841   newvar=newvar[k+1..size(newvar)];
    5842   list lR=ring_list(R);
    5843   int i,de,ii;
    5844   intvec vv=1:n;
    5845   //for(i=1;i<=n;i++){vv[i]=1;}
    5846 
    5847   list orst;
    5848   orst[1]=list("dp",vv);
    5849   orst[2]=list("dp",intvec(1));
    5850   orst[3]=list("C",0);
    5851   lR[3]=orst;
    5852   lR[2][n+1] = newvar;
    5853   def Rz = ring(lR);
    5854   setring Rz;
    5855   list L=imap(R,L);
     5839  string @newvar=@L[1][3];
     5840  int @k=find(@newvar,",",find(@newvar,",")+1);
     5841  @newvar=@newvar[@k+1..size(@newvar)];
     5842  list @lR=ring_list(@R);
     5843  int @i,@de,@ii;
     5844  intvec @vv=1:@n;
     5845
     5846  list @orst;
     5847  @orst[1]=list("dp",@vv);
     5848  @orst[2]=list("dp",intvec(1));
     5849  @orst[3]=list("C",0);
     5850  @lR[3]=@orst;
     5851  @lR[2][@n+1] = @newvar;
     5852  def @Rz = ring(@lR);
     5853  setring @Rz;
     5854  list @L=imap(@R,@L);
    58565855  list absolute_primes,primary_decomp;
    5857   ideal I,M,N,K;
    5858   M=maxideal(1);
    5859   N=maxideal(1);
    5860   poly p,q,f,g;
    5861   map phi,psi;
    5862   string tvar;
    5863   for(i=1;i<=size(L);i++)
    5864   {
    5865     tvar=L[i][4];
    5866     ii=find(tvar,"+");
    5867     while(ii)
    5868     {
    5869       tvar=tvar[ii+1..size(tvar)];
    5870       ii=find(tvar,"+");
    5871     }
    5872     for(ii=1;ii<=nvars(basering);ii++)
    5873     {
    5874       if(tvar==string(var(ii))) break;
    5875     }
    5876     I=L[i][2];
    5877     execute("K="+L[i][3]+";");
    5878     p=K[1];
    5879     q=K[2];
    5880     execute("f="+L[i][4]+";");
    5881     g=2*var(ii)-f;
    5882     M[ii]=f;
    5883     N[ii]=g;
    5884     de=deg(p);
    5885     psi=Rz,M;
    5886     phi=Rz,N;
    5887     I=phi(I),p,q;
    5888     I=std(I);
    5889     absolute_primes[i]=list(psi(I),de);
    5890     primary_decomp[i]=list(L[i][1],L[i][2]);
     5856  ideal @I,@M,@N,@K;
     5857  @M=maxideal(1);
     5858  @N=maxideal(1);
     5859  poly @p,@q,@f,@g;
     5860  map @phi,@psi;
     5861  string @tvar;
     5862  for(@i=1;@i<=size(@L);@i++)
     5863  {
     5864    @tvar=@L[@i][4];
     5865    @ii=find(@tvar,"+");
     5866    while(@ii)
     5867    {
     5868      @tvar=@tvar[@ii+1..size(@tvar)];
     5869      @ii=find(@tvar,"+");
     5870    }
     5871    for(@ii=1;@ii<=nvars(basering);@ii++)
     5872    {
     5873      if(@tvar==string(var(@ii))) break;
     5874    }
     5875    @I=@L[@i][2];
     5876    execute("@K="+@L[@i][3]+";");
     5877    @p=@K[1];
     5878    @q=@K[2];
     5879    execute("@f="+@L[@i][4]+";");
     5880    @g=2*var(@ii)-@f;
     5881    @M[@ii]=@f;
     5882    @N[@ii]=@g;
     5883    @de=deg(@p);
     5884    @psi=@Rz,@M;
     5885    @phi=@Rz,@N;
     5886    @I=@phi(@I),@p,@q;
     5887    @I=std(@I);
     5888    absolute_primes[@i]=list(@psi(@I),@de);
     5889    primary_decomp[@i]=list(@L[@i][1],@L[@i][2]);
    58915890  }
    58925891  export(primary_decomp);
    58935892  export(absolute_primes);
    5894   setring R;
     5893  setring @R;
    58955894  dbprint( printlevel-voice+4,"
    58965895// 'absPrimdecGTZ' created a ring, in which two lists absolute_primes (the
     
    59015900        setring S; absolute_primes; ");
    59025901
    5903   return(Rz);
     5902  return(@Rz);
    59045903}
    59055904
Note: See TracChangeset for help on using the changeset viewer.