Changeset 52bcb9 in git
- Timestamp:
- Oct 26, 2018, 7:04:26 PM (6 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- a1ffca6af5c75d9f838c990415bb13c8f075435d
- Parents:
- 38554beb085c7b26c5d00d8dd399ee6b5bb7bca8
- git-author:
- Karim Abou Zeid <karim23697@gmail.com>2018-10-26 19:04:26+02:00
- git-committer:
- Karim Abou Zeid <karim23697@gmail.com>2018-11-20 20:17:43+01:00
- Files:
-
- 3 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/freegb.lib
r38554b r52bcb9 26 26 lieBracket(a,b[, N]); Lie bracket ab-ba of two letterplace polynomials 27 27 letplaceGBasis(I); two-sided Groebner basis of a letterplace ideal I 28 lpNF(f,I); two-sided normal form of f with respect to ideal I29 28 lpDivision(f,I); two-sided division with remainder 30 29 lpGBPres2Poly(L,I); reconstructs a polynomial from the output of lpDivision … … 2770 2769 // TODO Oct 18: replace by legacy call to the kernel function 2771 2770 proc lpNF(poly p, ideal G) 2772 "USAGE: lpNF(p,G); poly p, ideal G 2771 "USAGE: lpNF(p,G); poly p, ideal G (deprecated in favor of reduce(). will be removed soon) 2773 2772 RETURN: poly 2774 2773 PURPOSE: computation of the normal form of p with respect to G -
Singular/table.h
r38554b r52bcb9 725 725 ,{D(jjRANK2), RANK_CMD, INT_CMD, MATRIX_CMD, INT_CMD, ALLOW_NC |NO_RING} 726 726 ,{D(jjREAD2), READ_CMD, STRING_CMD, LINK_CMD, STRING_CMD, ALLOW_NC |ALLOW_RING} 727 ,{D(jjREDUCE_P), REDUCE_CMD, POLY_CMD, POLY_CMD, IDEAL_CMD, ALLOW_ PLURAL|ALLOW_RING}727 ,{D(jjREDUCE_P), REDUCE_CMD, POLY_CMD, POLY_CMD, IDEAL_CMD, ALLOW_NC |ALLOW_RING} 728 728 ,{D(jjREDUCE_P), REDUCE_CMD, VECTOR_CMD, VECTOR_CMD, IDEAL_CMD, ALLOW_PLURAL |ALLOW_RING} 729 729 ,{D(jjREDUCE_P), REDUCE_CMD, VECTOR_CMD, VECTOR_CMD, MODUL_CMD, ALLOW_PLURAL |ALLOW_RING} 730 ,{D(jjREDUCE_ID), REDUCE_CMD, IDEAL_CMD, IDEAL_CMD, IDEAL_CMD, ALLOW_ PLURAL|ALLOW_RING}730 ,{D(jjREDUCE_ID), REDUCE_CMD, IDEAL_CMD, IDEAL_CMD, IDEAL_CMD, ALLOW_NC |ALLOW_RING} 731 731 ,{D(jjREDUCE_ID), REDUCE_CMD, MODUL_CMD, MODUL_CMD, IDEAL_CMD, ALLOW_PLURAL |ALLOW_RING} 732 732 ,{D(jjREDUCE_ID), REDUCE_CMD, MODUL_CMD, MODUL_CMD, MODUL_CMD, ALLOW_PLURAL |ALLOW_RING} … … 937 937 ,{D(jjCALL2ARG), CNUMBER_CMD, CNUMBER_CMD, 2 , ALLOW_NC |ALLOW_RING} 938 938 ,{D(jjOPTION_PL), OPTION_CMD, STRING_CMD/*or set by p*/,-1, ALLOW_NC |ALLOW_RING} 939 ,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_ PLURAL|ALLOW_RING}939 ,{D(jjCALL2ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 2, ALLOW_NC |ALLOW_RING} 940 940 ,{D(jjCALL3ARG), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 3, ALLOW_PLURAL |ALLOW_RING} 941 941 ,{D(jjREDUCE4), REDUCE_CMD, IDEAL_CMD/*or set by p*/, 4, ALLOW_PLURAL |ALLOW_RING} -
kernel/GBEngine/kInline.h
r38554b r52bcb9 31 31 #include "kernel/polys.h" 32 32 33 #ifdef HAVE_SHIFTBBA 34 #include "polys/shiftop.h" 35 #endif 36 33 37 34 38 #define HAVE_TAIL_BIN … … 125 129 { 126 130 assume(r == tailRing); 127 p_Test(p_in, r); 131 #ifdef HAVE_SHIFTBBA 132 if (r->isLPring) 133 { 134 shift = p_mFirstVblock(p_in, r); 135 if (!shift) p_Test(p_in, r); 136 } 137 else 138 #endif 139 { 140 p_Test(p_in, r); 141 } 128 142 t_p = p_in; 129 143 } 130 144 else 131 145 { 132 p_Test(p_in, currRing); 146 #ifdef HAVE_SHIFTBBA 147 if (currRing->isLPring) 148 { 149 shift = p_mFirstVblock(p_in, currRing); 150 if (!shift) p_Test(p_in, currRing); 151 } 152 else 153 #endif 154 { 155 p_Test(p_in, currRing); 156 } 133 157 p = p_in; 134 158 } … … 147 171 { 148 172 assume(c_r == currRing && t_r == tailRing); 149 p_Test(p_in, currRing); 173 #ifdef HAVE_SHIFTBBA 174 if (c_r->isLPring) 175 { 176 shift = p_mFirstVblock(p_in, c_r); 177 if (!shift) p_Test(p_in, currRing); 178 } 179 else 180 #endif 181 { 182 p_Test(p_in, currRing); 183 } 150 184 p = p_in; 151 185 pLength=::pLength(p_in); -
kernel/GBEngine/kspoly.cc
r38554b r52bcb9 21 21 #endif 22 22 #ifdef HAVE_SHIFTBBA 23 #include "kernel/GBEngine/shiftgb.h"24 23 #include "polys/shiftop.h" 25 24 #endif -
kernel/GBEngine/kstd1.cc
r38554b r52bcb9 2854 2854 2855 2855 if (rHasLocalOrMixedOrdering(currRing)) 2856 { 2857 #ifdef HAVE_SHIFTBBA 2858 if (currRing->isLPring) 2859 { 2860 WerrorS("No local ordering possible for shift algebra"); 2861 return(NULL); 2862 } 2863 #endif 2856 2864 res=kNF1(F,Q,pp,strat,lazyReduce); 2865 } 2857 2866 else 2858 2867 res=kNF2(F,Q,pp,strat,lazyReduce); … … 2949 2958 2950 2959 if (rHasLocalOrMixedOrdering(currRing)) 2960 { 2961 #ifdef HAVE_SHIFTBBA 2962 if (currRing->isLPring) 2963 { 2964 WerrorS("No local ordering possible for shift algebra"); 2965 return(NULL); 2966 } 2967 #endif 2951 2968 res=kNF1(F,Q,pp,strat,lazyReduce); 2969 } 2952 2970 else 2953 2971 res=kNF2(F,Q,pp,strat,lazyReduce); -
kernel/GBEngine/kstd2.cc
r38554b r52bcb9 3522 3522 initBuchMoraCrit(strat); 3523 3523 strat->initEcart = initEcartBBA; 3524 strat->enterS = enterSBba; 3524 #ifdef HAVE_SHIFTBBA 3525 if (strat->tailRing->isLPring) 3526 { 3527 strat->enterS = enterSBbaShift; 3528 } 3529 else 3530 #endif 3531 { 3532 strat->enterS = enterSBba; 3533 } 3525 3534 #ifndef NO_BUCKETS 3526 3535 strat->use_buckets = (!TEST_OPT_NOT_BUCKETS) && (!rIsPluralRing(currRing)); … … 3564 3573 omfree(strat->S_2_R); 3565 3574 omfree(strat->fromQ); 3575 #ifdef HAVE_SHIFTBBA 3576 // only LM of elements in S is shifted 3577 // necessary to prevent deleting the tail multiple times 3578 if (strat->tailRing->isLPring && strat->Shdl != NULL && strat->Shdl->m != NULL) 3579 { 3580 for (int j = 0; j < strat->Shdl->nrows * strat->Shdl->ncols; j++) 3581 { 3582 if (strat->Shdl->m[j]!=NULL && pmFirstVblock(strat->Shdl->m[j]) > 1) 3583 { 3584 // otherwise the tail would be freed multiple times 3585 pNext(strat->Shdl->m[j]) = NULL; 3586 } 3587 } 3588 } 3589 #endif 3566 3590 idDelete(&strat->Shdl); 3567 3591 SI_RESTORE_OPT1(save1); … … 3665 3689 initBuchMoraCrit(strat); 3666 3690 strat->initEcart = initEcartBBA; 3667 strat->enterS = enterSBba; 3691 #ifdef HAVE_SHIFTBBA 3692 if (strat->tailRing->isLPring) 3693 { 3694 strat->enterS = enterSBbaShift; 3695 } 3696 else 3697 #endif 3698 { 3699 strat->enterS = enterSBba; 3700 } 3668 3701 /*- set S -*/ 3669 3702 strat->sl = -1; … … 3709 3742 omfree(strat->S_2_R); 3710 3743 omfree(strat->fromQ); 3744 #ifdef HAVE_SHIFTBBA 3745 // only LM of elements in S is shifted 3746 // necessary to prevent deleting the tail multiple times 3747 if (strat->tailRing->isLPring && strat->Shdl != NULL && strat->Shdl->m != NULL) 3748 { 3749 for (int j = 0; j < strat->Shdl->nrows * strat->Shdl->ncols; j++) 3750 { 3751 if (strat->Shdl->m[j]!=NULL && pmFirstVblock(strat->Shdl->m[j]) > 1) 3752 { 3753 // otherwise the tail would be freed multiple times 3754 pNext(strat->Shdl->m[j]) = NULL; 3755 } 3756 } 3757 } 3758 #endif 3711 3759 idDelete(&strat->Shdl); 3712 3760 SI_RESTORE_OPT1(save1); -
kernel/GBEngine/kutil.cc
r38554b r52bcb9 9357 9357 strat->sl++; 9358 9358 } 9359 9360 #ifdef HAVE_SHIFTBBA 9361 void enterSBbaShift (LObject &p,int atS,kStrategy strat, int atR) 9362 { 9363 int toInsert = itoInsert(p.p, strat->tailRing); 9364 for (int i = toInsert; i > 0; i--) 9365 { 9366 LObject qq; 9367 qq.p = pLPCopyAndShiftLM(p.p, i); // don't use Set() because it'll test the poly order 9368 qq.shift = i; 9369 strat->initEcart(&qq); // initEcartBBA sets length, pLength, FDeg and ecart 9370 enterSBba(qq, atS, strat, -1); 9371 } 9372 enterSBba(p, atS, strat, atR); 9373 } 9374 #endif 9359 9375 9360 9376 /*2 -
kernel/GBEngine/kutil.h
r38554b r52bcb9 424 424 void enterL (LSet *set,int *length, int *LSetmax, LObject p,int at); 425 425 void enterSBba (LObject &p,int atS,kStrategy strat, int atR = -1); 426 void enterSBbaShift (LObject &p,int atS,kStrategy strat, int atR = -1); 426 427 void enterSSba (LObject &p,int atS,kStrategy strat, int atR = -1); 427 428 void initEcartPairBba (LObject* Lp,poly f,poly g,int ecartF,int ecartG); -
kernel/GBEngine/shiftgb.cc
r38554b r52bcb9 64 64 } 65 65 66 // splits a frame (e.g. x(1)*y(5)) m1 into m1 and m2 (e.g. m1=x(1) and m2=y(1))67 // according to p which is inside the frame68 void k_SplitFrame(poly &m1, poly &m2, int at, const ring r) {69 int lV = r->isLPring;70 71 number m1Coeff = pGetCoeff(m1);72 73 int hole = lV * at;74 m2 = p_GetExp_k_n(m1, 1, hole, r);75 m1 = p_GetExp_k_n(m1, hole, r->N, r);76 77 p_mLPunshift(m2, r);78 p_SetCoeff(m1, m1Coeff, r);79 80 assume(p_FirstVblock(m1,r) <= 1);81 assume(p_FirstVblock(m2,r) <= 1);82 }83 84 66 #endif -
kernel/GBEngine/shiftgb.h
r38554b r52bcb9 17 17 int itoInsert(poly p, const ring r); 18 18 19 void k_SplitFrame(poly &m1, poly &m2, int at, const ring r);20 19 #endif 21 20 #endif -
libpolys/polys/kbuckets.cc
r38554b r52bcb9 11 11 #include "polys/monomials/ring.h" 12 12 #include "polys/kbuckets.h" 13 14 #ifdef HAVE_SHIFTBBA 15 #include "polys/shiftop.h" 16 #endif 13 17 14 18 #ifdef HAVE_COEF_BUCKETS … … 1140 1144 1141 1145 assume((unsigned)l1==pLength(a1)); 1146 1147 #ifdef HAVE_SHIFTBBA 1148 poly lmRight; 1149 if (r->isLPring) { 1150 int firstBlock = p_mFirstVblock(p1, r); 1151 k_SplitFrame(lm, lmRight, firstBlock, r); 1152 } 1153 #endif 1142 1154 #if 0 1143 1155 BOOLEAN backuped=FALSE; … … 1160 1172 #endif 1161 1173 1162 kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether); 1174 #ifdef HAVE_SHIFTBBA 1175 if (r->isLPring) 1176 { 1177 kBucket_Minus_m_Mult_p(bucket, lm, r->p_Procs->pp_Mult_mm(a1, lmRight, r), &l1, spNoether); 1178 } 1179 else 1180 #endif 1181 { 1182 kBucket_Minus_m_Mult_p(bucket, lm, a1, &l1, spNoether); 1183 } 1163 1184 1164 1185 #if 0 … … 1168 1189 1169 1190 p_LmDelete(&lm, r); 1191 #ifdef HAVE_SHIFTBBA 1192 if (r->isLPring) 1193 { 1194 p_LmDelete(&lmRight, r); 1195 } 1196 #endif 1170 1197 if (reset_vec) p_SetCompP(a1, 0, r); 1171 1198 kbTest(bucket); -
libpolys/polys/shiftop.cc
r38554b r52bcb9 579 579 } 580 580 return StringEndS(); 581 } 582 583 // splits a frame (e.g. x(1)*y(5)) m1 into m1 and m2 (e.g. m1=x(1) and m2=y(1)) 584 // according to p which is inside the frame 585 void k_SplitFrame(poly &m1, poly &m2, int at, const ring r) 586 { 587 int lV = r->isLPring; 588 589 number m1Coeff = pGetCoeff(m1); 590 591 int hole = lV * at; 592 m2 = p_GetExp_k_n(m1, 1, hole, r); 593 m1 = p_GetExp_k_n(m1, hole, r->N, r); 594 595 p_mLPunshift(m2, r); 596 p_SetCoeff(m1, m1Coeff, r); 597 598 assume(p_FirstVblock(m1,r) <= 1); 599 assume(p_FirstVblock(m2,r) <= 1); 581 600 } 582 601 -
libpolys/polys/shiftop.h
r38554b r52bcb9 41 41 char* LPExpVString(int *expV, ring ri); 42 42 43 void k_SplitFrame(poly &m1, poly &m2, int at, const ring r); 44 #define kSplitFrame(m1, m2, at) k_SplitFrame(m1, m2, at, currRing); 45 43 46 int id_IsInV(ideal I, const ring r); 44 47 int p_IsInV(poly p, const ring r);
Note: See TracChangeset
for help on using the changeset viewer.