My Project
Loading...
Searching...
No Matches
syz.cc File Reference
#include "kernel/mod2.h"
#include "misc/options.h"
#include "kernel/polys.h"
#include "kernel/GBEngine/kstd1.h"
#include "kernel/GBEngine/kutil.h"
#include "kernel/combinatorics/stairc.h"
#include "misc/intvec.h"
#include "coeffs/numbers.h"
#include "kernel/ideals.h"
#include "polys/monomials/ring.h"
#include "kernel/GBEngine/syz.h"
#include "polys/prCopy.h"
#include "polys/nc/sca.h"

Go to the source code of this file.

Functions

static intvecsyPrepareModComp (ideal arg, intvec **w)
static void syDeleteAbove (ideal up, int k)
static void syMinStep (ideal mod, ideal &syz, BOOLEAN final=FALSE, ideal up=NULL, tHomog h=isNotHomog)
void syGaussForOne (ideal syz, int elnum, int ModComp, int from, int till)
static void syDeleteAbove1 (ideal up, int k)
static void syMinStep1 (resolvente res, int length)
void syMinimizeResolvente (resolvente res, int length, int first)
resolvente syResolvente (ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
syStrategy syResolution (ideal arg, int maxlength, intvec *w, BOOLEAN minim)
static poly sypCopyConstant (poly inp)
int syDetect (ideal id, int index, BOOLEAN homog, int *degrees, int *tocancel)
void syDetect (ideal id, int index, int rsmin, BOOLEAN homog, intvec *degrees, intvec *tocancel)
intvecsyBetti (resolvente res, int length, int *regularity, intvec *weights, BOOLEAN tomin, int *row_shift)
ideal syMinBase (ideal arg)
syStrategy syMres_with_map (ideal arg, int maxlength, intvec *w, ideal &trans)
void syMinimize_with_map (syStrategy res, ideal &trans)
syStrategy syMinimizeCopy (syStrategy org)
void syFix (syStrategy r)

Function Documentation

◆ syBetti()

intvec * syBetti ( resolvente res,
int length,
int * regularity,
intvec * weights,
BOOLEAN tomin,
int * row_shift )

Definition at line 787 of file syz.cc.

789{
790//#define BETTI_WITH_ZEROS
791 //tomin = FALSE;
792 int i,j=0,k=0,l,rows,cols,mr;
793 int *temp1,*temp2,*temp3;/*used to compute degrees*/
794 int *tocancel; /*(BOOLEAN)tocancel[i]=element is superfluous*/
795 int r0_len;
796
797 /*------ compute size --------------*/
798 *regularity = -1;
799 cols = length;
800 while ((cols>0)
801 && ((res[cols-1]==NULL)
802 || (idIs0(res[cols-1]))))
803 {
804 cols--;
805 }
806 intvec * result;
807 if (idIs0(res[0]))
808 {
809 if (res[0]==NULL)
810 result = new intvec(1,1,1);
811 else
812 result = new intvec(1,1,res[0]->rank);
813 return result;
814 }
815 intvec *w=NULL;
816 if (weights!=NULL)
817 {
818 if (!idTestHomModule(res[0],currRing->qideal,weights))
819 {
820 WarnS("wrong weights given(3):");weights->show();PrintLn();
821 idHomModule(res[0],currRing->qideal,&w);
822 if (w!=NULL) { w->show();PrintLn();}
823 weights=NULL;
824 }
825 }
826#if 0
827 if (idHomModule(res[0],currRing->qideal,&w)!=isHomog)
828 {
829 WarnS("betti-command: Input is not homogeneous!");
830 weights=NULL;
831 }
832#endif
833 if (weights==NULL) weights=w;
834 else delete w;
835 r0_len=IDELEMS(res[0]);
836 while ((r0_len>0) && (res[0]->m[r0_len-1]==NULL)) r0_len--;
837 #ifdef SHOW_W
838 PrintS("weights:");if (weights!=NULL) weights->show(); else Print("NULL"); PrintLn();
839 #endif
840 int rkl=l = si_max(id_RankFreeModule(res[0],currRing),res[0]->rank);
841 i = 0;
842 while ((i<length) && (res[i]!=NULL))
843 {
844 if (IDELEMS(res[i])>l) l = IDELEMS(res[i]);
845 i++;
846 }
847 temp1 = (int*)omAlloc0((l+1)*sizeof(int));
848 temp2 = (int*)omAlloc((l+1)*sizeof(int));
849 rows = 1;
850 mr = 1;
851 cols++;
852 for (i=0;i<cols-1;i++)
853 {
854 if ((i==0) && (weights!=NULL)) p_SetModDeg(weights, currRing);
855 memset(temp2,0,(l+1)*sizeof(int));
856 for (j=0;j<IDELEMS(res[i]);j++)
857 {
858 if (res[i]->m[j]!=NULL)
859 {
860 if ((pGetComp(res[i]->m[j])>l)
861 // usual resolutions do not the following, but artifulal built may: (tr. #763)
862 //|| ((i>1) && (res[i-1]->m[pGetComp(res[i]->m[j])-1]==NULL))
863 )
864 {
865 WerrorS("input not a resolution");
866 omFreeSize((ADDRESS)temp1,(l+1)*sizeof(int));
867 omFreeSize((ADDRESS)temp2,(l+1)*sizeof(int));
868 return NULL;
869 }
870 temp2[j+1] = p_FDeg(res[i]->m[j],currRing)+temp1[pGetComp(res[i]->m[j])];
871 if (temp2[j+1]-i>rows) rows = temp2[j+1]-i;
872 if (temp2[j+1]-i<mr) mr = temp2[j+1]-i;
873 }
874 }
875 if ((i==0) && (weights!=NULL)) p_SetModDeg(NULL, currRing);
876 temp3 = temp1;
877 temp1 = temp2;
878 temp2 = temp3;
879 }
880 mr--;
881 if (weights!=NULL)
882 {
883 for(j=0;j<weights->length();j++)
884 {
885 if (rows <(*weights)[j]+1) rows=(-mr)+(*weights)[j]+1;
886 }
887 }
888 /*------ computation betti numbers --------------*/
889 rows -= mr;
890 result = new intvec(rows+1,cols,0);
891 if (weights!=NULL)
892 {
893 for(j=0;j<weights->length();j++)
894 {
895 IMATELEM((*result),(-mr)+(*weights)[j]+1,1) ++;
896 //Print("imat(%d,%d)++ -> %d\n",(-mr)+(*weights)[j]+1, 1, IMATELEM((*result),(-mr)+(*weights)[j]+1,1));
897 }
898 }
899 else
900 {
901 (*result)[(-mr)*cols] = /*idRankFreeModule(res[0])*/ rkl;
902 if ((!idIs0(res[0])) && ((*result)[(-mr)*cols]==0))
903 (*result)[(-mr)*cols] = 1;
904 }
905 tocancel = (int*)omAlloc0((rows+1)*sizeof(int));
906 memset(temp1,0,(l+1)*sizeof(int));
907 if (weights!=NULL)
908 {
909 memset(temp2,0,l*sizeof(int));
910 p_SetModDeg(weights, currRing);
911 }
912 else
913 memset(temp2,0,l*sizeof(int));
914 syDetect(res[0],0,TRUE,temp2,tocancel);
915 if (weights!=NULL) p_SetModDeg(NULL, currRing);
916 if (tomin)
917 {
918 //(*result)[(-mr)*cols] -= dummy;
919 for(j=0;j<=rows+mr;j++)
920 {
921 //Print("tocancel[%d]=%d imat(%d,%d)=%d\n",j,tocancel[j],(-mr)+j+1,1,IMATELEM((*result),(-mr)+j+1,1));
922 IMATELEM((*result),(-mr)+j+1,1) -= tocancel[j];
923 }
924 }
925 for (i=0;i<cols-1;i++)
926 {
927 if ((i==0) && (weights!=NULL)) p_SetModDeg(weights, currRing);
928 memset(temp2,0,l*sizeof(int));
929 for (j=0;j<IDELEMS(res[i]);j++)
930 {
931 if (res[i]->m[j]!=NULL)
932 {
933 temp2[j+1] = p_FDeg(res[i]->m[j],currRing)+temp1[pGetComp(res[i]->m[j])];
934 //(*result)[i+1+(temp2[j+1]-i-1)*cols]++;
935 //if (temp2[j+1]>i) IMATELEM((*result),temp2[j+1]-i-mr,i+2)++;
936 IMATELEM((*result),temp2[j+1]-i-mr,i+2)++;
937 }
938 else if (i==0)
939 {
940 if (j<r0_len) IMATELEM((*result),-mr,2)++;
941 }
942 }
943 /*------ computation betti numbers, if res not minimal --------------*/
944 if (tomin)
945 {
946 for (j=mr;j<rows+mr;j++)
947 {
948 //(*result)[i+1+j*cols] -= tocancel[j+1];
949 IMATELEM((*result),j+1-mr,i+2) -= tocancel[j+1];
950 }
951 if ((i<length-1) && (res[i+1]!=NULL))
952 {
953 memset(tocancel,0,(rows+1)*sizeof(int));
954 syDetect(res[i+1],i+1,TRUE,temp2,tocancel);
955 for (j=0;j<rows;j++)
956 {
957 //(*result)[i+1+j*cols] -= tocancel[j];
958 IMATELEM((*result),j+1,i+2) -= tocancel[j];
959 }
960 }
961 }
962 temp3 = temp1;
963 temp1 = temp2;
964 temp2 = temp3;
965 for (j=0;j<=rows;j++)
966 {
967 // if (((*result)[i+1+j*cols]!=0) && (j>*regularity)) *regularity = j;
968 if ((IMATELEM((*result),j+1,i+2)!=0) && (j>*regularity)) *regularity = j;
969 }
970 if ((i==0) && (weights!=NULL)) p_SetModDeg(NULL, currRing);
971 }
972 // Print("nach minim:\n"); result->show(); PrintLn();
973 /*------ clean up --------------*/
974 omFreeSize((ADDRESS)tocancel,(rows+1)*sizeof(int));
975 omFreeSize((ADDRESS)temp1,(l+1)*sizeof(int));
976 omFreeSize((ADDRESS)temp2,(l+1)*sizeof(int));
977 if ((tomin) && (mr<0)) // deletes the first (zero) line
978 {
979 for (j=1;j<=rows+mr+1;j++)
980 {
981 for (k=1;k<=cols;k++)
982 {
983 IMATELEM((*result),j,k) = IMATELEM((*result),j-mr,k);
984 }
985 }
986 for (j=rows+mr+1;j<=rows+1;j++)
987 {
988 for (k=1;k<=cols;k++)
989 {
990 IMATELEM((*result),j,k) = 0;
991 }
992 }
993 }
994 j = 0;
995 k = 0;
996 for (i=1;i<=result->rows();i++)
997 {
998 for(l=1;l<=result->cols();l++)
999 if (IMATELEM((*result),i,l) != 0)
1000 {
1001 j = si_max(j, i-1);
1002 k = si_max(k, l-1);
1003 }
1004 }
1005 intvec * exactresult=new intvec(j+1,k+1,0);
1006 for (i=0;i<exactresult->rows();i++)
1007 {
1008 for (j=0;j<exactresult->cols();j++)
1009 {
1010 IMATELEM(*exactresult,i+1,j+1) = IMATELEM(*result,i+1,j+1);
1011 }
1012 }
1013 if (row_shift!=NULL) *row_shift = mr;
1014 delete result;
1015 return exactresult;
1016}
static int si_max(const int a, const int b)
Definition auxiliary.h:125
#define TRUE
Definition auxiliary.h:101
void * ADDRESS
Definition auxiliary.h:120
int l
Definition cfEzgcd.cc:100
int m
Definition cfEzgcd.cc:128
int i
Definition cfEzgcd.cc:132
int k
Definition cfEzgcd.cc:99
void show(int mat=0, int spaces=0) const
Definition intvec.cc:149
int length() const
Definition intvec.h:95
int cols() const
Definition intvec.h:96
int rows() const
Definition intvec.h:97
#define Print
Definition emacs.cc:80
#define WarnS
Definition emacs.cc:78
return result
CanonicalForm res
Definition facAbsFact.cc:60
const CanonicalForm & w
Definition facAbsFact.cc:51
int j
Definition facHensel.cc:110
void WerrorS(const char *s)
Definition feFopen.cc:24
BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w)
Definition ideals.cc:2125
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
static BOOLEAN idHomModule(ideal m, ideal Q, intvec **w)
Definition ideals.h:96
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
#define IMATELEM(M, I, J)
Definition intvec.h:86
#define omFreeSize(addr, size)
#define omAlloc(size)
#define omAlloc0(size)
#define NULL
Definition omList.c:12
void p_SetModDeg(intvec *w, ring r)
Definition p_polys.cc:3798
static long p_FDeg(const poly p, const ring r)
Definition p_polys.h:382
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
#define pGetComp(p)
Component.
Definition polys.h:38
void PrintS(const char *s)
Definition reporter.cc:288
void PrintLn()
Definition reporter.cc:314
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
#define IDELEMS(i)
@ isHomog
Definition structs.h:33
int syDetect(ideal id, int index, BOOLEAN homog, int *degrees, int *tocancel)
Definition syz.cc:718

