Changeset eeb5b0c in git
- Timestamp:
- Feb 25, 2014, 11:52:34 AM (10 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- be7a5d1166e45033b6b760b23ded5cc68cb2fe00ecc5d0a0657b1bdbcf12fcb168322a3365720243
- Parents:
- 7b00dbc9f0db50c18cea3edd1cbb42325128fa85ca4d699a62eed4a4238bdfb1699eaaf9f7334a42
- Files:
-
- 13 added
- 2 deleted
- 112 edited
- 6 moved
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
rca4d699 reeb5b0c 1 _config.h 2 _config.h.in 3 .deps 4 .dirstamp 5 .DS_Store 6 .libs 7 *.[oa] 1 8 *.d 2 9 *.dd 3 *.[oa] 10 *.exe 11 *.gcda 12 *.gcno 13 *.la 14 *.lo 4 15 *.o_ndebug 5 16 *.og 6 *. exe17 *.pc 7 18 *.swp 8 *.lo 9 *.la 10 *.gcno 11 *.gcda 12 *.pc 19 *.trs 13 20 *~ 14 .libs 21 /.tarball-git-version 15 22 /AUTOGEN_generated_stuff 16 MOD 23 /desktop/Singular-manual.desktop 24 /desktop/Singular.desktop 25 /doc/NTL 26 /doc/uname.texi 27 /doc/version.texi 28 /dyn_modules/modgen/modgen 29 /dyn_modules/modgen/pathnames.h 30 /factory/factory.h 31 /factory/factoryconf.h 32 /factory/ftest/GNUmakefile 33 /factory/gengftables 34 /factory/GNUmakefile 35 /factory/readcf.cc 36 /factory/test 37 /factory/ylwrap 38 /IntegerProgramming/change_cost 39 /IntegerProgramming/gen_test 40 /IntegerProgramming/LLL 41 /IntegerProgramming/solve_IP 42 /IntegerProgramming/toric_ideal 43 /ix86-Linux/* 44 /ix86-Win/* 45 /ix86Mac-darwin/* 46 /kernel/test 47 /libpolys/coeffs/test 48 /libpolys/libpolys-config 49 /libpolys/libpolysconfig.h 50 /libpolys/libpolysconfig.h.in 51 /libpolys/misc/auxiliary.h 52 /libpolys/polys/m4/ 53 /libpolys/polys/templates/p_Procs_Generate 54 /libpolys/polys/templates/p_Procs.inc 55 /libpolys/tests/gftables 56 /libpolys/tests/p_Procs_*.so 17 57 /libsingular-config 18 /factory/readcf.cc19 /factory/ylwrap20 /factory/gengftables21 58 /m4/libtool.m4 59 /m4/lt~obsolete.m4 22 60 /m4/ltoptions.m4 23 61 /m4/ltsugar.m4 24 62 /m4/ltversion.m4 25 /m4/lt~obsolete.m4 26 /Singular/Singular 63 /modules/include/config.h 64 /MP/* 65 /ntl/* 66 /omalloc/Makefile.in 67 /omalloc/omalloc.h 68 /omalloc/omConfig.h 69 /omalloc/omConfig.h.in 70 /omalloc/omExternalConfig.h 71 /omalloc/omlimits.h 72 /omalloc/omTables 73 /omalloc/omTables.dSYM/* 74 /omalloc/omTables.h 75 /omalloc/omTables.inc 76 /redhat/singular.spec 77 /resources/resourcesconfig.h 78 /resources/resourcesconfig.h.in 79 /Singular/all.lib 80 /Singular/ESingular 81 /Singular/feOptGen 82 /Singular/gftables 27 83 /Singular/mpsr_Tok.xx 28 84 /Singular/ndbm.dl_og 29 85 /Singular/sing_dbm.dl_og 30 /Singular/svnver 31 /dyn_modules/modgen/modgen 32 /dyn_modules/modgen/pathnames.h 86 /Singular/Singular 87 /Singular/Singular.rc 88 /Singular/TSingular 89 /x86_64-Linux/* 90 aclocal.m4 33 91 ar-lib 92 autom4te.cache/ 93 compile 94 confdefs.h 95 config.cache 96 config.guess 34 97 config.h 98 config.h.in* 99 config.log 100 config.status 101 config.sub 35 102 configure 36 config.h.in* 37 config.sub 38 config.log 39 config.guess 40 config.status 41 /ntl/* 42 .dirstamp 43 /libpolys/misc/auxiliary.h 44 /libpolys/polys/templates/p_Procs_Generate 45 /libpolys/polys/templates/p_Procs.inc 46 /libpolys/polys/m4/ 47 /libpolys/libpolys-config 103 COPYING 104 depcomp 48 105 depend 49 tags 106 GNUMakefile 107 INSTALL 108 install-sh 109 libtool 50 110 ltmain.sh 51 libtool52 INSTALL53 COPYING54 111 Makefile 55 112 Makefile.in 56 install-sh57 !configure.ac58 GNUMakefile59 confdefs.h60 tags61 stamp-h62 /ix86-Linux/*63 /ix86-Win/*64 /x86_64-Linux/*65 /ix86Mac-darwin/*66 /omalloc/stamp-h367 /omalloc/Makefile.in68 /omalloc/omTables69 /omalloc/omTables.h70 /omalloc/omTables.inc71 /omalloc/omalloc.h72 /omalloc/omTables.dSYM/*73 /MP/*74 /Singular/confdefs.h75 /Singular/Singular.rc76 config.cache77 /doc/uname.texi78 /doc/version.texi79 /factory/GNUmakefile80 config.h81 /factory/ftest/GNUmakefile82 /modules/include/config.h83 /ntl/*84 /omalloc/omConfig.h85 /omalloc/omExternalConfig.h86 /omalloc/omlimits.h87 /omalloc/omConfig.h.in88 /doc/NTL89 /factory/factory.h90 /factory/factoryconf.h91 /libpolys/tests/gftables92 /libpolys/tests/p_Procs_*.so93 aclocal.m494 autom4te.cache/95 .deps96 ylwrap97 compile98 depcomp99 113 missing 100 stamp-h1 101 stamp-h2 102 test-driver 114 MOD 103 115 singular.png 104 *.trs105 /.tarball-git-version106 .DS_Store107 116 singularconfig.h 108 117 singularconfig.h.in 109 /libpolys/libpolysconfig.h.in 110 /libpolys/libpolysconfig.h 111 /resources/resourcesconfig.h 112 /resources/resourcesconfig.h.in 113 /IntegerProgramming/LLL 114 /IntegerProgramming/change_cost 115 /IntegerProgramming/gen_test 116 /IntegerProgramming/solve_IP 117 /IntegerProgramming/toric_ideal 118 /Singular/ESingular 119 /Singular/Singular 120 /Singular/TSingular 121 /Singular/all.lib 122 /Singular/feOptGen 123 /Singular/gftables 124 /Singular/test 125 /desktop/Singular-manual.desktop 126 /desktop/Singular.desktop 127 /factory/test 128 /kernel/test 129 /libpolys/coeffs/test 130 /redhat/singular.spec 118 stamp-h* 119 tags 120 test-driver -
IntegerProgramming/binomial.cc
rca4d699 reeb5b0c 147 147 148 148 if(i<size_of_support_vectors) 149 { 149 150 // variable i is considered in the support vectors 150 151 if(actual_entry>0) 151 152 head_support|=(1<<i); 152 153 // bit i of head_support is set to 1 (counting from 0) 153 else 154 if(actual_entry<0)155 tail_support|=(1<<i);156 // bit i of tail_support is set to 1154 else if(actual_entry<0) 155 tail_support|=(1<<i); 156 // bit i of tail_support is set to 1 157 } 157 158 } 158 159 … … 209 210 210 211 if(i<size_of_support_vectors) 212 { 211 213 // variable i is considered in the support vectors 212 214 if(actual_entry>0) 213 215 head_support|=(1<<i); 214 216 // bit i of head_support is set to 1 (counting from 0) 215 else 216 if(actual_entry<0)217 tail_support|=(1<<i);218 // bit i of tail_support is set to 1217 else if(actual_entry<0) 218 tail_support|=(1<<i); 219 // bit i of tail_support is set to 1 220 } 219 221 } 220 222 … … 881 883 882 884 if(i<size_of_support_vectors) 885 { 883 886 if(actual_entry>0) 884 887 head_support|=(1<<i); 885 else 886 if(actual_entry<0)887 tail_support|=(1<<i);888 else if(actual_entry<0) 889 tail_support|=(1<<i); 890 } 888 891 } 889 892 … … 932 935 933 936 if(i<size_of_support_vectors) 937 { 934 938 if(actual_entry>0) 935 939 head_support|=(1<<i); 936 else 937 if(actual_entry<0)938 tail_support|=(1<<i);940 else if(actual_entry<0) 941 tail_support|=(1<<i); 942 } 939 943 } 940 944 … … 950 954 951 955 if(i<size_of_support_vectors) 956 { 952 957 if(actual_entry>0) 953 958 head_support|=(1<<i); 954 else 955 if(actual_entry<0)956 tail_support|=(1<<i);959 else if(actual_entry<0) 960 tail_support|=(1<<i); 961 } 957 962 } 958 963 … … 1027 1032 1028 1033 if(i<size_of_support_vectors) 1034 { 1029 1035 if(actual_entry>0) 1030 1036 result.head_support|=(1<<i); 1031 else 1032 if(actual_entry<0)1033 result.tail_support|=(1<<i);1037 else if(actual_entry<0) 1038 result.tail_support|=(1<<i); 1039 } 1034 1040 } 1035 1041 … … 1048 1054 1049 1055 if(i<size_of_support_vectors) 1056 { 1050 1057 if(actual_entry>0) 1051 1058 result.head_support|=(1<<i); 1052 else 1053 if(actual_entry<0) 1059 else if(actual_entry<0) 1054 1060 result.tail_support|=(1<<i); 1061 } 1055 1062 } 1056 1063 … … 1411 1418 if(actual_entry>0) 1412 1419 head_support|=(1<<i); 1413 else 1414 if(actual_entry[i]<0) 1415 tail_support|=(1<<i); 1420 else if(actual_entry[i]<0) 1421 tail_support|=(1<<i); 1416 1422 } 1417 1423 … … 1426 1432 if(actual_entry>0) 1427 1433 head_support|=(1<<i); 1428 else 1429 if(actual_entry<0) 1430 tail_support|=(1<<i); 1434 else if(actual_entry<0) 1435 tail_support|=(1<<i); 1431 1436 } 1432 1437 … … 1498 1503 if(actual_entry>0) 1499 1504 head_support|=(1<<i); 1500 else 1501 if(actual_entry<0) 1502 tail_support|=(1<<i); 1505 else if(actual_entry<0) 1506 tail_support|=(1<<i); 1503 1507 } 1504 1508 … … 1513 1517 if(actual_entry>0) 1514 1518 head_support|=(1<<i); 1515 else 1516 if(actual_entry<0) 1517 tail_support|=(1<<i); 1519 else if(actual_entry<0) 1520 tail_support|=(1<<i); 1518 1521 } 1519 1522 -
IntegerProgramming/matrix.cc
rca4d699 reeb5b0c 351 351 for(int i=0;i<_kernel_dimension;i++) 352 352 if(M[i]>BigInt(0)) 353 { 353 354 if(min_index==-1) 354 355 min_index=i; 355 else 356 if(M[i]<M[min_index])357 min_index=i;356 else if(M[i]<M[min_index]) 357 min_index=i; 358 } 358 359 359 360 // Now, H[min_index] is the vector to be transformed into a nonnegative one. … … 445 446 for(int i=current_position;i<_kernel_dimension;i++) 446 447 if(M[i]>BigInt(0)) 448 { 447 449 if(min_index==0) 448 450 min_index=i; 449 else 450 if(M[i]<M[min_index])451 min_index=i;451 else if(M[i]<M[min_index]) 452 min_index=i; 453 } 452 454 453 455 // Now, a multiple of H[min_index] will be added to the already constructed … … 639 641 for(int j=0;j<columns;j++) 640 642 if(ideal_saturated_by_var[j]==FALSE) 643 { 641 644 if(H[k][j]> BigInt(0)) 642 645 // ideal has to be saturated by the variables corresponding … … 647 650 number_of_sat_var++; 648 651 } 649 else 650 if(H[k][j]< BigInt(0)) 652 else if(H[k][j]< BigInt(0)) 651 653 // then the ideal is automatically saturated by the variables 652 654 // corresponding to negative components 653 655 ideal_saturated_by_var[j]=TRUE; 656 } 654 657 } 655 658 else … … 657 660 for(int j=0;j<columns;j++) 658 661 if(ideal_saturated_by_var[j]==FALSE) 662 { 659 663 if(H[k][j]< BigInt(0)) 660 664 // ideal has to be saturated by the variables corresponding … … 665 669 number_of_sat_var++; 666 670 } 667 else 668 if(H[k][j]> BigInt(0)) 671 else if(H[k][j]> BigInt(0)) 669 672 // then the ideal is automatically saturated by the variables 670 673 // corresponding to positive components 671 674 ideal_saturated_by_var[j]=TRUE; 675 } 672 676 } 673 677 } -
Makefile.am
rca4d699 reeb5b0c 6 6 7 7 SUBDIRS = resources omalloc xalloc $(USE_FACTORY) \ 8 libpolys kernel numericgfanlib dyn_modules \8 libpolys kernel gfanlib dyn_modules \ 9 9 IntegerProgramming Singular dox \ 10 10 emacs debian redhat desktop 11 12 # PACKAGES = $(SUBDIRS)13 # TESTDIRS = omalloc $(USE_FACTORY) libpolys kernel Singular dyn_modules14 11 15 12 EXTRA_DIST = README autogen.sh git-version-gen -
Singular/LIB/ehv.lib
rca4d699 reeb5b0c 34 34 componentEHV(I,P,L [,Strategy]); a P-primary component for I 35 35 primdecEHV(I [,Strategy]); a minimal primary decomposition of I 36 compareLists(L, K);procedure for comparing the output of36 primDecsAreEquivalent(L, K); procedure for comparing the output of 37 37 primary decomposition algorithms (checks 38 38 if the computed associated primes coincide) … … 538 538 ERROR("// Not implemented for this ordering, please change to global ordering."); 539 539 } 540 540 if (size(I) == 0) { return( ideal(0) ); } 541 541 //Compute the equidimensional radical J of I. 542 542 ideal J = equiRadEHV(I,#); … … 1037 1037 if(printlevel > 2){"Input not homogeneous; must homogenize.";} 1038 1038 def homoR=changeord(list(list("dp",1:nvars(basering)))); 1039 1039 setring homoR; 1040 1040 ideal homoJ = fetch(base,K); 1041 1041 homoJ = groebner(homoJ); … … 1369 1369 1370 1370 ///////////////////////////////////////////////////////////////////// 1371 proc compareLists(list L, list K)1372 "USAGE: checkLists(L,K); L,K list of ideals1371 proc primDecsAreEquivalent(list L, list K) 1372 "USAGE: primDecsAreEquivalent(L,K); L,K list of ideals 1373 1373 RETURN: integer, 1 if the lists are the same up to ordering and 0 otherwise 1374 EXAMPLE: example checkLists; shows an example"1374 EXAMPLE: example primDecsAreEquivalent; shows an example" 1375 1375 { 1376 1376 int s1 = size(L); … … 1409 1409 } 1410 1410 } 1411 if ( size(N) != s1 ) 1412 { 1413 return(0); 1414 } 1411 1415 return(1); 1412 1416 } … … 1420 1424 list L1 = primdecGTZ(i); 1421 1425 list L2 = primdecEHV(i); 1422 compareLists(L1,L2); 1423 } 1424 1426 primDecsAreEquivalent(L1,L2); 1427 } -
Singular/LIB/normal.lib
rca4d699 reeb5b0c 925 925 L = insert(L,0,1); 926 926 L[3] = delt; 927 setring(P); 927 928 return(L); 928 929 } … … 4961 4962 // The original test ideal is origJ. 4962 4963 // The original ring is R / I, where R is the basering. 4964 intvec save_opt=option(get); 4963 4965 int i; // counter 4964 4966 int dbg = printlevel - voice + 2; // dbg = printlevel (default: dbg = 0) … … 5001 5003 5002 5004 // ----- computation of the test ideal using the ring structure of Ai ----- 5003 intvec save_opt=option(get);5005 5004 5006 option(redSB); 5005 5007 option(returnSB); -
Singular/LIB/realclassify.lib
rca4d699 reeb5b0c 606 606 h = f-jet(f, 2)-corank_part(f); 607 607 } 608 poly g = cleardenom(f-jet(f, 2)); 608 poly g = f-jet(f, 2); 609 poly lead_g = leadcoef(g); 610 if(lead_g > 0) 611 { 612 g = g/lead_g; 613 } 614 if(lead_g < 0) 615 { 616 g = -g/lead_g; 617 } 609 618 610 619 return(list(c, lambda, k, g)); -
Singular/LIB/resolve.lib
rca4d699 reeb5b0c 9 9 10 10 REFERENCES: 11 [1] J.Kollar: Lectures on Resolution of Singularities, Princeton University Press (2007) 12 @* (contains large overview over various known methods for curves and surfaces as well as 13 @* a detailed description of the approach in the general case) 14 [2] A.Bravo, S.Encinas, O.Villamayor: A Simplified Proof of Desingularisation and 15 @* Applications, Rev. Math. Iberoamericana 21 (2005), 349-458 16 @*(description of the algorithmic proof of desingularization in characteristic zero17 @* which underlies this implementation) 11 [1] J.Kollar: Lectures on Resolution of Singularities, Princeton University Press (2007)@* 12 (contains large overview over various known methods for curves and surfaces as well as@* 13 a detailed description of the approach in the general case)@* 14 [2] A.Bravo, S.Encinas, O.Villamayor: A Simplified Proof of Desingularisation and@* 15 Applications, Rev. Math. Iberoamericana 21 (2005), 349-458@* 16 (description of the algorithmic proof of desingularization in characteristic zero 17 which underlies this implementation)@* 18 18 [3] A.Fruehbis-Krueger: Computational Aspects of Singularities, in J.-P. Brasselet, 19 @*J.Damon et al.: Singularities in Geometry and Topology, World Scientific20 @* Publishing, 253--327 (2007) 21 @*(chapter 4 contains a detailed discussion on algorithmic desingularization and22 @*efficiency aspects thereof)19 J.Damon et al.: Singularities in Geometry and Topology, World Scientific 20 Publishing, 253--327 (2007)@* 21 (chapter 4 contains a detailed discussion on algorithmic desingularization and 22 efficiency aspects thereof) 23 23 24 24 PROCEDURES: -
Singular/LIB/ring.lib
rca4d699 reeb5b0c 32 32 proc optionIsSet(string optionName) 33 33 " 34 USAGE: @code{optionIsSet( optionName );}35 PARAMETERS: @code{optionName}: a name(string)of an option of interest36 RETURN: true, if the by @code{optionName}given option is active, false otherwise.34 USAGE: optionIsSet( optionName ) 35 PARAMETERS: optionName: a name as string of an option of interest 36 RETURN: true, if the by optionName given option is active, false otherwise. 37 37 EXAMPLE: example optionIsSet; 38 38 " -
Singular/LIB/standard.lib
rca4d699 reeb5b0c 711 711 } 712 712 list Lhilb = Philb,w; 713 return(Lhilb);713 setring(P); return(Lhilb); 714 714 } 715 715 example -
Singular/LIB/tropical.lib
rca4d699 reeb5b0c 133 133 parameterSubstitute() substitutes in the polynomial the parameter t by t^N 134 134 tropicalSubst() makes certain substitutions in a tropical polynomial 135 randomPoly ()computes a polynomial with random coefficients135 randomPolyInT() computes a polynomial with random coefficients 136 136 cleanTmp() clears /tmp from files created by other procedures 137 137 … … 3818 3818 ///////////////////////////////////////////////////////////////////////// 3819 3819 3820 proc randomPoly (int d,int ug, int og, list #)3821 "USAGE: randomPoly (d,ug,og[,#]); d, ug, og int, # list3820 proc randomPolyInT (int d,int ug, int og, list #) 3821 "USAGE: randomPolyInT(d,ug,og[,#]); d, ug, og int, # list 3822 3822 ASSUME: the basering has a parameter t 3823 3823 RETURN: poly, a polynomial of degree d where the coefficients are … … 3826 3826 instead either of the form t^j as above or they are zero, 3827 3827 and this is chosen randomly 3828 EXAMPLE: example randomPoly; shows an example" 3829 { 3828 EXAMPLE: example randomPolyInT; shows an example" 3829 { 3830 if (defined(t)!=-1) { ERROR("basering has no paramter t");} 3830 3831 int i,j,k; 3831 3832 def BASERING=basering; … … 3854 3855 if ((size(randomPolynomial)<3) and (nnn>=3)) 3855 3856 { 3856 randomPolynomial=randomPoly (d,ug,og,#);3857 randomPolynomial=randomPolyInT(d,ug,og,#); 3857 3858 } 3858 3859 return(randomPolynomial); … … 3863 3864 echo=2; 3864 3865 ring r=(0,t),(x,y),dp; 3865 randomPoly (3,-2,5);3866 randomPoly (3,-2,5,1);3866 randomPolyInT(3,-2,5); 3867 randomPolyInT(3,-2,5,1); 3867 3868 } 3868 3869 -
Singular/Makefile.am
rca4d699 reeb5b0c 3 3 GIT_VERSION := $(shell $(top_srcdir)/git-version-gen $(top_srcdir)/.tarball-git-version) 4 4 5 AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/ numeric -I${top_builddir}/numeric -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS) $(FLINT_CFLAGS) -DGIT_VERSION='"$(GIT_VERSION)"'5 AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir} -I${top_srcdir}/kernel -I${top_builddir}/kernel -I${top_srcdir}/libpolys -I${top_builddir}/libpolys $(GMP_CFLAGS) -I${top_srcdir}/factory/include -I${top_builddir}/factory/include $(FACTORY_CFLAGS) $(NTL_CFLAGS) $(FLINT_CFLAGS) -DGIT_VERSION='"$(GIT_VERSION)"' 6 6 7 7 if HAVE_GFANLIB … … 11 11 endif 12 12 13 # AM_LDFLAGS = libSingular.la ${top_builddir}/ numeric/libnumeric.la ${top_builddir}/kernel/libkernel.la13 # AM_LDFLAGS = libSingular.la ${top_builddir}/kernel/libkernel.la 14 14 15 15 ########################### Dynamic Modules... ######################### … … 174 174 175 175 libSingular_la_LDFLAGS = ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} -release ${PACKAGE_VERSION} 176 177 libSingular_la_LIBADD = ${EMBED_PYOBJECT} ${top_builddir}/numeric/libnumeric.la ${top_builddir}/kernel/libkernel.la \ 178 ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} 179 176 libSingular_la_LIBADD = ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} ${EMBED_PYOBJECT} ${top_builddir}/kernel/libkernel.la 180 177 181 178 libSingular_includedir = ${includedir}/singular/Singular -
Singular/attrib.cc
rca4d699 reeb5b0c 306 306 { 307 307 res->rtyp=INT_CMD; 308 res->data=(void *)( rField_is_Ring((ring)v->Data()));308 res->data=(void *)(long)(rField_is_Ring((ring)v->Data())); 309 309 } 310 310 else if (strcmp(name,"qringNF")==0) -
Singular/cntrlc.cc
rca4d699 reeb5b0c 426 426 int pid; 427 427 char buf[16]; 428 char * args[4] = { (char*)"gdb", (char*)"Singular g", NULL, NULL };428 char * args[4] = { (char*)"gdb", (char*)"Singular", NULL, NULL }; 429 429 430 430 #ifdef HAVE_FEREAD -
Singular/extra.cc
rca4d699 reeb5b0c 14 14 #include <misc/auxiliary.h> 15 15 16 #define SI_DONT_HAVE_GLOBAL_VARS17 16 #include <factory/factory.h> 18 17 … … 77 76 #include <kernel/shiftgb.h> 78 77 #include <kernel/linearAlgebra.h> 78 79 #include <kernel/hutil.h> 79 80 80 81 // for tests of t-rep-GB … … 3153 3154 else 3154 3155 #endif 3156 /*==================== Roune Hilb =================*/ 3157 if (strcmp(sys_cmd, "hilbroune") == 0) 3158 { 3159 ideal I; 3160 if ((h!=NULL) && (h->Typ()==IDEAL_CMD)) 3161 { 3162 I=(ideal)h->CopyD(); 3163 slicehilb(I); 3164 } 3165 else return TRUE; 3166 return FALSE; 3167 } 3155 3168 /*==================== minor =================*/ 3156 3169 if (strcmp(sys_cmd, "minor")==0) … … 3871 3884 if (strcmp(sys_cmd,"reservedLink")==0) 3872 3885 { 3873 si_link ssiCommandLink();3886 extern si_link ssiCommandLink(); 3874 3887 res->rtyp=LINK_CMD; 3875 3888 si_link p=ssiCommandLink(); -
Singular/feOpt.cc
rca4d699 reeb5b0c 14 14 #include <stdlib.h> 15 15 16 #define SI_DONT_HAVE_GLOBAL_VARS17 16 #include <factory/factory.h> 18 17 -
Singular/fegetopt.c
rca4d699 reeb5b0c 182 182 extern char *getenv(const char *name); 183 183 extern int strcmp (const char *s1, const char *s2); 184 /*extern int strncmp(const char *s1, const char *s2, int n);*/ 184 extern int strncmp(const char *s1, const char *s2, size_t n); 185 185 186 186 static int my_strlen(const char *s); -
Singular/fehelp.cc
rca4d699 reeb5b0c 1057 1057 sprintf(temp,"%d-%d-%d",SINGULAR_VERSION/1000, 1058 1058 (SINGULAR_VERSION % 1000)/100, 1059 (SINGULAR_VERSION % 100) );1059 (SINGULAR_VERSION % 100)/10); 1060 1060 strcat(sys,temp); 1061 1061 i=strlen(sys); -
Singular/interpolation.cc
rca4d699 reeb5b0c 8 8 #include <kernel/mod2.h> 9 9 #include <misc/options.h> 10 #define SI_DONT_HAVE_GLOBAL_VARS 11 # include <factory/factory.h> 10 #include <factory/factory.h> 12 11 13 12 #include <misc/intvec.h> -
Singular/iparith.cc
rca4d699 reeb5b0c 2495 2495 { 2496 2496 res->data=(char *)idSect((ideal)u->Data(),(ideal)v->Data()); 2497 setFlag(res,FLAG_STD);2498 2497 return FALSE; 2499 2498 } -
Singular/ipassign.cc
rca4d699 reeb5b0c 223 223 224 224 number p = (number)a->CopyD(NUMBER_CMD); 225 n_Normalize(p, currRing->cf); 225 226 226 227 if (n_IsZero(p, currRing->cf)) 227 228 { 228 229 n_Delete(&p, currRing); 229 230 231 230 if( nCoeff_is_transExt(currRing->cf) ) 232 231 { … … 236 235 return FALSE; 237 236 } 238 239 237 WarnS("cannot set minpoly to 0 / alg. extension?"); 240 241 // return TRUE; 238 return TRUE; 242 239 } 243 240 … … 251 248 } 252 249 253 n_Normalize(p, currRing->cf);254 255 assume( currRing->cf->extRing->qideal == NULL );256 257 250 AlgExtInfo A; 258 251 259 252 A.r = rCopy(currRing->cf->extRing); // Copy ground field! 253 // if minpoly was already set: 254 if( currRing->cf->extRing->qideal != NULL ) id_Delete(&(A.r->qideal),A.r); 260 255 ideal q = idInit(1,1); 256 if ((p==NULL) ||(DEN((fraction)(p)) != NULL) ||(NUM((fraction)p)==NULL)) 257 { 258 Werror("Could not construct the alg. extension: minpoly==0"); 259 // cleanup A: TODO 260 rDelete( A.r ); 261 return TRUE; 262 } 261 263 262 264 assume( DEN((fraction)(p)) == NULL ); // minpoly must be a fraction with poly numerator...!! -
Singular/ipshell.cc
rca4d699 reeb5b0c 15 15 #include <misc/mylimits.h> 16 16 17 #define SI_DONT_HAVE_GLOBAL_VARS18 17 #include <factory/factory.h> 19 18 … … 58 57 #include <coeffs/rmodulon.h> 59 58 60 #include < numeric/mpr_base.h>61 #include < numeric/mpr_numeric.h>59 #include <kernel/numeric/mpr_base.h> 60 #include <kernel/numeric/mpr_numeric.h> 62 61 63 62 #include <math.h> … … 1940 1939 if (L->nr==2) 1941 1940 { 1942 R->cf->extRing->N=1;1941 //R->cf->extRing->N=1; 1943 1942 if (L->m[2].rtyp!=STRING_CMD) 1944 1943 { … … 1946 1945 return; 1947 1946 } 1948 R->cf->extRing->names=(char**)omAlloc0(rPar(R)*sizeof(char_ptr));1949 R->cf->extRing->names[0]=omStrDup((char *)L->m[2].data);1947 //(rParameter(R))=(char**)omAlloc0(rPar(R)*sizeof(char_ptr)); 1948 rParameter(R)[0]=omStrDup((char *)L->m[2].data); 1950 1949 } 1951 1950 // ---------------------------------------- … … 2199 2198 lists v=(lists)L->m[1].Data(); 2200 2199 R->N = v->nr+1; 2200 if (R->N<=0) 2201 { 2202 WerrorS("no ring variables"); 2203 goto rCompose_err; 2204 } 2201 2205 R->names = (char **)omAlloc0(R->N * sizeof(char_ptr)); 2202 2206 int i; -
Singular/janet.cc
rca4d699 reeb5b0c 793 793 } 794 794 795 #if 0 795 796 static void go_right(NodeM *current,poly_function disp) 796 797 { … … 803 804 } 804 805 805 #if 0806 806 void ForEach(TreeM *t,poly_function disp) 807 807 { -
Singular/libparse.cc
rca4d699 reeb5b0c 1062 1062 #ifdef STANDALONE_PARSER 1063 1063 #include <Singular/utils.h> 1064 1065 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!1066 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???1067 1064 1068 1065 #define HAVE_LIBPARSER … … 3376 3373 if(brace3>0) { yylp_errno=YYLP_MISS_BR3; } 3377 3374 if(quote>0) { yylp_errno=YYLP_MISSQUOT; } 3378 / * printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);/**/3375 //printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); 3379 3376 if(feof(yyin)) return 1; else return 0; 3380 3377 } -
Singular/libparse.ll
rca4d699 reeb5b0c 10 10 #ifdef STANDALONE_PARSER 11 11 #include <Singular/utils.h> 12 13 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!14 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???15 12 16 13 #define HAVE_LIBPARSER … … 834 831 if(brace3>0) { yylp_errno=YYLP_MISS_BR3; } 835 832 if(quote>0) { yylp_errno=YYLP_MISSQUOT; } 836 / * printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3);/**/833 //printf("{=%d, (=%d, [=%d\n", brace1, brace2, brace3); 837 834 if(feof(yyin)) return 1; else return 0; 838 835 } -
Singular/links/silink.cc
rca4d699 reeb5b0c 418 418 si_link_extension ns = (si_link_extension)omAlloc0Bin(s_si_link_extension_bin); 419 419 420 if (0) 0; // dummy 420 if (0) 421 ; // dummy 421 422 #ifdef HAVE_DBM 422 423 else if (strcmp(type, "DBM") == 0) -
Singular/minpoly.cc
rca4d699 reeb5b0c 363 363 } 364 364 } 365 abort(); 365 366 } 366 367 -
Singular/misc_ip.cc
rca4d699 reeb5b0c 20 20 #include <Singular/si_signals.h> 21 21 22 #define SI_DONT_HAVE_GLOBAL_VARS23 22 #include <factory/factory.h> 24 23 … … 402 401 #undef HAVE_DYN_RL 403 402 #endif 404 405 #define SI_DONT_HAVE_GLOBAL_VARS406 403 407 404 //#ifdef HAVE_LIBPARSER … … 1267 1264 errorreported = 0; 1268 1265 } 1269 1270 /*1271 #ifdef LIBSINGULAR1272 // the init routines of factory need mmInit1273 int mmInit( void )1274 {1275 return 1;1276 }1277 #endif1278 */ -
Singular/mmalloc.h
rca4d699 reeb5b0c 10 10 #include <stdlib.h> 11 11 12 int mmInit(void);13 12 #undef reallocSize 14 13 #undef freeSize -
Singular/newstruct.cc
rca4d699 reeb5b0c 607 607 if (ring_changed) 608 608 f->m->SetRing(f,save_ring,FALSE); 609 return FALSE; 609 610 } 610 611 -
Singular/pyobject.cc
rca4d699 reeb5b0c 269 269 void append_iter(self iterator) { 270 270 ptr_type item; 271 while ( item = PyIter_Next(iterator)) {271 while ((item = PyIter_Next(iterator))) { 272 272 PyList_Append(*this, item); 273 273 Py_DECREF(item); -
Singular/subexpr.cc
rca4d699 reeb5b0c 954 954 return INT_CMD; 955 955 case VMINPOLY: 956 data=NULL; 956 957 return NUMBER_CMD; 957 958 case VNOETHER: 959 data=NULL; 958 960 return POLY_CMD; 959 961 //case COMMAND: -
Singular/test.cc
rca4d699 reeb5b0c 52 52 53 53 #include <polys/clapsing.h> 54 55 56 // int initializeGMP(){ return 1; } // NEEDED FOR MAIN APP. LINKING!!!57 int mmInit(void) {return 1; } // ? due to SINGULAR!!!...???58 54 59 55 -
Singular/tesths.cc
rca4d699 reeb5b0c 17 17 #include <misc/options.h> 18 18 19 #define SI_DONT_HAVE_GLOBAL_VARS20 19 #include <factory/factory.h> 21 20 … … 53 52 extern int siInit(char *); 54 53 55 // int initializeGMP(){ return 1; }56 57 54 int mmInit( void ) 58 55 { … … 73 70 char** argv) /* parameter array */ 74 71 { 75 //mmInit();72 mmInit(); 76 73 // Don't worry: ifdef OM_NDEBUG, then all these calls are undef'ed 77 74 omInitRet_2_Info(argv[0]); -
Singular/walk.cc
rca4d699 reeb5b0c 437 437 #endif 438 438 439 #ifdef CHECK_IDEAL_MWALK 439 440 static void idString(ideal L, const char* st) 440 441 { … … 448 449 Print(" %s;", pString(L->m[nL-1])); 449 450 } 450 451 //unused 452 //#if 0 451 #endif 452 453 #if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS) 453 454 static void headidString(ideal L, char* st) 454 455 { … … 462 463 Print(" %s;", pString(pHead(L->m[nL-1]))); 463 464 } 464 //#endif 465 466 //unused 467 //#if 0 465 #endif 466 467 #if defined(CHECK_IDEAL_MWALK) || defined(ENDWALKS) 468 468 static void idElements(ideal L, char* st) 469 469 { … … 503 503 omFree(K); 504 504 } 505 //#endif505 #endif 506 506 507 507 … … 4611 4611 clock_t tim; 4612 4612 nstep=0; 4613 int i, k,nwalk,endwalks = 0;4613 int i,nwalk,endwalks = 0; 4614 4614 int nV = currRing->N; 4615 4615 … … 4696 4696 else 4697 4697 { 4698 NORMAL_GW:4699 4698 #ifndef BUCHBERGER_ALG 4700 4699 if(isNolVector(curr_weight) == 0) … … 4778 4777 } 4779 4778 4780 NEXT_VECTOR:4779 //NEXT_VECTOR: 4781 4780 to = clock(); 4782 4781 //intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight,G); … … 6790 6789 clock_t tinput = clock(); 6791 6790 #endif 6792 int nsteppert=0, i, k,nV = currRing->N, nwalk=0, npert_tmp=0;6791 int nsteppert=0, i, nV = currRing->N, nwalk=0, npert_tmp=0; 6793 6792 int *npert=(int*)omAlloc(2*nV*sizeof(int)); 6794 6793 ideal Gomega, M,F, G1, Gomega1, Gomega2, M1, F1; -
Tst/New.lst
rca4d699 reeb5b0c 40 40 New/trans_ext_denominator.tst 41 41 New/ntDiff.tst 42 New/bug_std.tst -
Tst/Short.lst
r7b00dbc reeb5b0c 58 58 Short/bug_532_s.tst 59 59 Short/bug_538_s.tst 60 Short/bug_540.tst 60 61 Short/bug_5.tst 61 62 Short/bug_6.tst -
Tst/Short/absfact.res.gz.uu
rca4d699 reeb5b0c 1 1 begin 640 absfact.res.gz 2 M'XL(" %M1WE(``V%B<V9A8W0N<F5S`.V<6V_<N!7'W_TIB&"!E4:231[>Q#5F3 M 'K9%BP6*/L1Y6\2!QAEO!G7MP*/44CY]#^="<BQ*\KB;/#1RD+'$VT@Z__/34 M (77DJW=__>V?A!"V(/_X[5?RIM[4YW?KY9O+LZM]#2P(%GY8WZ_K)+T\L[_)5 M 8D&JY>:VNJG/[U=/YYNZJEU[OB!N6YSO1CTT/AY9!BW5.7E<W_]!WI(Y26B:6 M DZ3)6_QU]]FWUPNR^?3P6,\)]87E@GQ^N&O)9]NQT+/F&DA&8-;,VNV6FC7X7 M V5X+_&1B7RAT.DMD`UD+Z36?)4W1IM?"#VH6Y./JEESAF'CH?\-#?WA<?UTE8 M GU-R>79V<4%^#HM_)C>/JZI>?235]B1RLKXG3Y_6-Y^PX&Z]J>T@#W=?ZM6'9 M VVV?#4GJ3RL[SJ&"["M2LMZ0#6ZM/I[;^G</I+JY66TV!#OLQGJX[?3*2=U^10 M 7I%D?;MM=E_]>X7'_E1M2+79K/^X7WVT8]4/V]K'5?WE\9[\I[K[LDI_L17[11 M G\VJMD>?7*67G0.^/"/.5HPNPK:NF$7,PV`1&>MW]OX7')!\P(TYNP#&0.[V12 M X?T\*=!,5<9,.FLRQJW%,FO8*C,BW;7B[^<2*Y,JG;6[$O%^CC8\P_[;@5G.13 M <IZ+,VSIOPB;^R_!\:ZA4+.J0"VX41,LS&3JQK1=\/=N3'`GQ=T%(&_]J8J=14 M :-X=:^;7O_R=H&XBLL&:'TTYTE^X=_["J9AP]+APG#6+)FN]#8O**L<+(P&T15 M ,N/;0JLE:U.G$X$Z80,ZJ8;$@0K::M5**"*3TO.-F7/RK_7=7:`70#<:0Q[$16 M ?`H@1-Z>8KZ6#[$+;3:;H2&Q!8(<O_P*]W]XHH&($@UD[.JK46'*4#ZS9UP:17 M TMI.7P<E.2&!CO$&RF'>=$S]+FKJ'X]"8&(4XC1B;,Y.H)`#S_]F;0X>&YQW18 M L,'%.#9X3+A<#6&#[W@;X"+7VA*CPJ/,BZ;*VKQRC<M%1'.VP^598CND^>%B19 M !)V,/R]!.^<EV/AY"8B<E^#'YR4*/+?PU(28B'BJCP@9):*(W:K%^*VZ\$BT20 M .#S<4<.[=',4O+$<7GI3CD=KPAU=&8.G,!,\7R4,26/PE+$X18['_J$N@A"N21 M ^!["D,%$58K]]/-Q3G/D3IWF'SUVI#P09MY<BRRIKWD!-09_4"/C<`=+I"T122 M Q:ZT8+;<$5WBY-;]V,:J$-@CPPZ9PL$R.YBEI:^R@V7"UMDJ?R2Z#V7YF\V;23 M F&XGFMG+5D9I)LVX0/WMO8%:9DVMBH;7O&!JA@6B8!3$K*EE4:L,-W@-V$9D24 M VV(L;40&MK3`QI"![;7KC%W!CF`[U3@1Q=8<&Q4U#(0/FT#JFV#*<3@A%3CG25 M HSM-Q?I8A[(A/;J9>+>_>!#CG>+_;\H1'H9*[H.S0$)J$?+QB(Y*.SIZ]JNR26 M- ^::(-6C-!.%E*:C4J/>\-U[X\'4U`W(8I#0T`^)B0_]5M,\Q@<M_FRC!6OE27 M 6G7\4^M^_]1NA7RN+QCSY?V+W).+QHU=QE>^R_%5`GOE3S)X"3$O+?GDI:\R28 M G(AY:2F_@=V4=]12=QRU+)VC)C2O\F6:[Y8Y`H<M3>2&:NCDK2<:W;"HMYKQ29 M :6D_FV\B)C<\YJJF]W'0Y*J#5HL^(S+CJ^XG&DU[/S5EQT^-&?531JGSTZ3*30 M 6'JQ]%5L\M;3[([3GIBW,CH^T]I=_&29GB(`1D7$:QF5D]>^RGHJXK6,CJ\,31 M O])X_M$JH^:Y]S)&Q[W7IBL<>^^L\94PK;.]0@5!8D3HPVQ\-N1EX!9-7K^:32 M P<(\@T`5:F`=;%H&&[:LCODW*[^W8?TS1`:TX_?`QOW>9T]XO[>I8;Y!;P+%33 M Y/L#"HGG4#`8GV.Q(WELC6*?A82WA).%`BI&`-`3`5YMWS)&`!A_A/(MS&N334 M -=PVZW#`IE",<8#S*`=:WZ`W;6#BP(!.>#1S@/'Q"5RO4&9#*36C4M$Q$O#>35 M Y*F)!*,6CN5/,3'^G.+;&-@F#KEM.*21L]V#_&.?=ZE"M_,D2/[FVRV)6R(336 M Z37X]@<$,#(_0L!M+)_W!Y/!48H0\YXN7N#I0=:'310+$H+\KMCN^A1OB?O637 M 4H%4`/_Q7`XEA$`!509A6@AD08G8E;#4?<=1RK=Q)Q6F8/I84?1CY'9"R(!V38 M H@B1+T"(5\Y6"\ZLSY.^0R5)M^NE(U$X\/)<(B\1T=&0#'76E8X,^"0=GSA&39 M %=3E.`:,DHY1MDD#K<A:E4'#6_S2IA6%1DIIF^&8,8&5"B^$:G!/8"%^M!Y?40 M \H"O(WB1Y)9/T4N/,&6P<G#E+^1+@A>F3(@U#RX4D'V-Q;[%PL3AQ9:DT+L741 M 6HZ2VP9)YB1H%:E1<6KW\LKSS#8F0UAQ?Q8.5L_@TZ>(B5;["Q>EE3J%5EOK42 M (R&8WAD?MV3:I=?+Q5`P564*.HSJB$$%^%$'_#S"/CS*O^9/1R&2>AXB95\Q43 M -H+L2?@F?F+4"8HFJL0$I.)S(O42K`AG=9OUE8$%"<R^HIY@&T`_#:5]A9H144 M *!#$3^25`Z;".9*_?Z@!8$R\&#!WE!<O2.0*WB6I\%Z16H/OMUJWA:9_L<UM45 M 6%+:6XZ.6%T'9-".#*Q_R42'2R:\J&"9@:Z6O`"]%.D%3NB6<G_,J%&]Y'C846 M OG/_6Q@3-N(ZTG%LZ'%L.`/LC1+J:KDWT=980Q/OFZ#;363BK4-J^#F1[J?&47 M ]`AUR-I1:I3CU/@NQBX#6)0.%KPOC"BC883(GDK?1.S^L(#]XP%?-HG7=RFG48 M ^.(TZ=BDL_BEU%&"E.//[=@%EP8M+12`8`9*R87D1DIJ2BI*;C1E(+3"_XQA49 M 2"B5P!HI*%4**#+*R:D0'/M2H-@)0QXM4)'=LC929H,<+90HI>*`-QQ%-1.`50 M 7V'#7Z!:":/!4+S!V:ZEH*7"@V.E.2$J`JDJ4=A/7FANOP?#:&,8I8;9&;W"51 M ,94L%0,3":[+P&<?_4S+)NM%[6'8%%&]1N`&^BYH+/V:F?&$@S#4L@&,9:C@52 M 58&"VB.S4]I&2T\*QT3!46B9*)6-S,QV#B<51)1E?,(W,^$?1]DO&N5?]\M&53 M '<V\M9HY]#R\FW&+/5N!$"Y:F"6L:""XAGWO:DS`[=6CB2P3`3UI_=*NX+6B54 M V-X:7ZJ?[HT9:/`ZQUM_*#"!YA6&!1KC"=!3>/*G&=83`"@2(.`?2R]_.OLO55 ([:LX;KI)````2 M'XL("#S)Z%(``V%B<V9A8W0N<F5S`.V<6V_CN!7'W_,IB,$"*UE20A[>I`WL 3 MAVW18H&B#Y.\+28#.;%WC*9)$&L:*9^^A[Z0=$1)=KHS#QUE,([$FR6=__GI 4 MD#K*U?5??_LG(83-R#]^^Y5\J-;5^?UJ_N'R[&I7`S."A9]7#ZLJBB_/S&\R 5 MFY%ROEZ6M]7YP^+E?%V5E6W/9\1NB_/MJ/O&AR-+KZ4Z)\^KAS_(1S(E$8U3 6 M$M5I@[_NGUQ[/2/K+X_/U9105YC/R-/C?4.>3,=,3^H;(`F!23UI-EMJ4N-G 7 M<R/PDXE=H=#Q))(U)`W$-WP2U5D3WP@W:#$C=XLEN<(Q\=#_AH?^^+QZ741/ 8 M,;D\.[NX(#_[Q3^3V^=%62WN2+DYB92L'LC+E]7M%RRX7ZTK,\CC_==J\7FY 9 MZ;,F4?5E8<;95Y!=14Q6:[+&K<7=N:F_?B3E[>UBO2;883O6X[+5*R55\[0@ 10 MT6JY:?90_GN!Q_Y2KDFY7J_^>%C<F;&JQTWM\Z+Z^OQ`_E/>?UW$OYB*W<]Z 11 M49FCCZ[BR]8!7YX1:RM&9WY;6\P"YF$P"XSU._OT"PY(/N/&E%T`8R"W^_!I 12 M&F5HIC)A13RI$\:-Q1)CV#(I1+QMQ3]-)59&93QIMB7BTQ1M>(;]-P.SE*4\ 13 M%6?8TGT1-G=?@N/=0*8F989:L*-&6)C(V(YINN#O[9A@3XK;"T`^NE,56]%< 14 M'VKFU[_\G:!N`K+!FA]-.=)=N&MWX51(.'I8.-::69TTSH99:93CA!$!6IGQ 15 M3:'1DK&IU8E`G;`>G91]XD`%;;1J)!202>[XQHIS\J_5_;VG%T`W&D(>A'P* 16 MP$?>CF*NEO>Q"VTVF:`AL06"'+_\"O=_>**!"!(-9.CJJT%A2E\^DS=<ZM/: 17 M5E][)5DA@0[Q!O)^WK1,?1TT]8]'(2A"%.(T8&S.3J"0!<__9FT.#AN<M[#! 18 MQ3`V>$BX7/5A@V]YZ^$BU=H0H\2C3+.Z3)JTM(WS64!SIL/E660ZQ.G^8GB= 19 M"G=>@K;.2[#A\Q(0."_!#\]+9'AN_JD),1+Q5!\1,DA$$;I5B^%;=>:0:'"X 20 MOZ/Z=^GZ('AC*1Q[4PY':\(>71Z"IRA&>+Y+&)*&X"E#<8H<COU]77@A7/8] 21 MA"&]B:H4N^GG\Y2FR)TJ3N\<=J3<$V9:WX@DJFYX!A4&?U`AXW`'2Z0I$=FV 22 M-&.FW!)=XN36_IC&*A/8(\$.B<+!$C.8H:6K,H,EPM29*G<DN@MEZ8?UAY!N 23 M1YJ9RY8':2:+88&ZVWL-E4SJ2F4UKWC&U`0+1,8HB$E=R:Q2"6[P"K"-2#;% 24 M6%J+!$QIAHTA`=-KVQF[@AG!=*IP(HJM.3;**N@)']:>U-?>E&-_0LISSF=[ 25 MFHIUL0YE0SIT,_)N=_$@Q#O%_]^4(QP,E=P%9YZ$U,SGXP$=E;9T=.Q7>6?, 26 M-4*J0VE%$%*:#DJ-.L.W[XU[4U,[(`M!0D,W)$8^=%M-\Q`?M/BSC>:ME6O5 27 M\D^MN_U3VQ7RJ;Y@S)5W+W*/+AHV=AY>^<Z'5PG,E3_)X#F$O#3GHY>^RW`B 28 MY*6Y_`9V4\Y1<]URU#RWCAK1M$SG<;I=YO`<-B\"-]2"CMYZHM$+%O368GA: 29 MVLWFVX#)"QYRU:+S<=#HJKU6"SXC*H97W4\TFG9^6N0M/RV*03]EE%H_C<J$ 30 MQ1=S5\5&;SW-[CCM"7DKH\,SK>W%C^;Q*0)@5`2\EE$Y>NV[K*<"7LOH\,KP 31 M.XWG'JTR6KSU7L;HL/>:=(5#[YW4KA+&=;9WJ,!+C/!]F`W/AIP,[*+)^U<S 32 MF)]GX*E"]:R#C<M@_9;5(?]F^?<VK'N&R("V_![8L-^[[`GG]R8US#7H3*`8 33 M?;]'(>$<"@;#<RQV((^-4<RS$/^6<+)00(4(`'HDP+OMFX<(`,./4+Z%>4VR 34 MAMUF+0Z8%(HA#G`>Y$#C&G2F#8P<Z-$)#V8.,#X\@>L4RJ0OI690*CI$`MZ9 35 M/#628-#"H?PI)H:?4WP;`YO$(;L-^S1RMGV0?^CS-E5H.8V\Y&^^V9*X)1(1 36 MWX!KOT<`(],#!"Q#^;P_F`P.4H28\W1QA*=[61\F4<Q+"'*[8K/K4KPE[AM+ 37 M>5(!_,=3V9<0`AF4"?AI(9!X)6);PF+['0<IWX4]*3\%T\6*HALCRQ$A/=H) 38 M(D0>@1"GG(T6K%G?)GW[2I)VUTE'HG#@^%PB)Q'1TI#T==:6CO3X)"V?.$85 39 MU.8X>HR2EE&F20V-2!J50,T;_-*Z$9E&2FF3X9@P@94*+X2J<4]@(7XT#E]R 40 MCZ\#>)%HR<?HI4.8TELYN'(7\IC@A:G"QYH#%PK(O,9BWF)A8O]B2Y3I[0LM 41 M!\EMO22S$C2*U*@XM7UYY6UF&Y,^K+@["PNK-_#I4L1(J]V%"])*G4*KC?61 42 M$$QOC8];,F[3ZW@Q9$R5B8(6HUIB4!Y^U!X_S[`+C]+7].4@1%)O0Z3D%6,C 43 M2%Z$:^(F1JV@:*1*2$`J/"=2QV!%6*N;K*\$#$A@\HIZ@DT`_=*7]N5K1J!` 44 M$#^!5PZ8\N=([OZA>H`Q\J+'W$%>')'(Y;U+4N*](C8&WVTU=@M-?[3-35B2 45 MFUN.#EA=>V30E@RL>\E$^TLF/"MAGH`NYSP#/1?Q!4[HYG)WS*A1/>=XV*YS 46 M]UL8(S;".M)A;.AA;%@#[(SBZVJ^,]'&6'T3[UNOVVU@XJU]:K@YD>ZFQO@( 47 MM<_:06KDP]3X+L;./5CD%A:\*XS(@V&$2%YRUT1L_["`^>,!7]>1TW<NQ_CB 48 M-.F8I+/PI=1!@N3#S^W8!9<%6EHH`,$*R"47DA=2TB*G(N>%I@R$5OB?,0P) 49 MI1)8(P6E2@%%1EDY98)C7PH4.V'(HP4JLEW6!,I,D*.%$KE4'/"&HZAF`O`K 50 M3/@+5"M1:"@HWN!,UUS07.'!L;PX(2H"J4J1F4^>:6Z^!\/HHF"4%LS,Z!6. 51 MJ62N&!2!X#KW?/;9S;1,LE[0'@4;(ZKW"+R`K@L:2K]FQ7#"@9FO:ZV!*0^7 52 M/"LV+"TQHMF!\["H:1>A2)4X7F\H-M053Z0P(C;:Y3PTAR]<PC<K_#^.LELT 53 M2E]WRT8MS7PTFMGWW+^;L<2>C4`(9PU,(I;5X%W#KG<U1N!VZK$(+!,!/6G] 54 MTJS@-2+;W!J/%4_[Q@S4>YWCHSL4&$'S#L,"#?$$Z!$\^?,-ZP@`%`G@\8_% 55 -ES^=_1?Y-J19NDD````` 56 56 ` 57 57 end -
Tst/Short/bug_ring_quot.res.gz.uu
rca4d699 reeb5b0c 1 begin 64 4bug_ring_quot.res.gz2 M'XL(" /1VBE$``V)U9U]R:6YG7W%U;W0N<F5S`(V1P6Z#,`R&[SR%U>T`:I8V3 M %.@J1`[3+DAK-XW=*H3HR%`D!ET(*O#T"ZP-[6T7Q[$_1_\?1Q_/X0X`"(674 M \`EFLI:XX(>9;T3GCDU!%1-><FE:OC&<0"D<FCP1O,R3GZ:2N&0G7,M4ZJD55 M !9T[&!8+.(FJS(&5DHG7DKVE7$1']LG30G,NAN%%>`^XHG(FD-FB#O46RHZ36 M 'H\"SUA:0!AX;3_O>C3&>3\A:PJUS,Q0R4WV)`Y<U?9ZE=MQ<(8U^TAA<,"57 M ,#-$[G]&-I,WLAR]28'A#IS-4M?)Q<NMF1LK1'WM=Y4U!8-=L&\1B9&*73P!8 M *PUL@R_!V-_%M*T)<:[T[]#VHK_M'EK-N%>"/3SE:SRN=EA<4YO$\N^-7SVD9 &:3H0`@``1 begin 640 bug_ring_quot.res.gz 2 M'XL("#WCZ%(``V)U9U]R:6YG7W%U;W0N<F5S`&V146^",!#'W_T4%[<'B*5: 3 M!9PA]&'9"\G49>[-$(*C(TT8N%(B\.E7G+::[.5ZO?M=\__W=A\OT08`"(77 4 MZ!G&LI:XX(=Q,-I=.G,*JICPDDO+#D;#"93"H<D3P<L\^6DJB4MVPK5,I9Y: 5 M4-"YBV$ZA9.HRAQ8*9G8ENPMY6)W9)\\+33G81A>A/>0*RIG`EDMZE!OH^QH 6 M]/@4>,;2`J+0;_M)UZ-SG/0&65*H969%2FZR)W'HJ;;?JWP>AQ=8LT\4!@=< 7 M";,BY/T_XKA=[WAF:&7<D=G9G108'L!=S72=7-W<V[DS0]3G?E=94S#8A/L6 8 MD1BIV,4&6&A@'7X)QOXNUMPVB'OC8(/65P=MY[2:\6X$^]CD2WQ>[K"ZIK:( 9 -'3R.?@'0`-^J$@(````` 10 10 ` 11 11 end -
Tst/Short/ok_s.lst
rca4d699 reeb5b0c 6 6 alias 7 7 allres_s 8 arcAtPoint 8 9 barei_s 9 10 betti_s … … 52 53 bug_51 53 54 bug_52 55 bug_526 54 56 bug_53 55 57 bug_54 … … 78 80 bug_newstruct 79 81 bug_newstruct2 82 bug_newstruct3 80 83 bug_pd 81 84 bug_presolve … … 89 92 bug_rp 90 93 bug_ring_quot 94 bug_sres 95 bug_sres_betti 96 bug_sres_cyc5 91 97 bug_tr132 92 98 bug_tr134 … … 102 108 ; do not try bug_tr276 without 2.2 GB RAM free 103 109 ; bug_tr276 104 ; do not try bug_tr280 without MP105 ; bug_tr280106 110 bug_tr288 107 111 bug_tr300 … … 124 128 bug_532_s 125 129 bug_538_s 130 bug_x_i_j 126 131 brnoeth_s 127 132 countedref_s 133 classify_s 128 134 cyc5_lp 129 bug_sres130 bug_sres_betti131 bug_sres_cyc5132 bug_x_i_j133 classify_s134 135 dbm_s 135 136 deform_s 136 137 decodegb 138 dim-test_for_rings_over_integers 137 139 div_lift_s 138 140 ecyclic_5_32003_lp … … 179 181 Gonnet-83_32003_dp_slim 180 182 Gonnet-83_1_32003_dp_slim 181 ;MP general_s182 183 graphics 183 184 groebner_s … … 212 213 mora_7 213 214 mora_9 214 ; mpsr_s215 215 mres_s 216 216 ncfactor_example2_7FromMaster_s … … 237 237 qhw_s 238 238 quotient_s 239 rcyclic_13_32003_lp 240 rcyclic_14_32003_lp 239 241 rcyclic_15_32003_lp 240 242 rcyclic_16_32003_lp … … 246 248 reduce_s 247 249 res_s 250 resjung 248 251 resources_s 249 252 resultantp_s … … 253 256 ringmodn 254 257 ringsum 258 ringutils_s 255 259 ringz 260 rInit 256 261 schwarz_6_32003_lp 257 262 schwarz_7_32003_lp … … 272 277 sres_s 273 278 std_s 274 ;MP stratify275 279 string 276 280 tasks_s … … 321 325 Zdim_s 322 326 ZidealAdd_s 327 sba_s -
Tst/Short/tropical.tst
rca4d699 reeb5b0c 168 168 f=t2x+1/t*y-1; 169 169 tropicalSubst(f,2,x,x+t,y,tx+y+t2); 170 randomPoly (3,-2,5);171 randomPoly (3,-2,5,1);170 randomPolyInT(3,-2,5); 171 randomPolyInT(3,-2,5,1); 172 172 ////////////////////////////// 173 173 tst_status(1);$ -
configure.ac
rca4d699 reeb5b0c 219 219 AC_CONFIG_FILES([xalloc/Makefile]) 220 220 AC_CONFIG_FILES([kernel/Makefile]) 221 AC_CONFIG_FILES([ numeric/Makefile])221 AC_CONFIG_FILES([kernel/numeric/Makefile]) 222 222 223 223 AC_CONFIG_SUBDIRS([gfanlib]) -
dyn_modules/Makefile.am
rca4d699 reeb5b0c 1 1 ACLOCAL_AMFLAGS = -I ../m4 2 2 3 PACKAGES=bigintm syzextra callgfanlib callpolymake 4 SUBDIRS=$(PACKAGES) 3 SUBDIRS=bigintm syzextra callgfanlib callpolymake 5 4 6 TESTDIRS=$(PACKAGES)7 5 -
dyn_modules/bigintm/Makefile.am
rca4d699 reeb5b0c 4 4 5 5 if ENABLE_P_PROCS_DYNAMIC 6 #noinst_LTLIBRARIES=bigintm.la7 check_LTLIBRARIES=bigintm.la6 noinst_LTLIBRARIES=bigintm.la 7 # check_LTLIBRARIES=bigintm.la 8 8 9 9 endif -
dyn_modules/callpolymake/Makefile.am
rca4d699 reeb5b0c 10 10 11 11 # forcefully enable exceptions for polymake 12 POLYMAKE_CFLAGS = -fexceptions -frtti13 14 12 AM_LDFLAGS = ${PM_LDFLAGS} 15 13 # -release ${PACKAGE_VERSION} … … 24 22 -I${top_srcdir}/libpolys -I${top_builddir}/libpolys \ 25 23 -I${top_builddir}/factory/include $(GMP_CFLAGS) $(PM_INC) $(PM_CFLAGS) \ 26 $(POLYMAKE_C FLAGS) $(FACTORY_CFLAGS)24 $(POLYMAKE_CXXFLAGS) $(FACTORY_CFLAGS) 27 25 28 26 P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION 29 27 30 polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_C FLAGS}31 polymake_la_CXXFLAGS = ${POLYMAKE_C FLAGS}32 polymake_la_CFLAGS = ${POLYMAKE_C FLAGS}28 polymake_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} ${POLYMAKE_CXXFLAGS} 29 polymake_la_CXXFLAGS = ${POLYMAKE_CXXFLAGS} 30 polymake_la_CFLAGS = ${POLYMAKE_CXXFLAGS} 33 31 34 32 if ENABLE_P_PROCS_DYNAMIC -
factory/Makefile.am
rca4d699 reeb5b0c 1 1 ACLOCAL_AMFLAGS = -I ../m4 2 2 3 PACKAGES=include/factory libfac 4 SUBDIRS=$(PACKAGES) 3 SUBDIRS=include/factory libfac 5 4 6 5 AM_CPPFLAGS = -I${builddir}/include -I${srcdir}/include $(FLINT_CFLAGS) ${GMP_CFLAGS} ${NTL_CFLAGS} ${OMALLOC_CFLAGS} -
factory/canonicalform.cc
rca4d699 reeb5b0c 23 23 CanonicalForm readCF( ISTREAM& ); 24 24 #endif /* NOSTREAMIO */ 25 26 //{{{ initialization27 int initializeCharacteristic();28 29 #ifdef SINGULAR30 extern int mmInit(void);31 #endif32 33 int34 initCanonicalForm( void )35 {36 static bool initialized = false;37 if ( ! initialized ) {38 #if defined (SINGULAR)39 (void)mmInit();40 #endif41 42 (void)initializeCharacteristic();43 initialized = true;44 }45 return 1;46 }47 //}}}48 25 49 26 //{{{ constructors, destructors, selectors -
factory/canonicalform.h
rca4d699 reeb5b0c 56 56 } 57 57 58 59 int initCanonicalForm( void );60 #ifndef SI_DONT_HAVE_GLOBAL_VARS61 static int cf_is_initialized_now = initCanonicalForm();62 #endif63 58 64 59 //{{{ class CanonicalForm -
factory/cf_char.cc
rca4d699 reeb5b0c 16 16 static int theCharacteristic = 0; 17 17 static int theDegree = 1; 18 19 int initializeCharacteristic ()20 {21 theCharacteristic = 0;22 theDegree = 1;23 return 1;24 }25 18 26 19 void setCharacteristic( int c ) … … 65 58 } 66 59 67 int getExp()68 {69 return InternalPrimePower::getk();70 }71 72 73 60 int getGFDegree() 74 61 { -
factory/cf_factor.cc
rca4d699 reeb5b0c 41 41 #endif 42 42 43 int getExp(); /* cf_char.cc */44 45 43 //static bool isUnivariateBaseDomain( const CanonicalForm & f ) 46 44 //{ -
factory/cf_factory.cc
rca4d699 reeb5b0c 276 276 else if ( symmetric ) { 277 277 mpz_init( dummy ); 278 InternalPrimePower::initialize(); 278 279 if ( mpz_cmp( InternalPrimePower::primepowhalf, InternalPrimePower::MPI( value ) ) < 0 ) 279 280 mpz_sub( dummy, InternalPrimePower::MPI( value ), InternalPrimePower::primepow ); -
factory/facFqSquarefree.cc
rca4d699 reeb5b0c 239 239 240 240 CanonicalForm buffer; 241 #if def HAVE_NTL241 #if defined(HAVE_NTL) || (HAVE_FLINT && __FLINT_VERSION_MINOR >= 4) 242 242 if (alpha.level() == 1) 243 243 #endif … … 252 252 fmpz_clear (qq); 253 253 } 254 #el se254 #elif defined(HAVE_NTL) 255 255 else 256 256 { -
factory/int_pp.cc
rca4d699 reeb5b0c 17 17 int InternalPrimePower::prime; 18 18 int InternalPrimePower::exp; 19 int InternalPrimePower::initialized = InternalPrimePower::initialize();19 bool InternalPrimePower::initialized = false; 20 20 21 21 … … 27 27 InternalPrimePower::InternalPrimePower( const int i ) 28 28 { 29 initialize(); 29 30 mpz_init_set_si( thempi, i ); 30 31 if ( mpz_cmp_si( thempi, 0 ) < 0 ) { … … 41 42 InternalPrimePower::InternalPrimePower( const char * str, const int base ) 42 43 { 44 initialize(); 43 45 mpz_init_set_str( thempi, str, base ); 44 46 if ( mpz_cmp_si( thempi, 0 ) < 0 ) { … … 76 78 } 77 79 78 int InternalPrimePower::initialize() 79 { 80 void InternalPrimePower::initialize() 81 { 82 if (initialized) return; 80 83 mpz_init_set_si( primepow, 3 ); 81 84 mpz_init_set_si( primepowhalf, 1 ); 82 85 prime = 3; 83 86 exp = 1; 84 return 1;87 initialized = true; 85 88 } 86 89 … … 89 92 { 90 93 ASSERT( p > 1 && k > 0, "illegal prime power" ); 94 initialize(); 91 95 if ( p != prime || k != exp ) { 92 96 mpz_set_si( primepow, p ); … … 96 100 exp = k; 97 101 } 98 }99 100 int101 InternalPrimePower::getp()102 {103 return prime;104 }105 106 int107 InternalPrimePower::getk()108 {109 return exp;110 102 } 111 103 -
factory/int_pp.h
rca4d699 reeb5b0c 27 27 private: 28 28 mpz_t thempi; 29 static intinitialized;29 static bool initialized; 30 30 static int prime; 31 31 static int exp; 32 32 static mpz_t primepow; 33 33 static mpz_t primepowhalf; 34 static intinitialize();34 static void initialize(); 35 35 static mpz_ptr MPI( const InternalCF * const c ); 36 36 public: … … 56 56 57 57 static void setPrimePower( int p, int k ); 58 static int getp();59 static int getk();60 58 61 59 bool is_imm() const; -
factory/test.cc
rca4d699 reeb5b0c 2 2 #include <resources/feFopen.h> 3 3 #include "cf_assert.h" 4 5 int mmInit(void) {6 #ifdef SINGULAR7 // this is a hack to make linker baheave on Mac OS X 10.6.8 / 64 bit8 // since otherwise both debug and release DYNAMIC tests failed there with:9 /*10 dyld: lazy symbol binding failed: Symbol not found: __Z7feFopenPKcS0_11 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib12 Expected in: flat namespace13 14 dyld: Symbol not found: __Z7feFopenPKcS0_15 Referenced from: ...BUILDDIR/factory/.libs/libfactory_g-3.1.3.dylib16 Expected in: flat namespace17 */18 const int f = (int)(long)(void*)feFopen;19 return (f ^ f) + 1;20 #else21 return 1;22 #endif23 }24 4 25 5 int test2 (int p) -
kernel/GMPrat.cc
rca4d699 reeb5b0c 31 31 32 32 // ---------------------------------------------------------------------------- 33 // Miscellaneous34 // ----------------------------------------------------------------------------35 36 Rational Rational::save; // dummy variable37 38 // ----------------------------------------------------------------------------39 33 // disconnect a rational from its reference 40 34 // ---------------------------------------------------------------------------- 41 35 42 void Rational::disconnect( 36 void Rational::disconnect() 43 37 { 44 38 if( p->n>1) 45 39 { 40 rep *old_p = p; 46 41 p->n--; 47 42 p = new rep; 48 } 49 else 50 { 51 mpq_clear(p->rat); 52 } 53 mpq_init(p->rat); 43 mpq_init(p->rat); 44 mpq_set(p->rat, old_p->rat); 45 } 54 46 } 55 47 … … 116 108 Rational& Rational::operator=(int a) 117 109 { 118 disconnect(); 110 if( p->n>1) 111 { 112 p->n--; 113 p = new rep; 114 mpq_init(p->rat); 115 } 119 116 mpq_set_si(p->rat,(long) a,1); 120 117 return *this; … … 223 220 Rational::operator+=(const Rational &a) 224 221 { 225 mpq_set(save.p->rat,p->rat); 226 disconnect(); 227 mpq_add(p->rat,save.p->rat,a.p->rat); 222 disconnect(); 223 mpq_add(p->rat,p->rat,a.p->rat); 228 224 return *this; 229 225 } … … 232 228 Rational::operator-=(const Rational &a) 233 229 { 234 mpq_set(save.p->rat,p->rat); 235 disconnect(); 236 mpq_sub(p->rat,save.p->rat,a.p->rat); 230 disconnect(); 231 mpq_sub(p->rat,p->rat,a.p->rat); 237 232 return *this; 238 233 } … … 241 236 Rational::operator*=(const Rational &a) 242 237 { 243 mpq_set(save.p->rat,p->rat); 244 disconnect(); 245 mpq_mul(p->rat,save.p->rat,a.p->rat); 238 disconnect(); 239 mpq_mul(p->rat,p->rat,a.p->rat); 246 240 return *this; 247 241 } … … 250 244 Rational::operator/=(const Rational &a) 251 245 { 252 mpq_set(save.p->rat,p->rat); 253 disconnect(); 254 mpq_div(p->rat,save.p->rat,a.p->rat); 246 disconnect(); 247 mpq_div(p->rat,p->rat,a.p->rat); 255 248 return *this; 256 249 } … … 263 256 Rational::operator++() 264 257 { 265 mpq_set(save.p->rat,p->rat); 266 *this=1; 267 mpq_add(p->rat,p->rat,save.p->rat); 258 disconnect(); 259 mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 268 260 return *this; 269 261 } … … 274 266 Rational erg(*this); 275 267 276 mpq_set(save.p->rat,p->rat); 277 *this=1; 278 mpq_add(p->rat,p->rat,save.p->rat); 268 disconnect(); 269 mpz_add(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 279 270 return erg; 280 271 } … … 283 274 Rational::operator--() 284 275 { 285 mpq_set(save.p->rat,p->rat); 286 *this=1; 287 mpq_sub(p->rat,save.p->rat,p->rat); 276 disconnect(); 277 mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 288 278 return *this; 289 279 } … … 294 284 Rational erg(*this); 295 285 296 mpq_set(save.p->rat,p->rat); 297 *this=1; 298 mpq_sub(p->rat,save.p->rat,p->rat); 286 disconnect(); 287 mpz_sub(mpq_numref(p->rat), mpq_numref(p->rat), mpq_denref(p->rat)); 299 288 return erg; 300 289 } -
kernel/GMPrat.h
rca4d699 reeb5b0c 22 22 23 23 rep *p; 24 static Rational save;25 24 26 25 void disconnect(); -
kernel/Makefile.am
rca4d699 reeb5b0c 1 1 ACLOCAL_AMFLAGS = -I ../m4 2 2 # TODO: use ${top_srcdir} instead of .. in the above? 3 4 SUBDIRS=numeric 3 5 4 6 noinst_LTLIBRARIES = libkernel.la … … 58 60 endif 59 61 60 libkernel_la_LIBADD = ${ top_builddir}/libpolys/polys/libpolys.la $(USE_FACTORY)62 libkernel_la_LIBADD = ${builddir}/numeric/libnumeric.la ${top_builddir}/libpolys/polys/libpolys.la $(USE_FACTORY) 61 63 ### libkernel_la_LDFLAGS = -release ${PACKAGE_VERSION} 62 64 … … 82 84 CLEANFILES = $(TESTS) 83 85 # $(BUILT_SOURCES) 86 -
kernel/fglmcomb.cc
rca4d699 reeb5b0c 13 13 #include <kernel/mod2.h> 14 14 15 #define SI_DONT_HAVE_GLOBAL_VARS16 15 #include <factory/factory.h> 17 16 #include <misc/options.h> -
kernel/hilb.cc
rca4d699 reeb5b0c 17 17 #include <kernel/hutil.h> 18 18 #include <kernel/stairc.h> 19 //ADICHANGES: 20 #include <kernel/ideals.h> 21 #include <kernel/kstd1.h> 22 #include<gmp.h> 23 #include<vector> 24 19 25 20 26 static int **Qpol; 21 27 static int *Q0, *Ql; 22 28 static int hLength; 29 23 30 24 31 static int hMinModulweight(intvec *modulweight) … … 213 220 } 214 221 } 215 222 // ---------------------------------- ADICHANGES --------------------------------------------- 223 //!!!!!!!!!!!!!!!!!!!!! Just for Monomial Ideals !!!!!!!!!!!!!!!!!!!!!!!!!!!! 224 225 //returns the degree of the monomial 226 static int DegMon(poly p) 227 { 228 #if 1 229 int i,deg; 230 deg = 0; 231 for(i=1;i<=currRing->N;i++) 232 { 233 deg = deg + p_GetExp(p, i, currRing); 234 } 235 return(deg); 236 #else 237 return(p_Deg(p, currRing)); 238 #endif 239 } 240 241 //Tests if the ideal is sorted by degree 242 static bool idDegSortTest(ideal I) 243 { 244 if((I == NULL)||(idIs0(I))) 245 { 246 return(TRUE); 247 } 248 for(int i = 0; i<IDELEMS(I)-1; i++) 249 { 250 if(DegMon(I->m[i])>DegMon(I->m[i+1])) 251 { 252 idPrint(I); 253 Werror("Ideal is not deg sorted!!"); 254 return(FALSE); 255 } 256 } 257 return(TRUE); 258 } 259 260 //adds the new polynomial at the coresponding position 261 //and simplifies the ideal 262 static ideal SortByDeg_p(ideal I, poly p) 263 { 264 int i,j; 265 if((I == NULL) || (idIs0(I))) 266 { 267 ideal res = idInit(1,1); 268 res->m[0] = p; 269 return(res); 270 } 271 idSkipZeroes(I); 272 #if 1 273 for(i = 0; (i<IDELEMS(I)) && (DegMon(I->m[i])<=DegMon(p)); i++) 274 { 275 if(p_DivisibleBy( I->m[i],p, currRing)) 276 { 277 return(I); 278 } 279 } 280 for(i = IDELEMS(I)-1; (i>=0) && (DegMon(I->m[i])>=DegMon(p)); i--) 281 { 282 if(p_DivisibleBy(p,I->m[i], currRing)) 283 { 284 I->m[i] = NULL; 285 } 286 } 287 if(idIs0(I)) 288 { 289 idSkipZeroes(I); 290 I->m[0] = p; 291 return(I); 292 } 293 #endif 294 idSkipZeroes(I); 295 //First I take the case when all generators have the same degree 296 if(DegMon(I->m[0]) == DegMon(I->m[IDELEMS(I)-1])) 297 { 298 if(DegMon(p)<DegMon(I->m[0])) 299 { 300 idInsertPoly(I,p); 301 idSkipZeroes(I); 302 for(i=IDELEMS(I)-1;i>=1; i--) 303 { 304 I->m[i] = I->m[i-1]; 305 } 306 I->m[0] = p; 307 return(I); 308 } 309 if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1])) 310 { 311 idInsertPoly(I,p); 312 idSkipZeroes(I); 313 return(I); 314 } 315 } 316 if(DegMon(p)<=DegMon(I->m[0])) 317 { 318 idInsertPoly(I,p); 319 idSkipZeroes(I); 320 for(i=IDELEMS(I)-1;i>=1; i--) 321 { 322 I->m[i] = I->m[i-1]; 323 } 324 I->m[0] = p; 325 return(I); 326 } 327 if(DegMon(p)>=DegMon(I->m[IDELEMS(I)-1])) 328 { 329 idInsertPoly(I,p); 330 idSkipZeroes(I); 331 return(I); 332 } 333 for(i = IDELEMS(I)-2; ;) 334 { 335 if(DegMon(p)==DegMon(I->m[i])) 336 { 337 idInsertPoly(I,p); 338 idSkipZeroes(I); 339 for(j = IDELEMS(I)-1; j>=i+1;j--) 340 { 341 I->m[j] = I->m[j-1]; 342 } 343 I->m[i] = p; 344 return(I); 345 } 346 if(DegMon(p)>DegMon(I->m[i])) 347 { 348 idInsertPoly(I,p); 349 idSkipZeroes(I); 350 for(j = IDELEMS(I)-1; j>=i+2;j--) 351 { 352 I->m[j] = I->m[j-1]; 353 } 354 I->m[i+1] = p; 355 return(I); 356 } 357 i--; 358 } 359 } 360 361 //it sorts the ideal by the degrees 362 static ideal SortByDeg(ideal I) 363 { 364 if(idIs0(I)) 365 { 366 return(I); 367 } 368 idSkipZeroes(I); 369 int i; 370 ideal res; 371 idSkipZeroes(I); 372 res = idInit(1,1); 373 res->m[0] = poly(0); 374 for(i = 0; i<=IDELEMS(I)-1;i++) 375 { 376 res = SortByDeg_p(res, I->m[i]); 377 } 378 idSkipZeroes(res); 379 //idDegSortTest(res); 380 return(res); 381 } 382 383 //idQuot(I,p) for I monomial ideal, p a ideal with a single monomial. 384 ideal idQuotMon(ideal Iorig, ideal p) 385 { 386 if(idIs0(Iorig)) 387 { 388 ideal res = idInit(1,1); 389 res->m[0] = poly(0); 390 return(res); 391 } 392 if(idIs0(p)) 393 { 394 ideal res = idInit(1,1); 395 res->m[0] = pOne(); 396 return(res); 397 } 398 ideal I = idCopy(Iorig); 399 ideal res = idInit(IDELEMS(I),1); 400 int i,j; 401 int dummy; 402 for(i = 0; i<IDELEMS(I); i++) 403 { 404 res->m[i] = p_Copy(I->m[i], currRing); 405 for(j = 1; (j<=currRing->N) ; j++) 406 { 407 dummy = p_GetExp(p->m[0], j, currRing); 408 if(dummy > 0) 409 { 410 if(p_GetExp(I->m[i], j, currRing) < dummy) 411 { 412 p_SetExp(res->m[i], j, 0, currRing); 413 } 414 else 415 { 416 p_SetExp(res->m[i], j, p_GetExp(I->m[i], j, currRing) - dummy, currRing); 417 } 418 } 419 } 420 p_Setm(res->m[i], currRing); 421 if(DegMon(res->m[i]) == DegMon(I->m[i])) 422 { 423 res->m[i] = NULL; 424 } 425 else 426 { 427 I->m[i] = NULL; 428 } 429 } 430 idSkipZeroes(res); 431 idSkipZeroes(I); 432 if(!idIs0(res)) 433 { 434 for(i = 0; i<=IDELEMS(res)-1; i++) 435 { 436 I = SortByDeg_p(I,res->m[i]); 437 } 438 } 439 //idDegSortTest(I); 440 return(I); 441 } 442 443 //id_Add for monomials 444 static ideal idAddMon(ideal I, ideal p) 445 { 446 #if 1 447 I = SortByDeg_p(I,p->m[0]); 448 #else 449 I = id_Add(I,p,currRing); 450 #endif 451 //idSkipZeroes(I); 452 return(I); 453 } 454 455 //searches for a variable that is not yet used (assumes that the ideal is sqrfree) 456 static poly ChoosePVar (ideal I) 457 { 458 bool flag=TRUE; 459 int i,j; 460 poly res; 461 for(i=1;i<=currRing->N;i++) 462 { 463 flag=TRUE; 464 for(j=IDELEMS(I)-1;(j>=0)&&(flag);j--) 465 { 466 if(p_GetExp(I->m[j], i, currRing)>0) 467 { 468 flag=FALSE; 469 } 470 } 471 472 if(flag == TRUE) 473 { 474 res = p_ISet(1, currRing); 475 p_SetExp(res, i, 1, currRing); 476 p_Setm(res,currRing); 477 return(res); 478 } 479 else 480 { 481 p_Delete(&res, currRing); 482 } 483 } 484 return(NULL); //i.e. it is the maximal ideal 485 } 486 487 //choice XL: last entry divided by x (xy10z15 -> y9z14) 488 static poly ChoosePXL(ideal I) 489 { 490 int i,j,dummy=0; 491 poly m; 492 for(i = IDELEMS(I)-1; (i>=0) && (dummy == 0); i--) 493 { 494 for(j = 1; (j<=currRing->N) && (dummy == 0); j++) 495 { 496 if(p_GetExp(I->m[i],j, currRing)>1) 497 { 498 dummy = 1; 499 } 500 } 501 } 502 m = p_Copy(I->m[i+1],currRing); 503 for(j = 1; j<=currRing->N; j++) 504 { 505 dummy = p_GetExp(m,j,currRing); 506 if(dummy >= 1) 507 { 508 p_SetExp(m, j, dummy-1, currRing); 509 } 510 } 511 if(!p_IsOne(m, currRing)) 512 { 513 p_Setm(m, currRing); 514 return(m); 515 } 516 m = ChoosePVar(I); 517 return(m); 518 } 519 520 //choice XF: first entry divided by x (xy10z15 -> y9z14) 521 static poly ChoosePXF(ideal I) 522 { 523 int i,j,dummy=0; 524 poly m; 525 for(i =0 ; (i<=IDELEMS(I)-1) && (dummy == 0); i++) 526 { 527 for(j = 1; (j<=currRing->N) && (dummy == 0); j++) 528 { 529 if(p_GetExp(I->m[i],j, currRing)>1) 530 { 531 dummy = 1; 532 } 533 } 534 } 535 m = p_Copy(I->m[i-1],currRing); 536 for(j = 1; j<=currRing->N; j++) 537 { 538 dummy = p_GetExp(m,j,currRing); 539 if(dummy >= 1) 540 { 541 p_SetExp(m, j, dummy-1, currRing); 542 } 543 } 544 if(!p_IsOne(m, currRing)) 545 { 546 p_Setm(m, currRing); 547 return(m); 548 } 549 m = ChoosePVar(I); 550 return(m); 551 } 552 553 //choice OL: last entry the first power (xy10z15 -> xy9z15) 554 static poly ChoosePOL(ideal I) 555 { 556 int i,j,dummy; 557 poly m; 558 for(i = IDELEMS(I)-1;i>=0;i--) 559 { 560 m = p_Copy(I->m[i],currRing); 561 for(j=1;j<=currRing->N;j++) 562 { 563 dummy = p_GetExp(m,j,currRing); 564 if(dummy > 0) 565 { 566 p_SetExp(m,j,dummy-1,currRing); 567 p_Setm(m,currRing); 568 } 569 } 570 if(!p_IsOne(m, currRing)) 571 { 572 return(m); 573 } 574 else 575 { 576 p_Delete(&m,currRing); 577 } 578 } 579 m = ChoosePVar(I); 580 return(m); 581 } 582 583 //choice OF: first entry the first power (xy10z15 -> xy9z15) 584 static poly ChoosePOF(ideal I) 585 { 586 int i,j,dummy; 587 poly m; 588 for(i = 0 ;i<=IDELEMS(I)-1;i++) 589 { 590 m = p_Copy(I->m[i],currRing); 591 for(j=1;j<=currRing->N;j++) 592 { 593 dummy = p_GetExp(m,j,currRing); 594 if(dummy > 0) 595 { 596 p_SetExp(m,j,dummy-1,currRing); 597 p_Setm(m,currRing); 598 } 599 } 600 if(!p_IsOne(m, currRing)) 601 { 602 return(m); 603 } 604 else 605 { 606 p_Delete(&m,currRing); 607 } 608 } 609 m = ChoosePVar(I); 610 return(m); 611 } 612 613 //choice VL: last entry the first variable with power (xy10z15 -> y) 614 static poly ChoosePVL(ideal I) 615 { 616 int i,j,dummy; 617 bool flag = TRUE; 618 poly m = p_ISet(1,currRing); 619 for(i = IDELEMS(I)-1;(i>=0) && (flag);i--) 620 { 621 flag = TRUE; 622 for(j=1;(j<=currRing->N) && (flag);j++) 623 { 624 dummy = p_GetExp(I->m[i],j,currRing); 625 if(dummy >= 2) 626 { 627 p_SetExp(m,j,1,currRing); 628 p_Setm(m,currRing); 629 flag = FALSE; 630 } 631 } 632 if(!p_IsOne(m, currRing)) 633 { 634 return(m); 635 } 636 } 637 m = ChoosePVar(I); 638 return(m); 639 } 640 641 //choice VF: first entry the first variable with power (xy10z15 -> y) 642 static poly ChoosePVF(ideal I) 643 { 644 int i,j,dummy; 645 bool flag = TRUE; 646 poly m = p_ISet(1,currRing); 647 for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++) 648 { 649 flag = TRUE; 650 for(j=1;(j<=currRing->N) && (flag);j++) 651 { 652 dummy = p_GetExp(I->m[i],j,currRing); 653 if(dummy >= 2) 654 { 655 p_SetExp(m,j,1,currRing); 656 p_Setm(m,currRing); 657 flag = FALSE; 658 } 659 } 660 if(!p_IsOne(m, currRing)) 661 { 662 return(m); 663 } 664 } 665 m = ChoosePVar(I); 666 return(m); 667 } 668 669 //choice JL: last entry just variable with power (xy10z15 -> y10) 670 static poly ChoosePJL(ideal I) 671 { 672 int i,j,dummy; 673 bool flag = TRUE; 674 poly m = p_ISet(1,currRing); 675 for(i = IDELEMS(I)-1;(i>=0) && (flag);i--) 676 { 677 flag = TRUE; 678 for(j=1;(j<=currRing->N) && (flag);j++) 679 { 680 dummy = p_GetExp(I->m[i],j,currRing); 681 if(dummy >= 2) 682 { 683 p_SetExp(m,j,dummy-1,currRing); 684 p_Setm(m,currRing); 685 flag = FALSE; 686 } 687 } 688 if(!p_IsOne(m, currRing)) 689 { 690 return(m); 691 } 692 } 693 m = ChoosePVar(I); 694 return(m); 695 } 696 697 //choice JF: last entry just variable with power -1 (xy10z15 -> y9) 698 static poly ChoosePJF(ideal I) 699 { 700 int i,j,dummy; 701 bool flag = TRUE; 702 poly m = p_ISet(1,currRing); 703 for(i = 0;(i<=IDELEMS(I)-1) && (flag);i++) 704 { 705 flag = TRUE; 706 for(j=1;(j<=currRing->N) && (flag);j++) 707 { 708 dummy = p_GetExp(I->m[i],j,currRing); 709 if(dummy >= 2) 710 { 711 p_SetExp(m,j,dummy-1,currRing); 712 p_Setm(m,currRing); 713 flag = FALSE; 714 } 715 } 716 if(!p_IsOne(m, currRing)) 717 { 718 return(m); 719 } 720 } 721 m = ChoosePVar(I); 722 return(m); 723 } 724 725 //chooses 1 \neq p \not\in S. This choice should be made optimal 726 static poly ChooseP(ideal I) 727 { 728 poly m; 729 // TEST TO SEE WHICH ONE IS BETTER 730 //m = ChoosePXL(I); 731 //m = ChoosePXF(I); 732 //m = ChoosePOL(I); 733 //m = ChoosePOF(I); 734 //m = ChoosePVL(I); 735 //m = ChoosePVF(I); 736 m = ChoosePJL(I); 737 //m = ChoosePJF(I); 738 return(m); 739 } 740 741 //searches for a monomial of degree d>=2 and divides it by a variable (result monomial of deg d-1) 742 static poly SearchP(ideal I) 743 { 744 int i,j,exp; 745 poly res; 746 if(DegMon(I->m[IDELEMS(I)-1])<=1) 747 { 748 res = ChoosePVar(I); 749 return(res); 750 } 751 i = IDELEMS(I)-1; 752 res = p_Copy(I->m[i], currRing); 753 for(j=1;j<=currRing->N;j++) 754 { 755 exp = p_GetExp(I->m[i], j, currRing); 756 if(exp > 0) 757 { 758 p_SetExp(res, j, exp - 1, currRing); 759 p_Setm(res,currRing); 760 return(res); 761 } 762 } 763 } 764 765 //test if the ideal is of the form (x1, ..., xr) 766 static bool JustVar(ideal I) 767 { 768 #if 0 769 int i,j; 770 bool foundone; 771 for(i=0;i<=IDELEMS(I)-1;i++) 772 { 773 foundone = FALSE; 774 for(j = 1;j<=currRing->N;j++) 775 { 776 if(p_GetExp(I->m[i], j, currRing)>0) 777 { 778 if(foundone == TRUE) 779 { 780 return(FALSE); 781 } 782 foundone = TRUE; 783 } 784 } 785 } 786 return(TRUE); 787 #else 788 if(DegMon(I->m[IDELEMS(I)-1])>1) 789 { 790 return(FALSE); 791 } 792 return(TRUE); 793 #endif 794 } 795 796 //computes the Euler Characteristic of the ideal 797 static void eulerchar (ideal I, int variables, mpz_ptr ec) 798 { 799 loop 800 { 801 mpz_t dummy; 802 if(JustVar(I) == TRUE) 803 { 804 if(IDELEMS(I) == variables) 805 { 806 mpz_init(dummy); 807 if((variables % 2) == 0) 808 {mpz_set_si(dummy, 1);} 809 else 810 {mpz_set_si(dummy, -1);} 811 mpz_add(ec, ec, dummy); 812 } 813 //mpz_clear(dummy); 814 return; 815 } 816 ideal p = idInit(1,1); 817 p->m[0] = SearchP(I); 818 //idPrint(I); 819 //idPrint(p); 820 //printf("\nNow get in idQuotMon\n"); 821 ideal Ip = idQuotMon(I,p); 822 //idPrint(Ip); 823 //Ip = SortByDeg(Ip); 824 int i,howmanyvarinp = 0; 825 for(i = 1;i<=currRing->N;i++) 826 { 827 if(p_GetExp(p->m[0],i,currRing)>0) 828 { 829 howmanyvarinp++; 830 } 831 } 832 eulerchar(Ip, variables-howmanyvarinp, ec); 833 id_Delete(&Ip, currRing); 834 I = idAddMon(I,p); 835 } 836 } 837 838 //tests if an ideal is Square Free, if no, returns the variable which appears at powers >1 839 static poly SqFree (ideal I) 840 { 841 int i,j; 842 bool flag=TRUE; 843 poly notsqrfree = NULL; 844 if(DegMon(I->m[IDELEMS(I)-1])<=1) 845 { 846 return(notsqrfree); 847 } 848 for(i=IDELEMS(I)-1;(i>=0)&&(flag);i--) 849 { 850 for(j=1;(j<=currRing->N)&&(flag);j++) 851 { 852 if(p_GetExp(I->m[i],j,currRing)>1) 853 { 854 flag=FALSE; 855 notsqrfree = p_ISet(1,currRing); 856 p_SetExp(notsqrfree,j,1,currRing); 857 } 858 } 859 } 860 if(notsqrfree != NULL) 861 { 862 p_Setm(notsqrfree,currRing); 863 } 864 return(notsqrfree); 865 } 866 867 //checks if a polynomial is in I 868 static bool IsIn(poly p, ideal I) 869 { 870 //assumes that I is ordered by degree 871 if(idIs0(I)) 872 { 873 if(p==poly(0)) 874 { 875 return(TRUE); 876 } 877 else 878 { 879 return(FALSE); 880 } 881 } 882 if(p==poly(0)) 883 { 884 return(FALSE); 885 } 886 int i,j; 887 bool flag; 888 for(i = 0;i<IDELEMS(I);i++) 889 { 890 flag = TRUE; 891 for(j = 1;(j<=currRing->N) &&(flag);j++) 892 { 893 if(p_GetExp(p, j, currRing)<p_GetExp(I->m[i], j, currRing)) 894 { 895 flag = FALSE; 896 } 897 } 898 if(flag) 899 { 900 return(TRUE); 901 } 902 } 903 return(FALSE); 904 } 905 906 //computes the lcm of min I, I monomial ideal 907 static poly LCMmon(ideal I) 908 { 909 if(idIs0(I)) 910 { 911 return(NULL); 912 } 913 poly m; 914 int dummy,i,j; 915 m = p_ISet(1,currRing); 916 for(i=1;i<=currRing->N;i++) 917 { 918 dummy=0; 919 for(j=IDELEMS(I)-1;j>=0;j--) 920 { 921 if(p_GetExp(I->m[j],i,currRing) > dummy) 922 { 923 dummy = p_GetExp(I->m[j],i,currRing); 924 } 925 } 926 p_SetExp(m,i,dummy,currRing); 927 } 928 p_Setm(m,currRing); 929 return(m); 930 } 931 932 //the Roune Slice Algorithm 933 void rouneslice(ideal I, ideal S, poly q, poly x, int &prune, int &moreprune, int &steps, int &NNN, mpz_ptr &hilbertcoef, int* &hilbpower) 934 { 935 loop 936 { 937 (steps)++; 938 int i,j; 939 int dummy; 940 poly m; 941 ideal p, koszsimp; 942 //----------- PRUNING OF S --------------- 943 //S SHOULD IN THIS POINT BE ORDERED BY DEGREE 944 for(i=IDELEMS(S)-1;i>=0;i--) 945 { 946 if(IsIn(S->m[i],I)) 947 { 948 S->m[i]=NULL; 949 prune++; 950 } 951 } 952 idSkipZeroes(S); 953 //---------------------------------------- 954 for(i=IDELEMS(I)-1;i>=0;i--) 955 { 956 m = p_Copy(I->m[i],currRing); 957 for(j=1;j<=currRing->N;j++) 958 { 959 dummy = p_GetExp(m,j,currRing); 960 if(dummy > 0) 961 { 962 p_SetExp(m,j,dummy-1,currRing); 963 } 964 } 965 p_Setm(m, currRing); 966 if(IsIn(m,S)) 967 { 968 I->m[i]=NULL; 969 //printf("\n Deleted, since pi(m) is in S\n");pWrite(m); 970 } 971 } 972 idSkipZeroes(I); 973 //----------- MORE PRUNING OF S ------------ 974 m = LCMmon(I); 975 if(m != NULL) 976 { 977 for(i=0;i<IDELEMS(S);i++) 978 { 979 if(!(p_DivisibleBy(S->m[i], m, currRing))) 980 { 981 S->m[i] = NULL; 982 j++; 983 moreprune++; 984 } 985 else 986 { 987 if(pLmEqual(S->m[i],m)) 988 { 989 S->m[i] = NULL; 990 moreprune++; 991 } 992 } 993 } 994 idSkipZeroes(S); 995 } 996 /*printf("\n---------------------------\n"); 997 printf("\n I\n");idPrint(I); 998 printf("\n S\n");idPrint(S); 999 printf("\n q\n");pWrite(q); 1000 getchar();*/ 1001 1002 if(idIs0(I)) 1003 { 1004 id_Delete(&I, currRing); 1005 id_Delete(&S, currRing); 1006 p_Delete(&m, currRing); 1007 break; 1008 } 1009 m = LCMmon(I); 1010 if(!p_DivisibleBy(x,m, currRing)) 1011 { 1012 //printf("\nx does not divide lcm(I)"); 1013 //printf("\nEmpty set");pWrite(q); 1014 id_Delete(&I, currRing); 1015 id_Delete(&S, currRing); 1016 p_Delete(&m, currRing); 1017 break; 1018 } 1019 m = SqFree(I); 1020 if(m==NULL) 1021 { 1022 //printf("\n Corner: "); 1023 //pWrite(q); 1024 //printf("\n With the facets of the dual simplex:\n"); 1025 //idPrint(I); 1026 mpz_t ec; 1027 mpz_init(ec); 1028 mpz_ptr ec_ptr = ec; 1029 eulerchar(I, currRing->N, ec_ptr); 1030 bool flag = FALSE; 1031 if(NNN==0) 1032 { 1033 hilbertcoef = (mpz_ptr)omAlloc((NNN+1)*sizeof(mpz_t)); 1034 hilbpower = (int*)omAlloc((NNN+1)*sizeof(int)); 1035 mpz_init( &hilbertcoef[NNN]); 1036 mpz_set( &hilbertcoef[NNN], ec); 1037 mpz_clear(ec); 1038 hilbpower[NNN] = DegMon(q); 1039 NNN++; 1040 } 1041 else 1042 { 1043 //I look if the power appears already 1044 for(i = 0;(i<NNN)&&(flag == FALSE)&&(DegMon(q)>=hilbpower[i]);i++) 1045 { 1046 if((hilbpower[i]) == (DegMon(q))) 1047 { 1048 flag = TRUE; 1049 mpz_add(&hilbertcoef[i],&hilbertcoef[i],ec_ptr); 1050 } 1051 } 1052 if(flag == FALSE) 1053 { 1054 hilbertcoef = (mpz_ptr)omRealloc(hilbertcoef, (NNN+1)*sizeof(mpz_t)); 1055 hilbpower = (int*)omRealloc(hilbpower, (NNN+1)*sizeof(int)); 1056 mpz_init(&hilbertcoef[NNN]); 1057 for(j = NNN; j>i; j--) 1058 { 1059 mpz_set(&hilbertcoef[j],&hilbertcoef[j-1]); 1060 hilbpower[j] = hilbpower[j-1]; 1061 } 1062 mpz_set( &hilbertcoef[i], ec); 1063 mpz_clear(ec); 1064 hilbpower[i] = DegMon(q); 1065 NNN++; 1066 } 1067 } 1068 break; 1069 } 1070 m = ChooseP(I); 1071 p = idInit(1,1); 1072 p->m[0] = m; 1073 ideal Ip = idQuotMon(I,p); 1074 ideal Sp = idQuotMon(S,p); 1075 poly pq = pp_Mult_mm(q,m,currRing); 1076 rouneslice(Ip, Sp, pq, x, prune, moreprune, steps, NNN, hilbertcoef,hilbpower); 1077 //id_Delete(&Ip, currRing); 1078 //id_Delete(&Sp, currRing); 1079 S = idAddMon(S,p); 1080 p->m[0]=NULL; 1081 id_Delete(&p, currRing); // p->m[0] was also in S 1082 p_Delete(&pq,currRing); 1083 } 1084 } 1085 1086 //it computes the first hilbert series by means of Roune Slice Algorithm 1087 void slicehilb(ideal I) 1088 { 1089 //printf("Adi changes are here: \n"); 1090 int i, NNN = 0; 1091 int steps = 0, prune = 0, moreprune = 0; 1092 mpz_ptr hilbertcoef; 1093 int *hilbpower; 1094 ideal S = idInit(1,1); 1095 poly q = p_ISet(1,currRing); 1096 ideal X = idInit(1,1); 1097 X->m[0]=p_One(currRing); 1098 for(i=1;i<=currRing->N;i++) 1099 { 1100 p_SetExp(X->m[0],i,1,currRing); 1101 } 1102 p_Setm(X->m[0],currRing); 1103 I = id_Mult(I,X,currRing); 1104 I = SortByDeg(I); 1105 //printf("\n-------------RouneSlice--------------\n"); 1106 rouneslice(I,S,q,X->m[0],prune, moreprune, steps, NNN, hilbertcoef, hilbpower); 1107 //printf("\nIn total Prune got rid of %i elements\n",prune); 1108 //printf("\nIn total More Prune got rid of %i elements\n",moreprune); 1109 //printf("\nSteps of rouneslice: %i\n\n", steps); 1110 mpz_t coefhilb; 1111 mpz_t dummy; 1112 mpz_init(coefhilb); 1113 mpz_init(dummy); 1114 printf("\n// %8d t^0",1); 1115 for(i = 0; i<NNN; i++) 1116 { 1117 if(mpz_sgn(&hilbertcoef[i])!=0) 1118 { 1119 gmp_printf("\n// %8Zd t^%d",&hilbertcoef[i],hilbpower[i]); 1120 } 1121 } 1122 omFreeSize(hilbertcoef, (NNN)*sizeof(mpz_t)); 1123 omFreeSize(hilbpower, (NNN)*sizeof(int)); 1124 //printf("\n-------------------------------------\n"); 1125 } 1126 1127 // -------------------------------- END OF CHANGES ------------------------------------------- 216 1128 static intvec * hSeries(ideal S, intvec *modulweight, 217 1129 int /*notstc*/, intvec *wdegree, ideal Q, ring tailRing) … … 472 1384 } 473 1385 1386 1387 -
kernel/hutil.h
rca4d699 reeb5b0c 74 74 void hDegreeSeries(intvec *s1, intvec *s2, int *co, int *mu); 75 75 76 void slicehilb(ideal I); 76 77 #endif -
kernel/khstd.cc
rca4d699 reeb5b0c 155 155 #if ADIDEBUG 156 156 PrintS("\nOriginal\n"); 157 int j, l, k;157 int i, j, l, k; 158 158 if (hilb == NULL) 159 159 return; -
kernel/kstd1.cc
rca4d699 reeb5b0c 1457 1457 #endif 1458 1458 1459 /*reads the ecartWeights used for Graebes method from the1460 1459 /*reads the ecartWeights used for Graebes method from the 1461 1460 *intvec ecart and set ecartWeights -
kernel/kstdfac.cc
rca4d699 reeb5b0c 641 641 } 642 642 643 n->P.pLength=0; 643 644 n->P.p=fac->m[i]; 644 645 n->initEcart(&n->P); -
kernel/kutil.cc
rca4d699 reeb5b0c 396 396 if (p_GetExp(p,i,r) > p_GetExp(h,i,r)) return ; // does not divide 397 397 #ifdef HAVE_RINGS 398 ///should check also if the lc is a zero divisor, if it divides all the others 398 // Note: As long as qring j forbidden if j contains integer (i.e. ground rings are 399 // domains), no zerodivisor test needed CAUTION 399 400 if (rField_is_Ring(currRing) && currRing->OrdSgn == -1) 400 401 if(n_DivBy(p_GetCoeff(h,r->cf),lc,r->cf) == 0) … … 725 726 } 726 727 727 if ( i >= 0 && T->pLength != 0728 && ! rIsSyzIndexRing(currRing) && T->pLength != pLength(p))728 if ((i >= 0) && (T->pLength != 0) 729 && (! rIsSyzIndexRing(currRing)) && (T->pLength != pLength(p))) 729 730 { 730 731 int l=T->pLength; … … 5510 5511 { 5511 5512 L->length = 0; 5513 L->pLength = 0; 5512 5514 } 5513 5515 … … 7588 7590 if (strat->kNoether!=NULL) pSetComp(strat->kNoetherTail(), strat->ak); 7589 7591 } 7590 if(TEST_OPT_SB_1) 7591 { 7592 #ifdef HAVE_RINGS 7593 if(!rField_is_Ring(currRing)) 7594 #endif 7592 #ifdef HAVE_RINGS 7593 if(rField_is_Ring(currRing)) 7594 { 7595 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 7596 } 7597 else 7598 #endif 7599 { 7600 if(TEST_OPT_SB_1) 7595 7601 { 7596 7602 int i; … … 7609 7615 idDelete(&P); 7610 7616 } 7611 } 7612 else 7613 { 7614 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 7615 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ 7617 7618 else 7619 { 7620 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 7621 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ 7622 } 7616 7623 } 7617 7624 strat->fromT = FALSE; 7618 7625 strat->noTailReduction = !TEST_OPT_REDTAIL; 7619 if (!TEST_OPT_SB_1) 7620 { 7621 #ifdef HAVE_RINGS 7622 if(!rField_is_Ring(currRing)) 7623 #endif 7626 if ((!TEST_OPT_SB_1) 7627 #ifdef HAVE_RINGS 7628 || (rField_is_Ring(currRing)) 7629 #endif 7630 ) 7631 { 7624 7632 updateS(TRUE,strat); 7625 7633 } … … 7777 7785 if (strat->kNoether!=NULL) pSetComp(strat->kNoetherTail(), strat->ak); 7778 7786 } 7779 if(TEST_OPT_SB_1) 7780 { 7781 #ifdef HAVE_RINGS 7782 if(!rField_is_Ring(currRing)) 7783 #endif 7787 #ifdef HAVE_RINGS 7788 if(rField_is_Ring(currRing)) 7789 { 7790 /*Shdl=*/initSLSba(F, Q,strat); /*sets also S, ecartS, fromQ */ 7791 } 7792 else 7793 #endif 7794 { 7795 if(TEST_OPT_SB_1) 7784 7796 { 7785 7797 int i; … … 7798 7810 idDelete(&P); 7799 7811 } 7800 }7801 else7802 {7803 /*Shdl=*/initSLSba(F, Q,strat); /*sets also S, ecartS, fromQ */7804 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */7812 else 7813 { 7814 /*Shdl=*/initSLSba(F, Q,strat); /*sets also S, ecartS, fromQ */ 7815 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ 7816 } 7805 7817 } 7806 7818 strat->fromT = FALSE; … … 9038 9050 if (strat->kNoether!=NULL) pSetComp(strat->kNoetherTail(), strat->ak); 9039 9051 } 9040 if(TEST_OPT_SB_1) 9041 { 9042 #ifdef HAVE_RINGS 9043 if(!rField_is_Ring(currRing)) 9044 #endif 9052 #ifdef HAVE_RINGS 9053 if(rField_is_Ring(currRing)) 9054 { 9055 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 9056 } 9057 #endif 9058 { 9059 if(TEST_OPT_SB_1) 9045 9060 { 9046 9061 int i; … … 9059 9074 idDelete(&P); 9060 9075 } 9061 }9062 else9063 {9064 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */9065 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */9076 else 9077 { 9078 /*Shdl=*/initSL(F, Q,strat); /*sets also S, ecartS, fromQ */ 9079 // /*Shdl=*/initS(F, Q,strat); /*sets also S, ecartS, fromQ */ 9080 } 9066 9081 } 9067 9082 strat->fromT = FALSE; -
kernel/misc.cc
rca4d699 reeb5b0c 11 11 #include <kernel/mod2.h> 12 12 13 #define SI_DONT_HAVE_GLOBAL_VARS 14 # include <factory/factory.h> 13 #include <factory/factory.h> 15 14 /* libfac version strings */ 16 15 -
kernel/numeric/mpr_base.h
rca4d699 reeb5b0c 10 10 */ 11 11 12 #include <numeric/mpr_numeric.h>12 #include "mpr_numeric.h" 13 13 14 14 #define SNONE -1 -
kernel/syz0.cc
rca4d699 reeb5b0c 772 772 } 773 773 774 #if 0 774 775 static void syMergeSortResolventFB(resolvente res,int length, int initial=1) 775 776 { … … 826 827 } 827 828 } 829 #endif 828 830 829 831 BOOLEAN syTestOrder(ideal M) -
kernel/syz3.cc
rca4d699 reeb5b0c 1070 1070 for (j=0;j<i;j++) 1071 1071 { 1072 if ( (pGetComp(add_generators->m[j])==pGetComp(add_generators->m[i])))1072 if (pGetComp(add_generators->m[j]) == pGetComp(add_generators->m[i])) 1073 1073 { 1074 1074 p = pOne(); -
kernel/test.cc
rca4d699 reeb5b0c 50 50 #include <polys/clapsing.h> 51 51 52 53 // The following are needed due to FACTORY (e.g. initCanonicalForm)54 // int initializeGMP(){ return 1; }55 int mmInit(void) {return 1; }56 52 57 53 // // TODO: DUE to the use of HALT in npolygon.cc :((( -
libpolys/Makefile.am
rca4d699 reeb5b0c 3 3 bin_SCRIPTS = libpolys-config 4 4 5 PACKAGES=misc reporter coeffs polys tests 6 SUBDIRS=$(PACKAGES) 7 8 TESTDIRS=coeffs tests 5 SUBDIRS=misc reporter coeffs polys tests 9 6 10 7 configheaderdir = ${includedir}/singular -
libpolys/coeffs/AE.cc
rca4d699 reeb5b0c 49 49 50 50 //Standard - Addition 51 int_polyint_poly::poly_add(const int_poly a, const int_poly b)51 void int_poly::poly_add(const int_poly a, const int_poly b) 52 52 { 53 53 if (a.deg >=b.deg) … … 78 78 //Ãberschreibende Addition 79 79 80 int_polyint_poly::poly_add_to(const int_poly g)80 void int_poly::poly_add_to(const int_poly g) 81 81 { 82 82 this->poly_add(*this,g); … … 84 84 85 85 //Addition einer Konstanten 86 int_polyint_poly::poly_add_const(int_poly f,const mpz_t a)86 void int_poly::poly_add_const(int_poly f,const mpz_t a) 87 87 { 88 88 if (f.is_zero()==1) … … 102 102 //To Variante Addition einer Konstanten 103 103 104 int_polyint_poly::poly_add_const_to(const mpz_t a)104 void int_poly::poly_add_const_to(const mpz_t a) 105 105 { 106 106 this->poly_add_const(*this,a); … … 108 108 109 109 //Monom Addition 110 int_polyint_poly::poly_add_mon(int_poly f, mpz_t a, int i)110 void int_poly::poly_add_mon(int_poly f, mpz_t a, int i) 111 111 { 112 112 poly_set(f); … … 141 141 142 142 //To Variante Monomaddition 143 int_polyint_poly::poly_add_mon_to(mpz_t a, int i)143 void int_poly::poly_add_mon_to(mpz_t a, int i) 144 144 { 145 145 if (i<=deg && is_zero()==0) … … 175 175 //Subtraktionen 176 176 177 int_polyint_poly::poly_sub(const int_poly a, const int_poly b)177 void int_poly::poly_sub(const int_poly a, const int_poly b) 178 178 { 179 179 int_poly temp; … … 193 193 //Ãberschreibende Subtraktion 194 194 195 int_polyint_poly::poly_sub_to(const int_poly b)195 void int_poly::poly_sub_to(const int_poly b) 196 196 { 197 197 this->poly_sub(*this,b); … … 199 199 200 200 //Subtraktion einer Konstanten 201 int_polyint_poly::poly_sub_const(int_poly f,const mpz_t a)201 void int_poly::poly_sub_const(int_poly f,const mpz_t a) 202 202 { 203 203 if (f.is_zero()==1) … … 222 222 //To Variante Subtraktion einer Konstanten 223 223 224 int_polyint_poly::poly_sub_const_to(const mpz_t a)224 void int_poly::poly_sub_const_to(const mpz_t a) 225 225 { 226 226 this->poly_sub_const(*this,a); … … 229 229 230 230 //Monom Subtraktion 231 int_polyint_poly::poly_sub_mon(const int_poly f , mpz_t a, int i)231 void int_poly::poly_sub_mon(const int_poly f , mpz_t a, int i) 232 232 { 233 233 poly_set(f); … … 261 261 262 262 //To Variante Monomaddition 263 int_polyint_poly::poly_sub_mon_to(mpz_t a, int i)263 void int_poly::poly_sub_mon_to(mpz_t a, int i) 264 264 { 265 265 … … 295 295 296 296 //Multiplikation mit Monom 297 int_polyint_poly::poly_mon_mult(const int_poly f, int n)298 { 299 if (f ,is_zero()==1)297 void int_poly::poly_mon_mult(const int_poly f, int n) 298 { 299 if (f.is_zero()==1) 300 300 { 301 301 poly_set_zero(); … … 315 315 } 316 316 317 int_polyint_poly::poly_mon_mult_to(const int n)317 void int_poly::poly_mon_mult_to(const int n) 318 318 { 319 319 this->poly_mon_mult(*this,n); … … 323 323 //Multiplikation mit Skalar 324 324 325 int_polyint_poly::poly_scalar_mult(const int_poly g, const mpz_t n)325 void int_poly::poly_scalar_mult(const int_poly g, const mpz_t n) 326 326 { 327 327 if (mpz_sgn(n)==0) … … 342 342 343 343 344 int_polyint_poly::poly_scalar_mult(const mpz_t n, const int_poly g)344 void int_poly::poly_scalar_mult(const mpz_t n, const int_poly g) 345 345 { 346 346 if (mpz_sgn(n)==0) … … 360 360 361 361 362 int_polyint_poly::poly_scalar_mult_to(const mpz_t n)362 void int_poly::poly_scalar_mult_to(const mpz_t n) 363 363 { 364 364 this->poly_scalar_mult(*this,n); … … 369 369 // Negation 370 370 371 int_polyint_poly::poly_neg()371 void int_poly::poly_neg() 372 372 { 373 373 for (int i=0;i<=deg;i++) … … 378 378 379 379 // Naive Multiplikation 380 int_polyint_poly::poly_mult_n(int_poly a,int_poly b)380 void int_poly::poly_mult_n(int_poly a,int_poly b) 381 381 { 382 382 … … 422 422 //Ãberschreibende Multiplikation 423 423 424 int_polyint_poly::poly_mult_n_to(const int_poly g)424 void int_poly::poly_mult_n_to(const int_poly g) 425 425 { 426 426 this->poly_mult_n(*this,g); … … 429 429 430 430 // Karatsuba-Multiplikation (Weimerskirch/Paar Alg. 1), ACHTUNG VORLÃUFIGE VERSION, macht noch Fehler beim Grad und ist unelegant !!! 431 int_polyint_poly::poly_mult_ka( int_poly A, int_poly B)431 void int_poly::poly_mult_ka( int_poly A, int_poly B) 432 432 { 433 433 … … 487 487 //Skalare Divisionen 488 488 489 int_polyint_poly::poly_scalar_div( const int_poly g, const mpz_t n)489 void int_poly::poly_scalar_div( const int_poly g, const mpz_t n) 490 490 { 491 491 deg=g.deg; … … 500 500 501 501 502 int_polyint_poly::poly_scalar_div_to(const mpz_t n)502 void int_poly::poly_scalar_div_to(const mpz_t n) 503 503 { 504 504 this->poly_scalar_div(*this,n); … … 506 506 507 507 // Division durch Monom - results in Quotient without remainder 508 int_polyint_poly::poly_mon_div(const int_poly f, const int n)508 void int_poly::poly_mon_div(const int_poly f, const int n) 509 509 { 510 510 if (f.deg<n) … … 523 523 524 524 // Division durch Monom - Rest 525 int_polyint_poly::poly_mon_div_rem(const int_poly f, const int n)525 void int_poly::poly_mon_div_rem(const int_poly f, const int n) 526 526 { 527 527 if (f.deg<n) … … 543 543 544 544 //Exakte Division nach Cohen 3.1.1 (works only if B!=0) 545 int_polyint_poly::poly_div(int_poly &Q,int_poly &R, int_poly A, int_poly B)545 void int_poly::poly_div(int_poly &Q,int_poly &R, int_poly A, int_poly B) 546 546 { 547 547 if (B.is_zero()==0) … … 574 574 //To Varainte der exakten Division 575 575 576 int_polyint_poly::poly_div_to(int_poly &Q,int_poly &R,const int_poly B)576 void int_poly::poly_div_to(int_poly &Q,int_poly &R,const int_poly B) 577 577 { 578 578 this->poly_div( Q, R,*this,B); … … 581 581 // pseudo Division nach Cohen 3.1.2 (geht eleganter) 582 582 583 int_polyint_poly::poly_pseudodiv_rem( int_poly A, int_poly B)583 void int_poly::poly_pseudodiv_rem( int_poly A, int_poly B) 584 584 { 585 585 … … 610 610 //To Variante Algo 3.1.2 nach Cohen 611 611 612 int_polyint_poly::poly_pseudodiv_rem_to(const int_poly B)612 void int_poly::poly_pseudodiv_rem_to(const int_poly B) 613 613 { 614 614 this->poly_pseudodiv_rem(*this,B); … … 619 619 //berechnet und entsprechendes in Q und R hineinschreibt 620 620 621 int_polyint_poly::poly_pseudodiv(int_poly &Q, int_poly &R, int_poly A, int_poly B)621 void int_poly::poly_pseudodiv(int_poly &Q, int_poly &R, int_poly A, int_poly B) 622 622 { 623 623 … … 678 678 //To Variante Algo 3.1.2 nach Cohen 679 679 680 int_polyint_poly::poly_pseudodiv_to(int_poly &Q, int_poly &R, int_poly B)680 void int_poly::poly_pseudodiv_to(int_poly &Q, int_poly &R, int_poly B) 681 681 { 682 682 this->poly_pseudodiv(Q, R,*this,B); … … 686 686 687 687 // a := a*b + c 688 int_polyint_poly::poly_multadd_to(const int_poly b, const int_poly c)688 void int_poly::poly_multadd_to(const int_poly b, const int_poly c) 689 689 { 690 690 poly_mult_n_to(b); … … 693 693 694 694 //a=a*b-c 695 int_polyint_poly::poly_multsub_to(const int_poly b, const int_poly c)695 void int_poly::poly_multsub_to(const int_poly b, const int_poly c) 696 696 { 697 697 poly_mult_n_to(b); … … 703 703 /* 704 704 // a := (a+b)* c 705 int_polyint_poly::poly_addmult_to(const int_poly b, const int_poly c)705 void int_poly::poly_addmult_to(const int_poly b, const int_poly c) 706 706 { 707 707 int_poly a(deg,coef); … … 741 741 742 742 743 int_polyint_poly::poly_pp(int_poly f)743 void int_poly::poly_pp(int_poly f) 744 744 { 745 745 mpz_t cont; … … 791 791 792 792 //setze int_polynom auf int_polynom b 793 int_polyint_poly::poly_set(const int_poly b)793 void int_poly::poly_set(const int_poly b) 794 794 { 795 795 deg=b.deg; … … 802 802 803 803 // setze int_polynom auf konstantes int_polynom b 804 int_polyint_poly::poly_set(const mpz_t b)804 void int_poly::poly_set(const mpz_t b) 805 805 { 806 806 deg=0; … … 810 810 811 811 //setze int_polynom auf Nullint_polynom 812 int_polyint_poly::poly_set_zero()812 void int_poly::poly_set_zero() 813 813 { 814 814 deg = -1; … … 818 818 //Vergleiche ob 2 int_polynome gleich return 1 falls ja sont 0 819 819 820 int int_poly::is_equal(const int_poly g) 820 int int_poly::is_equal(const int_poly g) const 821 821 { 822 822 if (deg!=g.deg) … … 834 834 //ÃberprÃŒft ob das int_polynom 0 ist 835 835 836 int int_poly::is_zero() 836 int int_poly::is_zero() const 837 837 { 838 838 if (deg<0) … … 843 843 } 844 844 845 int int_poly::is_one() 845 int int_poly::is_one() const 846 846 { 847 847 if (deg==0) … … 853 853 } 854 854 855 int int_poly::is_monic() 855 int int_poly::is_monic() const 856 856 { 857 857 if (mpz_cmpabs_ui(coef[deg],1)==0) … … 863 863 // klassischer GGT nach Cohen 3.2.1 864 864 865 int_polyint_poly::poly_gcd( int_poly A, int_poly B)865 void int_poly::poly_gcd( int_poly A, int_poly B) 866 866 { 867 867 if (A.deg<B.deg) … … 898 898 899 899 900 int_polyint_poly::poly_ppgcd(int_poly A,int_poly B)900 void int_poly::poly_ppgcd(int_poly A,int_poly B) 901 901 { 902 902 if(A.deg<B.deg) … … 956 956 957 957 958 int_polyint_poly::poly_ppgcd_to(int_poly B)958 void int_poly::poly_ppgcd_to(int_poly B) 959 959 { 960 960 this->poly_ppgcd(*this,B); … … 965 965 // GGT nach Cohen, Algorithmus 3.3.1 (Subresultant int_polynomial GCD) TO DO: Optimierung bzgl. Mehrfachberechnung) 966 966 // Bpp ist das B in den Schritten ab 2 967 int_polyint_poly::poly_subgcd(int_poly A, int_poly B)967 void int_poly::poly_subgcd(int_poly A, int_poly B) 968 968 { 969 969 //Initialisierung und Reduktionen … … 1050 1050 // To Varianta Subresultanten 1051 1051 1052 int_polyint_poly::poly_subgcd_to(int_poly B)1052 void int_poly::poly_subgcd_to(int_poly B) 1053 1053 { 1054 1054 this->poly_subgcd(*this,B); … … 1058 1058 //Extended Subresultant GCD; see Kaplan, M. Computeralgebra, chapter 4.6 1059 1059 //returns g=r*A+t*B IT WORKS DONT TOUCH IT!!!!!!!! 1060 int_polyint_poly::poly_extsubgcd(int_poly& r, int_poly& t,int_poly &g,int_poly A,int_poly B)1060 void int_poly::poly_extsubgcd(int_poly& r, int_poly& t,int_poly &g,int_poly A,int_poly B) 1061 1061 { 1062 1062 if (A.deg<B.deg) -
libpolys/coeffs/AE.h
rca4d699 reeb5b0c 30 30 // Additionen 31 31 32 int_polypoly_add(const int_poly , const int_poly );33 int_polypoly_add_to(const int_poly);34 int_polypoly_add_mon(const int_poly,mpz_t, int); //addiert Monome zu int_polynom35 int_polypoly_add_mon_to(mpz_t,int);36 int_polypoly_add_const( int_poly, const mpz_t);37 int_polypoly_add_const_to(const mpz_t);32 void poly_add(const int_poly , const int_poly ); 33 void poly_add_to(const int_poly); 34 void poly_add_mon(const int_poly,mpz_t, int); //addiert Monome zu int_polynom 35 void poly_add_mon_to(mpz_t,int); 36 void poly_add_const( int_poly, const mpz_t); 37 void poly_add_const_to(const mpz_t); 38 38 39 39 // Subtraktion 40 40 41 int_polypoly_sub(const int_poly , const int_poly );42 int_polypoly_sub_to(const int_poly);43 int_polypoly_sub_mon(const int_poly,mpz_t,int);44 int_polypoly_sub_mon_to(mpz_t,int);45 int_polypoly_sub_const( int_poly, const mpz_t);46 int_polypoly_sub_const_to(const mpz_t);41 void poly_sub(const int_poly , const int_poly ); 42 void poly_sub_to(const int_poly); 43 void poly_sub_mon(const int_poly,mpz_t,int); 44 void poly_sub_mon_to(mpz_t,int); 45 void poly_sub_const( int_poly, const mpz_t); 46 void poly_sub_const_to(const mpz_t); 47 47 48 48 //Multiplikationen 49 49 50 int_polypoly_mult_n(int_poly,int_poly);51 int_polypoly_mult_n_to(const int_poly);52 int_polypoly_mult_ka( int_poly, int_poly);53 int_polypoly_scalar_mult(const mpz_t ,const int_poly);54 int_polypoly_scalar_mult(const int_poly, const mpz_t);55 int_polypoly_scalar_mult_to(const mpz_t);56 int_polypoly_neg();57 int_polypoly_mon_mult(const int_poly, const int);58 int_polypoly_mon_mult_to(const int);50 void poly_mult_n(int_poly,int_poly); 51 void poly_mult_n_to(const int_poly); 52 void poly_mult_ka( int_poly, int_poly); 53 void poly_scalar_mult(const mpz_t ,const int_poly); 54 void poly_scalar_mult(const int_poly, const mpz_t); 55 void poly_scalar_mult_to(const mpz_t); 56 void poly_neg(); 57 void poly_mon_mult(const int_poly, const int); 58 void poly_mon_mult_to(const int); 59 59 60 60 //Divisionen 61 int_polypoly_div(int_poly &,int_poly &, int_poly, int_poly); // exakte Division62 int_polypoly_div_to(int_poly &,int_poly &,const int_poly); // To Variante exakte Division63 int_polypoly_pseudodiv(int_poly &, int_poly &, int_poly , int_poly );64 int_polypoly_pseudodiv_to(int_poly &, int_poly &, int_poly );65 int_polypoly_pseudodiv_rem( int_poly , int_poly);66 int_polypoly_pseudodiv_rem_to(const int_poly);67 int_polypoly_scalar_div(const int_poly, const mpz_t);68 int_polypoly_scalar_div_to(const mpz_t);69 int_polypoly_mon_div(const int_poly, const int);70 int_polypoly_mon_div_rem(const int_poly, const int);61 void poly_div(int_poly &,int_poly &, int_poly, int_poly); // exakte Division 62 void poly_div_to(int_poly &,int_poly &,const int_poly); // To Variante exakte Division 63 void poly_pseudodiv(int_poly &, int_poly &, int_poly , int_poly ); 64 void poly_pseudodiv_to(int_poly &, int_poly &, int_poly ); 65 void poly_pseudodiv_rem( int_poly , int_poly); 66 void poly_pseudodiv_rem_to(const int_poly); 67 void poly_scalar_div(const int_poly, const mpz_t); 68 void poly_scalar_div_to(const mpz_t); 69 void poly_mon_div(const int_poly, const int); 70 void poly_mon_div_rem(const int_poly, const int); 71 71 72 72 //Kombinationen 73 73 74 int_polypoly_multadd_to(const int_poly, const int_poly); //a=a*b+c75 int_polypoly_multsub_to(const int_poly,const int_poly); //a=a*b-c74 void poly_multadd_to(const int_poly, const int_poly); //a=a*b+c 75 void poly_multsub_to(const int_poly,const int_poly); //a=a*b-c 76 76 //int_poly poly_addmult_to(const int_poly, const int_poly); 77 77 … … 80 80 // Content & Primitive Part 81 81 void poly_cont(mpz_t&); 82 int_polypoly_pp(int_poly);82 void poly_pp(int_poly); 83 83 84 84 85 85 // Sonstige Operationen 86 int_polypoly_set(const int_poly);87 int_polypoly_set(const mpz_t); // Setzt int_polynom auf Konstante88 int_polypoly_set_zero(); // Setzt int_polynom auf 086 void poly_set(const int_poly); 87 void poly_set(const mpz_t); // Setzt int_polynom auf Konstante 88 void poly_set_zero(); // Setzt int_polynom auf 0 89 89 void poly_horner(mpz_t, const mpz_t); // Wertet int_polynom mittels Horner-Schema an einer Stelle aus 90 90 void poly_horner_int_poly(int_poly, const int_poly); //Setzt int_polynom in int_polynom mittels Horner Schema ein 91 int_polypoly_gcd(int_poly,int_poly); //Standard GGT92 int_polypoly_extgcd(int_poly,int_poly,int_poly,int_poly); //Erweiterter Standard GGT93 int_polypoly_ppgcd( int_poly, int_poly); // Primitive int_polynomial GCD94 int_polypoly_ppgcd_to(int_poly);95 int_polypoly_subgcd( int_poly, int_poly); // Subresulatant GCD96 int_polypoly_subgcd_to(int_poly);97 int_polypoly_extsubgcd(int_poly&, int_poly&,int_poly &,int_poly,int_poly);98 int is_equal(const int_poly) ; // Test auf Gleichheit99 int is_zero() ; // Test auf Gleichheit mit 0100 int is_one() ; // Test auf Gleichheit mit 1101 int is_monic() ; // testet, ob das int_polynom normiert ist91 void poly_gcd(int_poly,int_poly); //Standard GGT 92 void poly_extgcd(int_poly,int_poly,int_poly,int_poly); //Erweiterter Standard GGT 93 void poly_ppgcd( int_poly, int_poly); // Primitive int_polynomial GCD 94 void poly_ppgcd_to(int_poly); 95 void poly_subgcd( int_poly, int_poly); // Subresulatant GCD 96 void poly_subgcd_to(int_poly); 97 void poly_extsubgcd(int_poly&, int_poly&,int_poly &,int_poly,int_poly); 98 int is_equal(const int_poly) const; // Test auf Gleichheit 99 int is_zero() const; // Test auf Gleichheit mit 0 100 int is_one() const; // Test auf Gleichheit mit 1 101 int is_monic() const; // testet, ob das int_polynom normiert ist 102 102 103 103 -
libpolys/coeffs/AEQ.cc
rca4d699 reeb5b0c 42 42 43 43 // KÃŒrzen -- MACHT NOCH MIST! 44 Q_polyQ_poly::Q_poly_reduce()44 void Q_poly::Q_poly_reduce() 45 45 { 46 46 if (is_zero()==1) … … 79 79 80 80 // Koeffizienten mit b erweitern 81 Q_polyQ_poly::Q_poly_extend(mpz_t b)81 void Q_poly::Q_poly_extend(mpz_t b) 82 82 { 83 83 mpz_mul(denom,denom,b); … … 95 95 96 96 //Standard - Addition 97 Q_polyQ_poly::Q_poly_add(const Q_poly a, const Q_poly b)97 void Q_poly::Q_poly_add(const Q_poly a, const Q_poly b) 98 98 { 99 99 if (a.deg >= b.deg) … … 129 129 //Ãberschreibende Addition 130 130 131 Q_polyQ_poly::Q_poly_add_to(const Q_poly g)131 void Q_poly::Q_poly_add_to(const Q_poly g) 132 132 { 133 133 this->Q_poly_add(*this,g); … … 135 135 136 136 //Addition einer Konstanten 137 Q_polyQ_poly::Q_poly_add_const(Q_poly f, const mpz_t a)137 void Q_poly::Q_poly_add_const(Q_poly f, const mpz_t a) 138 138 { 139 139 if (f.is_zero()==1) … … 156 156 //To Variante Addition einer Konstanten 157 157 158 Q_polyQ_poly::Q_poly_add_const_to(const mpz_t a)158 void Q_poly::Q_poly_add_const_to(const mpz_t a) 159 159 { 160 160 this->Q_poly_add_const(*this,a); … … 162 162 163 163 //Monom Addition 164 Q_polyQ_poly::Q_poly_add_mon(const Q_poly f, mpz_t a, int i)164 void Q_poly::Q_poly_add_mon(const Q_poly f, mpz_t a, int i) 165 165 { 166 166 Q_poly_set(f); … … 201 201 202 202 //To Variante Monomaddition 203 Q_polyQ_poly::Q_poly_add_mon_to(mpz_t a, int i)203 void Q_poly::Q_poly_add_mon_to(mpz_t a, int i) 204 204 { 205 205 this->Q_poly_add_mon(*this,a,i); … … 208 208 //Subtraktionen 209 209 210 Q_polyQ_poly::Q_poly_sub(const Q_poly a, const Q_poly b)210 void Q_poly::Q_poly_sub(const Q_poly a, const Q_poly b) 211 211 { 212 212 Q_poly temp; … … 219 219 //Ãberschreibende Subtraktion 220 220 221 Q_polyQ_poly::Q_poly_sub_to(const Q_poly b)221 void Q_poly::Q_poly_sub_to(const Q_poly b) 222 222 { 223 223 this->Q_poly_sub(*this,b); … … 225 225 226 226 //Subtraktion einer Konstanten 227 Q_polyQ_poly::Q_poly_sub_const(Q_poly f,const mpz_t a)227 void Q_poly::Q_poly_sub_const(Q_poly f,const mpz_t a) 228 228 { 229 229 if (f.is_zero()==1) … … 245 245 //To Variante Subtraktion einer Konstanten 246 246 247 Q_polyQ_poly::Q_poly_sub_const_to(const mpz_t a)247 void Q_poly::Q_poly_sub_const_to(const mpz_t a) 248 248 { 249 249 this->Q_poly_sub_const(*this,a); … … 252 252 253 253 //Monom Subtraktion 254 Q_polyQ_poly::Q_poly_sub_mon(const Q_poly f , mpz_t a, int i)254 void Q_poly::Q_poly_sub_mon(const Q_poly f , mpz_t a, int i) 255 255 { 256 256 mpz_t temp; … … 261 261 262 262 //To Variante Monomsubtraktion 263 Q_polyQ_poly::Q_poly_sub_mon_to(mpz_t a, int i)263 void Q_poly::Q_poly_sub_mon_to(mpz_t a, int i) 264 264 { 265 265 this->Q_poly_sub_mon(*this,a,i); … … 270 270 271 271 //Multiplikation mit Monom 272 Q_polyQ_poly::Q_poly_mon_mult(const Q_poly f, int n)272 void Q_poly::Q_poly_mon_mult(const Q_poly f, int n) 273 273 { 274 274 deg=f.deg+n; … … 284 284 } 285 285 286 Q_polyQ_poly::Q_poly_mon_mult_to(const int n)286 void Q_poly::Q_poly_mon_mult_to(const int n) 287 287 { 288 288 this->Q_poly_mon_mult(*this,n); … … 292 292 //Multiplikation mit Skalar 293 293 294 Q_polyQ_poly::Q_poly_scalar_mult(const Q_poly g, const mpz_t n)294 void Q_poly::Q_poly_scalar_mult(const Q_poly g, const mpz_t n) 295 295 { 296 296 deg=g.deg; … … 308 308 309 309 310 Q_polyQ_poly::Q_poly_scalar_mult(const mpz_t n, const Q_poly g)310 void Q_poly::Q_poly_scalar_mult(const mpz_t n, const Q_poly g) 311 311 { 312 312 deg=g.deg; … … 323 323 324 324 325 Q_polyQ_poly::Q_poly_scalar_mult_to(const mpz_t n)325 void Q_poly::Q_poly_scalar_mult_to(const mpz_t n) 326 326 { 327 327 this->Q_poly_scalar_mult(*this,n); … … 332 332 // Negation 333 333 334 Q_polyQ_poly::Q_poly_neg()334 void Q_poly::Q_poly_neg() 335 335 { 336 336 mpz_neg(denom,denom); … … 338 338 339 339 // Naive Multiplikation 340 Q_polyQ_poly::Q_poly_mult_n(Q_poly a,Q_poly b)340 void Q_poly::Q_poly_mult_n(Q_poly a,Q_poly b) 341 341 { 342 342 … … 380 380 //Ãberschreibende Multiplikation 381 381 382 Q_polyQ_poly::Q_poly_mult_n_to(const Q_poly g)382 void Q_poly::Q_poly_mult_n_to(const Q_poly g) 383 383 { 384 384 this->Q_poly_mult_n(*this,g); … … 386 386 387 387 // Karatsuba-Multiplikation (Weimerskirch/Paar Alg. 1), ACHTUNG VORLÃUFIGE VERSION, macht noch Fehler beim Grad und ist unelegant !!! 388 Q_polyQ_poly::Q_poly_mult_ka(const Q_poly A, const Q_poly B)388 void Q_poly::Q_poly_mult_ka(const Q_poly A, const Q_poly B) 389 389 { 390 390 // GröÃeren Grad feststellen … … 436 436 //Skalare Divisionen 437 437 438 Q_polyQ_poly::Q_poly_scalar_div(const Q_poly g, const mpz_t n)438 void Q_poly::Q_poly_scalar_div(const Q_poly g, const mpz_t n) 439 439 { 440 440 if (mpz_sgn(n)!=0) // ÃŒberprÃŒft Teilung durch 0 … … 446 446 447 447 448 Q_polyQ_poly::Q_poly_scalar_div_to(const mpz_t n)448 void Q_poly::Q_poly_scalar_div_to(const mpz_t n) 449 449 { 450 450 this->Q_poly_scalar_div(*this,n); … … 452 452 453 453 // Division durch Monom - Quotient 454 Q_polyQ_poly::Q_poly_mon_div(const Q_poly f, const int n)454 void Q_poly::Q_poly_mon_div(const Q_poly f, const int n) 455 455 { 456 456 if (f.deg<n) … … 471 471 472 472 // Division durch Monom - Rest 473 Q_polyQ_poly::Q_poly_mon_div_rem(const Q_poly f, const int n)473 void Q_poly::Q_poly_mon_div_rem(const Q_poly f, const int n) 474 474 { 475 475 if (f.deg<n) … … 501 501 // Euklidische Division nach Cohen Algo 3.1.1 (degA muss gröÃer gleich deg B sein)!! 502 502 503 Q_polyQ_poly::Q_poly_div_rem(const Q_poly A, const Q_poly B)503 void Q_poly::Q_poly_div_rem(const Q_poly A, const Q_poly B) 504 504 { 505 505 … … 549 549 //To Variante von Algo 3.1.1 im Cohen 550 550 551 Q_polyQ_poly::Q_poly_div_rem_to(const Q_poly B)551 void Q_poly::Q_poly_div_rem_to(const Q_poly B) 552 552 { 553 553 this->Q_poly_div_rem(*this,B); … … 556 556 557 557 // Division nach Cohen 3.1.2 (gibt R und Q aus) --> FÃŒhrt Pseudo-Division durch, korrigiert den Faktor aber im Nenner 558 Q_polyQ_poly::Q_poly_div(Q_poly &Q, Q_poly &R, const Q_poly A, const Q_poly B)558 void Q_poly::Q_poly_div(Q_poly &Q, Q_poly &R, const Q_poly A, const Q_poly B) 559 559 { 560 560 … … 613 613 //To Variante der exakten Division 614 614 615 Q_polyQ_poly::Q_poly_div_to(Q_poly &Q,Q_poly &R,const Q_poly B)615 void Q_poly::Q_poly_div_to(Q_poly &Q,Q_poly &R,const Q_poly B) 616 616 { 617 617 this->Q_poly_div(Q,R,*this,B); … … 622 622 623 623 // a := a*b + c 624 Q_polyQ_poly::Q_poly_multadd_to(const Q_poly b, const Q_poly c)624 void Q_poly::Q_poly_multadd_to(const Q_poly b, const Q_poly c) 625 625 { 626 626 Q_poly_mult_n_to(b); … … 629 629 630 630 //a=a*b-c 631 Q_polyQ_poly::Q_poly_multsub_to(const Q_poly b, const Q_poly c)631 void Q_poly::Q_poly_multsub_to(const Q_poly b, const Q_poly c) 632 632 { 633 633 Q_poly_mult_n_to(b); … … 639 639 /* 640 640 // a := (a+b)* c 641 Q_polyQ_poly::poly_addmult_to(const Q_poly b, const Q_poly c)641 void Q_poly::poly_addmult_to(const Q_poly b, const Q_poly c) 642 642 { 643 643 Q_poly a(deg,coef); … … 685 685 686 686 //setze Q_polynom auf Q_polynom b 687 Q_polyQ_poly::Q_poly_set(const Q_poly b)687 void Q_poly::Q_poly_set(const Q_poly b) 688 688 { 689 689 deg=b.deg; … … 698 698 699 699 // setze Q_polynom auf konstantes Q_polynom b/d 700 Q_polyQ_poly::Q_poly_set(const mpz_t b, const mpz_t d)700 void Q_poly::Q_poly_set(const mpz_t b, const mpz_t d) 701 701 { 702 702 deg=0; … … 706 706 707 707 // setze Q_polynom auf konstantes Z_polynom b 708 Q_polyQ_poly::Q_poly_set(const mpz_t b)708 void Q_poly::Q_poly_set(const mpz_t b) 709 709 { 710 710 deg=0; … … 715 715 716 716 //setze Q_polynom auf Nullpolynom 717 Q_polyQ_poly::Q_poly_set_zero()717 void Q_poly::Q_poly_set_zero() 718 718 { 719 719 deg = -1; … … 743 743 744 744 //ÃberprÃŒft ob das Q_polynom 0 ist 745 int Q_poly::is_zero() 745 int Q_poly::is_zero() const 746 746 { 747 747 if (deg<0) … … 754 754 755 755 //ÃberprÃŒft ob das Q_polynom 1 ist 756 int Q_poly::is_one() 756 int Q_poly::is_one() const 757 757 { 758 758 if (deg==0) … … 764 764 } 765 765 766 int Q_poly::is_monic() 766 int Q_poly::is_monic() const 767 767 { 768 768 if (mpz_cmp(coef[deg],denom)==0) … … 774 774 // klassischer GGT nach Cohen 3.2.1 775 775 776 Q_polyQ_poly::Q_poly_gcd(Q_poly A, Q_poly B)776 void Q_poly::Q_poly_gcd(Q_poly A, Q_poly B) 777 777 { 778 778 … … 805 805 // Nach nach Fieker 2.12 Symbolisches Rechnen (2012) MACHT PROBLEME 806 806 // gibt g=s*A+t*B aus 807 Q_polyQ_poly::Q_poly_extgcd(Q_poly &s,Q_poly &t,Q_poly &g, Q_poly A, Q_poly B)807 void Q_poly::Q_poly_extgcd(Q_poly &s,Q_poly &t,Q_poly &g, Q_poly A, Q_poly B) 808 808 { 809 809 if (A.deg<B.deg) -
libpolys/coeffs/AEQ.h
rca4d699 reeb5b0c 26 26 27 27 //Reduktion modulo p 28 Q_polyQ_poly_reduce();29 Q_polyQ_poly_extend(mpz_t);28 void Q_poly_reduce(); 29 void Q_poly_extend(mpz_t); 30 30 31 31 // Arithmetische Operationen … … 34 34 // Additionen 35 35 36 Q_polyQ_poly_add(const Q_poly , const Q_poly );37 Q_polyQ_poly_add_to(const Q_poly);38 Q_polyQ_poly_add_mon(const Q_poly,mpz_t, int); //addiert Monome zu Q_polynom39 Q_polyQ_poly_add_mon_to(mpz_t,int);40 Q_polyQ_poly_add_const( Q_poly, const mpz_t);41 Q_polyQ_poly_add_const_to(const mpz_t);36 void Q_poly_add(const Q_poly , const Q_poly ); 37 void Q_poly_add_to(const Q_poly); 38 void Q_poly_add_mon(const Q_poly,mpz_t, int); //addiert Monome zu Q_polynom 39 void Q_poly_add_mon_to(mpz_t,int); 40 void Q_poly_add_const( Q_poly, const mpz_t); 41 void Q_poly_add_const_to(const mpz_t); 42 42 43 43 // Subtraktion 44 44 45 Q_polyQ_poly_sub(const Q_poly , const Q_poly );46 Q_polyQ_poly_sub_to(const Q_poly);47 Q_polyQ_poly_sub_mon(const Q_poly,mpz_t,int);48 Q_polyQ_poly_sub_mon_to(mpz_t,int);49 Q_polyQ_poly_sub_const( Q_poly, const mpz_t);50 Q_polyQ_poly_sub_const_to(const mpz_t);45 void Q_poly_sub(const Q_poly , const Q_poly ); 46 void Q_poly_sub_to(const Q_poly); 47 void Q_poly_sub_mon(const Q_poly,mpz_t,int); 48 void Q_poly_sub_mon_to(mpz_t,int); 49 void Q_poly_sub_const( Q_poly, const mpz_t); 50 void Q_poly_sub_const_to(const mpz_t); 51 51 52 52 //Multiplikationen 53 53 54 Q_polyQ_poly_mult_n(Q_poly,Q_poly);55 Q_polyQ_poly_mult_n_to(const Q_poly);56 Q_polyQ_poly_mult_ka(const Q_poly, const Q_poly);57 Q_polyQ_poly_scalar_mult(const mpz_t ,const Q_poly);58 Q_polyQ_poly_scalar_mult(const Q_poly, const mpz_t);59 Q_polyQ_poly_scalar_mult_to(const mpz_t);60 Q_polyQ_poly_neg();61 Q_polyQ_poly_mon_mult(const Q_poly, const int);62 Q_polyQ_poly_mon_mult_to(const int);54 void Q_poly_mult_n(Q_poly,Q_poly); 55 void Q_poly_mult_n_to(const Q_poly); 56 void Q_poly_mult_ka(const Q_poly, const Q_poly); 57 void Q_poly_scalar_mult(const mpz_t ,const Q_poly); 58 void Q_poly_scalar_mult(const Q_poly, const mpz_t); 59 void Q_poly_scalar_mult_to(const mpz_t); 60 void Q_poly_neg(); 61 void Q_poly_mon_mult(const Q_poly, const int); 62 void Q_poly_mon_mult_to(const int); 63 63 64 64 //Divisionen 65 Q_polyQ_poly_div(Q_poly&, Q_poly&,const Q_poly, const Q_poly); // exakte Division66 Q_polyQ_poly_div_to(Q_poly&, Q_poly&,const Q_poly); // To Variante exakte Division67 Q_polyQ_poly_scalar_div(const Q_poly, const mpz_t); // Dividiert Polynom durch ganze Zahl68 Q_polyQ_poly_scalar_div_to(const mpz_t);69 Q_polyQ_poly_div_rem(const Q_poly, const Q_poly); //Division mit Rest70 Q_polyQ_poly_div_rem_to(const Q_poly);71 Q_polyQ_poly_mon_div(const Q_poly, const int); //Division durch Monom72 Q_polyQ_poly_mon_div_rem(const Q_poly, const int);65 void Q_poly_div(Q_poly&, Q_poly&,const Q_poly, const Q_poly); // exakte Division 66 void Q_poly_div_to(Q_poly&, Q_poly&,const Q_poly); // To Variante exakte Division 67 void Q_poly_scalar_div(const Q_poly, const mpz_t); // Dividiert Polynom durch ganze Zahl 68 void Q_poly_scalar_div_to(const mpz_t); 69 void Q_poly_div_rem(const Q_poly, const Q_poly); //Division mit Rest 70 void Q_poly_div_rem_to(const Q_poly); 71 void Q_poly_mon_div(const Q_poly, const int); //Division durch Monom 72 void Q_poly_mon_div_rem(const Q_poly, const int); 73 73 74 74 //Kombinationen 75 75 76 Q_polyQ_poly_multadd_to(const Q_poly, const Q_poly); //a=a*b+c77 Q_polyQ_poly_multsub_to(const Q_poly,const Q_poly); //a=a*b-c76 void Q_poly_multadd_to(const Q_poly, const Q_poly); //a=a*b+c 77 void Q_poly_multsub_to(const Q_poly,const Q_poly); //a=a*b-c 78 78 //Q_poly Q_poly_addmult_to(const Q_poly, const Q_poly); 79 79 … … 82 82 83 83 // Sonstige Operationen 84 Q_polyQ_poly_set(const Q_poly);85 Q_polyQ_poly_set(const mpz_t); // Setzt Q_polynom auf Konstante aus Z86 Q_polyQ_poly_set(const mpz_t, const mpz_t); // Setzt Q_polynom auf Konstante aus Q87 Q_polyQ_poly_set_zero(); // Setzt Q_polynom auf 084 void Q_poly_set(const Q_poly); 85 void Q_poly_set(const mpz_t); // Setzt Q_polynom auf Konstante aus Z 86 void Q_poly_set(const mpz_t, const mpz_t); // Setzt Q_polynom auf Konstante aus Q 87 void Q_poly_set_zero(); // Setzt Q_polynom auf 0 88 88 void Q_poly_horner(mpz_t, const mpz_t); // Wertet Q_polynom mittels Horner-Schema an einer Stelle aus 89 89 void Q_poly_horner_Q_poly(Q_poly, const Q_poly); //Setzt Q_polynom in Q_polynom mittels Horner Schema ein 90 Q_polyQ_poly_gcd(Q_poly,Q_poly); //Standard GGT91 Q_polyQ_poly_extgcd(Q_poly &,Q_poly &,Q_poly &, Q_poly, Q_poly); //Erweiterter Standard GGT90 void Q_poly_gcd(Q_poly,Q_poly); //Standard GGT 91 void Q_poly_extgcd(Q_poly &,Q_poly &,Q_poly &, Q_poly, Q_poly); //Erweiterter Standard GGT 92 92 int is_equal(Q_poly &); // Test auf Gleichheit 93 int is_zero() ; // Test auf Gleichheit mit 094 int is_one() ; // Test auf Gleichheit mit 195 int is_monic() ; // testet, ob das Q_polynom normiert ist93 int is_zero() const; // Test auf Gleichheit mit 0 94 int is_one() const; // Test auf Gleichheit mit 1 95 int is_monic() const; // testet, ob das Q_polynom normiert ist 96 96 97 97 // Ein und Ausgabe -
libpolys/coeffs/AEp.cc
rca4d699 reeb5b0c 47 47 //Reduktion modulo p 48 48 49 p_polyp_poly::p_poly_reduce(p_poly f,int p)49 void p_poly::p_poly_reduce(p_poly f,int p) 50 50 { 51 51 if (f.is_zero()==0) … … 70 70 71 71 //Standard - Addition 72 p_polyp_poly::p_poly_add(const p_poly a, const p_poly b)72 void p_poly::p_poly_add(const p_poly a, const p_poly b) 73 73 { 74 74 if (a.deg >=b.deg) … … 102 102 //Ãberschreibende Addition 103 103 104 p_polyp_poly::p_poly_add_to(const p_poly g)104 void p_poly::p_poly_add_to(const p_poly g) 105 105 { 106 106 this->p_poly_add(*this,g); … … 108 108 109 109 //Addition einer Konstanten 110 p_polyp_poly::p_poly_add_const(p_poly f,const mpz_t a)110 void p_poly::p_poly_add_const(p_poly f,const mpz_t a) 111 111 { 112 112 if (f.is_zero()==1 && mpz_divisible_ui_p(a,f.mod)==0) … … 129 129 //To Variante Addition einer Konstanten 130 130 131 p_polyp_poly::p_poly_add_const_to(const mpz_t a)131 void p_poly::p_poly_add_const_to(const mpz_t a) 132 132 { 133 133 this->p_poly_add_const(*this,a); … … 135 135 136 136 //Monom Addition 137 p_polyp_poly::p_poly_add_mon(const p_poly f, mpz_t a, int i)137 void p_poly::p_poly_add_mon(const p_poly f, mpz_t a, int i) 138 138 { 139 139 p_poly_set(f); … … 177 177 178 178 //To Variante Monomaddition 179 p_polyp_poly::p_poly_add_mon_to(mpz_t a, int i)179 void p_poly::p_poly_add_mon_to(mpz_t a, int i) 180 180 { 181 181 … … 218 218 //Subtraktionen 219 219 220 p_polyp_poly::p_poly_sub(const p_poly a, const p_poly b)220 void p_poly::p_poly_sub(const p_poly a, const p_poly b) 221 221 { 222 222 if (a.deg >=b.deg) … … 250 250 //Ãberschreibende Subtraktion 251 251 252 p_polyp_poly::p_poly_sub_to(const p_poly b)252 void p_poly::p_poly_sub_to(const p_poly b) 253 253 { 254 254 this->p_poly_sub(*this,b); … … 256 256 257 257 //Subtraktion einer Konstanten 258 p_polyp_poly::p_poly_sub_const(p_poly f,const mpz_t a)258 void p_poly::p_poly_sub_const(p_poly f,const mpz_t a) 259 259 { 260 260 if (f.is_zero()==1) … … 278 278 //To Variante Subtraktion einer Konstanten 279 279 280 p_polyp_poly::p_poly_sub_const_to(const mpz_t a)280 void p_poly::p_poly_sub_const_to(const mpz_t a) 281 281 { 282 282 this->p_poly_sub_const(*this,a); … … 285 285 286 286 //Monom Subtraktion 287 p_polyp_poly::p_poly_sub_mon(const p_poly f , mpz_t a, int i)287 void p_poly::p_poly_sub_mon(const p_poly f , mpz_t a, int i) 288 288 { 289 289 mpz_t temp; … … 293 293 294 294 //To Variante Monomaddition 295 p_polyp_poly::p_poly_sub_mon_to(mpz_t a, int i)295 void p_poly::p_poly_sub_mon_to(mpz_t a, int i) 296 296 { 297 297 mpz_t temp; … … 304 304 305 305 //Multiplikation mit Monom 306 p_polyp_poly::p_poly_mon_mult( p_poly f, int n)306 void p_poly::p_poly_mon_mult( p_poly f, int n) 307 307 { 308 308 if (f.is_zero()==1) … … 328 328 } 329 329 330 p_polyp_poly::p_poly_mon_mult_to(const int n)330 void p_poly::p_poly_mon_mult_to(const int n) 331 331 { 332 332 this->p_poly_mon_mult(*this,n); … … 336 336 //Multiplikation mit Skalar 337 337 338 p_polyp_poly::p_poly_scalar_mult(const p_poly g, const mpz_t n)338 void p_poly::p_poly_scalar_mult(const p_poly g, const mpz_t n) 339 339 { 340 340 if (mpz_divisible_ui_p(n,g.mod)!=0) … … 357 357 358 358 359 p_polyp_poly::p_poly_scalar_mult(const mpz_t n, const p_poly g)359 void p_poly::p_poly_scalar_mult(const mpz_t n, const p_poly g) 360 360 { 361 361 if (mpz_divisible_ui_p(n,g.mod)!=0) … … 382 382 383 383 384 p_polyp_poly::p_poly_scalar_mult_to(const mpz_t n)384 void p_poly::p_poly_scalar_mult_to(const mpz_t n) 385 385 { 386 386 this->p_poly_scalar_mult(*this,n); … … 391 391 // Negation 392 392 393 p_polyp_poly::p_poly_neg()393 void p_poly::p_poly_neg() 394 394 { 395 395 for (int i=0;i<=deg;i++) … … 400 400 401 401 // Naive Multiplikation 402 p_polyp_poly::p_poly_mult_n(p_poly a,p_poly b)402 void p_poly::p_poly_mult_n(p_poly a,p_poly b) 403 403 { 404 404 //Reduktion mod p … … 452 452 //Ãberschreibende Multiplikation 453 453 454 p_polyp_poly::p_poly_mult_n_to(const p_poly g)454 void p_poly::p_poly_mult_n_to(const p_poly g) 455 455 { 456 456 this->p_poly_mult_n(*this,g); … … 459 459 460 460 // Karatsuba-Multiplikation (Weimerskirch/Paar Alg. 1), ACHTUNG VORLÃUFIGE VERSION, macht noch Fehler beim Grad und ist unelegant !!! 461 p_polyp_poly::p_poly_mult_ka( p_poly A, p_poly B)461 void p_poly::p_poly_mult_ka( p_poly A, p_poly B) 462 462 { 463 463 … … 528 528 //Skalare Divisionen 529 529 530 p_polyp_poly::p_poly_scalar_div( const p_poly g, const mpz_t n)530 void p_poly::p_poly_scalar_div( const p_poly g, const mpz_t n) 531 531 { 532 532 … … 556 556 557 557 558 p_polyp_poly::p_poly_scalar_div_to(const mpz_t n)558 void p_poly::p_poly_scalar_div_to(const mpz_t n) 559 559 { 560 560 this->p_poly_scalar_div(*this,n); … … 562 562 563 563 // Division durch Monom - Quotient 564 p_polyp_poly::p_poly_mon_div(const p_poly f, const int n)564 void p_poly::p_poly_mon_div(const p_poly f, const int n) 565 565 { 566 566 if (f.deg<n) … … 581 581 582 582 // Division durch Monom - Rest 583 p_polyp_poly::p_poly_mon_div_rem(const p_poly f, const int n)583 void p_poly::p_poly_mon_div_rem(const p_poly f, const int n) 584 584 { 585 585 if (f.deg<n) … … 605 605 //Euklidische Division nach Cohen Algo 3.1.1 (degA muss gröÃer gleich deg B sein)!! 606 606 607 p_polyp_poly::p_poly_div_rem( p_poly A, p_poly B)607 void p_poly::p_poly_div_rem( p_poly A, p_poly B) 608 608 { 609 609 … … 650 650 //To Variante von Algo 3.1.1 im Cohen 651 651 652 p_polyp_poly::p_poly_div_rem_to(const p_poly B)652 void p_poly::p_poly_div_rem_to(const p_poly B) 653 653 { 654 654 this->p_poly_div_rem(*this,B); … … 660 660 661 661 //Exakte Division nach Cohen 3.1.1 662 p_polyp_poly::p_poly_div(p_poly &Q, p_poly &R, p_poly A, p_poly B)662 void p_poly::p_poly_div(p_poly &Q, p_poly &R, p_poly A, p_poly B) 663 663 { 664 664 if (B.is_zero()==0) … … 716 716 //To Varainte der exakten Division 717 717 718 p_polyp_poly::p_poly_div_to(p_poly &Q,p_poly &R, p_poly B)718 void p_poly::p_poly_div_to(p_poly &Q,p_poly &R, p_poly B) 719 719 { 720 720 this->p_poly_div(Q ,R,*this,B); … … 725 725 726 726 // a := a*b + c 727 p_polyp_poly::p_poly_multadd_to(const p_poly b, const p_poly c)727 void p_poly::p_poly_multadd_to(const p_poly b, const p_poly c) 728 728 { 729 729 p_poly_mult_n_to(b); … … 732 732 733 733 //a=a*b-c 734 p_polyp_poly::p_poly_multsub_to(const p_poly b, const p_poly c)734 void p_poly::p_poly_multsub_to(const p_poly b, const p_poly c) 735 735 { 736 736 p_poly_mult_n_to(b); … … 742 742 /* 743 743 // a := (a+b)* c 744 p_polyp_poly::poly_addmult_to(const p_poly b, const p_poly c)744 void p_poly::poly_addmult_to(const p_poly b, const p_poly c) 745 745 { 746 746 p_poly a(deg,coef); … … 800 800 801 801 //setze p_polynom auf p_polynom b 802 p_polyp_poly::p_poly_set(const p_poly b)802 void p_poly::p_poly_set(const p_poly b) 803 803 { 804 804 deg=b.deg; … … 814 814 815 815 // setze p_polynom auf konstantes p_polynom b 816 p_polyp_poly::p_poly_set(const mpz_t b,int p)816 void p_poly::p_poly_set(const mpz_t b,int p) 817 817 { 818 818 deg=0; … … 832 832 833 833 //setze p_polynom auf Nullpolynom 834 p_polyp_poly::p_poly_set_zero()834 void p_poly::p_poly_set_zero() 835 835 { 836 836 deg = -1; … … 840 840 //Vergleiche ob 2 p_polynome gleich return 1 falls ja sont 0 841 841 842 int p_poly::is_equal(const p_poly g) 842 int p_poly::is_equal(const p_poly g) const 843 843 { 844 844 if (deg!=g.deg) … … 856 856 //ÃberprÃŒft ob das p_polynom 0 ist 857 857 858 int p_poly::is_zero() 858 int p_poly::is_zero() const 859 859 { 860 860 if (deg<0) … … 865 865 } 866 866 867 int p_poly::is_one() 867 int p_poly::is_one() const 868 868 { 869 869 if (deg==0) … … 875 875 } 876 876 877 int p_poly::is_monic() 877 int p_poly::is_monic() const 878 878 { 879 879 if (mpz_cmpabs_ui(coef[deg],1)==0) … … 885 885 // klassischer GGT nach Cohen 3.2.1 886 886 887 p_polyp_poly::p_poly_gcd( p_poly A, p_poly B)887 void p_poly::p_poly_gcd( p_poly A, p_poly B) 888 888 { 889 889 … … 917 917 //Nach nach Fieker 2.12 Symbolisches Rechnen (2012) 918 918 // gibt g=s*A+t*B aus 919 p_polyp_poly::p_poly_extgcd(p_poly &s,p_poly &t,p_poly &g, p_poly A, p_poly B)919 void p_poly::p_poly_extgcd(p_poly &s,p_poly &t,p_poly &g, p_poly A, p_poly B) 920 920 { 921 921 -
libpolys/coeffs/AEp.h
rca4d699 reeb5b0c 26 26 27 27 //Reduktion modulo p 28 p_polyp_poly_reduce(p_poly, int);28 void p_poly_reduce(p_poly, int); 29 29 30 30 // Arithmetische Operationen … … 33 33 // Additionen 34 34 35 p_polyp_poly_add(const p_poly , const p_poly );36 p_polyp_poly_add_to(const p_poly);37 p_polyp_poly_add_mon(const p_poly,mpz_t, int); //addiert Monome zu p_polynom38 p_polyp_poly_add_mon_to(mpz_t,int);39 p_polyp_poly_add_const( p_poly, const mpz_t);40 p_polyp_poly_add_const_to(const mpz_t);35 void p_poly_add(const p_poly , const p_poly ); 36 void p_poly_add_to(const p_poly); 37 void p_poly_add_mon(const p_poly,mpz_t, int); //addiert Monome zu p_polynom 38 void p_poly_add_mon_to(mpz_t,int); 39 void p_poly_add_const( p_poly, const mpz_t); 40 void p_poly_add_const_to(const mpz_t); 41 41 42 42 // Subtraktion 43 43 44 p_polyp_poly_sub(const p_poly , const p_poly );45 p_polyp_poly_sub_to(const p_poly);46 p_polyp_poly_sub_mon(const p_poly,mpz_t,int);47 p_polyp_poly_sub_mon_to(mpz_t,int);48 p_polyp_poly_sub_const( p_poly, const mpz_t);49 p_polyp_poly_sub_const_to(const mpz_t);44 void p_poly_sub(const p_poly , const p_poly ); 45 void p_poly_sub_to(const p_poly); 46 void p_poly_sub_mon(const p_poly,mpz_t,int); 47 void p_poly_sub_mon_to(mpz_t,int); 48 void p_poly_sub_const( p_poly, const mpz_t); 49 void p_poly_sub_const_to(const mpz_t); 50 50 51 51 //Multiplikationen 52 52 53 p_polyp_poly_mult_n(p_poly,p_poly);54 p_polyp_poly_mult_n_to(const p_poly);55 p_polyp_poly_mult_ka( p_poly, p_poly);56 p_polyp_poly_scalar_mult(const mpz_t ,const p_poly);57 p_polyp_poly_scalar_mult(const p_poly, const mpz_t);58 p_polyp_poly_scalar_mult_to(const mpz_t);59 p_polyp_poly_neg();60 p_polyp_poly_mon_mult( p_poly, const int);61 p_polyp_poly_mon_mult_to(const int);53 void p_poly_mult_n(p_poly,p_poly); 54 void p_poly_mult_n_to(const p_poly); 55 void p_poly_mult_ka( p_poly, p_poly); 56 void p_poly_scalar_mult(const mpz_t ,const p_poly); 57 void p_poly_scalar_mult(const p_poly, const mpz_t); 58 void p_poly_scalar_mult_to(const mpz_t); 59 void p_poly_neg(); 60 void p_poly_mon_mult( p_poly, const int); 61 void p_poly_mon_mult_to(const int); 62 62 63 63 //Divisionen 64 p_polyp_poly_div(p_poly&, p_poly&, p_poly, p_poly); // exakte Division65 p_polyp_poly_div_to(p_poly&, p_poly&, p_poly); // To Variante exakte Division66 p_polyp_poly_scalar_div(const p_poly, const mpz_t n); // Multipliziert konstante an Polynom67 p_polyp_poly_scalar_div_to(const mpz_t n);68 p_polyp_poly_div_rem( p_poly, p_poly);//Division mit Rest69 p_polyp_poly_div_rem_to( p_poly);70 p_polyp_poly_mon_div(const p_poly, const int); //Division durch MOnom71 p_polyp_poly_mon_div_rem(const p_poly, const int);64 void p_poly_div(p_poly&, p_poly&, p_poly, p_poly); // exakte Division 65 void p_poly_div_to(p_poly&, p_poly&, p_poly); // To Variante exakte Division 66 void p_poly_scalar_div(const p_poly, const mpz_t n); // Multipliziert konstante an Polynom 67 void p_poly_scalar_div_to(const mpz_t n); 68 void p_poly_div_rem( p_poly, p_poly);//Division mit Rest 69 void p_poly_div_rem_to( p_poly); 70 void p_poly_mon_div(const p_poly, const int); //Division durch MOnom 71 void p_poly_mon_div_rem(const p_poly, const int); 72 72 73 73 //Kombinationen 74 74 75 p_polyp_poly_multadd_to(const p_poly, const p_poly); //a=a*b+c76 p_polyp_poly_multsub_to(const p_poly,const p_poly); //a=a*b-c75 void p_poly_multadd_to(const p_poly, const p_poly); //a=a*b+c 76 void p_poly_multsub_to(const p_poly,const p_poly); //a=a*b-c 77 77 //p_poly p_poly_addmult_to(const p_poly, const p_poly); 78 78 … … 81 81 82 82 // Sonstige Operationen 83 p_polyp_poly_set(const p_poly);84 p_polyp_poly_set(const mpz_t,int); // Setzt p_polynom auf Konstante85 p_polyp_poly_set_zero(); // Setzt p_polynom auf 083 void p_poly_set(const p_poly); 84 void p_poly_set(const mpz_t,int); // Setzt p_polynom auf Konstante 85 void p_poly_set_zero(); // Setzt p_polynom auf 0 86 86 void p_poly_horner(mpz_t, const mpz_t); // Wertet p_polynom mittels Horner-Schema an einer Stelle aus 87 87 void p_poly_horner_p_poly(p_poly, p_poly); //Setzt p_polynom in p_polynom mittels Horner Schema ein 88 p_polyp_poly_gcd(p_poly,p_poly); //Standard GGT89 p_polyp_poly_extgcd(p_poly &,p_poly &,p_poly &, p_poly, p_poly); //Erweiterter Standard GGT90 int is_equal(const p_poly) ; // Test auf Gleichheit91 int is_zero() ; // Test auf Gleichheit mit 092 int is_one() ; // Test auf Gleichheit mit 193 int is_monic() ; // testet, ob das p_polynom normiert ist88 void p_poly_gcd(p_poly,p_poly); //Standard GGT 89 void p_poly_extgcd(p_poly &,p_poly &,p_poly &, p_poly, p_poly); //Erweiterter Standard GGT 90 int is_equal(const p_poly) const; // Test auf Gleichheit 91 int is_zero() const; // Test auf Gleichheit mit 0 92 int is_one() const; // Test auf Gleichheit mit 1 93 int is_monic() const; // testet, ob das p_polynom normiert ist 94 94 95 95 // Ein und Ausgabe -
libpolys/coeffs/OPAE.cc
rca4d699 reeb5b0c 28 28 // DEFINITION DER FUNKTIONEN 29 29 30 number nAEAdd(number a, number b, const coeffs r)30 number nAEAdd(number a, number b, const coeffs) 31 31 { 32 32 int_poly* f=reinterpret_cast<int_poly*> (a); … … 38 38 } 39 39 40 number nAEMult(number a, number b, const coeffs r)40 number nAEMult(number a, number b, const coeffs) 41 41 { 42 42 int_poly* f=reinterpret_cast<int_poly*> (a); … … 48 48 } 49 49 50 number nAESub(number a, number b, const coeffs r)50 number nAESub(number a, number b, const coeffs) 51 51 { 52 52 int_poly* f=reinterpret_cast<int_poly*> (a); … … 59 59 60 60 61 number nAEDiv(number a, number b, const coeffs r)61 number nAEDiv(number a, number b, const coeffs) 62 62 { 63 63 int_poly* f=reinterpret_cast<int_poly*> (a); … … 70 70 71 71 72 number nAEIntDiv(number a, number b, const coeffs r)72 number nAEIntDiv(number a, number b, const coeffs) 73 73 { 74 74 … … 81 81 } 82 82 83 number nAEIntMod(number a, number b,const coeffs r)83 number nAEIntMod(number a, number, const coeffs) 84 84 { 85 85 return a; 86 86 } 87 87 88 number nAEExactDiv(number a, number b, const coeffs r)88 number nAEExactDiv(number a, number b, const coeffs) 89 89 { 90 90 int_poly* f=reinterpret_cast<int_poly*> (a); … … 98 98 99 99 100 number nAEInit(long i, const coeffs r)100 number nAEInit(long i, const coeffs) 101 101 { 102 102 mpz_t m; 103 mpz_init_set_ui(m, i);103 mpz_init_set_ui(m, i); 104 104 int_poly* res=new int_poly; 105 105 res->poly_set(m); … … 108 108 } 109 109 110 number nAEInitMPZ(mpz_t m, const coeffs r)110 number nAEInitMPZ(mpz_t m, const coeffs) 111 111 { 112 112 int_poly* res=new int_poly; … … 117 117 118 118 119 int nAESize (number a, const coeffs r)119 int nAESize (number a, const coeffs) 120 120 { 121 121 int_poly* f=reinterpret_cast<int_poly*> (a); … … 123 123 } 124 124 125 int nAEInt(number & a,const coeffs r)125 int nAEInt(number &, const coeffs) 126 126 { 127 127 return 1; … … 129 129 130 130 131 number nAEMPZ(number a, const coeffs r)131 number nAEMPZ(number a, const coeffs) 132 132 { 133 133 return a; … … 135 135 136 136 137 number nAENeg(number c, const coeffs r)137 number nAENeg(number c, const coeffs) 138 138 { 139 139 int_poly* f=reinterpret_cast<int_poly*> (c); … … 144 144 } 145 145 146 number nAECopy(number c, const coeffs r)146 number nAECopy(number c, const coeffs) 147 147 { 148 148 return (number) c; 149 149 } 150 150 151 number nAERePart(number c, const coeffs r)151 number nAERePart(number c, const coeffs) 152 152 { 153 153 return (number) c; 154 154 } 155 155 156 number nAEImPart(number c, const coeffs r)156 number nAEImPart(number c, const coeffs) 157 157 { 158 158 return (number) c; 159 159 } 160 160 161 void nAEWriteLong (number &a, const coeffs r)161 void nAEWriteLong (number &a, const coeffs) 162 162 { 163 163 int_poly* f=reinterpret_cast <int_poly*>(a); … … 166 166 } 167 167 168 void nAEWriteShort (number &a, const coeffs r)168 void nAEWriteShort (number &a, const coeffs) 169 169 { 170 170 int_poly* f=reinterpret_cast <int_poly*>(a); … … 174 174 175 175 176 const char * nAERead (const char * s, number *a,const coeffs r)176 const char * nAERead (const char *, number *, const coeffs) 177 177 { 178 178 char* c=new char; … … 181 181 } 182 182 183 number nAENormalize (number a, number b,const coeffs r) // ?183 number nAENormalize (number a, number, const coeffs) // ? 184 184 { 185 185 return a; 186 186 } 187 187 188 BOOLEAN nAEGreater (number a, number b, const coeffs r)188 BOOLEAN nAEGreater (number a, number b, const coeffs) 189 189 { 190 190 int_poly* f=reinterpret_cast<int_poly*> (a); … … 194 194 } 195 195 196 BOOLEAN nAEEqual (number a, number b, const coeffs r)196 BOOLEAN nAEEqual (number a, number b, const coeffs) 197 197 { 198 198 int_poly* f=reinterpret_cast<int_poly*> (a); … … 202 202 } 203 203 204 BOOLEAN nAEIsZero (number a, const coeffs r)204 BOOLEAN nAEIsZero (number a, const coeffs) 205 205 { 206 206 int_poly* f=reinterpret_cast<int_poly*> (a); … … 209 209 } 210 210 211 BOOLEAN nAEIsOne (number a, const coeffs r)211 BOOLEAN nAEIsOne (number a, const coeffs) 212 212 { 213 213 int_poly* f=reinterpret_cast<int_poly*> (a); … … 216 216 } 217 217 218 BOOLEAN nAEIsMOne (number a, const coeffs r)218 BOOLEAN nAEIsMOne (number a, const coeffs) 219 219 { 220 220 int_poly* f=reinterpret_cast<int_poly*> (a); … … 225 225 BOOLEAN nAEGreaterZero (number a, const coeffs r) 226 226 { 227 if (nAEIsZero(a, r) == FALSE) { return TRUE; }227 if (nAEIsZero(a, r) == FALSE) { return TRUE; } 228 228 else { return FALSE; } 229 229 } 230 230 231 void nAEPower (number a, int i, number * result,const coeffs r)231 void nAEPower (number, int, number *, const coeffs) 232 232 { 233 233 return; 234 234 } 235 235 236 number nAEGetDenom (number & a, const coeffs r)236 number nAEGetDenom (number &, const coeffs) 237 237 { 238 238 return (number) 1; 239 239 } 240 240 241 number nAEGetNumerator (number &a, const coeffs r)241 number nAEGetNumerator (number &a, const coeffs) 242 242 { 243 243 return a; 244 244 } 245 245 246 number nAEGcd (number a, number b,const coeffs r)246 number nAEGcd (number a, number b, const coeffs) 247 247 { 248 248 int_poly* f=reinterpret_cast<int_poly*> (a); … … 253 253 } 254 254 255 number nAELcm (number a, number b,const coeffs r)255 number nAELcm (number a, number b, const coeffs) 256 256 { 257 257 int_poly* f=reinterpret_cast<int_poly*> (a); … … 265 265 } 266 266 267 void nAEDelete (number * a, const coeffs r)267 void nAEDelete (number *, const coeffs) 268 268 { 269 269 return; … … 271 271 272 272 /* 273 number nAESetMap (number a, const coeffs r)273 number nAESetMap (number a, const coeffs) 274 274 { 275 275 return a; 276 276 } 277 277 */ 278 char* nAEName (number a, const coeffs r)278 char* nAEName (number, const coeffs) 279 279 { char *c=new char; 280 280 *c='c'; … … 282 282 } 283 283 284 void nAEInpMult (number & a, number b,const coeffs r)284 void nAEInpMult (number &, number, const coeffs) 285 285 { 286 286 return ; 287 287 } 288 288 289 void nAECoeffWrite (const coeffs r, BOOLEAN details)289 void nAECoeffWrite (const coeffs, BOOLEAN) 290 290 { 291 291 return; 292 292 } 293 293 294 BOOLEAN nAEClearContent (number a,const coeffs r)294 BOOLEAN nAEClearContent (number, const coeffs) 295 295 { 296 296 return FALSE; 297 297 } 298 298 299 BOOLEAN nAEClearDenominators (number a,const coeffs r)299 BOOLEAN nAEClearDenominators (number, const coeffs) 300 300 { 301 301 return FALSE; … … 307 307 308 308 309 BOOLEAN n_AEInitChar(coeffs r,void * p) // vlt noch void* p hin 310 { 311 309 BOOLEAN n_AEInitChar(coeffs r, void *) 310 { 312 311 r->ch = 0; 313 312 r->cfKillChar=NULL; -
libpolys/coeffs/OPAE.h
rca4d699 reeb5b0c 9 9 10 10 BOOLEAN n_AEInitChar(coeffs , void *); 11 BOOLEAN nAECoeffIsEqual (number a, number b, const coeffs r);11 BOOLEAN nAECoeffIsEqual (number a, number b, const coeffs r); 12 12 number nAEMult (number a, number b, const coeffs r); 13 number nAESub (number a, number b, const coeffs r);14 number nAEAdd (number a, number b, const coeffs r);15 number nAEDiv (number a, number b, const coeffs r);13 number nAESub (number a, number b, const coeffs r); 14 number nAEAdd (number a, number b, const coeffs r); 15 number nAEDiv (number a, number b, const coeffs r); 16 16 number nAEIntDiv (number a, number b, const coeffs r); //Hir wollte wir was gucken 17 17 number nAEIntMod (number a, number b, const coeffs r);// Hir wollte wir was gucken 18 number nAEExactDiv (number a, number b, const coeffs r);18 number nAEExactDiv (number a, number b, const coeffs r); 19 19 number nAEInit (long i, const coeffs r); 20 20 number nAEInitMPZ (mpz_t m, const coeffs r); //nachgucken/fragen 21 21 int nAESize (number a, const coeffs r);/// 22 int nAEInt (number &a, const coeffs r);23 number nAEMPZ (number a, const coeffs r); //nachgucken/fragen24 number nAENeg (number c, const coeffs r);25 number nAECopy (number a, number b, const coeffs r); // nachgicken26 number nAERePart (number a, number b, const coeffs r); // nachgicken27 number nAEImPart (number a, number b, const coeffs r); // nachgicken22 int nAEInt (number &a, const coeffs r); 23 number nAEMPZ (number a, const coeffs r); //nachgucken/fragen 24 number nAENeg (number c, const coeffs r); 25 number nAECopy (number a, number b, const coeffs r); // nachgicken 26 number nAERePart (number a, number b, const coeffs r); // nachgicken 27 number nAEImPart (number a, number b, const coeffs r); // nachgicken 28 28 29 29 void nAEWriteLong (number &a, const coeffs r);// … … 31 31 32 32 33 const char * nAERead (const char *s, number *a, const coeffs r);34 number nAENormalize (number a, number b,const coeffs r);//35 BOOLEAN nAEGreater (number a, number b, const coeffs r);//36 BOOLEAN nAEEqual (number a, number b, const coeffs r);37 BOOLEAN nAEIsZero (number a, const coeffs r);38 BOOLEAN nAEIsOne (number a, const coeffs r);39 BOOLEAN nAEIsMOne (number a, const coeffs r);40 BOOLEAN nAEGreaterZero (number a, number b, const coeffs r);41 void nAEPower (number a, int i, number * result, const coeffs r);33 const char * nAERead (const char *s, number *a, const coeffs r); 34 number nAENormalize (number a, number b, const coeffs r);// 35 BOOLEAN nAEGreater (number a, number b, const coeffs r);// 36 BOOLEAN nAEEqual (number a, number b, const coeffs r); 37 BOOLEAN nAEIsZero (number a, const coeffs r); 38 BOOLEAN nAEIsOne (number a, const coeffs r); 39 BOOLEAN nAEIsMOne (number a, const coeffs r); 40 BOOLEAN nAEGreaterZero (number a, number b, const coeffs r); 41 void nAEPower (number a, int i, number * result, const coeffs r); 42 42 number nAEGetDenom (number &a, const coeffs r);// 43 43 number nAEGetNumerator (number &a, const coeffs r);// 44 number nAEGcd (number a, number b,const coeffs r);45 number nAELcm (number a, number b,const coeffs r);44 number nAEGcd (number a, number b, const coeffs r); 45 number nAELcm (number a, number b, const coeffs r); 46 46 47 47 void nAEDelete (number *a, const coeffs r);// … … 51 51 void nAECoeffWrite (const coeffs r, BOOLEAN details);// 52 52 53 BOOLEAN nAEClearContent (number a, const coeffs r);//54 BOOLEAN nAEClearDenominators (number a, const coeffs r);//53 BOOLEAN nAEClearContent (number a, const coeffs r);// 54 BOOLEAN nAEClearDenominators (number a, const coeffs r);// 55 55 56 56 -
libpolys/coeffs/OPAEQ.cc
rca4d699 reeb5b0c 29 29 // DEFINITION DER FUNKTIONEN 30 30 31 number nAEQAdd(number a, number b, const coeffs r)31 number nAEQAdd(number a, number b, const coeffs) 32 32 { 33 33 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 39 39 } 40 40 41 number nAEQMult(number a, number b, const coeffs r)41 number nAEQMult(number a, number b, const coeffs) 42 42 { 43 43 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 49 49 } 50 50 51 number nAEQSub(number a, number b, const coeffs r)51 number nAEQSub(number a, number b, const coeffs) 52 52 { 53 53 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 60 60 61 61 62 number nAEQDiv(number a, number b, const coeffs r)62 number nAEQDiv(number a, number b, const coeffs) 63 63 { 64 64 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 72 72 73 73 74 number nAEQIntDiv(number a, number b, const coeffs r)74 number nAEQIntDiv(number a, number b, const coeffs) 75 75 { 76 76 … … 83 83 } 84 84 85 number nAEQIntMod(number a, number b,const coeffs r)85 number nAEQIntMod(number a, number, const coeffs) 86 86 { 87 87 return a; 88 88 } 89 89 90 number nAEQExactDiv(number a, number b, const coeffs r)90 number nAEQExactDiv(number a, number b, const coeffs) 91 91 { 92 92 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 101 101 102 102 103 number nAEQInit(long i, const coeffs r)103 number nAEQInit(long i, const coeffs) 104 104 { 105 105 number res = (number) i; … … 107 107 } 108 108 109 number nAEQInitMPZ(mpz_t m, const coeffs r)109 number nAEQInitMPZ(mpz_t m, const coeffs) 110 110 { 111 111 number res= (number) m; … … 113 113 } 114 114 115 int nAEQSize (number a, const coeffs r)115 int nAEQSize (number a, const coeffs) 116 116 { 117 117 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 119 119 } 120 120 121 int nAEQInt(number & a,const coeffs r)121 int nAEQInt(number &, const coeffs) 122 122 { 123 123 return 1; … … 125 125 126 126 127 number nAEQMPZ(number a, const coeffs r)127 number nAEQMPZ(number a, const coeffs) 128 128 { 129 129 return a; … … 131 131 132 132 133 number nAEQNeg(number c, const coeffs r)133 number nAEQNeg(number c, const coeffs) 134 134 { 135 135 Q_poly* f=reinterpret_cast<Q_poly*> (c); … … 140 140 } 141 141 142 number nAEQCopy(number c, const coeffs r)142 number nAEQCopy(number c, const coeffs) 143 143 { 144 144 return (number) c; 145 145 } 146 146 147 number nAEQRePart(number c, const coeffs r)147 number nAEQRePart(number c, const coeffs) 148 148 { 149 149 return (number) c; 150 150 } 151 151 152 number nAEQImPart(number c, const coeffs r)152 number nAEQImPart(number c, const coeffs) 153 153 { 154 154 return (number) c; 155 155 } 156 156 157 void nAEQWriteLong (number & a, const coeffs r)157 void nAEQWriteLong (number &, const coeffs) 158 158 { 159 159 return; 160 160 } 161 161 162 void nAEQWriteShort (number & a, const coeffs r)162 void nAEQWriteShort (number &, const coeffs) 163 163 { 164 164 return ; … … 166 166 167 167 168 const char * nAEQRead (const char * s, number *a,const coeffs r)168 const char * nAEQRead (const char *, number *, const coeffs) 169 169 { 170 170 return ""; 171 171 } 172 172 173 number nAEQNormalize (number a, number b,const coeffs r) // ?173 number nAEQNormalize (number a, number , const coeffs) // ? 174 174 { 175 175 return a; 176 176 } 177 177 178 BOOLEAN nAEQGreater (number a, number b, const coeffs r)178 BOOLEAN nAEQGreater (number a, number b, const coeffs) 179 179 { 180 180 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 184 184 } 185 185 186 BOOLEAN nAEQEqual (number a, number b, const coeffs r)186 BOOLEAN nAEQEqual (number a, number b, const coeffs) 187 187 { 188 188 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 192 192 } 193 193 194 BOOLEAN nAEQIsZero (number a, const coeffs r)194 BOOLEAN nAEQIsZero (number a, const coeffs) 195 195 { 196 196 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 199 199 } 200 200 201 BOOLEAN nAEQIsOne (number a, const coeffs r)201 BOOLEAN nAEQIsOne (number a, const coeffs) 202 202 { 203 203 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 206 206 } 207 207 208 BOOLEAN nAEQIsMOne (number a, const coeffs r)208 BOOLEAN nAEQIsMOne (number a, const coeffs) 209 209 { 210 210 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 215 215 BOOLEAN nAEQGreaterZero (number a, const coeffs r) 216 216 { 217 if (nAEQIsZero(a, r) == FALSE) { return TRUE; }217 if (nAEQIsZero(a, r) == FALSE) { return TRUE; } 218 218 else { return FALSE; } 219 219 } 220 220 221 void nAEQPower (number a, int i, number * result,const coeffs r)221 void nAEQPower (number, int, number *, const coeffs) 222 222 { 223 223 return; 224 224 } 225 225 226 number nAEQGetDenom (number & a, const coeffs r)226 number nAEQGetDenom (number &, const coeffs) 227 227 { 228 228 return (number) 1; 229 229 } 230 230 231 number nAEQGetNumerator (number &a, const coeffs r)231 number nAEQGetNumerator (number &a, const coeffs) 232 232 { 233 233 return a; 234 234 } 235 235 236 number nAEQGcd (number a, number b,const coeffs r)236 number nAEQGcd (number a, number b, const coeffs) 237 237 { 238 238 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 243 243 } 244 244 245 number nAEQLcm (number a, number b,const coeffs r)245 number nAEQLcm (number a, number b, const coeffs) 246 246 { 247 247 Q_poly* f=reinterpret_cast<Q_poly*> (a); … … 256 256 } 257 257 258 void nAEQDelete (number * a, const coeffs r)258 void nAEQDelete (number *, const coeffs) 259 259 { 260 260 return; … … 262 262 263 263 /* 264 number nAEQSetMap (number a, const coeffs r)264 number nAEQSetMap (number a, const coeffs) 265 265 { 266 266 return a; 267 267 } 268 268 */ 269 char* nAEQName (number a, const coeffs r)269 char* nAEQName (number, const coeffs) 270 270 { 271 271 char* c=new char; … … 275 275 } 276 276 277 void nAEQInpMult (number & a, number b,const coeffs r)277 void nAEQInpMult (number &, number, const coeffs) 278 278 { 279 279 return ; 280 280 } 281 281 282 void nAEQCoeffWrite (const coeffs r, BOOLEAN details)282 void nAEQCoeffWrite (const coeffs, BOOLEAN) 283 283 { 284 284 return; 285 285 } 286 286 287 BOOLEAN nAEQClearContent (number a,const coeffs r)287 BOOLEAN nAEQClearContent (number, const coeffs) 288 288 { 289 289 return FALSE; 290 290 } 291 291 292 BOOLEAN nAEQClearDenominators (number a,const coeffs r)292 BOOLEAN nAEQClearDenominators (number, const coeffs) 293 293 { 294 294 return FALSE; … … 300 300 301 301 302 BOOLEAN n_QAEInitChar(coeffs r,void *p) // vlt noch void* p hin 303 { 304 305 306 302 BOOLEAN n_QAEInitChar(coeffs r, void *) 303 { 307 304 r->ch=0; 308 305 r->cfKillChar=NULL; -
libpolys/coeffs/OPAEQ.h
rca4d699 reeb5b0c 9 9 10 10 BOOLEAN n_QAEInitChar(coeffs , void *); 11 BOOLEAN nAEQCoeffIsEqual (number a, number b, const coeffs r);11 BOOLEAN nAEQCoeffIsEqual (number a, number b, const coeffs r); 12 12 number nAEQMult (number a, number b, const coeffs r); 13 number nAEQSub (number a, number b, const coeffs r);14 number nAEQAdd (number a, number b, const coeffs r);15 number nAEQDiv (number a, number b, const coeffs r);13 number nAEQSub (number a, number b, const coeffs r); 14 number nAEQAdd (number a, number b, const coeffs r); 15 number nAEQDiv (number a, number b, const coeffs r); 16 16 number nAEQIntDiv (number a, number b, const coeffs r); //Hir wollte wir was gucken 17 17 number nAEQIntMod (number a, number b, const coeffs r);// Hir wollte wir was gucken 18 number nAEQExactDiv (number a, number b, const coeffs r);18 number nAEQExactDiv (number a, number b, const coeffs r); 19 19 number nAEQInit (long i, const coeffs r); 20 20 number nAEQInitMPZ (mpz_t m, const coeffs r); //nachgucken/fragen 21 21 int nAEQSize (number a, const coeffs r);/// 22 int nAEQInt (number &a, const coeffs r);23 number nAEQMPZ (number a, const coeffs r); //nachgucken/fragen24 number nAEQNeg (number c, const coeffs r);25 number nAEQCopy (number a, number b, const coeffs r); // nachgicken26 number nAEQRePart (number a, number b, const coeffs r); // nachgicken27 number nAEQImPart (number a, number b, const coeffs r); // nachgicken22 int nAEQInt (number &a, const coeffs r); 23 number nAEQMPZ (number a, const coeffs r); //nachgucken/fragen 24 number nAEQNeg (number c, const coeffs r); 25 number nAEQCopy (number a, number b, const coeffs r); // nachgicken 26 number nAEQRePart (number a, number b, const coeffs r); // nachgicken 27 number nAEQImPart (number a, number b, const coeffs r); // nachgicken 28 28 29 29 void nAEQWriteLong (number &a, const coeffs r);// … … 31 31 32 32 33 const char * nAEQRead (const char *s, number *a, const coeffs r);34 number nAEQNormalize (number a, number b,const coeffs r);//35 BOOLEAN nAEQGreater (number a, number b, const coeffs r);//36 BOOLEAN nAEQEqual (number a, number b, const coeffs r);37 BOOLEAN nAEQIsZero (number a, const coeffs r);38 BOOLEAN nAEQIsOne (number a, const coeffs r);39 BOOLEAN nAEQIsMOne (number a, const coeffs r);40 BOOLEAN nAEQGreaterZero (number a, number b, const coeffs r);41 void nAEQPower (number a, int i, number * result, const coeffs r);33 const char * nAEQRead (const char *s, number *a, const coeffs r); 34 number nAEQNormalize (number a, number b, const coeffs r);// 35 BOOLEAN nAEQGreater (number a, number b, const coeffs r);// 36 BOOLEAN nAEQEqual (number a, number b, const coeffs r); 37 BOOLEAN nAEQIsZero (number a, const coeffs r); 38 BOOLEAN nAEQIsOne (number a, const coeffs r); 39 BOOLEAN nAEQIsMOne (number a, const coeffs r); 40 BOOLEAN nAEQGreaterZero (number a, number b, const coeffs r); 41 void nAEQPower (number a, int i, number * result, const coeffs r); 42 42 number nAEQGetDenom (number &a, const coeffs r);// 43 43 number nAEQGetNumerator (number &a, const coeffs r);// 44 number nAEQGcd (number a, number b,const coeffs r);45 number nAEQLcm (number a, number b,const coeffs r);44 number nAEQGcd (number a, number b, const coeffs r); 45 number nAEQLcm (number a, number b, const coeffs r); 46 46 47 47 void nAEQDelete (number *a, const coeffs r);// … … 51 51 void nAEQCoeffWrite (const coeffs r, BOOLEAN details);// 52 52 53 BOOLEAN nAEQClearContent (number a, const coeffs r);//54 BOOLEAN nAEQClearDenominators (number a, const coeffs r);//53 BOOLEAN nAEQClearContent (number a, const coeffs r);// 54 BOOLEAN nAEQClearDenominators (number a, const coeffs r);// 55 55 56 56 -
libpolys/coeffs/OPAEp.cc
rca4d699 reeb5b0c 29 29 // DEFINITION DER FUNKTIONEN 30 30 31 number nAEpAdd(number a, number b, const coeffs r)31 number nAEpAdd(number a, number b, const coeffs) 32 32 { 33 33 p_poly* f=reinterpret_cast<p_poly*> (a); … … 39 39 } 40 40 41 number nAEpMult(number a, number b, const coeffs r)41 number nAEpMult(number a, number b, const coeffs) 42 42 { 43 43 p_poly* f=reinterpret_cast<p_poly*> (a); … … 49 49 } 50 50 51 number nAEpSub(number a, number b, const coeffs r)51 number nAEpSub(number a, number b, const coeffs) 52 52 { 53 53 p_poly* f=reinterpret_cast<p_poly*> (a); … … 60 60 61 61 62 number nAEpDiv(number a, number b, const coeffs r)62 number nAEpDiv(number a, number b, const coeffs) 63 63 { 64 64 p_poly* f=reinterpret_cast<p_poly*> (a); … … 72 72 73 73 74 number nAEpIntDiv(number a, number b, const coeffs r)74 number nAEpIntDiv(number a, number b, const coeffs) 75 75 { 76 76 … … 83 83 } 84 84 85 number nAEpIntMod(number a, number b,const coeffs r)85 number nAEpIntMod(number a, number, const coeffs) 86 86 { 87 87 return a; 88 88 } 89 89 90 number nAEpExactDiv(number a, number b, const coeffs r)90 number nAEpExactDiv(number a, number b, const coeffs) 91 91 {