Changeset ce1f78 in git
- Timestamp:
- Mar 16, 2012, 8:22:15 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 7fee87629a807b6be566a7757b3b60f36c22d651
- Parents:
- cd9796d49b820bd9ecc81b49dc04073e0bbf6012
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-16 20:22:15+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-03-16 21:36:33+01:00
- Location:
- libpolys
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/coeffs.h
rcd9796 rce1f78 145 145 number (*cfRePart)(number a, const coeffs r); 146 146 number (*cfImPart)(number a, const coeffs r); 147 void (*cfWrite)(number &a, const coeffs r); 147 148 /// print a given number (long format) 149 void (*cfWriteLong)(number &a, const coeffs r); 150 151 /// print a given number in a shorter way, if possible 152 /// e.g. in K(a): a2 instead of a^2 153 void (*cfWriteShort)(number &a, const coeffs r); 154 148 155 const char * (*cfRead)(const char * s, number * a, const coeffs r); 149 156 void (*cfNormalize)(number &a, const coeffs r); … … 262 269 short float_len2; /* additional char-flags, rInit */ 263 270 264 BOOLEAN CanShortOut; //< if the elements can be printed in short format265 // this is set to FALSE if a parameter name has >2 chars266 BOOLEAN ShortOut; //< if the elements should print in short format271 // BOOLEAN CanShortOut; //< if the elements can be printed in short format 272 // // this is set to FALSE if a parameter name has >2 chars 273 // BOOLEAN ShortOut; //< if the elements should print in short format 267 274 268 275 // --------------------------------------------------- … … 449 456 450 457 /// write to the output buffer of the currently used reporter 451 static inline void n_Write(number& n, const coeffs r) 452 { assume(r != NULL); assume(r->cfWrite!=NULL); r->cfWrite(n,r); } 458 static inline void n_WriteLong(number& n, const coeffs r) 459 { assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); } 460 461 /// write to the output buffer of the currently used reporter 462 /// in a shortest possible way, e.g. in K(a): a2 instead of a^2 463 static inline void n_WriteShort(number& n, const coeffs r) 464 { assume(r != NULL); assume(r->cfWriteShort!=NULL); r->cfWriteShort(n,r); } 465 466 static inline void n_Write(number& n, const coeffs r, const BOOLEAN bShortOut = TRUE) 467 { if (bShortOut) n_WriteShort(n, r); else n_WriteLong(n, r); } 468 453 469 454 470 /// @todo: Describe me!!! --> Hans -
libpolys/coeffs/ffields.cc
rcd9796 rce1f78 384 384 * write via StringAppend 385 385 */ 386 void nfWrite(number &a, const coeffs r)386 static void nfWriteLong (number &a, const coeffs r) 387 387 { 388 388 #ifdef LDEBUG … … 397 397 if ((long)a!=1L) 398 398 { 399 if(r->ShortOut==0) StringAppendS("^"); 399 StringAppend("^%d",(int)((long)a)); // long output! 400 } 401 } 402 } 403 404 405 /*2 406 * write (shortert output) via StringAppend 407 */ 408 static void nfWriteShort (number &a, const coeffs r) 409 { 410 #ifdef LDEBUG 411 nfTest(a, r); 412 #endif 413 if ((long)a==(long)r->m_nfCharQ) StringAppendS("0"); 414 else if ((long)a==0L) StringAppendS("1"); 415 else if (nfIsMOne(a, r)) StringAppendS("-1"); 416 else 417 { 418 StringAppendS(r->m_nfParameter); 419 if ((long)a!=1L) 420 { 400 421 StringAppend("%d",(int)((long)a)); 401 422 } … … 786 807 //r->cfRePart = ndCopy; 787 808 //r->cfImPart = ndReturn0; 788 r->cfWrite = nfWrite; 809 810 r->cfWriteLong = nfWriteLong; 811 789 812 r->cfRead = nfRead; 790 813 //r->cfNormalize=ndNormalize; … … 824 847 r->m_nfPlus1Table= NULL; 825 848 826 if (strlen(name) > 1) { 827 r->ShortOut = 0; 828 r->CanShortOut = FALSE; 829 } else { 830 r->ShortOut = 1; 831 } 849 if (strlen(name) > 1) 850 r->cfWriteShort = nfWriteLong; 851 else 852 r->cfWriteShort = nfWriteShort; 832 853 833 854 r->has_simple_Alloc=TRUE; -
libpolys/coeffs/gnumpc.cc
rcd9796 rce1f78 416 416 n->cfIsMOne = ngcIsMOne; 417 417 n->cfGreaterZero = ngcGreaterZero; 418 n->cfWrite = ngcWrite; 418 419 n->cfWriteLong = ngcWrite; 420 n->cfWriteShort = ngcWrite; 421 419 422 n->cfRead = ngcRead; 420 423 n->cfPower = ngcPower; … … 459 462 r->cfRePart = nl_Copy; 460 463 r->cfImPart = ndReturn0; 461 r->cfWrite = nlWrite;464 r->cfWriteLong = nlWrite; 462 465 r->cfRead = nlRead; 463 466 r->cfNormalize=nlNormalize; -
libpolys/coeffs/gnumpfl.cc
rcd9796 rce1f78 428 428 n->cfIsMOne = ngfIsMOne; 429 429 n->cfGreaterZero = ngfGreaterZero; 430 n->cfWrite = ngfWrite;430 n->cfWriteLong = ngfWrite; 431 431 n->cfRead = ngfRead; 432 432 n->cfPower = ngfPower; -
libpolys/coeffs/longrat.cc
rcd9796 rce1f78 2675 2675 r->cfRePart = nlCopy; 2676 2676 //r->cfImPart = ndReturn0; 2677 r->cfWrite = nlWrite;2677 r->cfWriteLong = nlWrite; 2678 2678 r->cfRead = nlRead; 2679 2679 r->cfNormalize=nlNormalize; -
libpolys/coeffs/modulop.cc
rcd9796 rce1f78 468 468 //r->cfRePart = ndCopy; 469 469 //r->cfImPart = ndReturn0; 470 r->cfWrite = npWrite;470 r->cfWriteLong = npWrite; 471 471 r->cfRead = npRead; 472 472 //r->cfNormalize=ndNormalize; -
libpolys/coeffs/numbers.cc
rcd9796 rce1f78 291 291 if (n->cfGetUnit==NULL) n->cfGetUnit=n->cfCopy; 292 292 #endif 293 293 294 if(n->cfWriteShort==NULL) 295 n->cfWriteShort = n->cfWriteLong; 296 294 297 #ifndef NDEBUG 295 298 assume(n->nCoeffIsEqual!=NULL); … … 316 319 assume(n->cfRePart!=NULL); 317 320 assume(n->cfImPart!=NULL); 318 assume(n->cfWrite!=NULL); 321 322 assume(n->cfWriteLong!=NULL); 323 assume(n->cfWriteShort!=NULL); 324 325 326 if(n->cfWriteLong==NULL) Warn("cfWrite is NULL for coeff %d",t); 327 if(n->cfWriteShort==NULL) Warn("cfWriteShort is NULL for coeff %d",t); 328 319 329 assume(n->cfRead!=NULL); 320 330 assume(n->cfNormalize!=NULL); -
libpolys/coeffs/numbers.h
rcd9796 rce1f78 27 27 #define nIsMOne(n) n_IsMOne(n, currRing->cf) 28 28 #define nGreaterZero(n) n_GreaterZero(n, currRing->cf) 29 #define nGreater(a, b) n_Greater (a,b,currRing->cf)30 #define nWrite(n) n_Write(n, currRing->cf)29 #define nGreater(a, b) n_Greater (a,b,currRing->cf) 30 #define nWrite(n) n_Write(n, currRing->cf, rShortOut(currRing)) 31 31 #define nNormalize(n) n_Normalize(n,currRing->cf) 32 32 -
libpolys/coeffs/rintegers.cc
rcd9796 rce1f78 408 408 r->cfInvers= nrzInvers; 409 409 r->cfCopy = nrzCopy; 410 r->cfWrite = nrzWrite;410 r->cfWriteLong = nrzWrite; 411 411 r->cfRead = nrzRead; 412 412 r->cfGreater = nrzGreater; -
libpolys/coeffs/rmodulo2m.cc
rcd9796 rce1f78 77 77 r->cfIsMOne = nr2mIsMOne; 78 78 r->cfGreaterZero = nr2mGreaterZero; 79 r->cfWrite = nr2mWrite;79 r->cfWriteLong = nr2mWrite; 80 80 r->cfRead = nr2mRead; 81 81 r->cfPower = nr2mPower; -
libpolys/coeffs/rmodulon.cc
rcd9796 rce1f78 78 78 r->cfIsMOne = nrnIsMOne; 79 79 r->cfGreaterZero = nrnGreaterZero; 80 r->cfWrite = nrnWrite;80 r->cfWriteLong = nrnWrite; 81 81 r->cfRead = nrnRead; 82 82 r->cfPower = nrnPower; -
libpolys/coeffs/shortfl.cc
rcd9796 rce1f78 567 567 n->cfIsMOne = nrIsMOne; 568 568 n->cfGreaterZero = nrGreaterZero; 569 n->cfWrite = nrWrite;569 n->cfWriteLong = nrWrite; 570 570 n->cfRead = nrRead; 571 571 n->cfPower = nrPower; -
libpolys/coeffs/test.cc
rcd9796 rce1f78 196 196 197 197 assume( r->cfInit != NULL ); 198 assume( r->cfWrite != NULL );198 assume( r->cfWriteLong != NULL ); 199 199 assume( r->cfAdd != NULL ); 200 200 assume( r->cfDelete != NULL ); … … 203 203 { 204 204 assume( r->cfInit == nlInit ); 205 assume( r->cfWrite == nlWrite );206 205 assume( r->cfAdd == nlAdd ); 207 206 assume( r->cfDelete == nlDelete ); … … 210 209 { 211 210 assume( r->cfInit == ngfInit ); 212 assume( r->cfWrite == ngfWrite );213 211 assume( r->cfAdd == ngfAdd ); 214 212 assume( r->cfDelete == ngfDelete ); … … 217 215 { 218 216 assume( r->cfInit == ngcInit ); 219 assume( r->cfWrite == ngcWrite );220 217 assume( r->cfAdd == ngcAdd ); 221 218 assume( r->cfDelete == ngcDelete ); … … 224 221 { 225 222 assume( r->cfInit == nrInit ); 226 assume( r->cfWrite == nrWrite );227 223 assume( r->cfAdd == nrAdd ); 228 224 // assume( r->cfDelete == nrDelete ); // No? … … 232 228 { 233 229 assume( r->cfInit == nr2mInit ); 234 assume( r->cfWrite == nr2mWrite );235 230 assume( r->cfAdd == nr2mAdd ); 236 231 assume( r->cfDelete == ndDelete ); … … 239 234 { 240 235 assume( r->cfInit == nrnInit ); 241 assume( r->cfWrite == nrnWrite );242 236 assume( r->cfAdd == nrnAdd ); 243 237 assume( r->cfDelete == nrnDelete ); … … 247 241 { 248 242 assume( r->cfInit == nfInit ); 249 assume( r->cfWrite == nfWrite );250 243 assume( r->cfAdd == nfAdd ); 251 244 //assume( r->cfDelete == nfDelete ); -
libpolys/polys/coeffrings.h
rcd9796 rce1f78 27 27 static inline int n_Size(number n, const ring r){ return n_Size(n,r->cf); } 28 28 static inline void n_Normalize(number& n, const ring r){ return n_Normalize(n,r->cf); } 29 static inline void n_Write(number& n, const ring r){ return n_Write(n, r->cf); }29 static inline void n_Write(number& n, const ring r){ return n_Write(n, r->cf, rShortOut(r)); } 30 30 static inline number n_GetDenom(number& n, const ring r){ return n_GetDenom(n, r->cf);} 31 31 static inline number n_GetNumerator(number& n, const ring r){ return n_GetNumerator(n, r->cf);} -
libpolys/polys/ext_fields/algext.cc
rcd9796 rce1f78 92 92 void naPower(number a, int exp, number *b, const coeffs cf); 93 93 number naCopy(number a, const coeffs cf); 94 void naWrite(number &a, const coeffs cf); 94 void naWriteLong(number &a, const coeffs cf); 95 void naWriteShort(number &a, const coeffs cf); 95 96 number naRePart(number a, const coeffs cf); 96 97 number naImPart(number a, const coeffs cf); … … 468 469 } 469 470 470 void naWrite (number &a, const coeffs cf)471 void naWriteLong(number &a, const coeffs cf) 471 472 { 472 473 naTest(a); … … 481 482 BOOLEAN useBrackets = !(p_IsConstant(aAsPoly, naRing)); 482 483 if (useBrackets) StringAppendS("("); 483 p_String0(aAsPoly, naRing, naRing); 484 p_String0Long(aAsPoly, naRing, naRing); 485 if (useBrackets) StringAppendS(")"); 486 } 487 } 488 489 void naWriteShort(number &a, const coeffs cf) 490 { 491 naTest(a); 492 if (a == NULL) 493 StringAppendS("0"); 494 else 495 { 496 poly aAsPoly = (poly)a; 497 /* basically, just write aAsPoly using p_Write, 498 but use brackets around the output, if a is not 499 a constant living in naCoeffs = cf->extRing->cf */ 500 BOOLEAN useBrackets = !(p_IsConstant(aAsPoly, naRing)); 501 if (useBrackets) StringAppendS("("); 502 p_String0Short(aAsPoly, naRing, naRing); 484 503 if (useBrackets) StringAppendS(")"); 485 504 } … … 817 836 cf->cfPower = naPower; 818 837 cf->cfCopy = naCopy; 819 cf->cfWrite = naWrite; 838 839 cf->cfWriteLong = naWriteLong; 840 841 if( rCanShortOut(naRing) ) 842 cf->cfWriteShort = naWriteShort; 843 else 844 cf->cfWriteShort = naWriteLong; 845 820 846 cf->cfRead = naRead; 821 847 cf->cfDelete = naDelete; -
libpolys/polys/ext_fields/transext.cc
rcd9796 rce1f78 110 110 void ntPower(number a, int exp, number *b, const coeffs cf); 111 111 number ntCopy(number a, const coeffs cf); 112 void ntWrite(number &a, const coeffs cf); 112 void ntWriteLong(number &a, const coeffs cf); 113 void ntWriteShort(number &a, const coeffs cf); 113 114 number ntRePart(number a, const coeffs cf); 114 115 number ntImPart(number a, const coeffs cf); … … 896 897 } 897 898 898 / * modifies a */899 void ntWrite (number &a, const coeffs cf)899 // NOTE: modifies a 900 void ntWriteLong(number &a, const coeffs cf) 900 901 { 901 902 ntTest(a); … … 909 910 BOOLEAN omitBrackets = p_IsConstant(NUM(f), ntRing); 910 911 if (!omitBrackets) StringAppendS("("); 911 p_String0 (NUM(f), ntRing, ntRing);912 p_String0Long(NUM(f), ntRing, ntRing); 912 913 if (!omitBrackets) StringAppendS(")"); 913 914 if (!DENIS1(f)) … … 916 917 omitBrackets = p_IsConstant(DEN(f), ntRing); 917 918 if (!omitBrackets) StringAppendS("("); 918 p_String0(DEN(f), ntRing, ntRing); 919 p_String0Long(DEN(f), ntRing, ntRing); 920 if (!omitBrackets) StringAppendS(")"); 921 } 922 } 923 } 924 925 // NOTE: modifies a 926 void ntWriteShort(number &a, const coeffs cf) 927 { 928 ntTest(a); 929 definiteGcdCancellation(a, cf, FALSE); 930 if (IS0(a)) 931 StringAppendS("0"); 932 else 933 { 934 fraction f = (fraction)a; 935 // stole logic from napWrite from kernel/longtrans.cc of legacy singular 936 BOOLEAN omitBrackets = p_IsConstant(NUM(f), ntRing); 937 if (!omitBrackets) StringAppendS("("); 938 p_String0Short(NUM(f), ntRing, ntRing); 939 if (!omitBrackets) StringAppendS(")"); 940 if (!DENIS1(f)) 941 { 942 StringAppendS("/"); 943 omitBrackets = p_IsConstant(DEN(f), ntRing); 944 if (!omitBrackets) StringAppendS("("); 945 p_String0Short(DEN(f), ntRing, ntRing); 919 946 if (!omitBrackets) StringAppendS(")"); 920 947 } … … 1369 1396 cf->cfPower = ntPower; 1370 1397 cf->cfCopy = ntCopy; 1371 cf->cfWrite = ntWrite;1398 cf->cfWriteLong = ntWriteLong; 1372 1399 cf->cfRead = ntRead; 1373 1400 cf->cfNormalize = ntNormalize; … … 1390 1417 cf->cfKillChar = ntKillChar; 1391 1418 1419 if( rCanShortOut(ntRing) ) 1420 cf->cfWriteShort = ntWriteShort; 1421 else 1422 cf->cfWriteShort = ntWriteLong; 1423 1392 1424 #ifndef HAVE_FACTORY 1393 1425 PrintS("// Warning: The 'factory' module is not available.\n"); -
libpolys/polys/monomials/p_polys.cc
rcd9796 rce1f78 3367 3367 { 3368 3368 number zz = n_Copy(z, src->cf); 3369 PrintS("z: "); n_Write(zz, src ->cf);3369 PrintS("z: "); n_Write(zz, src); 3370 3370 n_Delete(&zz, src->cf); 3371 3371 } -
libpolys/polys/monomials/p_polys.h
rcd9796 rce1f78 379 379 * 380 380 ***************************************************************/ 381 /// print p according to ShortOut in lmRing & tailRing 382 char* p_String0(poly p, ring lmRing, ring tailRing); 381 383 char* p_String(poly p, ring lmRing, ring tailRing); 382 char* p_String0(poly p, ring lmRing, ring tailRing);383 384 void p_Write(poly p, ring lmRing, ring tailRing); 384 385 void p_Write0(poly p, ring lmRing, ring tailRing); 385 386 void p_wrp(poly p, ring lmRing, ring tailRing); 387 388 /// print p in a short way, if possible 389 char* p_String0Short(const poly p, ring lmRing, ring tailRing); 390 391 /// print p in a long way 392 char* p_String0Long(const poly p, ring lmRing, ring tailRing); 393 386 394 387 395 /*************************************************************** -
libpolys/polys/monomials/ring.cc
rcd9796 rce1f78 241 241 return; /*to avoid printing after errors....*/ 242 242 243 assume(r != NULL); 244 const coeffs C = r->cf; 245 assume(C != NULL); 246 243 247 int nblocks=rBlocks(r); 244 248 … … 252 256 nblocks--; 253 257 254 n_CoeffWrite(r->cf, details); 258 259 if( nCoeff_is_algExt(C) ) 260 { 261 // NOTE: the following (non-thread-safe!) UGLYNESS 262 // (changing naRing->ShortOut for a while) is due to Hans! 263 // Just think of other ring using the VERY SAME naRing and possible 264 // side-effects... 265 ring R = C->extRing; 266 const BOOLEAN bSaveShortOut = rShortOut(R); R->ShortOut = rShortOut(r) & rCanShortOut(R); 267 268 n_CoeffWrite(C, details); // for correct printing of minpoly... WHAT AN UGLYNESS!!! 269 270 R->ShortOut = bSaveShortOut; 271 } 272 else 273 n_CoeffWrite(C, details); 274 255 275 #if 0 256 276 { … … 279 299 else 280 300 { 281 StringSetS(""); n_Write(r->cf->minpoly, r->cf); PrintS(StringAppendS("\n"));301 StringSetS(""); n_Write(r->cf->minpoly, r); PrintS(StringAppendS("\n")); 282 302 } 283 303 //if (r->minideal!=NULL) … … 2988 3008 { 2989 3009 r->VectorOut = (r->order[0] == ringorder_c); 2990 r-> ShortOut = TRUE;3010 r->CanShortOut = TRUE; 2991 3011 { 2992 3012 int i; … … 2997 3017 if(strlen(rParameter(r)[i])>1) 2998 3018 { 2999 r-> ShortOut=FALSE;3019 r->CanShortOut=FALSE; 3000 3020 break; 3001 3021 } 3002 3022 } 3003 3023 } 3004 if (r-> ShortOut)3024 if (r->CanShortOut) 3005 3025 { 3006 3026 // Hmm... sometimes (e.g., from maGetPreimage) new variables … … 3014 3034 if(r->names[i] != NULL && strlen(r->names[i])>1) 3015 3035 { 3016 r-> ShortOut=FALSE;3036 r->CanShortOut=FALSE; 3017 3037 break; 3018 3038 } … … 3020 3040 } 3021 3041 } 3022 r->CanShortOut = r->ShortOut; 3042 r->ShortOut = r->CanShortOut; 3043 3044 assume( !( !r->CanShortOut && r->ShortOut ) ); 3023 3045 } 3024 3046 -
libpolys/polys/monomials/ring.h
rcd9796 rce1f78 522 522 static inline BOOLEAN rShortOut(const ring r) 523 523 { 524 assume(r != NULL); assume(r->cf != NULL); return (r->ShortOut); 524 assume(r != NULL); return (r->ShortOut); 525 } 526 527 static inline BOOLEAN rCanShortOut(const ring r) 528 { 529 assume(r != NULL); return (r->CanShortOut); 525 530 } 526 531 -
libpolys/polys/polys0.cc
rcd9796 rce1f78 20 20 * uses form x*gen(.) if ko != coloumn number of p 21 21 */ 22 static void writemon(poly p, int ko, ring r) 23 { 22 static void writemon(poly p, int ko, const ring r) 23 { 24 assume(r != NULL); 25 const coeffs C = r->cf; 26 assume(C != NULL); 27 24 28 BOOLEAN wroteCoef=FALSE,writeGen=FALSE; 29 const BOOLEAN bNotShortOut = (rShortOut(r) == FALSE); 25 30 26 31 if (pGetCoeff(p)!=NULL) 27 n_Normalize(pGetCoeff(p), r->cf);32 n_Normalize(pGetCoeff(p),C); 28 33 29 34 if (((p_GetComp(p,r) == (short)ko) 30 35 &&(p_LmIsConstantComp(p, r))) 31 || ((!n_IsOne(pGetCoeff(p), r->cf))32 && (!n_IsMOne(pGetCoeff(p), r->cf))36 || ((!n_IsOne(pGetCoeff(p),C)) 37 && (!n_IsMOne(pGetCoeff(p),C)) 33 38 ) 34 39 ) 35 40 { 36 n_Write(p->coef,r->cf); 37 wroteCoef=(rShortOut(r) == FALSE) 41 if( bNotShortOut ) 42 n_WriteLong(pGetCoeff(p),C); 43 else 44 n_WriteShort(pGetCoeff(p),C); 45 46 wroteCoef=(bNotShortOut) 38 47 || (rParameter(r)!=NULL) 39 48 || rField_is_R(r) || (rField_is_long_R(r)) || (rField_is_long_C(r)); 40 49 writeGen=TRUE; 41 50 } 42 else if (n_IsMOne(pGetCoeff(p),r->cf)) 43 { 44 if (n_GreaterZero(pGetCoeff(p),r->cf)) 45 { 46 n_Write(p->coef,r->cf); 47 wroteCoef=(rShortOut(r) == FALSE) 51 else if (n_IsMOne(pGetCoeff(p),C)) 52 { 53 if (n_GreaterZero(pGetCoeff(p),C)) 54 { 55 if( bNotShortOut ) 56 n_WriteLong(pGetCoeff(p),C); 57 else 58 n_WriteShort(pGetCoeff(p),C); 59 60 wroteCoef=(bNotShortOut) 48 61 || (rParameter(r)!=NULL) 49 62 || rField_is_R(r) || (rField_is_long_R(r)) || (rField_is_long_C(r)); … … 64 77 StringAppendS("*"); 65 78 //else 66 wroteCoef=( rShortOut(r) == FALSE);79 wroteCoef=(bNotShortOut); 67 80 writeGen=TRUE; 68 81 StringAppendS(rRingVar(i, r)); 69 82 if (ee != 1L) 70 83 { 71 if ( rShortOut(r)==0) StringAppendS("^");84 if (bNotShortOut) StringAppendS("^"); 72 85 StringAppend("%ld", ee); 73 86 } … … 82 95 } 83 96 } 97 98 /// if possible print p in a short way... 99 char* p_String0Short(const poly p, ring lmRing, ring tailRing) 100 { 101 // NOTE: the following (non-thread-safe!) UGLYNESS 102 // (changing naRing->ShortOut for a while) is due to Hans! 103 // Just think of other ring using the VERY SAME naRing and possible 104 // side-effects... 105 const BOOLEAN bLMShortOut = rShortOut(lmRing); 106 const BOOLEAN bTAILShortOut = rShortOut(tailRing); 107 108 lmRing->ShortOut = rCanShortOut(lmRing); 109 tailRing->ShortOut = rCanShortOut(tailRing); 110 111 char* res = p_String0(p, lmRing, tailRing); 112 113 lmRing->ShortOut = bLMShortOut; 114 tailRing->ShortOut = bTAILShortOut; 115 116 return res; 117 } 118 119 /// print p in a long way... 120 char* p_String0Long(const poly p, ring lmRing, ring tailRing) 121 { 122 // NOTE: the following (non-thread-safe!) UGLYNESS 123 // (changing naRing->ShortOut for a while) is due to Hans! 124 // Just think of other ring using the VERY SAME naRing and possible 125 // side-effects... 126 const BOOLEAN bLMShortOut = rShortOut(lmRing); 127 const BOOLEAN bTAILShortOut = rShortOut(tailRing); 128 129 lmRing->ShortOut = FALSE; 130 tailRing->ShortOut = FALSE; 131 132 char* res = p_String0(p, lmRing, tailRing); 133 134 lmRing->ShortOut = bLMShortOut; 135 tailRing->ShortOut = bTAILShortOut; 136 137 return res; 138 } 139 84 140 85 141 char* p_String0(poly p, ring lmRing, ring tailRing) -
libpolys/tests/coeffs_test.h
rcd9796 rce1f78 250 250 251 251 TS_ASSERT_DIFFERS( r->cfInit, NULLp ); 252 TS_ASSERT_DIFFERS( r->cfWrite , NULLp );252 TS_ASSERT_DIFFERS( r->cfWriteLong, NULLp ); 253 253 TS_ASSERT_DIFFERS( r->cfAdd, NULLp ); 254 254 TS_ASSERT_DIFFERS( r->cfDelete, NULLp ); … … 259 259 { 260 260 TS_ASSERT_EQUALS( r->cfInit, nlInit ); 261 TS_ASSERT_EQUALS( r->cfWrite, nlWrite );262 261 TS_ASSERT_EQUALS( r->cfAdd, nlAdd ); 263 262 TS_ASSERT_EQUALS( r->cfDelete, nlDelete ); … … 289 288 { 290 289 TS_ASSERT_EQUALS( r->cfInit, ngfInit ); 291 TS_ASSERT_EQUALS( r->cfWrite, ngfWrite );292 290 TS_ASSERT_EQUALS( r->cfAdd, ngfAdd ); 293 291 TS_ASSERT_EQUALS( r->cfDelete, ngfDelete ); … … 297 295 { 298 296 TS_ASSERT_EQUALS( r->cfInit, ngcInit ); 299 TS_ASSERT_EQUALS( r->cfWrite, ngcWrite );300 297 TS_ASSERT_EQUALS( r->cfAdd, ngcAdd ); 301 298 TS_ASSERT_EQUALS( r->cfDelete, ngcDelete ); … … 305 302 { 306 303 TS_ASSERT_EQUALS( r->cfInit, nrInit ); 307 TS_ASSERT_EQUALS( r->cfWrite, nrWrite );308 304 TS_ASSERT_EQUALS( r->cfAdd, nrAdd ); 309 305 // TS_ASSERT_EQUALS( r->cfDelete, nrDelete ); // No? … … 313 309 { 314 310 TS_ASSERT_EQUALS( r->cfInit, nfInit ); 315 TS_ASSERT_EQUALS( r->cfWrite, nfWrite );316 311 TS_ASSERT_EQUALS( r->cfAdd, nfAdd ); 317 312 //TS_ASSERT_EQUALS( r->cfDelete, nfDelete ); … … 322 317 { 323 318 TS_ASSERT_EQUALS( r->cfInit, nr2mInit ); 324 TS_ASSERT_EQUALS( r->cfWrite, nr2mWrite );325 319 TS_ASSERT_EQUALS( r->cfAdd, nr2mAdd ); 326 320 TS_ASSERT_EQUALS( r->cfDelete, ndDelete ); … … 330 324 { 331 325 TS_ASSERT_EQUALS( r->cfInit, nrnInit ); 332 TS_ASSERT_EQUALS( r->cfWrite, nrnWrite );333 326 TS_ASSERT_EQUALS( r->cfAdd, nrnAdd ); 334 327 TS_ASSERT_EQUALS( r->cfDelete, nrnDelete );
Note: See TracChangeset
for help on using the changeset viewer.