◆ syDeleteAbove()

void syDeleteAbove ( ideal up,
int k )
static

Definition at line 66 of file syz.cc.

67{
68 if (up!=NULL)
69 {
70 for (int i=0;i<IDELEMS(up);i++)
71 {
72 if (up->m[i]!=NULL)
73 pDeleteComp(&(up->m[i]),k+1);
74 }
75 }
76}
#define pDeleteComp(p, k)
Definition polys.h:361

◆ syDeleteAbove1()

void syDeleteAbove1 ( ideal up,
int k )
static

Definition at line 264 of file syz.cc.

265{
266 poly p/*,pp*/;
267 if (up!=NULL)
268 {
269 for (int i=0;i<IDELEMS(up);i++)
270 {
271 p = up->m[i];
272 while ((p!=NULL) && ((int)__p_GetComp(p,currRing)==k))
273 {
274 pLmDelete(&p);
275 }
276 up->m[i] = p;
277 if (p!=NULL)
278 {
279 while (pNext(p)!=NULL)
280 {
281 if ((int)__p_GetComp(pNext(p),currRing)==k)
282 {
283 pLmDelete(&pNext(p));
284 }
285 else
286 pIter(p);
287 }
288 }
289 }
290 }
291}
int p
Definition cfModGcd.cc:4086
#define pIter(p)
Definition monomials.h:37
#define pNext(p)
Definition monomials.h:36
#define __p_GetComp(p, r)
Definition monomials.h:63
#define pLmDelete(p)
assume p != NULL, deletes Lm(p)->coef and Lm(p)
Definition polys.h:77

