Changeset 103e30 in git
 Timestamp:
 Feb 8, 2023, 9:35:06 AM (10 months ago)
 Branches:
 (u'spielwiese', '9bfa4dc4755d071a0d1290dd0e3cda52bac9f27e')
 Children:
 0d7ffeded36f5660db047d76670b184bc97cecd3
 Parents:
 c987db42cd2ec943b97ac5746c99892ceddf909c
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/primdec.lib
rc987db r103e30 5759 5759 5760 5760 5761 static proc absPrimdecGTZ_i(int patchPrimaryDecomposition, idealI, list #)5761 static proc absPrimdecGTZ_i(int @patchPrimaryDecomposition, ideal @I, list #) 5762 5762 { 5763 5763 // if parameter patchPrimaryDecomposition=1, drop the unit ideal in the decomposition, … … 5774 5774 if(size(#)>0) 5775 5775 { 5776 int keep_comp=1;5776 int @keep_comp=1; 5777 5777 } 5778 5778 … … 5781 5781 // algorithm automatically passes to the global case 5782 5782 // 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; 5792 5792 // 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) 5802 5802 { 5803 tempid=absolute_primes[k][1];5804 tempid[1]=0; // ignore minimal polynomial5805 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) 5806 5806 { 5807 5807 // 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); 5809 5809 } 5810 5810 } 5811 for( k=size(primary_decomp);k>=1;k)5811 for(@k=size(primary_decomp);@k>=1;@k) 5812 5812 { 5813 if(mindeg(std(lead(primary_decomp[ k][2]))[1])==0)5813 if(mindeg(std(lead(primary_decomp[@k][2]))[1])==0) 5814 5814 { 5815 5815 // 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); 5817 5817 } 5818 5818 } 5819 kill tempid;5819 kill @tempid; 5820 5820 } 5821 5821 export(primary_decomp); 5822 5822 export(absolute_primes); 5823 return( rS);5823 return(@rS); 5824 5824 } 5825 5825 if(minpoly!=0) … … 5830 5830 ); 5831 5831 } 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 ) 5836 5836 { 5837 5837 "// will not handle case with unit ideal"; 5838 5838 } 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); 5856 5855 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]); 5891 5890 } 5892 5891 export(primary_decomp); 5893 5892 export(absolute_primes); 5894 setring R;5893 setring @R; 5895 5894 dbprint( printlevelvoice+4," 5896 5895 // 'absPrimdecGTZ' created a ring, in which two lists absolute_primes (the … … 5901 5900 setring S; absolute_primes; "); 5902 5901 5903 return( Rz);5902 return(@Rz); 5904 5903 } 5905 5904
Note: See TracChangeset
for help on using the changeset viewer.