Changeset 488808e in git for libpolys/polys/ext_fields/algext.cc
- Timestamp:
- May 26, 2011, 12:12:01 PM (13 years ago)
- Branches:
- (u'spielwiese', '379ec2d037299db64c43fe3550b5ba8fe508dbe5')
- Children:
- 5a4b26f3e00776270c3ba83b16c92a69f3cca0e0
- Parents:
- 73a9ffb72679635d0a4389f31022ac7b37564499
- git-author:
- Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-26 12:12:01+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:53+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/ext_fields/algext.cc
r73a9ffb r488808e 87 87 void definiteReduce(poly &p, poly reducer, const coeffs cf); 88 88 89 /* returns the bottom field in this field extension tower; if the tower 90 is flat, i.e., if there is no extension, then r itself is returned; 91 as a side-effect, the counter 'height' is filled with the height of 92 the extension tower (in case the tower is flat, 'height' is zero) */ 93 static coeffs nCoeff_bottom(const coeffs r, int &height) 94 { 95 assume(r != NULL); 96 coeffs cf = r; 97 height = 0; 98 while (nCoeff_is_Extension(cf)) 99 { 100 assume(cf->algring != NULL); assume(cf->algring->cf != NULL); 101 cf = cf->algring->cf; 102 height++; 103 } 104 return cf; 105 } 106 89 107 BOOLEAN naIsZero(number a, const coeffs cf) 90 108 { … … 526 544 nMapFunc naSetMap(const coeffs src, const coeffs dst) 527 545 { 528 /* dst is expected to be an algebraic extension field*/546 /* dst is expected to be an algebraic field extension */ 529 547 assume(getCoeffType(dst) == n_algExt); 530 548 531 /* ATTENTION: This code assumes that dst is an algebraic extension of Q 532 or Zp. So, dst must NOT BE an algebraic extension of some 533 extension etc. This code will NOT WORK for extension 534 towers of height >= 2. */ 535 536 if (nCoeff_is_Q(src) && nCoeff_is_Q_a(dst)) 549 int h = 0; /* the height of the extension tower given by dst */ 550 coeffs bDst = nCoeff_bottom(dst, h); /* the bottom field in the tower dst */ 551 552 /* for the time being, we only provide maps if h = 1 and if b is Q or 553 some field Z/pZ: */ 554 if (h != 1) return NULL; 555 if ((!nCoeff_is_Zp(bDst)) && (!nCoeff_is_Q(bDst))) return NULL; 556 557 if (nCoeff_is_Q(src) && nCoeff_is_Q(bDst)) 537 558 return naMap00; /// Q --> Q(a) 538 559 539 if (nCoeff_is_Zp(src) && nCoeff_is_Q _a(dst))560 if (nCoeff_is_Zp(src) && nCoeff_is_Q(bDst)) 540 561 return naMapP0; /// Z/p --> Q(a) 541 562 542 if (nCoeff_is_Q_a(src) && nCoeff_is_Q_a(dst)) 563 if (nCoeff_is_Q(src) && nCoeff_is_Zp(bDst)) 564 return naMap0P; /// Q --> Z/p(a) 565 566 if (nCoeff_is_Zp(src) && nCoeff_is_Zp(bDst)) 567 { 568 if (src->ch == dst->ch) return naMapPP; /// Z/p --> Z/p(a) 569 else return naMapUP; /// Z/u --> Z/p(a) 570 } 571 572 coeffs bSrc = nCoeff_bottom(src, h); /* the bottom field in the tower src */ 573 if (h != 1) return NULL; 574 if ((!nCoeff_is_Zp(bSrc)) && (!nCoeff_is_Q(bSrc))) return NULL; 575 576 if (nCoeff_is_Q(bSrc) && nCoeff_is_Q(bDst)) 543 577 { 544 578 if (strcmp(rParameter(src->algring)[0], … … 549 583 } 550 584 551 if (nCoeff_is_Q(src) && nCoeff_is_Zp_a(dst)) 552 return naMap0P; /// Q --> Z/p(a) 553 554 if (nCoeff_is_Zp(src) && nCoeff_is_Zp_a(dst)) 555 { 556 if (src->ch == dst->ch) return naMapPP; /// Z/p --> Z/p(a) 557 else return naMapUP; /// Z/u --> Z/p(a) 558 } 559 560 if (nCoeff_is_Zp_a(src) && nCoeff_is_Zp_a(dst)) 585 if (nCoeff_is_Zp(bSrc) && nCoeff_is_Zp(bDst)) 561 586 { 562 587 if (strcmp(rParameter(src->algring)[0],
Note: See TracChangeset
for help on using the changeset viewer.