◆ syDetect() [1/2]

int syDetect ( ideal id,
int index,
BOOLEAN homog,
int * degrees,
int * tocancel )

Definition at line 718 of file syz.cc.

719{
720 int i, j, k, subFromRank=0;
721 ideal temp;
722
723 if (idIs0(id)) return 0;
724 temp = idInit(IDELEMS(id),id->rank);
725 for (i=0;i<IDELEMS(id);i++)
726 {
727 temp->m[i] = sypCopyConstant(id->m[i]);
728 }
729 i = IDELEMS(id);
730 while ((i>0) && (temp->m[i-1]==NULL)) i--;
731 if (i==0)
732 {
733 idDelete(&temp);
734 return 0;
735 }
736 j = 0;
737 while ((j<i) && (temp->m[j]==NULL)) j++;
738 while (j<i)
739 {
740 if (homog)
741 {
742 if (index==0) k = p_FDeg(temp->m[j],currRing)+degrees[pGetComp(temp->m[j])];
743 else k = degrees[pGetComp(temp->m[j])];
744 if (k>=index) tocancel[k-index]++;
745 if ((k>=0) && (index==0)) subFromRank++;
746 }
747 else
748 {
749 tocancel[0]--;
750 }
751 syGaussForOne(temp,j,pGetComp(temp->m[j]),j+1,i);
752 j++;
753 while ((j<i) && (temp->m[j]==NULL)) j++;
754 }
755 idDelete(&temp);
756 return subFromRank;
757}
int * degrees(const CanonicalForm &f, int *degs=0)
int * degrees ( const CanonicalForm & f, int * degs )
Definition cf_ops.cc:493
#define idDelete(H)
delete an ideal
Definition ideals.h:29
static int index(p_Length length, p_Ord ord)
ideal idInit(int idsize, int rank)
initialise an ideal / module
static poly sypCopyConstant(poly inp)
Definition syz.cc:696
void syGaussForOne(ideal syz, int elnum, int ModComp, int from, int till)
Definition syz.cc:218

◆ syDetect() [2/2]

void syDetect ( ideal id,
int index,
int rsmin,
BOOLEAN homog,
intvec * degrees,
intvec * tocancel )

Definition at line 759 of file syz.cc.

761{
762 int * deg=NULL;
763 int * tocan=(int*) omAlloc0(tocancel->length()*sizeof(int));
764 int i;
765
766 if (homog)
767 {
768 deg = (int*) omAlloc0(degrees->length()*sizeof(int));
769 for (i=degrees->length();i>0;i--)
770 deg[i-1] = (*degrees)[i-1]-rsmin;
771 }
772 syDetect(id,index,homog,deg,tocan);
773 for (i=tocancel->length();i>0;i--)
774 (*tocancel)[i-1] = tocan[i-1];
775 if (homog)
776 omFreeSize((ADDRESS)deg,degrees->length()*sizeof(int));
777 omFreeSize((ADDRESS)tocan,tocancel->length()*sizeof(int));
778}

◆ syFix()

void syFix ( syStrategy r)

Definition at line 1230 of file syz.cc.

1231{
1232 if (r->fullres==NULL)
1233 {
1234 if(r->minres==NULL)
1235 {
1236 return;
1237 }
1238 }
1239 int found=-1;
1240 for(int i=1;i<r->length;i++)
1241 {
1242 // search (0)
1243 if((r->fullres!=NULL) && (r->fullres[i]!=NULL))
1244 {
1245 if (idIs0(r->fullres[i])) {found=i;break;}
1246 }
1247 if((r->fullres!=NULL) && (r->fullres[i]==NULL))
1248 break;
1249 if((r->minres!=NULL) && (r->minres[i]!=NULL))
1250 {
1251 if (idIs0(r->minres[i])) {found=i;break;}
1252 }
1253 if((r->minres!=NULL) && (r->minres[i]==NULL))
1254 break;
1255 }
1256 if (found>0) // delete trailing stuff
1257 {
1258 for(int i=found+1;i<r->length;i++)
1259 {
1260 if ((r->fullres!=NULL) && (r->fullres[i]!=NULL))
1262 if ((r->minres!=NULL) && (r->minres[i]!=NULL))
1263 id_Delete(&r->minres[i],currRing);
1264 }
1265 r->list_length=found;
1266 }
1267 else
1268 {
1269 // append (0)
1270 for(int i=1;i<r->length;i++)
1271 {
1272 if ((r->fullres!=NULL) && (r->fullres[i]==NULL))
1273 {
1274 r->fullres[i]=idInit(1,IDELEMS(r->fullres[i-1]));
1275 if ((r->minres!=NULL) && (r->minres[i-1]==NULL))
1276 {
1277 r->minres[i]=idInit(1,IDELEMS(r->minres[i-1]));
1278 }
1279 break;
1280 }
1281 else
1282 {
1283 if ((r->minres!=NULL) && (r->minres[i]==NULL))
1284 {
1285 r->minres[i]=idInit(1,IDELEMS(r->minres[i-1]));
1286 break;
1287 }
1288 }
1289 }
1290 }
1291}
bool found
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
resolvente minres
Definition syz.h:58
short list_length
Definition syz.h:62
resolvente fullres
Definition syz.h:57
int length
Definition syz.h:60

