MCPcopy Create free account
hub / github.com/Singular/Singular / idSyzygies

Function idSyzygies

kernel/ideals.cc:830–970  ·  view source on GitHub ↗

2 * compute the syzygies of h1 in R/quot, * weights of components are in w * if setRegularity, return the regularity in deg * do not change h1, w */

Source from the content-addressed store, hash-verified

828* do not change h1, w
829*/
830ideal idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp,
831 BOOLEAN setRegularity, int *deg, GbVariant alg)
832{
833 ideal s_h1;
834 int j, k, length=0,reg;
835 BOOLEAN isMonomial=TRUE;
836 int ii, idElemens_h1;
837
838 assume(h1 != NULL);
839
840 idElemens_h1=IDELEMS(h1);
841#ifdef PDEBUG
842 for(ii=0;ii<idElemens_h1 /*IDELEMS(h1)*/;ii++) pTest(h1->m[ii]);
843#endif
844 if (idIs0(h1))
845 {
846 ideal result=idFreeModule(idElemens_h1/*IDELEMS(h1)*/);
847 return result;
848 }
849 int slength=(int)id_RankFreeModule(h1,currRing);
850 k=si_max(1,slength /*id_RankFreeModule(h1)*/);
851
852 assume(currRing != NULL);
853 ring orig_ring=currRing;
854 ring syz_ring=rAssure_SyzComp(orig_ring,TRUE);
855 if (setSyzComp) rSetSyzComp(k,syz_ring);
856
857 if (orig_ring != syz_ring)
858 {
859 rChangeCurrRing(syz_ring);
860 s_h1=idrCopyR_NoSort(h1,orig_ring,syz_ring);
861 }
862 else
863 {
864 s_h1 = h1;
865 }
866
867 idTest(s_h1);
868
869 BITSET save_opt;
870 SI_SAVE_OPT1(save_opt);
871 si_opt_1|=Sy_bit(OPT_REDTAIL_SYZ);
872
873 ideal s_h3=idPrepare(s_h1,NULL,h,k,w,alg); // main (syz) GB computation
874
875 SI_RESTORE_OPT1(save_opt);
876
877 if (orig_ring != syz_ring)
878 {
879 idDelete(&s_h1);
880 for (j=0; j<IDELEMS(s_h3); j++)
881 {
882 if (s_h3->m[j] != NULL)
883 {
884 if (p_MinComp(s_h3->m[j],syz_ring) > k)
885 p_Shift(&s_h3->m[j], -k,syz_ring);
886 else
887 p_Delete(&s_h3->m[j],syz_ring);

Callers 9

jjSYZ_2Function · 0.85
jjSYZYGYFunction · 0.85
id_GCDFunction · 0.85
singclap_gcdFunction · 0.85
TestGBEngineFunction · 0.85
syResolventeFunction · 0.85
ncGCD2Function · 0.85
preIntegerCheckFunction · 0.85
TestGBEngineFunction · 0.85

Calls 15

idIs0Function · 0.85
idFreeModuleFunction · 0.85
si_maxFunction · 0.85
rAssure_SyzCompFunction · 0.85
rSetSyzCompFunction · 0.85
rChangeCurrRingFunction · 0.85
idrCopyR_NoSortFunction · 0.85
p_MinCompFunction · 0.85
p_ShiftFunction · 0.85
p_DeleteFunction · 0.85
idSkipZeroesFunction · 0.85
idrMoveR_NoSortFunction · 0.85

Tested by 2

TestGBEngineFunction · 0.68
TestGBEngineFunction · 0.68