Changeset c14846c in git
- Timestamp:
- Sep 27, 2011, 6:06:45 PM (12 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- de7521eef6abc64c1312e46961fc93fb053d9bd5
- Parents:
- c7aad03a695808dc3f5aaaa108a93dbc905bf922
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-09-27 18:06:45+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:38+01:00
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
rc7aad0 rc14846c 892 892 if (charstr(basering)[1]=="i") // either integer or integer,q 893 893 { 894 if (find( option(),"prot")) { "calling std for ideals in ring with ring coefficients"; }894 if (find(s_opt, option())) { "calling std for ideals in ring with ring coefficients"; } 895 895 return (std(i)); 896 896 } -
libpolys/coeffs/gnumpfl.cc
rc7aad0 rc14846c 98 98 } 99 99 100 #if 0 100 101 static number ngfCopyMap(number a, const coeffs r1, const coeffs r2) 101 102 { … … 110 111 return (number)b; 111 112 } 113 #endif 112 114 113 115 /*2 … … 463 465 if (nCoeff_is_long_R(src)) 464 466 { 465 return n gfCopyMap;467 return ndCopyMap; //ngfCopyMap; 466 468 } 467 469 if (nCoeff_is_R(src)) -
libpolys/coeffs/longrat.cc
rc7aad0 rc14846c 1986 1986 if (nCoeff_is_Q(src)) 1987 1987 { 1988 return n lCopyMap;1988 return ndCopyMap; 1989 1989 } 1990 1990 if (nCoeff_is_Zp(src)) -
libpolys/coeffs/rintegers.cc
rc7aad0 rc14846c 112 112 } 113 113 114 #if 0 114 115 number nrzCopyMap(number a, const coeffs /*src*/, const coeffs dst) 115 116 { 116 117 return nrzCopy(a,dst); 117 118 } 119 #endif 118 120 119 121 int nrzSize(number a, const coeffs) … … 283 285 if (nCoeff_is_Ring_Z(src) || nCoeff_is_Ring_ModN(src) || nCoeff_is_Ring_PtoM(src)) 284 286 { 285 return n rzCopyMap;287 return ndCopyMap; //nrzCopyMap; 286 288 } 287 289 if (nCoeff_is_Ring_2toM(src)) -
libpolys/polys/ext_fields/algext.cc
rc7aad0 rc14846c 557 557 } 558 558 559 #if 0 559 560 /* assumes that either src = Q(a), dst = Q(a), or 560 561 src = Z/p(a), dst = Z/p(a) */ … … 563 564 return naCopy(a, dst); 564 565 } 566 #endif 565 567 566 568 number naCopyExt(number a, const coeffs src, const coeffs dst) … … 639 641 { 640 642 if (src->type==n_algExt) 641 return n aCopyMap;/// Q(a) --> Q(a)643 return ndCopyMap; // naCopyMap; /// Q(a) --> Q(a) 642 644 else 643 645 return naCopyExt; … … 652 654 { 653 655 if (src->type==n_algExt) 654 return n aCopyMap;/// Z/p(a) --> Z/p(a)656 return ndCopyMap; // naCopyMap; /// Z/p(a) --> Z/p(a) 655 657 else 656 658 return naCopyExt; -
libpolys/polys/ext_fields/transext.cc
rc7aad0 rc14846c 97 97 98 98 /// forward declarations 99 BOOLEAN ntGreaterZero(number a, const coeffs cf); 99 BOOLEAN ntGreaterZero(number a, const coeffs cf); 100 100 BOOLEAN ntGreater(number a, number b, const coeffs cf); 101 101 BOOLEAN ntEqual(number a, number b, const coeffs cf); … … 182 182 { 183 183 ntTest(a); ntTest(b); 184 184 185 185 /// simple tests 186 186 if (a == b) return TRUE; 187 187 if ((IS0(a)) && (!IS0(b))) return FALSE; 188 188 if ((IS0(b)) && (!IS0(a))) return FALSE; 189 190 /// cheap test if gcd's have been cancelled in both numbers 189 190 /// cheap test if gcd's have been cancelled in both numbers 191 191 fraction fa = (fraction)a; 192 192 fraction fb = (fraction)b; … … 206 206 return TRUE; 207 207 } 208 208 209 209 /* default: the more expensive multiplication test 210 210 a/b = c/d <==> a*d = b*c */ … … 383 383 const int P = rVar(A); 384 384 assume( P > 0 ); 385 385 386 386 Print("// %d parameter : ", P); 387 387 388 388 for (int nop=0; nop < P; nop ++) 389 389 Print("%s ", rRingVar(nop, A)); 390 390 391 391 assume( A->minideal == NULL ); 392 392 393 393 PrintS("\n// minpoly : 0\n"); 394 394 … … 412 412 if (IS0(a)) return ntCopy(b, cf); 413 413 if (IS0(b)) return ntCopy(a, cf); 414 414 415 415 fraction fa = (fraction)a; 416 416 fraction fb = (fraction)b; 417 417 418 418 poly g = p_Copy(NUM(fa), ntRing); 419 419 if (!DENIS1(fb)) g = p_Mult_q(g, p_Copy(DEN(fb), ntRing), ntRing); … … 421 421 if (!DENIS1(fa)) h = p_Mult_q(h, p_Copy(DEN(fa), ntRing), ntRing); 422 422 g = p_Add_q(g, h, ntRing); 423 423 424 424 if (g == NULL) return NULL; 425 425 426 426 poly f; 427 427 if (DENIS1(fa) && DENIS1(fb)) f = NULL; … … 431 431 p_Copy(DEN(fb), ntRing), 432 432 ntRing); 433 433 434 434 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 435 435 NUM(result) = g; … … 445 445 if (IS0(a)) return ntNeg(ntCopy(b, cf), cf); 446 446 if (IS0(b)) return ntCopy(a, cf); 447 447 448 448 fraction fa = (fraction)a; 449 449 fraction fb = (fraction)b; 450 450 451 451 poly g = p_Copy(NUM(fa), ntRing); 452 452 if (!DENIS1(fb)) g = p_Mult_q(g, p_Copy(DEN(fb), ntRing), ntRing); … … 454 454 if (!DENIS1(fa)) h = p_Mult_q(h, p_Copy(DEN(fa), ntRing), ntRing); 455 455 g = p_Add_q(g, p_Neg(h, ntRing), ntRing); 456 456 457 457 if (g == NULL) return NULL; 458 458 459 459 poly f; 460 460 if (DENIS1(fa) && DENIS1(fb)) f = NULL; … … 464 464 p_Copy(DEN(fb), ntRing), 465 465 ntRing); 466 466 467 467 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 468 468 NUM(result) = g; … … 477 477 ntTest(a); ntTest(b); 478 478 if (IS0(a) || IS0(b)) return NULL; 479 479 480 480 fraction fa = (fraction)a; 481 481 fraction fb = (fraction)b; 482 482 483 483 poly g = p_Copy(NUM(fa), ntRing); 484 484 poly h = p_Copy(NUM(fb), ntRing); 485 485 g = p_Mult_q(g, h, ntRing); 486 486 487 487 if (g == NULL) return NULL; /* may happen due to zero divisors */ 488 488 489 489 poly f; 490 490 if (DENIS1(fa) && DENIS1(fb)) f = NULL; … … 494 494 p_Copy(DEN(fb), ntRing), 495 495 ntRing); 496 496 497 497 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 498 498 NUM(result) = g; … … 508 508 if (IS0(a)) return NULL; 509 509 if (IS0(b)) WerrorS(nDivBy0); 510 510 511 511 fraction fa = (fraction)a; 512 512 fraction fb = (fraction)b; 513 513 514 514 poly g = p_Copy(NUM(fa), ntRing); 515 515 if (!DENIS1(fb)) g = p_Mult_q(g, p_Copy(DEN(fb), ntRing), ntRing); 516 516 517 517 if (g == NULL) return NULL; /* may happen due to zero divisors */ 518 518 519 519 poly f = p_Copy(NUM(fb), ntRing); 520 520 if (!DENIS1(fa)) f = p_Mult_q(f, p_Copy(DEN(fa), ntRing), ntRing); 521 521 522 522 fraction result = (fraction)omAlloc0Bin(fractionObjectBin); 523 523 NUM(result) = g; … … 539 539 { 540 540 ntTest(a); 541 541 542 542 /* special cases first */ 543 543 if (IS0(a)) … … 549 549 else if (exp == 1) { *b = ntCopy(a, cf); return;} 550 550 else if (exp == -1) { *b = ntInvers(a, cf); return;} 551 551 552 552 int expAbs = exp; if (expAbs < 0) expAbs = -expAbs; 553 553 554 554 /* now compute a^expAbs */ 555 555 number pow; number t; … … 589 589 ntDelete(&factor, cf); 590 590 } 591 591 592 592 /* invert if original exponent was negative */ 593 593 if (exp < 0) … … 636 636 assume(!IS0(f)); 637 637 assume(!DENIS1(f)); 638 638 639 639 if (!p_IsConstant(DEN(f), ntRing)) 640 640 { /* step (1); see documentation of this procedure above */ … … 715 715 DEN(f) = NULL; 716 716 } 717 717 718 718 /* Now, due to the above computations, DEN(f) may have become the 719 719 1-polynomial which needs to be represented by NULL: */ … … 731 731 ntTest(a); 732 732 if (IS0(a)) return; 733 733 734 734 fraction f = (fraction)a; 735 735 if (DENIS1(f) || NUMIS1(f)) { COM(f) = 0; return; } 736 736 737 737 /* check whether NUM(f) = DEN(f), and - if so - replace 'a' by 1 */ 738 738 if (p_EqualPolys(NUM(f), DEN(f), ntRing)) … … 743 743 return; 744 744 } 745 745 746 746 if (COM(f) <= BOUND_COMPLEXITY) return; 747 747 else definiteGcdCancellation(a, cf, TRUE); … … 753 753 { 754 754 ntTest(a); 755 755 756 756 fraction f = (fraction)a; 757 757 758 758 if (!simpleTestsHaveAlreadyBeenPerformed) 759 759 { 760 760 if (IS0(a)) return; 761 761 if (DENIS1(f) || NUMIS1(f)) { COM(f) = 0; return; } 762 762 763 763 /* check whether NUM(f) = DEN(f), and - if so - replace 'a' by 1 */ 764 764 if (p_EqualPolys(NUM(f), DEN(f), ntRing)) … … 770 770 } 771 771 } 772 773 #ifdef HAVE_FACTORY 772 773 #ifdef HAVE_FACTORY 774 774 /* singclap_gcd destroys its arguments; we hence need copies: */ 775 775 poly pNum = p_Copy(NUM(f), ntRing); 776 776 poly pDen = p_Copy(DEN(f), ntRing); 777 777 778 778 /* Note that, over Q, singclap_gcd will remove the denominators in all 779 779 rational coefficients of pNum and pDen, before starting to compute … … 879 879 fraction fb = (fraction)b; 880 880 if ((b==NULL)||(DEN(fb)==NULL)) return ntCopy(a,cf); 881 #ifdef HAVE_FACTORY 881 #ifdef HAVE_FACTORY 882 882 fraction fa = (fraction)a; 883 883 /* singclap_gcd destroys its arguments; we hence need copies: */ 884 884 poly pa = p_Copy(NUM(fa), ntRing); 885 885 poly pb = p_Copy(DEN(fb), ntRing); 886 886 887 887 /* Note that, over Q, singclap_gcd will remove the denominators in all 888 888 rational coefficients of pa and pb, before starting to compute … … 918 918 if (a==NULL) return ntCopy(b,cf); 919 919 if (b==NULL) return ntCopy(a,cf); 920 #ifdef HAVE_FACTORY 920 #ifdef HAVE_FACTORY 921 921 fraction fa = (fraction)a; 922 922 fraction fb = (fraction)b; … … 924 924 poly pa = p_Copy(NUM(fa), ntRing); 925 925 poly pb = p_Copy(NUM(fb), ntRing); 926 926 927 927 /* Note that, over Q, singclap_gcd will remove the denominators in all 928 928 rational coefficients of pa and pb, before starting to compute … … 1095 1095 /* dst is expected to be a rational function field */ 1096 1096 assume(getCoeffType(dst) == ID); 1097 1097 1098 1098 int h = 0; /* the height of the extension tower given by dst */ 1099 1099 coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */ 1100 1100 coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */ 1101 1101 1102 1102 /* for the time being, we only provide maps if h = 1 and if b is Q or 1103 1103 some field Z/pZ: */ … … 1118 1118 if (h != 1) return NULL; 1119 1119 if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL; 1120 1120 1121 1121 /* Let T denote the sequence of transcendental extension variables, i.e., 1122 1122 K[t_1, ..., t_s] =: K[T]; 1123 1123 Let moreover, for any such sequence T, T' denote any subsequence of T 1124 1124 of the form t_1, ..., t_w with w <= s. */ 1125 1125 1126 1126 if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q(bSrc))) return NULL; 1127 1127 1128 1128 if (nCoeff_is_Q(bSrc) && nCoeff_is_Q(bDst)) 1129 1129 { … … 1133 1133 rRingVar(i, dst->extRing)) != 0) return NULL; 1134 1134 if (src->type==n_transExt) 1135 return n tCopyMap;/// Q(T') --> Q(T)1135 return ndCopyMap; //ntCopyMap; /// Q(T') --> Q(T) 1136 1136 else 1137 1137 return ntCopyAlg; 1138 1138 } 1139 1139 1140 1140 if (nCoeff_is_Zp(bSrc) && nCoeff_is_Zp(bDst)) 1141 1141 { … … 1145 1145 rRingVar(i, dst->extRing)) != 0) return NULL; 1146 1146 if (src->type==n_transExt) 1147 return n tCopyMap;/// Z/p(T') --> Z/p(T)1147 return ndCopyMap; //ntCopyMap; /// Z/p(T') --> Z/p(T) 1148 1148 else 1149 1149 return ntCopyAlg; 1150 1150 } 1151 1152 return NULL; 1151 1152 return NULL; /// default 1153 1153 } 1154 1154 … … 1163 1163 1164 1164 assume( infoStruct != NULL ); 1165 1165 1166 1166 TransExtInfo *e = (TransExtInfo *)infoStruct; 1167 1167 1168 1168 assume( e->r != NULL); // extRing; 1169 1169 assume( e->r->cf != NULL); // extRing->cf; 1170 assume( e->r->minideal == NULL ); 1170 assume( e->r->minideal == NULL ); 1171 1171 1172 1172 assume( cf != NULL ); … … 1174 1174 1175 1175 cf->extRing = e->r; 1176 cf->extRing->ref ++; // increase the ref.counter for the ground poly. ring! 1176 cf->extRing->ref ++; // increase the ref.counter for the ground poly. ring! 1177 1177 1178 1178 /* propagate characteristic up so that it becomes 1179 1179 directly accessible in cf: */ 1180 1180 cf->ch = cf->extRing->cf->ch; 1181 1181 1182 1182 cf->cfGreaterZero = ntGreaterZero; 1183 1183 cf->cfGreater = ntGreater; … … 1215 1215 cf->cfIntDiv = ntDiv; 1216 1216 cf->cfKillChar = ntKillChar; 1217 1217 1218 1218 #ifndef HAVE_FACTORY 1219 1219 PrintS("// Warning: The 'factory' module is not available.\n"); … … 1221 1221 PrintS("// computed fraction!\n"); 1222 1222 #endif 1223 1223 1224 1224 return FALSE; 1225 1225 } … … 1231 1231 1232 1232 const ring R = cf->extRing; 1233 assume( R != NULL ); 1233 assume( R != NULL ); 1234 1234 assume( 0 < iParameter && iParameter <= rVar(R) ); 1235 1235 1236 1236 poly p = p_One(R); p_SetExp(p, iParameter, 1, R); p_Setm(p, R); 1237 1237 1238 // return (number) p; 1238 // return (number) p; 1239 1239 1240 1240 fraction f = (fraction)omAlloc0Bin(fractionObjectBin); … … 1247 1247 1248 1248 1249 /// if m == var(i)/1 => return i, 1249 /// if m == var(i)/1 => return i, 1250 1250 int ntIsParam(number m, const coeffs cf) 1251 1251 { … … 1260 1260 return 0; 1261 1261 1262 return p_Var( NUM(f), R ); 1263 } 1262 return p_Var( NUM(f), R ); 1263 }
Note: See TracChangeset
for help on using the changeset viewer.