Changeset 1cce47 in git
- Timestamp:
- Sep 29, 2010, 3:14:38 PM (14 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
- Children:
- a9f5845397ce9720c65552912884a25952f7e724
- Parents:
- 7f7b2ae08d4ef302906c949966fc7a88fe8d895f
- git-author:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2010-09-29 15:14:38+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:55:29+01:00
- Location:
- coeffs
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/coeffs.h
r7f7b2a r1cce47 227 227 228 228 /// one-time initialisations for new coeffs 229 /// in case of an error return NULL 229 230 coeffs nInitChar(n_coeffType t, void * parameter); 230 231 /// undo all initialisations -
coeffs/ffields.cc
r7f7b2a r1cce47 736 736 nMapFunc nfSetMap(const coeffs src, const coeffs dst) 737 737 { 738 if (n Field_is_GF(src,src->m_nfCharQ))738 if (nCoeff_is_GF(src,src->m_nfCharQ)) 739 739 { 740 740 return ndCopyMap; /* GF(p,n) -> GF(p,n) */ 741 741 } 742 if (n Field_is_GF(src))742 if (nCoeff_is_GF(src)) 743 743 { 744 744 const coeffs r = dst; … … 774 774 } 775 775 } 776 if (n Field_is_Zp(src,src->m_nfCharP))776 if (nCoeff_is_Zp(src,src->m_nfCharP)) 777 777 { 778 778 return nfMapP; /* Z/p -> GF(p,n) */ … … 781 781 } 782 782 783 voidnfInitChar(coeffs r, void * parameter)783 BOOLEAN nfInitChar(coeffs r, void * parameter) 784 784 { 785 785 -
coeffs/ffields.h
r7f7b2a r1cce47 19 19 20 20 21 voidnfInitChar(coeffs r, void*);21 BOOLEAN nfInitChar(coeffs r, void*); 22 22 23 23 //static BOOLEAN nfCoeffsEqual(const coeffs r, n_coeffType n, void* parameter); -
coeffs/gnumpc.cc
r7f7b2a r1cce47 382 382 } 383 383 384 voidngcInitChar(coeffs n, void*)384 BOOLEAN ngcInitChar(coeffs n, void*) 385 385 { 386 386 assume( getCoeffType(n) == ID ); … … 563 563 assume( getCoeffType(dst) == ID ); 564 564 565 if (n Field_is_Q(src))565 if (nCoeff_is_Q(src)) 566 566 { 567 567 return ngcMapQ; 568 568 } 569 if (n Field_is_long_R(src))569 if (nCoeff_is_long_R(src)) 570 570 { 571 571 return ngcMapLongR; 572 572 } 573 if (n Field_is_long_C(src))573 if (nCoeff_is_long_C(src)) 574 574 { 575 575 return ngcCopyMap; 576 576 } 577 if (n Field_is_R(src))577 if (nCoeff_is_R(src)) 578 578 { 579 579 return ngcMapR; 580 580 } 581 if (n Field_is_Zp(src))581 if (nCoeff_is_Zp(src)) 582 582 { 583 583 return ngcMapP; -
coeffs/gnumpc.h
r7f7b2a r1cce47 14 14 15 15 /// Initialize r 16 voidngcInitChar(coeffs r, void*);16 BOOLEAN ngcInitChar(coeffs r, void*); 17 17 18 18 -
coeffs/gnumpfl.cc
r7f7b2a r1cce47 389 389 } 390 390 391 voidngfInitChar(coeffs n, void *)391 BOOLEAN ngfInitChar(coeffs n, void *) 392 392 { 393 393 assume( getCoeffType(n) == ID ); … … 461 461 assume( getCoeffType(dst) == ID ); 462 462 463 if (n Field_is_Q(src))463 if (nCoeff_is_Q(src)) 464 464 { 465 465 return ngfMapQ; 466 466 } 467 if (n Field_is_long_R(src))467 if (nCoeff_is_long_R(src)) 468 468 { 469 469 return ngfCopyMap; 470 470 } 471 if (n Field_is_R(src))471 if (nCoeff_is_R(src)) 472 472 { 473 473 return ngfMapR; 474 474 } 475 if (n Field_is_long_C(src))475 if (nCoeff_is_long_C(src)) 476 476 { 477 477 return ngfMapC; 478 478 } 479 if (n Field_is_Zp(src))479 if (nCoeff_is_Zp(src)) 480 480 { 481 481 return ngfMapP; -
coeffs/gnumpfl.h
r7f7b2a r1cce47 14 14 15 15 /// Initialize r 16 voidngfInitChar(coeffs r, void *);16 BOOLEAN ngfInitChar(coeffs r, void *); 17 17 18 18 const char * ngfRead (const char *s, number *a, const coeffs r); -
coeffs/longrat.cc
r7f7b2a r1cce47 1920 1920 // assume( getCoeffType(src) == ID ); 1921 1921 1922 if (n Field_is_Q(src))1922 if (nCoeff_is_Q(src)) 1923 1923 { 1924 1924 return nlCopyMap; 1925 1925 } 1926 if (n Field_is_Zp(src))1926 if (nCoeff_is_Zp(src)) 1927 1927 { 1928 1928 return nlMapP; 1929 1929 } 1930 if (n Field_is_R(src))1930 if (nCoeff_is_R(src)) 1931 1931 { 1932 1932 return nlMapR; 1933 1933 } 1934 if (n Field_is_long_R(src))1934 if (nCoeff_is_long_R(src)) 1935 1935 { 1936 1936 return nlMapLongR; /* long R -> Q */ 1937 1937 } 1938 1938 #ifdef HAVE_RINGS 1939 if (n Field_is_Ring_Z(src) || nField_is_Ring_PtoM(src) || nField_is_Ring_ModN(src))1939 if (nCoeff_is_Ring_Z(src) || nCoeff_is_Ring_PtoM(src) || nCoeff_is_Ring_ModN(src)) 1940 1940 { 1941 1941 return nlMapGMP; 1942 1942 } 1943 if (n Field_is_Ring_2toM(src))1943 if (nCoeff_is_Ring_2toM(src)) 1944 1944 { 1945 1945 return nlMapMachineInt; … … 2462 2462 } 2463 2463 2464 voidnlInitChar(coeffs r, void* p)2464 BOOLEAN nlInitChar(coeffs r, void* p) 2465 2465 { 2466 2466 const int ch = (int)(long)(p); -
coeffs/longrat.h
r7f7b2a r1cce47 58 58 LINLINE number nlMult(number a, number b, const coeffs r); 59 59 60 voidnlInitChar(coeffs r, void*);60 BOOLEAN nlInitChar(coeffs r, void*); 61 61 62 62 number nlInit2 (int i, int j, const coeffs r); -
coeffs/modulop.cc
r7f7b2a r1cce47 322 322 } 323 323 324 voidnpInitChar(coeffs r, void* p)324 BOOLEAN npInitChar(coeffs r, void* p) 325 325 { 326 326 const int c = (int) (long) p; … … 587 587 { 588 588 #ifdef HAVE_RINGS 589 if (n Field_is_Ring_2toM(src))589 if (nCoeff_is_Ring_2toM(src)) 590 590 { 591 591 return npMapMachineInt; 592 592 } 593 if (n Field_is_Ring_Z(src) || nField_is_Ring_PtoM(src) || nField_is_Ring_ModN(src))593 if (nCoeff_is_Ring_Z(src) || nCoeff_is_Ring_PtoM(src) || nCoeff_is_Ring_ModN(src)) 594 594 { 595 595 return npMapGMP; 596 596 } 597 597 #endif 598 if (n Field_is_Q(src))598 if (nCoeff_is_Q(src)) 599 599 { 600 600 return npMap0; 601 601 } 602 if ( n Field_is_Zp(src) )602 if ( nCoeff_is_Zp(src) ) 603 603 { 604 604 if (n_GetChar(src) == n_GetChar(dst)) … … 611 611 } 612 612 } 613 if (n Field_is_long_R(src))613 if (nCoeff_is_long_R(src)) 614 614 { 615 615 return npMapLongR; 616 616 } 617 617 #ifdef HAVE_FACTORY 618 if (n Field_is_CF (src))618 if (nCoeff_is_CF (src)) 619 619 { 620 620 return npMapCanonicalForm; -
coeffs/modulop.h
r7f7b2a r1cce47 24 24 extern int npGen; 25 25 26 voidnpInitChar(coeffs r, void* p);26 BOOLEAN npInitChar(coeffs r, void* p); 27 27 28 28 BOOLEAN npGreaterZero (number k, const coeffs r); -
coeffs/mpr_complex.cc
r7f7b2a r1cce47 375 375 gmp_float r; 376 376 377 if ( n Field_is_Q(src) )377 if ( nCoeff_is_Q(src) ) 378 378 { 379 379 if ( num != NULL ) … … 412 412 } 413 413 } 414 else if (n Field_is_long_R(src) || nField_is_long_C(src))414 else if (nCoeff_is_long_R(src) || nCoeff_is_long_C(src)) 415 415 { 416 416 r= *(gmp_float*)num; 417 417 } 418 else if ( n Field_is_R(src) )418 else if ( nCoeff_is_R(src) ) 419 419 { 420 420 // Add some code here :-) … … 717 717 in_imag=floatToStr( abs(c.imag()), oprec ); // get imaginary part 718 718 719 if (n Field_is_long_C(src))719 if (nCoeff_is_long_C(src)) 720 720 { 721 721 int len=(strlen(in_real)+strlen(in_imag)+7+strlen(src->parameter[0]))*sizeof(char); -
coeffs/mpr_complex.h
r7f7b2a r1cce47 314 314 inline gmp_complex numberToComplex( number num, const coeffs r ) 315 315 { 316 if (n Field_is_long_C(r))316 if (nCoeff_is_long_C(r)) 317 317 { 318 318 return *(gmp_complex*)num; -
coeffs/numbers.cc
r7f7b2a r1cce47 92 92 { 93 93 assume( getCoeffType(r) == getCoeffType(aRing) ); 94 assume( n Field_has_simple_Alloc(r) && nField_has_simple_Alloc(aRing) );94 assume( nCoeff_has_simple_Alloc(r) && nCoeff_has_simple_Alloc(aRing) ); 95 95 96 96 return a; … … 190 190 #endif 191 191 cf_root=n; 192 193 BOOLEAN nOK=TRUE; 192 194 // init 193 195 if ((nInitCharTable!=NULL) && (t<=nLastCoeffs)) 194 (nInitCharTable[t])(n,parameter);195 196 nOK = (nInitCharTable[t])(n,parameter); 197 else 196 198 Werror("coeff init missing for %d",(int)t); 197 199 if (nOK) 200 { 201 omFreeSize(n,sizeof(*n)); 202 return NULL; 203 } 204 cf_root=n; 198 205 // post init settings: 199 206 if (n->cfRePart==NULL) n->cfRePart=n->cfCopy; -
coeffs/numbers.h
r7f7b2a r1cce47 41 41 42 42 // Tests: 43 static inline BOOLEAN n Field_is_Ring_2toM(const coeffs r)43 static inline BOOLEAN nCoeff_is_Ring_2toM(const coeffs r) 44 44 { return (r->ringtype == 1); } 45 45 46 static inline BOOLEAN n Field_is_Ring_ModN(const coeffs r)46 static inline BOOLEAN nCoeff_is_Ring_ModN(const coeffs r) 47 47 { return (r->ringtype == 2); } 48 48 49 static inline BOOLEAN n Field_is_Ring_PtoM(const coeffs r)49 static inline BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r) 50 50 { return (r->ringtype == 3); } 51 51 52 static inline BOOLEAN n Field_is_Ring_Z(const coeffs r)52 static inline BOOLEAN nCoeff_is_Ring_Z(const coeffs r) 53 53 { return (r->ringtype == 4); } 54 54 55 static inline BOOLEAN n Field_is_Ring(const coeffs r)55 static inline BOOLEAN nCoeff_is_Ring(const coeffs r) 56 56 { return (r->ringtype != 0); } 57 57 58 static inline BOOLEAN n Field_is_Domain(const coeffs r)58 static inline BOOLEAN nCoeff_is_Domain(const coeffs r) 59 59 { return (r->ringtype == 4 || r->ringtype == 0); } 60 60 61 static inline BOOLEAN n Field_has_Units(const coeffs r)61 static inline BOOLEAN nCoeff_has_Units(const coeffs r) 62 62 { return ((r->ringtype == 1) || (r->ringtype == 2) || (r->ringtype == 3)); } 63 63 64 static inline BOOLEAN n Field_is_Zp(const coeffs r)64 static inline BOOLEAN nCoeff_is_Zp(const coeffs r) 65 65 { return getCoeffType(r)==n_Zp; } 66 66 67 static inline BOOLEAN n Field_is_Zp(const coeffs r, int p)67 static inline BOOLEAN nCoeff_is_Zp(const coeffs r, int p) 68 68 { return (getCoeffType(r) && (r->ch == ABS(p))); } 69 69 70 static inline BOOLEAN n Field_is_Q(const coeffs r)70 static inline BOOLEAN nCoeff_is_Q(const coeffs r) 71 71 { return getCoeffType(r)==n_Q; } 72 72 73 static inline BOOLEAN n Field_is_numeric(const coeffs r) /* R, long R, long C */73 static inline BOOLEAN nCoeff_is_numeric(const coeffs r) /* R, long R, long C */ 74 74 { return (getCoeffType(r)==n_R) || (getCoeffType(r)==n_long_R) || (getCoeffType(r)==n_long_C); } 75 75 76 static inline BOOLEAN n Field_is_R(const coeffs r)76 static inline BOOLEAN nCoeff_is_R(const coeffs r) 77 77 { return getCoeffType(r)==n_R; } 78 78 79 static inline BOOLEAN n Field_is_GF(const coeffs r)79 static inline BOOLEAN nCoeff_is_GF(const coeffs r) 80 80 { return getCoeffType(r)==n_GF; } 81 81 82 static inline BOOLEAN n Field_is_GF(const coeffs r, int q)82 static inline BOOLEAN nCoeff_is_GF(const coeffs r, int q) 83 83 { return (getCoeffType(r)==n_GF) && (r->ch == q); } 84 84 85 static inline BOOLEAN n Field_is_Zp_a(const coeffs r)85 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r) 86 86 { return (r->ringtype == 0) && (r->ch < -1); } 87 87 88 static inline BOOLEAN n Field_is_Zp_a(const coeffs r, int p)88 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p) 89 89 { return (r->ringtype == 0) && (r->ch < -1 ) && (-(r->ch) == ABS(p)); } 90 90 91 static inline BOOLEAN n Field_is_Q_a(const coeffs r)91 static inline BOOLEAN nCoeff_is_Q_a(const coeffs r) 92 92 { return (r->ringtype == 0) && (r->ch == 1); } 93 93 94 static inline BOOLEAN n Field_is_long_R(const coeffs r)94 static inline BOOLEAN nCoeff_is_long_R(const coeffs r) 95 95 { return getCoeffType(r)==n_long_R; } 96 96 97 static inline BOOLEAN n Field_is_long_C(const coeffs r)97 static inline BOOLEAN nCoeff_is_long_C(const coeffs r) 98 98 { return getCoeffType(r)==n_long_C; } 99 99 100 static inline BOOLEAN n Field_is_CF(const coeffs r)100 static inline BOOLEAN nCoeff_is_CF(const coeffs r) 101 101 { return getCoeffType(r)==n_CF; } 102 102 103 static inline BOOLEAN n Field_has_simple_inverse(const coeffs r)103 static inline BOOLEAN nCoeff_has_simple_inverse(const coeffs r) 104 104 { return r->has_simple_Inverse; } 105 105 /* Z/2^n, Z/p, GF(p,n), R, long_R, long_C*/ 106 106 107 static inline BOOLEAN n Field_has_simple_Alloc(const coeffs r)107 static inline BOOLEAN nCoeff_has_simple_Alloc(const coeffs r) 108 108 { return r->has_simple_Alloc; } 109 109 /* Z/p, GF(p,n), R, Ring_2toM: nCopy, nNew, nDelete are dummies*/ 110 110 111 static inline BOOLEAN n Field_is_Extension(const coeffs r)112 { return (n Field_is_Q_a(r)) || (nField_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/111 static inline BOOLEAN nCoeff_is_Extension(const coeffs r) 112 { return (nCoeff_is_Q_a(r)) || (nCoeff_is_Zp_a(r)); } /* Z/p(a) and Q(a)*/ 113 113 114 typedef void (*cfInitCharProc)(coeffs, void *); 114 /// initialize an object of type coeff, return FALSE in case of success 115 typedef BOOLEAN (*cfInitCharProc)(coeffs, void *); 115 116 n_coeffType nRegister(n_coeffType n, cfInitCharProc p); 116 117 -
coeffs/rintegers.cc
r7f7b2a r1cce47 279 279 { 280 280 /* dst = currRing */ 281 if (n Field_is_Ring_Z(src) || nField_is_Ring_ModN(src) || nField_is_Ring_PtoM(src))281 if (nCoeff_is_Ring_Z(src) || nCoeff_is_Ring_ModN(src) || nCoeff_is_Ring_PtoM(src)) 282 282 { 283 283 return nrzCopyMap; 284 284 } 285 if (n Field_is_Ring_2toM(src))285 if (nCoeff_is_Ring_2toM(src)) 286 286 { 287 287 return nrzMapMachineInt; 288 288 } 289 if (n Field_is_Zp(src))289 if (nCoeff_is_Zp(src)) 290 290 { 291 291 return nrzMapZp; 292 292 } 293 if (n Field_is_Q(src))293 if (nCoeff_is_Q(src)) 294 294 { 295 295 return nrzMapQ; … … 373 373 } 374 374 375 voidnrzInitChar(coeffs r, void * parameter)375 BOOLEAN nrzInitChar(coeffs r, void * parameter) 376 376 { 377 377 r->cfSetChar= NULL; -
coeffs/rintegers.h
r7f7b2a r1cce47 14 14 extern NATNUMBER nrzModul; 15 15 16 voidnrzInitChar (coeffs r, void * parameter);16 BOOLEAN nrzInitChar (coeffs r, void * parameter); 17 17 number nrzCopy (number a, const coeffs r); 18 18 int nrzSize (number a, const coeffs r); -
coeffs/rmodulo2m.cc
r7f7b2a r1cce47 29 29 30 30 /* for initializing function pointers */ 31 voidnr2mInitChar (coeffs r, void* p)31 BOOLEAN nr2mInitChar (coeffs r, void* p) 32 32 { 33 33 … … 563 563 nMapFunc nr2mSetMap(const coeffs src, const coeffs dst) 564 564 { 565 if (n Field_is_Ring_2toM(src)565 if (nCoeff_is_Ring_2toM(src) 566 566 && (src->ringflagb == dst->ringflagb)) 567 567 { 568 568 return ndCopyMap; 569 569 } 570 if (n Field_is_Ring_2toM(src)570 if (nCoeff_is_Ring_2toM(src) 571 571 && (src->ringflagb < dst->ringflagb)) 572 572 { /* i.e. map an integer mod 2^s into Z mod 2^t, where t < s */ 573 573 return nr2mMapMachineInt; 574 574 } 575 if (n Field_is_Ring_2toM(src)575 if (nCoeff_is_Ring_2toM(src) 576 576 && (src->ringflagb > dst->ringflagb)) 577 577 { /* i.e. map an integer mod 2^s into Z mod 2^t, where t > s */ 578 578 // to be done 579 579 } 580 if (n Field_is_Ring_Z(src))580 if (nCoeff_is_Ring_Z(src)) 581 581 { 582 582 return nr2mMapGMP; 583 583 } 584 if (n Field_is_Q(src))584 if (nCoeff_is_Q(src)) 585 585 { 586 586 return nr2mMapQ; 587 587 } 588 if (n Field_is_Zp(src)588 if (nCoeff_is_Zp(src) 589 589 && (src->ch == 2) 590 590 && (dst->ringflagb == 1)) … … 592 592 return nr2mMapZp; 593 593 } 594 if (n Field_is_Ring_PtoM(src) || nField_is_Ring_ModN(src))594 if (nCoeff_is_Ring_PtoM(src) || nCoeff_is_Ring_ModN(src)) 595 595 { 596 596 // Computing the n of Z/n -
coeffs/rmodulo2m.h
r7f7b2a r1cce47 17 17 18 18 19 voidnr2mInitChar (coeffs r, void*);19 BOOLEAN nr2mInitChar (coeffs r, void*); 20 20 21 21 extern int nr2mExp; -
coeffs/rmodulon.cc
r7f7b2a r1cce47 30 30 31 31 /* for initializing function pointers */ 32 voidnrnInitChar (coeffs r, void* p)32 BOOLEAN nrnInitChar (coeffs r, void* p) 33 33 { 34 34 … … 458 458 { 459 459 /* dst = currRing->cf */ 460 if (n Field_is_Ring_Z(src))460 if (nCoeff_is_Ring_Z(src)) 461 461 { 462 462 return nrnMapGMP; 463 463 } 464 if (n Field_is_Q(src))464 if (nCoeff_is_Q(src)) 465 465 { 466 466 return nrnMapQ; 467 467 } 468 468 // Some type of Z/n ring / field 469 if (n Field_is_Ring_ModN(src) || nField_is_Ring_PtoM(src) || nField_is_Ring_2toM(src) || nField_is_Zp(src))469 if (nCoeff_is_Ring_ModN(src) || nCoeff_is_Ring_PtoM(src) || nCoeff_is_Ring_2toM(src) || nCoeff_is_Zp(src)) 470 470 { 471 471 if ( (src->ringtype > 0) … … 476 476 int_number nrnMapModul = (int_number) omAllocBin(gmp_nrz_bin); 477 477 // Computing the n of Z/n 478 if (n Field_is_Zp(src))478 if (nCoeff_is_Zp(src)) 479 479 { 480 480 mpz_init_set_si(nrnMapModul, src->ch); … … 521 521 } 522 522 nrnDelete((number*) &nrnMapModul, dst); 523 if (n Field_is_Ring_2toM(src))523 if (nCoeff_is_Ring_2toM(src)) 524 524 return nrnMap2toM; 525 else if (n Field_is_Zp(src))525 else if (nCoeff_is_Zp(src)) 526 526 return nrnMapZp; 527 527 else -
coeffs/rmodulon.h
r7f7b2a r1cce47 16 16 #endif 17 17 18 voidnrnInitChar (coeffs r, void*);18 BOOLEAN nrnInitChar (coeffs r, void*); 19 19 number nrnCopy (number a, const coeffs r); 20 20 int nrnSize (number a, const coeffs r); -
coeffs/shortfl.cc
r7f7b2a r1cce47 511 511 assume( getCoeffType(dst) == ID ); 512 512 513 if (n Field_is_Q(src))513 if (nCoeff_is_Q(src)) 514 514 { 515 515 return nrMapQ; 516 516 } 517 if (n Field_is_long_R(src))517 if (nCoeff_is_long_R(src)) 518 518 { 519 519 return nrMapLongR; 520 520 } 521 if (n Field_is_R(src))521 if (nCoeff_is_R(src)) 522 522 { 523 523 return ndCopyMap; 524 524 } 525 if(n Field_is_Zp(src))525 if(nCoeff_is_Zp(src)) 526 526 { 527 527 return nrMapP; 528 528 } 529 if (n Field_is_long_C(src))529 if (nCoeff_is_long_C(src)) 530 530 { 531 531 return nrMapC; … … 547 547 548 548 549 voidnrInitChar(coeffs n, void*)549 BOOLEAN nrInitChar(coeffs n, void*) 550 550 { 551 551 assume( getCoeffType(n) == ID ); -
coeffs/shortfl.h
r7f7b2a r1cce47 15 15 16 16 /// Initialize r 17 voidnrInitChar(coeffs r, void*);17 BOOLEAN nrInitChar(coeffs r, void*); 18 18 19 19 // Private interface should be hidden!!!
Note: See TracChangeset
for help on using the changeset viewer.