◆ syGaussForOne()

void syGaussForOne ( ideal syz,
int elnum,
int ModComp,
int from,
int till )

Definition at line 218 of file syz.cc.

219{
220 int /*k,j,i,*/lu;
221 poly unit1,unit2;
222 poly actWith=syz->m[elnum];
223 syz->m[elnum] = NULL;
224
225 if (from<0) from = 0;
226 if ((till<=0) || (till>IDELEMS(syz))) till = IDELEMS(syz);
228/*--makes Gauss alg. for the column ModComp--*/
229 pTakeOutComp(&(actWith), ModComp, &unit1, &lu);
230 if (lu==1) /*p_IsConstantComp(unit1,currRing)*/
231 {
232 number n_unit1=pGetCoeff(unit1);
233 while (from<till)
234 {
235 poly tmp=syz->m[from];
236 if (/*syz->m[from]*/ tmp!=NULL)
237 {
238 pTakeOutComp(&tmp, ModComp, &unit2, &lu);
239 tmp = p_Mult_nn(tmp,n_unit1,currRing);
240 syz->m[from] = pSub(tmp,
241 pMult(unit2,pCopy(actWith)));
242 }
243 from++;
244 }
245 }
246 else
247 {
248 while (from<till)
249 {
250 poly tmp=syz->m[from];
251 if (/*syz->m[from]*/ tmp!=NULL)
252 {
253 pTakeOutComp(&tmp, ModComp, &unit2, &lu);
254 tmp = pMult(pCopy(unit1),tmp);
255 syz->m[from] = pSub(tmp,
256 pMult(unit2,pCopy(actWith)));
257 }
258 from++;
259 }
260 }
261 pDelete(&actWith);
262 pDelete(&unit1);
263}
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
poly p_Cleardenom(poly p, const ring r)
Definition p_polys.cc:2893
static poly p_Mult_nn(poly p, number n, const ring r)
Definition p_polys.h:960
#define pDelete(p_ptr)
Definition polys.h:187
#define pSub(a, b)
Definition polys.h:288
#define pMult(p, q)
Definition polys.h:208
void pTakeOutComp(poly *p, long comp, poly *q, int *lq, const ring R=currRing)
Splits *p into two polys: *q which consists of all monoms with component == comp and *p of all other ...
Definition polys.h:339
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition ring.h:559

◆ syMinBase()

ideal syMinBase ( ideal arg)

Definition at line 1021 of file syz.cc.

1022{
1023 intvec ** weights=NULL;
1024 int leng;
1025 if (idIs0(arg)) return idInit(1,arg->rank);
1026 resolvente res=syResolvente(arg,1,&leng,&weights,TRUE);
1027 ideal result=res[0];
1028 omFreeSize((ADDRESS)res,leng*sizeof(ideal));
1029 if (weights!=NULL)
1030 {
1031 if (*weights!=NULL)
1032 {
1033 delete (*weights);
1034 *weights=NULL;
1035 }
1036 if ((leng>=1) && (*(weights+1)!=NULL))
1037 {
1038 delete *(weights+1);
1039 *(weights+1)=NULL;
1040 }
1041 }
1043 return result;
1044}
ideal * resolvente
Definition ideals.h:18
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
resolvente syResolvente(ideal arg, int maxlength, int *length, intvec ***weights, BOOLEAN minim)
Definition syz.cc:403

◆ syMinimize_with_map()

void syMinimize_with_map ( syStrategy res,
ideal & trans )

Definition at line 1189 of file syz.cc.

1190{
1191 ideal *r=res->minres;
1192 if (r==NULL) r=res->fullres;
1193 ideal org=idCopy(r[0]);
1195 r=res->minres;
1196 if (r==NULL) r=res->fullres;
1197 trans=idLift(org,r[0],NULL,TRUE,FALSE,FALSE,NULL);
1198}
#define FALSE
Definition auxiliary.h:97
ideal idLift(ideal mod, ideal submod, ideal *rest, BOOLEAN goodShape, BOOLEAN isSB, BOOLEAN divide, matrix *unit, GbVariant alg)
represents the generators of submod in terms of the generators of mod (Matrix(SM)*U-Matrix(rest)) = M...
Definition ideals.cc:1109
ideal idCopy(ideal A)
Definition ideals.h:60
syStrategy syMinimize(syStrategy syzstr)
Definition syz1.cc:2394

◆ syMinimizeCopy()

syStrategy syMinimizeCopy ( syStrategy org)

Definition at line 1200 of file syz.cc.

1201{
1203
1204 result->length=org->length;
1205 if (org->weights!=NULL)
1206 {
1207 result->weights=(intvec**)omAlloc0(org->length*sizeof(intvec*));
1208 for (int i=org->length-1;i>=0;i--)
1209 {
1210 if (org->weights[i]!=NULL)
1211 {
1212 result->weights[i]=ivCopy(org->weights[i]);
1213 }
1214 }
1215 }
1216 result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
1217 resolvente fr = org->minres;
1218 if (fr==NULL) fr=org->fullres;
1219
1220 for (int i=result->length-1;i>=0;i--)
1221 {
1222 if (fr[i]!=NULL)
1223 result->fullres[i] = idCopy(fr[i]);
1224 }
1225 result->list_length=result->length;
1227 return result;
1228}
intvec * ivCopy(const intvec *o)
Definition intvec.h:146
intvec ** weights
Definition syz.h:45
ssyStrategy * syStrategy
Definition syz.h:36

◆ syMinimizeResolvente()

void syMinimizeResolvente ( resolvente res,
int length,
int first )

