Changeset 738395 in git
- Timestamp:
- Apr 10, 2024, 3:00:43 PM (6 weeks ago)
- Branches:
- (u'spielwiese', 'b4f17ed1d25f93d46dbe29e4b499baecc2fd51bb')
- Children:
- 466c063f95840de930831a8c461736654a00b926
- Parents:
- 77d0bf735657ddd72e8000512e173a937c1e18bf
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/GBEngine/ringgb.h
r77d0bf r738395 9 9 // #include "kernel/mod2.h" 10 10 11 #ifdef HAVE_RINGS12 11 #include "kernel/polys.h" 13 12 … … 20 19 21 20 #endif 22 #endif -
libpolys/coeffs/bigintmat.cc
r77d0bf r738395 17 17 #include <cmath> 18 18 19 #ifdef HAVE_RINGS20 19 ///create Z/nA of type n_Zn 21 20 static coeffs numbercoeffs(number n, coeffs c) // TODO: FIXME: replace with n_CoeffRingQuot1 … … 31 30 return nc; 32 31 } 33 #endif34 32 35 33 //#define BIMATELEM(M,I,J) (M)[ (M).index(I,J) ] … … 1759 1757 } 1760 1758 1761 #ifdef HAVE_RINGS1762 1759 // normalize by units: 1763 1760 if (!n_IsZero(view(i, j), basecoeffs())) … … 1770 1767 n_Delete(&u, basecoeffs()); 1771 1768 } 1772 #endif1773 1769 // Zum Schluss mache alle EintrÀge rechts vom Diagonalelement betragsmÀÃig kleiner als dieses 1774 1770 for (int l=j+1; l<=col; l++) … … 1821 1817 } 1822 1818 1823 #ifdef HAVE_RINGS1824 1819 //OK: a HNF of (this | p*I) 1825 1820 //so the result will always have FULL rank!!!! … … 1851 1846 return C; 1852 1847 } 1853 #endif1854 1855 1848 1856 1849 //exactly divide matrix by b … … 2101 2094 } 2102 2095 2103 #ifdef HAVE_RINGS2104 2096 static number solveAx_dixon(bigintmat *A, bigintmat *B, bigintmat *x, bigintmat *kern) { 2105 2097 coeffs R = A->basecoeffs(); … … 2289 2281 return NULL; 2290 2282 } 2291 #endif2292 2283 2293 2284 //TODO: re-write using reduce_mod_howell … … 2443 2434 switch (getCoeffType(R)) 2444 2435 { 2445 #ifdef HAVE_RINGS2446 2436 case n_Z: 2447 2437 return solveAx_dixon(A, b, x, NULL); … … 2450 2440 case n_Z2m: 2451 2441 return solveAx_howell(A, b, x, NULL); 2452 #endif2453 2442 case n_Zp: 2454 2443 case n_Q: … … 2590 2579 } 2591 2580 2592 #ifdef HAVE_RINGS2593 2581 //a "q-base" for the kernel of a. 2594 2582 //Should be re-done to use Howell rather than smith. … … 2637 2625 return c->cols(); 2638 2626 } 2639 #endif2640 2627 2641 2628 bool nCoeffs_are_equal(coeffs r, coeffs s) -
libpolys/coeffs/bigintmat.h
r77d0bf r738395 300 300 void howell(); ///<dito, but Howell form (only different for zero-divsors) 301 301 void swapMatrix(bigintmat * a); 302 #ifdef HAVE_RINGS303 302 bigintmat * modhnf(number p, coeffs c); ///< computes HNF(this | p*I) 304 #endif305 303 bigintmat * modgauss(number p, coeffs c); 306 304 void skaldiv(number b); ///< Macht Ganzzahldivision aller MatrixeintrÀge mit b -
libpolys/coeffs/coeffs.h
r77d0bf r738395 523 523 { assume(r != NULL); assume(r->cfQuot1 != NULL); return r->cfQuot1(c, r); } 524 524 525 #ifdef HAVE_RINGS526 525 static FORCE_INLINE int n_DivComp(number a, number b, const coeffs r) 527 526 { assume(r != NULL); assume(r->cfDivComp!=NULL); return r->cfDivComp (a,b,r); } … … 536 535 static FORCE_INLINE number n_GetUnit(number n, const coeffs r) 537 536 { assume(r != NULL); assume(r->cfGetUnit!=NULL); return r->cfGetUnit(n,r); } 538 539 #endif540 537 541 538 /// a number representing i in the given coeff field/ring r … … 725 722 726 723 // Tests: 727 #ifdef HAVE_RINGS728 724 static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r) 729 725 { assume(r != NULL); return (getCoeffType(r)==n_Z2m); } … … 734 730 static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r) 735 731 { assume(r != NULL); return (r->is_field==0); } 736 #else737 #define nCoeff_is_Ring_2toM(A) 0738 #define nCoeff_is_Ring_PtoM(A) 0739 #define nCoeff_is_Ring(A) 0740 #endif741 732 742 733 /// returns TRUE, if r is a field or r has no zero divisors (i.e is a domain) … … 757 748 static FORCE_INLINE BOOLEAN n_DivBy(number a, number b, const coeffs r) 758 749 { assume(r != NULL); 759 #ifdef HAVE_RINGS760 750 if( nCoeff_is_Ring(r) ) 761 751 { 762 752 assume(r->cfDivBy!=NULL); return r->cfDivBy(a,b,r); 763 753 } 764 #endif765 754 return !n_IsZero(b, r); 766 755 } -
libpolys/coeffs/ffields.cc
r77d0bf r738395 898 898 //r->cfSize = ndSize; 899 899 r->cfInt = nfInt; 900 #ifdef HAVE_RINGS901 900 //r->cfDivComp = NULL; // only for ring stuff 902 901 //r->cfIsUnit = NULL; // only for ring stuff … … 904 903 //r->cfExtGcd = NULL; // only for ring stuff 905 904 // r->cfDivBy = NULL; // only for ring stuff 906 #endif907 905 r->cfInpNeg = nfNeg; 908 906 r->cfInvers= nfInvers; -
libpolys/coeffs/generics.cc
r77d0bf r738395 486 486 r->cfSize = gSize; 487 487 r->cfInt = gInt; 488 #ifdef HAVE_RINGS489 488 r->cfDivComp = gDivComp; 490 489 r->cfIsUnit = gIsUnit; … … 492 491 r->cfExtGcd = gExtGcd; 493 492 r->cfDivBy = gDivBy; 494 #endif495 493 r->cfInpNeg = gInpNeg; 496 494 r->cfInvers= gInvers; -
libpolys/coeffs/gnumpc.cc
r77d0bf r738395 623 623 r->cfSize = nlSize; 624 624 r->cfInt = nlInt; 625 #ifdef HAVE_RINGS626 625 r->cfDivComp = NULL; // only for ring stuff 627 626 r->cfIsUnit = NULL; // only for ring stuff 628 627 r->cfGetUnit = NULL; // only for ring stuff 629 628 r->cfExtGcd = NULL; // only for ring stuff 630 #endif631 629 r->cfInpNeg = nlNeg; 632 630 r->cfInvers= nlInvers; … … 638 636 r->cfNormalize=nlNormalize; 639 637 r->cfGreater = nlGreater; 640 #ifdef HAVE_RINGS641 638 r->cfDivBy = NULL; // only for ring stuff 642 #endif643 639 r->cfEqual = nlEqual; 644 640 r->cfIsZero = nlIsZero; -
libpolys/coeffs/longrat.cc
r77d0bf r738395 200 200 201 201 202 #ifdef HAVE_RINGS203 202 /*2 204 203 * convert from a GMP integer … … 232 231 return z; 233 232 } 234 #endif235 236 233 237 234 #ifdef LDEBUG … … 1118 1115 rr = nInitChar(n_Zp,(void*)ch); 1119 1116 } 1120 #ifdef HAVE_RINGS1121 1117 else 1122 1118 { … … 1129 1125 mpz_clear(dummy); 1130 1126 } 1131 #endif1132 1127 return(rr); 1133 1128 } … … 1613 1608 } 1614 1609 1615 #ifdef HAVE_RINGS1616 1610 /*2 1617 1611 * convert number i (from Q) to GMP and warn if denom != 1 … … 1633 1627 mpz_set(n, i->z); 1634 1628 } 1635 #endif1636 1629 1637 1630 /*2 … … 2509 2502 return nlMapC; /* C -> Q */ 2510 2503 } 2511 #ifdef HAVE_RINGS2512 2504 if (src->rep==n_rep_gmp) // nCoeff_is_Z(src) || nCoeff_is_Ring_PtoM(src) || nCoeff_is_Zn(src)) 2513 2505 { … … 2522 2514 return nlMapMachineInt; 2523 2515 } 2524 #endif2525 2516 return NULL; 2526 2517 } -
libpolys/coeffs/modulop.cc
r77d0bf r738395 367 367 r->cfInt = npInt; 368 368 r->cfInitMPZ = npInitMPZ; 369 #ifdef HAVE_RINGS370 369 //r->cfDivComp = NULL; // only for ring stuff 371 370 //r->cfIsUnit = NULL; // only for ring stuff … … 373 372 //r->cfExtGcd = NULL; // only for ring stuff 374 373 // r->cfDivBy = NULL; // only for ring stuff 375 #endif376 374 r->cfInpNeg = npNeg; 377 375 r->cfInvers= npInvers; … … 569 567 } 570 568 571 #ifdef HAVE_RINGS572 569 /*2 573 570 * convert from a GMP integer … … 596 593 return (number) i; 597 594 } 598 #endif599 595 600 596 static number npMapCanonicalForm (number a, const coeffs /*src*/, const coeffs dst) … … 607 603 static nMapFunc npSetMap(const coeffs src, const coeffs) 608 604 { 609 #ifdef HAVE_RINGS610 605 if ((src->rep==n_rep_int) && nCoeff_is_Ring_2toM(src)) 611 606 { … … 620 615 return npMapZ; 621 616 } 622 #endif623 617 if (src->rep==n_rep_gap_rat) /* Q, Z */ 624 618 { -
libpolys/coeffs/numbers.cc
r77d0bf r738395 28 28 #include "coeffs/flintcf_Qrat.h" 29 29 30 #ifdef HAVE_RINGS31 30 #include "coeffs/rmodulo2m.h" 32 31 #include "coeffs/rmodulon.h" 33 32 #include "coeffs/rintegers.h" 34 #endif35 33 36 34 #ifdef HAVE_POLYEXTENSIONS … … 224 222 number &curr = numberCollectionEnumerator.Current(); 225 223 226 #ifdef HAVE_RINGS227 224 /// TODO: move to a separate implementation 228 225 if (nCoeff_is_Ring(r)) … … 251 248 return; 252 249 } 253 #endif254 250 255 251 assume(!nCoeff_is_Ring(r)); … … 305 301 number nd_Copy(number a, const coeffs r) { return r->cfCopy(a, r); } 306 302 307 #ifdef HAVE_RINGS308 303 static BOOLEAN ndDivBy(number, number, const coeffs) { return TRUE; } // assume a,b !=0 309 304 static int ndDivComp(number, number, const coeffs) { return 2; } 310 305 static number ndExtGcd (number, number, number *, number *, const coeffs r) { return r->cfInit(1,r); } 311 #endif312 306 313 307 CanonicalForm ndConvSingNFactoryN( number, BOOLEAN /*setChar*/, const coeffs) … … 392 386 ngcInitChar, /* n_long_C */ 393 387 nnInitChar, /* n_nTupel */ 394 #ifdef HAVE_RINGS395 388 nrzInitChar, /* n_Z */ 396 389 nrnInitChar, /* n_Zn */ 397 390 nrnInitChar, /* n_Znm */ 398 391 nr2mInitChar, /* n_Z2m */ 399 #else400 NULL, /* n_Z */401 NULL, /* n_Zn */402 NULL, /* n_Znm */403 NULL, /* n_Z2m */404 #endif405 392 flintQrat_InitChar, /* n_FlintQrat */ 406 393 NULL, /* n_CF */ … … 474 461 475 462 n->cfEucNorm = ndEucNorm; 476 #ifdef HAVE_RINGS477 463 n->cfDivComp = ndDivComp; 478 464 n->cfDivBy = ndDivBy; … … 480 466 n->cfXExtGcd = ndXExtGcd; 481 467 //n->cfGetUnit = ndGetUnit_Ring;// set afterwards 482 #endif483 468 484 469 // report error, if not redefined … … 515 500 else n->cfIsUnit=ndIsUnit_Ring; 516 501 } 517 #ifdef HAVE_RINGS518 502 if (n->cfGetUnit==NULL) 519 503 { … … 525 509 n->cfInvers=ndInvers_Ring; 526 510 } 527 #endif528 529 511 530 512 if(n->cfMult==NULL) PrintS("cfMult missing\n"); -
libpolys/coeffs/rintegers.cc
r77d0bf r738395 8 8 #include "misc/auxiliary.h" 9 9 10 #ifdef HAVE_RINGS11 10 #include "factory/factory.h" 12 11 … … 41 40 #error set SI_INTEGER_VARIANT 42 41 #endif 43 #endif -
libpolys/coeffs/rintegers.h
r77d0bf r738395 9 9 #include "misc/auxiliary.h" 10 10 11 #ifdef HAVE_RINGS12 11 #include "coeffs/coeffs.h" 13 12 … … 35 34 36 35 #endif 37 38 #endif -
libpolys/coeffs/rintegers2.cc
r77d0bf r738395 7 7 8 8 9 #ifdef HAVE_RINGS10 9 #if SI_INTEGER_VARIANT == 2 11 10 … … 719 718 } 720 719 #endif 721 #endif -
libpolys/coeffs/rintegers3.cc
r77d0bf r738395 5 5 * ABSTRACT: numbers (integers) 6 6 */ 7 #ifdef HAVE_RINGS8 7 #if SI_INTEGER_VARIANT == 3 9 8 #define POW_2_28 (1L<<60) … … 1213 1212 r->cfSize = nrzSize; 1214 1213 r->cfInt = nrzInt; 1215 //#ifdef HAVE_RINGS1216 1214 r->cfDivComp = nrzDivComp; // only for ring stuff 1217 1215 r->cfIsUnit = nrzIsUnit; // only for ring stuff … … 1223 1221 r->cfQuotRem = nrzQuotRem; 1224 1222 r->cfDivBy = nrzDivBy; // only for ring stuff 1225 //#endif1226 1223 r->cfInpNeg = nrzNeg; 1227 1224 r->cfInvers= nrzInvers; … … 1262 1259 } 1263 1260 #endif 1264 #endif -
libpolys/coeffs/rmodulo2m.cc
r77d0bf r738395 20 20 21 21 #include <string.h> 22 23 #ifdef HAVE_RINGS24 22 25 23 #ifdef LDEBUG … … 856 854 return FALSE; 857 855 } 858 859 #endif860 /* #ifdef HAVE_RINGS */ -
libpolys/coeffs/rmodulo2m.h
r77d0bf r738395 14 14 struct snumber; typedef struct snumber * number; 15 15 16 #ifdef HAVE_RINGS17 18 16 BOOLEAN nr2mInitChar (coeffs r, void*); 19 17 number nr2mMapZp (number from, const coeffs /*src*/, const coeffs dst); … … 21 19 22 20 #endif 23 #endif -
libpolys/coeffs/rmodulon.cc
r77d0bf r738395 23 23 24 24 #include <string.h> 25 26 #ifdef HAVE_RINGS27 25 28 26 void nrnWrite (number a, const coeffs); … … 1070 1068 return FALSE; 1071 1069 } 1072 1073 #endif1074 /* #ifdef HAVE_RINGS */ -
libpolys/coeffs/rmodulon.h
r77d0bf r738395 13 13 struct snumber; typedef struct snumber * number; 14 14 15 #ifdef HAVE_RINGS16 15 #include "coeffs/rintegers.h" 17 16 … … 24 23 25 24 #endif 26 27 #endif -
libpolys/coeffs/test.cc
r77d0bf r738395 219 219 220 220 221 #ifdef HAVE_RINGS222 221 // TODO(Frank, Segmentation fault! (if used wihout omalloc???). Please_ investigate!); 223 222 type = n_Z2m; 224 223 if( Test(type, (void*) 4) ) 225 224 c ++; 226 #endif227 225 228 226 type = n_Zp; … … 230 228 c ++; 231 229 232 #ifdef HAVE_RINGS233 230 // TODO(Frank, memmory corruption_ if used wihout omalloc??? Please_ investigate!); 234 231 … … 237 234 c ++; 238 235 239 #endif240 241 242 236 type = n_Q; 243 237 if( Test(type) ) … … 248 242 c ++; 249 243 250 #ifdef HAVE_RINGS251 244 type = n_Z; 252 245 if( Test(type) ) 253 246 c ++; 254 #endif 247 255 248 type = n_GF; 256 249 … … 281 274 delete param; 282 275 283 284 285 286 #ifdef HAVE_RINGS287 276 type = n_Zn; 288 277 … … 295 284 c ++; 296 285 297 #endif298 299 286 type = n_long_C; 300 287 if( Test(type) ) … … 305 292 c ++; 306 293 307 #ifdef HAVE_RINGS308 294 type = n_Z2m; 309 295 if( Test(type, (void*) 2) ) 310 296 c ++; 311 #endif312 297 313 298 // polynomial rings needed for: n_algExt, n_transExt ! -
libpolys/polys/pDebug.cc
r77d0bf r738395 153 153 } 154 154 while (i); 155 #ifdef HAVE_RINGS156 155 return n_DivBy(pGetCoeff(b), pGetCoeff(a), r->cf); 157 #else 158 return TRUE; 159 #endif 160 } 156 } 161 157 162 158 -
libpolys/polys/p_Procs_Generate.cc
r77d0bf r738395 123 123 if (strcmp(s_field, "RingGeneral") == 0) 124 124 { 125 #ifdef HAVE_RINGS126 125 printf("#define HAVE_RINGS\n"); 127 126 printf("#define HAVE_ZERODIVISORS\n"); 128 #else129 printf("#if 0\n");130 #endif131 127 } 132 128 else … … 207 203 if (strcmp(s_field, "RingGeneral") == 0) 208 204 { 209 #ifdef HAVE_RINGS210 205 printf("#undef HAVE_RINGS\n"); 211 206 printf("#undef HAVE_ZERODIVISORS\n"); 212 #else213 printf("#endif\n");214 #endif215 207 } 216 208 #ifndef p_Procs_Static
Note: See TracChangeset
for help on using the changeset viewer.