Changeset 17bad9 in git
- Timestamp:
- Dec 12, 2018, 4:20:51 PM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 46a76ba9bfad59f96c1075c0730715fb0e47c6f1
- Parents:
- f04e8db1241a45b11103d9b24bd600bb1906a278
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpadim.lib
rf04e8db r17bad9 132 132 "PURPOSE: Checks, if all the Assumptions are holding 133 133 " 134 {if ( attrib(basering,"isLetterplaceRing")==0) {ERROR("Basering is not a Letterplace ring!");}135 if (d > attrib(basering,"uptodeg")) {ERROR("Specified degree bound exceeds ring parameter!");}134 {if (!isFreeAlgebra(basering)) {ERROR("Basering is not a Letterplace ring!");} 135 if (d > lpDegBound(basering)) {ERROR("Specified degree bound exceeds ring parameter!");} 136 136 int i; 137 137 for (i = 1; i <= size(L); i++) 138 {if (entryViolation(L[i], attrib(basering,"isLetterplaceRing")))138 {if (entryViolation(L[i], lpBlockSize(basering))) 139 139 {ERROR("Not allowed monomial/intvec found!");} 140 140 } … … 907 907 // construct the Graph of normal words [Studzinski page 78] 908 908 // construct set of vertices 909 int v = attrib(basering,"isLetterplaceRing"); int d = attrib(basering,"uptodeg");909 int v = lpBlockSize(basering); int d = lpDegBound(basering); 910 910 ideal V; poly p,q,w; 911 911 ideal LG = lead(G); … … 1691 1691 EXAMPLE: example lpDHilbert; shows examples 1692 1692 " 1693 {int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "isLetterplaceRing");1693 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 1694 1694 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1695 1695 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 1733 1733 EXAMPLE: example lpDHilbertSickle; shows examples 1734 1734 " 1735 {int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "isLetterplaceRing");1735 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 1736 1736 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1737 1737 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 1778 1778 SEE ALSO: ncHilb_lib 1779 1779 " 1780 {int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "isLetterplaceRing");1780 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 1781 1781 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1782 1782 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 1809 1809 EXAMPLE: example lpKDimCheck; shows examples 1810 1810 " 1811 {int n = attrib(basering,"isLetterplaceRing");1811 {int n = lpBlockSize(basering); 1812 1812 list L; 1813 1813 ideal R; … … 1844 1844 EXAMPLE: example lpKDim; shows examples 1845 1845 " 1846 {int degbound = attrib(basering, "uptodeg");int n = attrib(basering, "isLetterplaceRing");1846 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 1847 1847 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1848 1848 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 1948 1948 EXAMPLE: example lpSickle; shows examples 1949 1949 " 1950 {int degbound = attrib(basering,"uptodeg"); int n = attrib(basering, "isLetterplaceRing");1950 {int degbound = lpDegBound(basering); int n = lpBlockSize(basering); 1951 1951 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1952 1952 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 1988 1988 EXAMPLE: example lpSickleDim; shows examples 1989 1989 " 1990 {int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "isLetterplaceRing");1990 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 1991 1991 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 1992 1992 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 2028 2028 EXAMPLE: example lpSickleHil; shows examples 2029 2029 " 2030 {int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "isLetterplaceRing");2030 {int degbound = lpDegBound(basering);int n = lpBlockSize(basering); 2031 2031 if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}} 2032 2032 if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}} … … 2075 2075 " 2076 2076 {int m,d,h,degbound; 2077 m = 1; d = 0; h = 0; degbound = attrib(basering,"uptodeg");2077 m = 1; d = 0; h = 0; degbound = lpDegBound(basering); 2078 2078 if (size(#) > 0) {if (typeof(#[1])=="int"){if (#[1] < 1) {m = 0;}}} 2079 2079 if (size(#) > 1) {if (typeof(#[1])=="int"){if (#[2] > 0) {d = 1;}}} … … 2082 2082 if (m == 1) 2083 2083 {if (d == 0) 2084 {if (h == 0) {return(lpSickle(G,degbound, attrib(basering,"isLetterplaceRing")));}2085 else {return(lpSickleHil(G,degbound, attrib(basering,"isLetterplaceRing")));}2084 {if (h == 0) {return(lpSickle(G,degbound,lpBlockSize(basering)));} 2085 else {return(lpSickleHil(G,degbound,lpBlockSize(basering)));} 2086 2086 } 2087 2087 else 2088 {if (h == 0) {return(lpSickleDim(G,degbound, attrib(basering,"isLetterplaceRing")));}2089 else {return(lpDHilbertSickle(G,degbound, attrib(basering,"isLetterplaceRing")));}2088 {if (h == 0) {return(lpSickleDim(G,degbound,lpBlockSize(basering)));} 2089 else {return(lpDHilbertSickle(G,degbound,lpBlockSize(basering)));} 2090 2090 } 2091 2091 } … … 2093 2093 {if (d == 0) 2094 2094 {if (h == 0) {ERROR("You request to do nothing, so relax and do so");} 2095 else {return(lpHilbert(G,degbound, attrib(basering,"isLetterplaceRing")));}2095 else {return(lpHilbert(G,degbound,lpBlockSize(basering)));} 2096 2096 } 2097 2097 else 2098 {if (h == 0) {return(lpKDim(G,degbound, attrib(basering,"isLetterplaceRing")));}2099 else {return(lpDHilbert(G,degbound, attrib(basering,"isLetterplaceRing")));}2098 {if (h == 0) {return(lpKDim(G,degbound,lpBlockSize(basering)));} 2099 else {return(lpDHilbert(G,degbound,lpBlockSize(basering)));} 2100 2100 } 2101 2101 } -
Singular/LIB/fpaprops.lib
rf04e8db r17bad9 91 91 // if longest word has length 1 we handle it as a special case 92 92 if (l == 1) { 93 int n = attrib(basering, "isLetterplaceRing"); // variable count93 int n = lpBlockSize(basering); // variable count 94 94 int k = size(G); 95 95 if (k == n) { // only the field left … … 746 746 ERROR("Ufnarovskij graph not implemented for l = 1"); 747 747 } 748 int lV = attrib(basering, "isLetterplaceRing");748 int lV = lpBlockSize(basering); 749 749 // TODO: what if l <= 0? 750 750 dbprint("computing standard words"); … … 836 836 return (words); // no standard words 837 837 } 838 int lV = attrib(basering, "isLetterplaceRing"); // variable count838 int lV = lpBlockSize(basering); // variable count 839 839 list prevWords = ivStandardWords(G, length - 1); 840 840 list words; … … 907 907 // if longest word has length 1, or G is the zero ideal, we handle it as a special case 908 908 if (l == 1 || size(G) == 0) { 909 int n = attrib(basering, "isLetterplaceRing"); // variable count909 int n = lpBlockSize(basering); // variable count 910 910 int k = size(G); 911 911 if (k == n) { // V = {1} no edges … … 1004 1004 if (size(G1) > 0) { 1005 1005 while (size(G1) > 0) { 1006 if ( attrib(R, "isLetterplaceRing") > 1) {1007 ring R = lpDelVar(lp2iv(G1[1])[1]); 1006 if (lpBlockSize(R) > 1) { 1007 ring R = lpDelVar(lp2iv(G1[1])[1]); // TODO replace with proper method 1008 1008 ideal G1 = imap(save,G1); 1009 1009 G1 = simplify(G1, 2); // remove zero generators … … 1078 1078 { 1079 1079 list LG = lpId2ivLi(lead(G)); 1080 int n = attrib(basering, "isLetterplaceRing");1080 int n = lpBlockSize(basering); 1081 1081 int degbound = attrib(basering, "uptodeg"); 1082 1082 … … 1379 1379 // removes a variable from a letterplace ring (a bit of a hack) 1380 1380 static proc lpDelVar(int index) { 1381 int lV = attrib(basering, "isLetterplaceRing"); // number of variables in the main block1381 int lV = lpBlockSize(basering); // number of variables in the main block 1382 1382 int d = attrib(basering, "uptodeg"); // degree bround 1383 1383 list LR = ringlist(basering); -
Singular/LIB/freegb.lib
rf04e8db r17bad9 116 116 attrib(RL, "maxExp", 1); 117 117 def @R = ring(RL); 118 attrib(@R, "uptodeg", uptodeg); 118 attrib(@R, "uptodeg", uptodeg); // no longer needed 119 119 attrib(@R, "isLetterplaceRing", lV); 120 120 return (@R); … … 125 125 ring r = 0,(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4)),dp; 126 126 def R = setLetterplaceAttributes(r, 4, 2); setring R; 127 attrib(R,"isLetterplaceRing");127 lpBlockSize(R); 128 128 lieBracket(x(1),y(1),2); 129 129 } … … 1127 1127 def A = makeLetterplaceRing(2); // same as makeLetterplaceRing(2,0) 1128 1128 setring A; A; 1129 attrib(A,"isLetterplaceRing");1130 attrib(A,"uptodeg"); // degree bound1129 lpBlockSize(A); 1130 lpDegBound(A); // degree bound 1131 1131 setring r; def B = makeLetterplaceRing(2,1); // to compare: 1132 1132 setring B; B; 1133 attrib(B,"isLetterplaceRing");1134 attrib(B,"uptodeg"); // degree bound1133 lpBlockSize(B); 1134 lpDegBound(B); // degree bound 1135 1135 setring r; def C = makeLetterplaceRing(2,2); // to compare: 1136 1136 setring C; C; 1137 attrib(C,"isLetterplaceRing");1138 attrib(C,"uptodeg"); // degree bound1137 lpDegBound(C); 1138 lpDegBound(C); // degree bound 1139 1139 } 1140 1140 … … 1218 1218 setring A; 1219 1219 A; 1220 attrib(A,"isLetterplaceRing");// number of variables in the main block1221 attrib(A,"uptodeg"); // degree bound1220 lpBlockSize(A);// number of variables in the main block 1221 lpDegBound(A); // degree bound 1222 1222 } 1223 1223 … … 1323 1323 setring A; 1324 1324 A; 1325 attrib(A,"isLetterplaceRing"); // number of variables in the main block1326 attrib(A,"uptodeg"); // degree bound1325 lpBlockSize(A); // number of variables in the main block 1326 lpDegBound(A); // degree bound 1327 1327 } 1328 1328 … … 1387 1387 setring A; 1388 1388 A; 1389 attrib(A,"isLetterplaceRing"); // number of variables in the main block1390 attrib(A,"uptodeg"); // degree bound1389 lpBlockSize(A); // number of variables in the main block 1390 lpDegBound(A); // degree bound 1391 1391 } 1392 1392 … … 1493 1493 setring A; 1494 1494 A; 1495 attrib(A,"isLetterplaceRing"); // number of variables in the main block1496 attrib(A,"uptodeg"); // degree bound1495 lpBlockSize(A); // number of variables in the main block 1496 lpDegBound(A); // degree bound 1497 1497 } 1498 1498 … … 2754 2754 // } 2755 2755 // intvec v = w; 2756 // for(i=1; i< attrib(basering,"uptodeg"); i++)2756 // for(i=1; i< lpDegBound(basering); i++) 2757 2757 // { 2758 2758 // v = v,w; … … 2940 2940 // make new ring 2941 2941 def save = basering; 2942 int norigvars = attrib(save, "isLetterplaceRing");2942 int norigvars = lpBlockSize(save); 2943 2943 def Rtagged; def temp = save; 2944 2944 for (int i = 1; i <= size(I); i++) { … … 2947 2947 } kill i; 2948 2948 // currently R + "var" doesn't preserve uptodeg 2949 Rtagged = setLetterplaceAttributes(Rtagged, attrib(Rtagged, "isLetterplaceRing"), attrib(save, "uptodeg"));2949 Rtagged = setLetterplaceAttributes(Rtagged, lpBlockSize(Rtagged), lpDegBound(save)); 2950 2950 setring Rtagged; 2951 2951 … … 3059 3059 {if (I==intvec(0)) {return(intvec(0));} 3060 3060 int j,k,l; 3061 int n = attrib(basering,"isLetterplaceRing"); int d = attrib(basering,"uptodeg");3061 int n = lpBlockSize(basering); int d = lpDegBound(basering); 3062 3062 intvec w; j = 1; 3063 3063 while (j <= d) … … 3095 3095 " 3096 3096 {int i,j,k,r1,r2; intvec D; 3097 int n = attrib(basering,"isLetterplaceRing");3097 int n = lpBlockSize(basering); 3098 3098 k = size(V) div n; r1 = 0; r2 = 0; 3099 3099 for (i=1; i<= k; i++) … … 3140 3140 3141 3141 int i,j,r; intvec T; list R; 3142 int n = attrib(basering,"isLetterplaceRing");3142 int n = lpBlockSize(basering); 3143 3143 int k = size(V) - size(W) + 1; 3144 3144 if (intvec(V[1..size(W)])-W == 0){R[1]=0;} … … 3241 3241 int shiftInvariant = 1; 3242 3242 3243 int n = attrib(basering, "isLetterplaceRing");3244 int d = attrib(basering, "uptodeg");3243 int n = lpDegBound(basering); 3244 int d = lpDegBound(basering); 3245 3245 3246 3246 ideal monomials; … … 3309 3309 } 3310 3310 3311 int lV = attrib(basering, "isLetterplaceRing"); // variable count3311 int lV = lpBlockSize(basering); // variable count 3312 3312 ideal prevMonomials = lpMonomialsWithHoles(d - 1); 3313 3313 … … 3335 3335 static proc getlpCoeffs(poly q, poly p) 3336 3336 {list R; intvec cq,t,lv,rv,bla; 3337 int n = attrib(basering,"isLetterplaceRing"); int d = attrib(basering,"uptodeg");3337 int n = lpBlockSize(basering); int d = lpDegBound(basering); 3338 3338 int i; 3339 3339 cq = leadexp(p)-leadexp(q); /* p/q */ … … 3379 3379 "PURPOSE: Checks, if all the Assumptions are holding 3380 3380 " 3381 {if ( attrib(basering,"isLetterplaceRing")==0) {ERROR("Basering is not a Letterplace ring!");}3382 if (d > attrib(basering,"uptodeg")) {ERROR("Specified degree bound exceeds ring parameter!");}3381 {if (!isFreeAlgebra(basering)) {ERROR("Basering is not a Letterplace ring!");} 3382 if (d > lpDegBound(basering)) {ERROR("Specified degree bound exceeds ring parameter!");} 3383 3383 int i; 3384 3384 for (i = 1; i <= size(L); i++) 3385 {if (entryViolation(L[i], attrib(basering,"isLetterplaceRing")))3385 {if (entryViolation(L[i], lpBlockSize(basering))) 3386 3386 {ERROR("Not allowed monomial/intvec found!");} 3387 3387 } … … 3401 3401 " 3402 3402 " 3403 {if ( attrib(basering,"isLetterplaceRing")==0) {ERROR("Basering is not a Letterplace ring!");}3403 {if (!isFreeAlgebra(basering)) {ERROR("Basering is not a Letterplace ring!");} 3404 3404 return(); 3405 3405 } … … 3427 3427 {int r = 0; intvec w; 3428 3428 intvec l = leadexp(p); 3429 int n = attrib(basering,"isLetterplaceRing"); int d = attrib(basering,"uptodeg");3429 int n = lpBlockSize(basering); int d = lpDegBound(basering); 3430 3430 int i,j,c,c1; 3431 3431 while (1 <= d) … … 3539 3539 // uptodeg and lV are defined 3540 3540 // returns Boolean : yes/no [for assume violation] 3541 def uptodeg = attrib(basering,"uptodeg");3541 def uptodeg = lpDegBound(basering); 3542 3542 if ( typeof(uptodeg)!="int" ) 3543 3543 { 3544 3544 return(1); 3545 3545 } 3546 int lV = attrib(basering,"isLetterplaceRing"); 3547 // isLetterplaceRing for rings is always defined and of type int 3548 if ( lV==0 ) 3549 { 3550 return(1); 3551 } 3552 return(0); 3546 return (!isFreeAlgebra(basering)) 3553 3547 } 3554 3548 … … 3706 3700 {if (I[1] == 0) {return(1);} 3707 3701 int i = size(I); 3708 if (i > attrib(basering,"uptodeg")) {ERROR("polynomial exceeds degreebound");}3702 if (i > lpDegBound(basering)) {ERROR("polynomial exceeds degreebound");} 3709 3703 int j; poly p = 1; 3710 3704 for (j = 1; j <= i; j++) {if (I[j] > 0) { p = p*var(I[j]);}} //ignore zeroes, because they correspond to 1 … … 3824 3818 intvec I; 3825 3819 int i,j; 3826 if (deg(p) > attrib(basering,"uptodeg")) {ERROR("Monomial exceeds degreebound");}3820 if (deg(p) > lpDegBound(basering)) {ERROR("Monomial exceeds degreebound");} 3827 3821 if (p == 1) {return(I);} 3828 3822 if (p == 0) {ERROR("Monomial is not allowed to equal zero");} 3829 3823 intvec lep = leadexp(p); 3830 for ( i = 1; i <= attrib(basering,"isLetterplaceRing"); i++) {if (lep[i] == 1) {I = i; break;}}3831 for (i = ( attrib(basering,"isLetterplaceRing")+1); i <= size(lep); i++)3824 for ( i = 1; i <= lpBlockSize(basering); i++) {if (lep[i] == 1) {I = i; break;}} 3825 for (i = (lpBlockSize(basering)+1); i <= size(lep); i++) 3832 3826 {if (lep[i] == 1) 3833 { j = (i mod attrib(basering,"isLetterplaceRing"));3834 if (j == 0) {I = I, attrib(basering,"isLetterplaceRing");}3827 { j = (i mod lpBlockSize(basering)); 3828 if (j == 0) {I = I,lpBlockSize(basering);} 3835 3829 else {I = I,j;} 3836 3830 } -
Singular/LIB/ncHilb.lib
rf04e8db r17bad9 69 69 EXAMPLE: example fpahilb; shows an example " 70 70 { 71 if ( attrib(basering, "isLetterplaceRing")==0)71 if (!isFreeAlgebra(basering)) 72 72 { 73 73 ERROR("Basering should be Letterplace ring"); … … 75 75 def save = basering; 76 76 int sz=size(#); 77 int lV= attrib(save,"isLetterplaceRing"); // nvars(orig comm ring)77 int lV=lpBlockSize(save); // nvars(orig comm ring) 78 78 int ig=0; 79 79 int mgrad=0; … … 137 137 } 138 138 // new: truncation should be < than degbound/2 139 int degbnd = attrib(save,"uptodeg");139 int degbnd = lpDegBound(save); 140 140 if (tdeg == 0) 141 141 { … … 403 403 EXAMPLE: example rcolon; shows an example" 404 404 { 405 int lV = attrib(R,"isLetterplaceRing"); //nvars(save);405 int lV = lpBlockSize(R); //nvars(save); 406 406 if (lV == 0) 407 407 { … … 419 419 } 420 420 } 421 int degbnd = attrib(R,"uptodeg");421 int degbnd = lpDegBound(R); 422 422 if ( 2*maxdegI != degbnd) 423 423 { -
Tst/Manual/makeLetterplaceRing.tst
rf04e8db r17bad9 4 4 def A = makeLetterplaceRing(2); 5 5 setring A; A; 6 attrib(A,"isLetterplaceRing");7 attrib(A,"uptodeg"); // degree bound8 attrib(A,"lV"); // number of variables in the main block6 isFreeAlgebra(A); 7 lpDegBound(A); // degree bound 8 lpBlockSize(A); // number of variables in the main block 9 9 setring r; def B = makeLetterplaceRing(2,1); // to compare: 10 10 setring B; B; -
Tst/Manual/setLetterplaceAttributes.tst
rf04e8db r17bad9 3 3 ring r = 0,(x(1),y(1),x(2),y(2),x(3),y(3),x(4),y(4)),dp; 4 4 def R = setLetterplaceAttributes(r, 4, 2); setring R; 5 attrib(R,"isLetterplaceRing"); 5 isFreeAlgebra(R); 6 lpDegBound(R); 7 lpBlockSize(R); 6 8 lieBracket(x(1),y(1),2); 7 9 tst_status(1);$
Note: See TracChangeset
for help on using the changeset viewer.