Definition at line 367 of file syz.cc.

368{
369 int syzIndex=first;
370 intvec *dummy;
371
372 if (syzIndex<1) syzIndex=1;
373 if ((syzIndex==1) && (!rIsPluralRing(currRing)) && (idHomModule(res[0],currRing->qideal,&dummy)))
374 {
376 delete dummy;
377 return;
378 }
379 while ((syzIndex<length-1) && (res[syzIndex]!=NULL) && (res[syzIndex+1]!=NULL))
380 {
381 syMinStep(res[syzIndex-1],res[syzIndex],FALSE,res[syzIndex+1]);
382 syzIndex++;
383 }
384 if (res[syzIndex]!=NULL)
385 syMinStep(res[syzIndex-1],res[syzIndex]);
386 if (!idIs0(res[0]))
388 if((length>0) && (res[length]!=NULL) && idIs0(res[length]))
390}
ideal idMinEmbedding(ideal arg, BOOLEAN inPlace, intvec **w)
Definition ideals.cc:2858
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406
static void syMinStep1(resolvente res, int length)
Definition syz.cc:296
static void syMinStep(ideal mod, ideal &syz, BOOLEAN final=FALSE, ideal up=NULL, tHomog h=isNotHomog)
Definition syz.cc:82

◆ syMinStep()

void syMinStep ( ideal mod,
ideal & syz,
BOOLEAN final = FALSE,
ideal up = NULL,
tHomog h = isNotHomog )
static

Definition at line 82 of file syz.cc.

84{
85 poly Unit1,Unit2,actWith;
86 int len,i,j,ModComp,m,k,l;
87 BOOLEAN searchUnit,existsUnit;
88
89 if (TEST_OPT_PROT) PrintS("m");
90 if ((final) && (h==isHomog))
91 /*minim is TRUE, we are in the module: maxlength, maxlength <>0*/
92 {
93 ideal deg0=id_Jet0(syz,currRing);
94 id_Delete(&syz,currRing);
95 idSkipZeroes0(deg0);
96 syz=deg0;
97 }
98/*--cancels empty entees and their related components above--*/
99 j = IDELEMS(syz);
100 while ((j>0) && (!syz->m[j-1])) j--;
101 k = 0;
102 while (k<j)
103 {
104 if (syz->m[k]!=NULL)
105 k++;
106 else
107 {
108 if (TEST_OPT_PROT) PrintS(".");
109 for (l=k;l<j-1;l++) syz->m[l] = syz->m[l+1];
110 syz->m[j-1] = NULL;
111 syDeleteAbove(up,k);
112 j--;
113 }
114 }
115/*--searches for syzygies coming from superfluous elements
116* in the module below--*/
117 searchUnit = TRUE;
118 int curr_syz_limit = rGetCurrSyzLimit(currRing);
119 BOOLEAN bHasGlobalOrdering=rHasGlobalOrdering(currRing);
120 BOOLEAN bField_has_simple_inverse=rField_has_simple_inverse(currRing);
121 while (searchUnit)
122 {
123 i=0;
124 j=IDELEMS(syz);
125 while ((j>0) && (syz->m[j-1]==NULL)) j--;
126 existsUnit = FALSE;
127 if (bHasGlobalOrdering)
128 {
129 while ((i<j) && (!existsUnit))
130 {
131 existsUnit = pVectorHasUnitB(syz->m[i],&ModComp);
132 i++;
133 }
134 }
135 else
136 {
137 int I=0;
138 l = 0;
139 len=0;
140 for (i=0;i<IDELEMS(syz);i++)
141 {
142 if (syz->m[i]!=NULL)
143 {
144 pVectorHasUnit(syz->m[i],&m, &l);
145 if ((len==0) ||((l>0) && (l<len)))
146 {
147 len = l;
148 ModComp = m;
149 I = i;
150 }
151 }
152 }
153//Print("Laenge ist: %d\n",len);
154 if (len>0) existsUnit = TRUE;
155 i = I+1;
156 }
157 if (existsUnit)
158 {
159 i--;
160//--takes out the founded syzygy--
161 if (TEST_OPT_PROT) PrintS("f");
162 actWith = syz->m[i];
163 if (!bField_has_simple_inverse) p_Cleardenom(actWith, currRing);
164//Print("actWith: ");pWrite(actWith);
165 syz->m[i] = NULL;
166 for (k=i;k<j-1;k++) syz->m[k] = syz->m[k+1];
167 syz->m[j-1] = NULL;
168 syDeleteAbove(up,i);
169 j--;
170//--makes Gauss alg. for the column ModComp--
171 Unit1 = pTakeOutComp(&(actWith), ModComp);
172//PrintS("actWith now: ");pWrite(actWith);
173//Print("Unit1: ");pWrite(Unit1);
174 k=0;
175//Print("j= %d",j);
176 while (k<j)
177 {
178 if (syz->m[k]!=NULL)
179 {
180 Unit2 = pTakeOutComp(&(syz->m[k]), ModComp);
181//Print("element %d: ",k);pWrite(syz->m[k]);
182//PrintS("Unit2: ");pWrite(Unit2);
183 syz->m[k] = pMult(pCopy(Unit1),syz->m[k]);
184 syz->m[k] = pSub(syz->m[k],
185 pMult(Unit2,pCopy(actWith)));
186 if (syz->m[k]==NULL)
187 {
188 for (l=k;l<j-1;l++)
189 syz->m[l] = syz->m[l+1];
190 syz->m[j-1] = NULL;
191 j--;
192 syDeleteAbove(up,k);
193 k--;
194 }
195 }
196 k++;
197 }
198 pDelete(&actWith);
199 pDelete(&Unit1);
200//--deletes superfluous elements from the module below---
201 pDelete(&(mod->m[ModComp-1 - curr_syz_limit]));
202 for (k=ModComp-1 - curr_syz_limit;k<IDELEMS(mod)-1;k++)
203 mod->m[k] = mod->m[k+1];
204 mod->m[IDELEMS(mod)-1] = NULL;
205 }
206 else
207 searchUnit = FALSE;
208 }
209 if (TEST_OPT_PROT) PrintLn();
211 idSkipZeroes(syz);
212}
int BOOLEAN
Definition auxiliary.h:88
CF_NO_INLINE FACTORY_PUBLIC CanonicalForm mod(const CanonicalForm &, const CanonicalForm &)
STATIC_VAR Poly * h
Definition janet.cc:971
#define TEST_OPT_PROT
Definition options.h:105
#define pVectorHasUnitB(p, k)
Definition polys.h:333
#define pVectorHasUnit(p, k, l)
Definition polys.h:334
static BOOLEAN rHasGlobalOrdering(const ring r)
Definition ring.h:773
static int rGetCurrSyzLimit(const ring r)
Definition ring.h:734
int idSkipZeroes0(ideal ide)
ideal id_Jet0(const ideal i, const ring R)
static void syDeleteAbove(ideal up, int k)
Definition syz.cc:66

