Changeset 141342 in git
- Timestamp:
- May 25, 2011, 11:13:13 AM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- f0797cc6a47f909e14515d7d07179ce7dbb9c8b7
- Parents:
- 48a994659e87a54916c1ebffdba59be9375387e4
- git-author:
- Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-25 11:13:13+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:36:52+01:00
- Location:
- libpolys
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/coeffs.h
r48a994 r141342 27 27 n_GF, 28 28 n_long_R, 29 n_Ext, // used for all extensions (of Zp, of Q AND OF EXTENSIONS THEREOF) 29 n_algExt, /* used for all algebraic extensions, i.e., 30 the top-most extension in an extension tower 31 is algebraic */ 32 n_transExt, /* used for all transcendental extensions, i.e., 33 the top-most extension in an extension tower 34 is transcendental */ 30 35 n_long_C, 31 36 // only used if HAVE_RINGS is defined: … … 442 447 { assume(r != NULL); return (getCoeffType(r)==n_GF) && (r->ch == q); } 443 448 449 /* TRUE iff an extension tower is build upon some Zp, i.e., the bottom 450 field in this tower is Zp */ 444 451 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r) 445 452 { 446 453 assume(r != NULL); 447 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1); 448 } 449 454 printf("###### %d, %d\n", r->ringtype, r->ch); 455 printf("###### %d, %d, %d\n", getCoeffType(r), n_algExt, n_transExt); 456 return (r->ringtype == 0) && 457 ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) && 458 (r->ch < -1); 459 } 460 461 /* TRUE iff an extension tower is build upon Zp (p as provided), i.e., 462 the bottom field in this tower is Zp */ 450 463 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p) 451 464 { 452 465 assume(r != NULL); 453 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1 ) 454 && (-(r->ch) == ABS(p)); 455 } 456 466 return (r->ringtype == 0) && 467 ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) && 468 (r->ch < -1 ) && (-(r->ch) == p); 469 } 470 471 /* TRUE iff an extension tower is build upon Q, i.e., 472 the bottom field in this tower is Q */ 457 473 static inline BOOLEAN nCoeff_is_Q_a(const coeffs r) 458 474 { 459 475 assume(r != NULL); 460 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch == 0); 476 return (r->ringtype == 0) && 477 ((getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt)) && 478 (r->ch == 0); 461 479 } 462 480 … … 494 512 // || rField_is_R(r)); } 495 513 496 514 /* TRUE iff r represents an algebraic or transcendental extension field */ 497 515 static inline BOOLEAN nCoeff_is_Extension(const coeffs r) 498 { assume(r != NULL); return (nCoeff_is_Q_a(r)) || (nCoeff_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/ 516 { 517 assume(r != NULL); 518 return (getCoeffType(r)==n_algExt) || (getCoeffType(r)==n_transExt); 519 } 520 521 /* TRUE iff r represents an algebraic extension field */ 522 static inline BOOLEAN nCoeff_is_algExt(const coeffs r) 523 { assume(r != NULL); return (getCoeffType(r)==n_algExt); } 524 525 /* TRUE iff r represents a transcendental extension field */ 526 static inline BOOLEAN nCoeff_is_transExt(const coeffs r) 527 { assume(r != NULL); return (getCoeffType(r)==n_transExt); } 499 528 500 529 /// BOOLEAN n_Test(number a, const coeffs r) -
libpolys/coeffs/test.cc
r48a994 r141342 160 160 CASE(n_GF); 161 161 CASE(n_long_R); 162 CASE(n_Ext); 162 CASE(n_algExt); 163 CASE(n_transExt); 163 164 CASE(n_long_C); 164 165 CASE(n_Z); … … 372 373 #endif 373 374 374 // polynomial rings needed for: n_ Ext !375 // polynomial rings needed for: n_algExt, n_transExt ! 375 376 376 377 return c; -
libpolys/polys/ext_fields/algext.cc
r48a994 r141342 523 523 nMapFunc naSetMap(const coeffs src, const coeffs dst) 524 524 { 525 /* dst is expected to be an (algebraic) extension field */ 526 assume(getCoeffType(dst) == n_Ext); 525 /* dst is expected to be an algebraic extension field */ 526 assume(getCoeffType(dst) == n_algExt); 527 528 /* ATTENTION: This code assumes that dst is an algebraic extension of Q 529 or Zp. So, dst must NOT BE an algebraic extension of some 530 extension etc. This code will NOT WORK for extension 531 towers of height >= 2. */ 527 532 528 533 if (nCoeff_is_Q(src) && nCoeff_is_Q_a(dst)) … … 575 580 assume(cf->algring->cf != NULL); // algring->cf; 576 581 assume(getCoeffType(cf) == naID); // coeff type; 582 583 cf->ch = cf->algring->cf->ch; /* propagate characteristic up so that it 584 becomes directly accessible in cf */ 577 585 578 586 #ifdef LDEBUG -
libpolys/polys/ext_fields/algext.h
r48a994 r141342 37 37 } ExtInfo; 38 38 39 /// Get a mapping function from src into the domain of this type (n_ Ext)39 /// Get a mapping function from src into the domain of this type (n_algExt) 40 40 nMapFunc naSetMap(const coeffs src, const coeffs dst); 41 41 … … 84 84 85 85 /* our own type */ 86 #define naID n_ Ext86 #define naID n_algExt 87 87 88 88 /* polynomial ring in which our numbers live */ -
libpolys/polys/monomials/ring.cc
r48a994 r141342 4881 4881 if (rField_is_GF(r)) return n_GF; 4882 4882 if (rField_is_long_R(r)) return n_long_R; 4883 if (rField_is_Zp_a(r)) return n_Ext;4884 if (rField_is_Q_a(r)) return n_Ext;4883 if (rField_is_Zp_a(r)) return getCoeffType(r->cf); 4884 if (rField_is_Q_a(r)) return getCoeffType(r->cf); 4885 4885 if (rField_is_long_C(r)) return n_long_C; 4886 4886 #ifdef HAVE_RINGS -
libpolys/tests/coeffs_test.h
r48a994 r141342 488 488 489 489 490 // polynomial rings needed for extentions: n_ Ext !490 // polynomial rings needed for extentions: n_algExt, n_transExt ! 491 491 492 492 }; -
libpolys/tests/common.h
r48a994 r141342 36 36 CASE(n_GF); 37 37 CASE(n_long_R); 38 CASE(n_Ext); 38 CASE(n_algExt); 39 CASE(n_transExt); 39 40 CASE(n_long_C); 40 41 CASE(n_Z); -
libpolys/tests/polys_test.h
r48a994 r141342 560 560 minIdeal->m[0] = minPoly; // minIdeal = < a^2 + 1 > 561 561 562 n_coeffType type = nRegister(n_ Ext, naInitChar);563 TS_ASSERT(type == n_ Ext);562 n_coeffType type = nRegister(n_algExt, naInitChar); 563 TS_ASSERT(type == n_algExt); 564 564 565 565 ExtInfo extParam; … … 581 581 n_CoeffWrite(cf); PrintLn(); 582 582 } 583 584 TS_ASSERT( nCoeff_is_algExt(cf) ); 585 TS_ASSERT( !nCoeff_is_transExt(cf) ); 586 TS_ASSERT( nCoeff_is_Q_a(cf) ); 587 TS_ASSERT( !nCoeff_is_Zp_a(cf) ); 583 588 584 589 // some tests for the coefficient field represented by cf: … … 658 663 minIdeal->m[0] = minPoly; // minIdeal = < b^7 + 17 > 659 664 660 n_coeffType type = nRegister(n_ Ext, naInitChar);661 TS_ASSERT(type == n_ Ext);665 n_coeffType type = nRegister(n_algExt, naInitChar); 666 TS_ASSERT(type == n_algExt); 662 667 663 668 ExtInfo extParam; … … 679 684 n_CoeffWrite(cf); PrintLn(); 680 685 } 686 687 TS_ASSERT( nCoeff_is_algExt(cf) ); 688 TS_ASSERT( !nCoeff_is_transExt(cf) ); 689 TS_ASSERT( nCoeff_is_Q_a(cf) ); 690 TS_ASSERT( !nCoeff_is_Zp_a(cf) ); 681 691 682 692 // some tests for the coefficient field represented by cf: … … 799 809 minIdeal->m[0] = minPoly; // minIdeal = < a^2 + 3 > 800 810 801 n_coeffType type = nRegister(n_ Ext, naInitChar);802 TS_ASSERT(type == n_ Ext);811 n_coeffType type = nRegister(n_algExt, naInitChar); 812 TS_ASSERT(type == n_algExt); 803 813 804 814 ExtInfo extParam; … … 820 830 n_CoeffWrite(cf); PrintLn(); 821 831 } 832 833 TS_ASSERT( nCoeff_is_algExt(cf) ); 834 TS_ASSERT( !nCoeff_is_transExt(cf) ); 835 TS_ASSERT( !nCoeff_is_Q_a(cf) ); 836 TS_ASSERT( nCoeff_is_Zp_a(cf) ); 822 837 823 838 // some tests for the coefficient field represented by cf: … … 849 864 850 865 Test(s); 851 866 /* 852 867 #ifdef HAVE_FACTORY 853 868 poly f = p_ISet(3, s); … … 870 885 p_Delete(&h, s); 871 886 #endif 887 */ 872 888 rDelete(s); // kills 'cf' and 'r' as well 873 889 }
Note: See TracChangeset
for help on using the changeset viewer.