Changeset 5956ac9 in git for libpolys/polys/polys0.cc
- Timestamp:
- Dec 3, 2018, 3:06:25 PM (5 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a2e710f5fec606bbc77b74c30907c0b6defd141d
- Parents:
- 65e8f13fcb176d13e624ff95cb8efa00cf8fea763055a67024ccc2284bfe7f6f6484aa74f17a0b73
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/polys0.cc
r65e8f1 r5956ac9 28 28 assume(C != NULL); 29 29 30 #ifdef HAVE_SHIFTBBA31 if (r->isLPring)32 {33 if (!p_mIsInV(p, r))34 {35 /*36 * the monomial is not a valid letterplace monomial37 * without this warning one cannot distinguish between38 * x(1)*x(3) and x(1)*x(2) because they would both be displayed39 * as x*x40 */41 int *expV = (int *) omAlloc((r->N+1)*sizeof(int));42 p_GetExpV(p, expV, r);43 char* s = LPExpVString(expV, r);44 Warn("invalid letterplace monomial: (%s)", s);45 omFreeSize((ADDRESS) expV, (r->N+1)*sizeof(int));46 omFree(s);47 }48 }49 #endif50 51 30 BOOLEAN wroteCoef=FALSE,writeGen=FALSE; 52 31 const BOOLEAN bNotShortOut = (rShortOut(r) == FALSE); … … 88 67 89 68 int i; 90 for (i=0; i<rVar(r); i++) 91 { 92 { 93 long ee = p_GetExp(p,i+1,r); 94 if (ee!=0L) 69 #ifdef HAVE_SHIFTBBA 70 if (rIsLPRing(r)) // this implies bNotShortOut 71 { 72 int lV = r->isLPring; 73 int lastVar = p_mLastVblock(p, r) * lV; 74 BOOLEAN wroteBlock = FALSE; 75 for (i=0; i<rVar(r); i++) 76 { 95 77 { 96 if (wroteCoef) 97 StringAppendS("*"); 98 //else 78 long ee = p_GetExp(p,i+1,r); 79 BOOLEAN endOfBlock = ((i+1) % lV) == 0; 80 BOOLEAN writeEmptyBlock = ee==0L && endOfBlock && !wroteBlock && i < lastVar; 81 if (ee!=0L || writeEmptyBlock) 82 { 83 if (wroteBlock) 84 StringAppendS("&"); 85 else if (wroteCoef) 86 StringAppendS("*"); 87 //else 88 wroteCoef=TRUE; //(bNotShortOut); 89 writeGen=TRUE; 90 if (writeEmptyBlock) 91 StringAppendS("_"); 92 else 93 { 94 StringAppendS(rRingVar(i, r)); 95 if (ee != 1L) 96 { 97 StringAppend("^%ld", ee); 98 } 99 wroteBlock = TRUE; 100 } 101 } 102 if (endOfBlock) 103 wroteBlock = FALSE; 104 } 105 } 106 } 107 else 108 #endif 109 { 110 for (i=0; i<rVar(r); i++) 111 { 112 { 113 long ee = p_GetExp(p,i+1,r); 114 if (ee!=0L) 115 { 116 if (wroteCoef) 117 StringAppendS("*"); 118 //else 99 119 wroteCoef=(bNotShortOut); 100 writeGen=TRUE; 101 StringAppendS(rRingVar(i, r)); 102 if (ee != 1L) 103 { 104 if (bNotShortOut) StringAppendS("^"); 105 StringAppend("%ld", ee); 120 writeGen=TRUE; 121 StringAppendS(rRingVar(i, r)); 122 if (ee != 1L) 123 { 124 if (bNotShortOut) StringAppendS("^"); 125 StringAppend("%ld", ee); 126 } 106 127 } 107 128 }
Note: See TracChangeset
for help on using the changeset viewer.