◆ syMinStep1()

void syMinStep1 ( resolvente res,
int length )
static

Definition at line 296 of file syz.cc.

297{
298 int i,j,k,index=0;
299 poly p;
300 intvec *have_del=NULL,*to_del=NULL;
301
302 while ((index<length) && (res[index]!=NULL))
303 {
304/*---we take out dependent elements from syz---------------------*/
305 if (res[index+1]!=NULL)
306 {
307 ideal deg0 = id_Jet0(res[index+1],currRing);
308 ideal reddeg0 = kInterRedOld(deg0);
309 idDelete(&deg0);
310 have_del = new intvec(IDELEMS(res[index]));
311 for (i=0;i<IDELEMS(reddeg0);i++)
312 {
313 if (reddeg0->m[i]!=NULL)
314 {
315 j = (int)__p_GetComp(reddeg0->m[i],currRing);
316 pDelete(&(res[index]->m[j-1]));
317 /*res[index]->m[j-1] = NULL;*/
318 (*have_del)[j-1] = 1;
319 }
320 }
321 idDelete(&reddeg0);
322 }
323 if (index>0)
324 {
325/*--- we search for units and perform Gaussian elimination------*/
326 j = to_del->length();
327 while (j>0)
328 {
329 if ((*to_del)[j-1]==1)
330 {
331 k = 0;
332 while (k<IDELEMS(res[index]))
333 {
334 p = res[index]->m[k];
335 while ((p!=NULL)
336 && ((!pLmIsConstantComp(p)) || ((int)__p_GetComp(p,currRing)!=j)))
337 pIter(p);
338 if ((p!=NULL)
339 && (pLmIsConstantComp(p))
340 && ((int)__p_GetComp(p,currRing)==j)) break;
341 k++;
342 }
343 #ifndef SING_NDEBUG
344 if (k>=IDELEMS(res[index]))
345 {
346 PrintS("out of range\n");
347 }
348 #endif
350 if (res[index+1]!=NULL)
352 (*to_del)[j-1] = 0;
353 }
354 j--;
355 }
356 }
357 if (to_del!=NULL) delete to_del;
358 to_del = have_del;
359 have_del = NULL;
360 index++;
361 }
362 if (TEST_OPT_PROT) PrintLn();
364 if (to_del!=NULL) delete to_del;
365}
ideal kInterRedOld(ideal F, const ideal Q)
Definition kstd1.cc:3457
#define pLmIsConstantComp(p)
like above, except that p must be != NULL
Definition polys.h:243
static void syDeleteAbove1(ideal up, int k)
Definition syz.cc:264
void syKillEmptyEntres(resolvente res, int length)
Definition syz1.cc:2200

◆ syMres_with_map()

syStrategy syMres_with_map ( ideal arg,
int maxlength,
intvec * w,
ideal & trans )

Definition at line 1180 of file syz.cc.

1181{
1182 syStrategy res=syResolution(arg,maxlength,w,1);
1183 ideal *r=res->minres;
1184 if (r==NULL) r=res->fullres;
1185 trans=idLift(arg,r[0],NULL,TRUE,FALSE,FALSE,NULL);
1186 return res;
1187}
syStrategy syResolution(ideal arg, int maxlength, intvec *w, BOOLEAN minim)
Definition syz.cc:625

◆ sypCopyConstant()

poly sypCopyConstant ( poly inp)
static

Definition at line 696 of file syz.cc.

697{
698 poly outp=NULL,q;
699
700 while (inp!=NULL)
701 {
702 if (pLmIsConstantComp(inp))
703 {
704 if (outp==NULL)
705 {
706 q = outp = pHead(inp);
707 }
708 else
709 {
710 pNext(q) = pHead(inp);
711 pIter(q);
712 }
713 }
714 pIter(inp);
715 }
716 return outp;
717}
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition polys.h:68

◆ syPrepareModComp()

intvec * syPrepareModComp ( ideal arg,
intvec ** w )
static

Definition at line 25 of file syz.cc.

26{
27 intvec *w1 = NULL;
28 int i;
29 BOOLEAN isIdeal=FALSE;
30
31 if ((w==NULL) || (*w==NULL)) return w1;
32 int maxxx = (*w)->length();
33 if (maxxx==1)
34 {
35 maxxx = 2;
36 isIdeal = TRUE;
37 }
38 w1 = new intvec(maxxx+IDELEMS(arg));
39 if (!isIdeal)
40 {
41 for (i=0;i<maxxx;i++)
42 {
43 (*w1)[i] = (**w)[i];
44 }
45 }
46 for (i=maxxx;i<maxxx+IDELEMS(arg);i++)
47 {
48 if (arg->m[i-maxxx]!=NULL)
49 {
50 (*w1)[i] = p_FDeg(arg->m[i-maxxx],currRing);
51 if (pGetComp(arg->m[i-maxxx])!=0)
52 {
53 (*w1)[i]+=(**w)[pGetComp(arg->m[i-maxxx])-1];
54 }
55 }
56 }
57 delete (*w);
58 *w = new intvec(IDELEMS(arg)+1);
59 for (i=0;i<IDELEMS(arg);i++)
60 {
61 (**w)[i+1] = (*w1)[i+maxxx];
62 }
63 return w1;
64}

◆ syResolution()

syStrategy syResolution ( ideal arg,
int maxlength,
intvec * w,
BOOLEAN minim )

Definition at line 625 of file syz.cc.

626{
627
628#ifdef HAVE_PLURAL
629 const ideal idSaveCurrRingQuotient = currRing->qideal;
630 if( rIsSCA(currRing) )
631 {
633 {
634 currRing->qideal = SCAQuotient(currRing);
635 }
636 const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
637 const unsigned int m_iLastAltVar = scaLastAltVar(currRing);
638 arg = id_KillSquares(idCopy(arg), m_iFirstAltVar, m_iLastAltVar, currRing, false); // kill squares in input!
639 }
640#endif
641
643
644 if ((w!=NULL) && (!idTestHomModule(arg,currRing->qideal,w))) // is this right in SCA case???
645 {
646 WarnS("wrong weights given(2):");w->show();PrintLn();
647 idHomModule(arg,currRing->qideal,&w);
648 w->show();PrintLn();
649 w=NULL;
650 }
651 if (w!=NULL)
652 {
653 result->weights = (intvec**)omAlloc0Bin(char_ptr_bin);
654 (result->weights)[0] = ivCopy(w);
655 result->length = 1;
656 }
657 resolvente fr = syResolvente(arg,maxlength,&(result->length),&(result->weights),minim);
658 resolvente fr1;
659 if (minim)
660 {
661 result->minres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
662 fr1 = result->minres;
663 }
664 else
665 {
666 result->fullres = (resolvente)omAlloc0((result->length+1)*sizeof(ideal));
667 fr1 = result->fullres;
668 }
669 for (int i=result->length-1;i>=0;i--)
670 {
671 if (fr[i]!=NULL)
672 fr1[i] = fr[i];
673 fr[i] = NULL;
674 }
675 for (int i=result->length-1;i>0;i--)
676 {
677 if (fr1[i]!=NULL)
678 fr1[i]->rank=IDELEMS(fr1[i-1]);
679 }
680 omFreeSize((ADDRESS)fr,(result->length)*sizeof(ideal));
681
682#ifdef HAVE_PLURAL
683 if( rIsSCA(currRing) )
684 {
686 {
687 currRing->qideal = idSaveCurrRingQuotient;
688 }
689 id_Delete(&arg, currRing);
690 }
691#endif
692
693 return result;
694}
static bool rIsSCA(const ring r)
Definition nc.h:190
bool ncExtensions(int iMask)
Definition old.gring.cc:94
const int TESTSYZSCAMASK
Definition nc.h:338
ideal id_KillSquares(const ideal id, const short iFirstAltVar, const short iLastAltVar, const ring r, const bool bSkipZeroes)
Definition sca.cc:1518
#define omAlloc0Bin(bin)
ideal SCAQuotient(const ring r)
Definition sca.h:10
static short scaLastAltVar(ring r)
Definition sca.h:25
static short scaFirstAltVar(ring r)
Definition sca.h:18
EXTERN_VAR omBin char_ptr_bin
Definition structs.h:73

◆ syResolvente()

resolvente syResolvente ( ideal arg,
int maxlength,
int * length,
intvec *** weights,
BOOLEAN minim )

Definition at line 403 of file syz.cc.

405{
406 BITSET save1;
407 SI_SAVE_OPT1(save1);
408 resolvente newres;
409 tHomog hom=isNotHomog;
410 intvec *w = NULL,**tempW;
411 int i,k,syzIndex = 0,j,rk_arg=si_max(1,(int)id_RankFreeModule(arg,currRing));
412 int Kstd1_OldDeg=Kstd1_deg;
413 BOOLEAN completeMinim;
414 BOOLEAN setRegularity=TRUE;
415 int wlength=*length;
416
417 if (maxlength!=-1) *length = maxlength+1;
418 else *length = 5;
419 if ((wlength!=0) && (*length!=wlength))
420 {
421 intvec **wtmp = (intvec**)omAlloc0((*length)*sizeof(intvec*));
422 wtmp[0]=(*weights)[0];
423 omFreeSize((ADDRESS)*weights,wlength*sizeof(intvec*));
424 *weights=wtmp;
425 }
426 resolvente res = (resolvente)omAlloc0((*length)*sizeof(ideal));
427
428/*--- initialize the syzygy-ring -----------------------------*/
429 ring origR = currRing;
430 ring syz_ring = rAssure_SyzComp(origR, TRUE); // will do rChangeCurrRing if needed
431 rSetSyzComp(rk_arg, syz_ring);
432
433 if (syz_ring != origR)
434 {
435 rChangeCurrRing(syz_ring);
436 res[0] = idrCopyR_NoSort(arg, origR, syz_ring);
437 }
438 else
439 {
440 res[0] = idCopy(arg);
441 }
442
443/*--- creating weights for the module components ---------------*/
444 if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL))
445 {
446 if (!idTestHomModule(res[0],currRing->qideal,(*weights)[0]))
447 {
448 WarnS("wrong weights given(1):"); (*weights)[0]->show();PrintLn();
449 idHomModule(res[0],currRing->qideal,&w);
450 w->show();PrintLn();
451 *weights=NULL;
452 }
453 }
454
455 if ((weights==NULL) || (*weights==NULL) || ((*weights)[0]==NULL))
456 {
457 hom=(tHomog)idHomModule(res[0],currRing->qideal,&w);
458 if (hom==isHomog)
459 {
460 *weights = (intvec**)omAlloc0((*length)*sizeof(intvec*));
461 if (w!=NULL) (*weights)[0] = ivCopy(w);
462 }
463 }
464 else
465 {
466 if ((weights!=NULL) && (*weights!=NULL)&& ((*weights)[0]!=NULL))
467 {
468 w = ivCopy((*weights)[0]);
469 hom = isHomog;
470 }
471 }
472
473#ifdef HAVE_PLURAL
475 {
476// quick solution; need theory to apply homog GB stuff for G-Algebras
477 hom = isNotHomog;
478 }
479#endif // HAVE_PLURAL
480
481 if (hom==isHomog)
482 {
483 intvec *w1 = syPrepareModComp(res[0],&w);
484 if (w!=NULL) { delete w;w=NULL; }
485 w = w1;
486 j = 0;
487 while ((j<IDELEMS(res[0])) && (res[0]->m[j]==NULL)) j++;
488 if (j<IDELEMS(res[0]))
489 {
490 if (p_FDeg(res[0]->m[j],currRing)!=pTotaldegree(res[0]->m[j]))
491 setRegularity = FALSE;
492 }
493 }
494 else
495 {
496 setRegularity = FALSE;
497 }
498
499/*--- the main loop --------------------------------------*/
500 while ((res[syzIndex]!=NULL) && (!idIs0(res[syzIndex])) &&
501 ((maxlength==-1) || (syzIndex<=maxlength)))
502 // (syzIndex<maxlength+(int)minim)))
503/*--- compute one step more for minimizing-----------------*/
504 {
505 if (Kstd1_deg!=0) Kstd1_deg++;
506 if (syzIndex+1==*length)
507 {
508 newres = (resolvente)omAlloc0((*length+5)*sizeof(ideal));
509 tempW = (intvec**)omAlloc0((*length+5)*sizeof(intvec*));
510 for (j=0;j<*length;j++)
511 {
512 newres[j] = res[j];
513 if (*weights!=NULL) tempW[j] = (*weights)[j];
514 /*else tempW[j] = NULL;*/
515 }
516 omFreeSize((ADDRESS)res,*length*sizeof(ideal));
517 if (*weights != NULL) omFreeSize((ADDRESS)*weights,*length*sizeof(intvec*));
518 *length += 5;
519 res=newres;
520 *weights = tempW;
521 }
522/*--- interreducing first -----------------------------------*/
523 if (syzIndex>0)
524 {
525 int rkI=id_RankFreeModule(res[syzIndex],currRing);
526 rSetSyzComp(rkI, currRing);
527 }
529 if (minim || (syzIndex!=0))
530 {
531 ideal temp = kInterRedOld(res[syzIndex],currRing->qideal);
532 idDelete(&res[syzIndex]);
533 idSkipZeroes(temp);
534 res[syzIndex] = temp;
535 }
536/*--- computing the syzygy modules --------------------------------*/
537 if ((currRing->qideal==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))
538 {
539 res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg);
543 }
544 else
545 {
546 res[syzIndex+1] = idSyzygies(res[syzIndex],hom,&w,FALSE);
547 }
548 completeMinim=(syzIndex!=maxlength) || (maxlength ==-1) || (hom!=isHomog);
549 syzIndex++;
550 if (TEST_OPT_PROT) Print("[%d]\n",syzIndex);
551
553 {
554 if ((minim)||(syzIndex>1))
555 syMinStep(res[syzIndex-1],res[syzIndex],!completeMinim,NULL,hom);
556 if (!completeMinim)
557 /*minim is TRUE, we are in the module: maxlength, maxlength <>0*/
558 {
559 idDelete(&res[syzIndex]);
560 }
561 }
562/*---creating the iterated weights for module components ---------*/
563 if ((hom == isHomog) && (res[syzIndex]!=NULL) && (!idIs0(res[syzIndex])))
564 {
565//Print("die %d Modulegewichte sind:\n",w1->length());
566//w1->show();
567//PrintLn();
568 int max_comp = id_RankFreeModule(res[syzIndex],currRing);
569 k = max_comp - rGetCurrSyzLimit(currRing);
570 assume(w != NULL);
571 if (w != NULL)
572 w->resize(max_comp+IDELEMS(res[syzIndex]));
573 else
574 w = new intvec(max_comp+IDELEMS(res[syzIndex]));
575 (*weights)[syzIndex] = new intvec(k);
576 for (i=0;i<k;i++)
577 {
578 if (res[syzIndex-1]->m[i]!=NULL) // hs
579 {
580 (*w)[i + rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex-1]->m[i],currRing);
581 if (pGetComp(res[syzIndex-1]->m[i])>0)
583 += (*w)[pGetComp(res[syzIndex-1]->m[i])-1];
584 (*((*weights)[syzIndex]))[i] = (*w)[i+rGetCurrSyzLimit(currRing)];
585 }
586 }
587 for (i=k;i<k+IDELEMS(res[syzIndex]);i++)
588 {
589 if (res[syzIndex]->m[i-k]!=NULL)
590 (*w)[i+rGetCurrSyzLimit(currRing)] = p_FDeg(res[syzIndex]->m[i-k],currRing)
591 +(*w)[pGetComp(res[syzIndex]->m[i-k])-1];
592 }
593 }
594 }
595/*--- end of the main loop --------------------------------------*/
596/*--- deleting the temporare data structures --------------------*/
597 if ((syzIndex!=0) && (res[syzIndex]!=NULL) && (idIs0(res[syzIndex])))
598 idDelete(&res[syzIndex]);
599 if (w !=NULL) delete w;
600
601 Kstd1_deg=Kstd1_OldDeg;
602
603 for (i=1; i<=syzIndex; i++)
604 {
605 if ((res[i]!=NULL) && ! idIs0(res[i]))
606 {
608 res[i]->rank=idElem(res[i-1]);
609 }
610 }
611/*--- going back to the original ring -------------------------*/
612 if (origR != syz_ring)
613 {
614 rChangeCurrRing(origR); // should not be needed now?
615 for (i=0; i<=syzIndex; i++)
616 {
617 res[i] = idrMoveR_NoSort(res[i], syz_ring, origR);
618 }
619 rDelete(syz_ring);
620 }
621 SI_RESTORE_OPT1(save1);
622 return res;
623}
#define BITSET
Definition auxiliary.h:85
ideal idSyzygies(ideal h1, tHomog h, intvec **w, BOOLEAN setSyzComp, BOOLEAN setRegularity, int *deg, GbVariant alg)
Definition ideals.cc:834
EXTERN_VAR int Kstd1_deg
Definition kstd1.h:70
#define assume(x)
Definition mod2.h:389
VAR unsigned si_opt_1
Definition options.c:5
#define SI_SAVE_OPT1(A)
Definition options.h:21
#define SI_RESTORE_OPT1(A)
Definition options.h:24
#define Sy_bit(x)
Definition options.h:31
#define TEST_OPT_DEGBOUND
Definition options.h:115
#define TEST_OPT_NOTREGULARITY
Definition options.h:122
#define OPT_DEGBOUND
Definition options.h:91
#define TEST_OPT_NO_SYZ_MINIM
Definition options.h:126
void rChangeCurrRing(ring r)
Definition polys.cc:16
static long pTotaldegree(poly p)
Definition polys.h:283
ideal idrMoveR_NoSort(ideal &id, ring src_r, ring dest_r)
Definition prCopy.cc:261
ideal idrCopyR_NoSort(ideal id, ring src_r, ring dest_r)
Definition prCopy.cc:205
ring rAssure_SyzComp(const ring r, BOOLEAN complete)
Definition ring.cc:4527
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition ring.cc:5302
void rDelete(ring r)
unconditionally deletes fields in r
Definition ring.cc:454
void rSetSyzComp(int k, const ring r)
Definition ring.cc:5230
#define rField_is_Ring(R)
Definition ring.h:491
void id_Shift(ideal M, int s, const ring r)
static int idElem(const ideal F)
number of non-zero polys in F
tHomog
Definition structs.h:31
@ isNotHomog
Definition structs.h:32
static intvec * syPrepareModComp(ideal arg, intvec **w)
Definition syz.cc:25