Changeset f92fa13 in git
- Timestamp:
- Mar 16, 1998, 3:56:48 PM (25 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 5c8eae0ee4adf297d4ee70c4eb367499625899d8
- Parents:
- 057fd3b14dfe97c1070a5e6e9ea465fb317ae57f
- Location:
- Singular
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/ChangeLog
r057fd3 rf92fa13 1 1998-03-16 Olaf Bachmann <obachman@mathematik.uni-kl.de> 2 3 * polys-impl.h: #define COMP_FAST 4 5 * configure.in,Makefile.in: check for flex -P; increased version 6 number to 1.1.7 7 1 8 Fri Mar 13 16:16:27 MET 1998 hannes 2 9 * fixed: Singular crashed while changing the minpoly in GF(q) … … 16 23 made fixes requested by libparse (s.a. brackets, ....) 17 24 25 1998-03-04 Olaf Bachmann <obachman@mathematik.uni-kl.de> 26 27 * febase.h: added macro assume() 28 29 * spSpolyLoop.cc: Automatic generation of SpolyLoops using 30 spSpolyLoop.pl 31 32 * kstd*.cc: New calling interface to get SpolyLoop 33 34 * ring.h: Introduced rOrderType_t 35 18 36 Mon Mar 2 16:18:25 MET 1998 hannes 19 37 * changed handling of "echo" in examples: do not report file + lineno -
Singular/Makefile.in
r057fd3 rf92fa13 32 32 CC = @CC@ 33 33 CXX = @CXX@ 34 LEXP = @LEXP@ 34 35 BISON = bison 35 LEX = flex 36 PERL = perl 36 37 @SET_MAKE@ 37 38 INSTALL = ./install-sh -c … … 46 47 CXXFLAGS = @CXXFLAGS@ -pipe 47 48 CXXTEMPLFLAGS = @CXXTEMPLFLAGS@ 48 CPPFLAGS = -I${srcdir} @CPPFLAGS@ 49 CPPFLAGS = -I${srcdir} @CPPFLAGS@ 49 50 DEFS = @DEFS@ -DNDEBUG 50 51 LDFLAGS = @LDFLAGS@ … … 100 101 CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c weight0.c 101 102 102 SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l 103 SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l spSpolyLoop.pl 103 104 104 105 HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \ … … 150 151 151 152 .l.cc: 152 ${LEX} -s -I -t $< > scanner.cc 153 153 @if test "${LEXP}" = touch; then \ 154 touch scanner.cc; \ 155 echo Warning: could not rebuilt scanner.cc;\ 156 else \ 157 echo "${LEXP} -s -I -t $< > scanner.cc"; \ 158 ${LEXP} -s -I -t $< > scanner.cc; \ 159 fi 154 160 .y.cc: 155 161 ${BISON} -d -t -o grammar.cc $< … … 175 181 ${OBJS} ${STATIC_LDFLAGS} ${LDFLAGS} ${LIBS} 176 182 177 libparse: libparse_main.o utils.o178 ${CXX} -o libparse libparse_main.o utils.o179 180 libparse_main.o: libparse.cc181 ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER182 183 183 184 iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc … … 204 205 fi 205 206 206 libparse.cc: libparse.l207 ${LEX} -I -Pyylp -olibparse.cc libparse.l208 207 209 208 version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in … … 214 213 stamp-h : config.status mod2.h.in 215 214 CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status 215 216 spSpolyLoop.cc spSpolyLoop.dd : spSpolyLoop.inc 217 218 spSpolyLoop.inc: spSpolyLoop.pl 219 ${PERL} spSpolyLoop.pl > spSpolyLoop.inc 220 221 libparse: libparse_main.o utils.o 222 ${CXX} -o libparse libparse_main.o utils.o 223 224 libparse_main.o: libparse.cc 225 ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER 226 227 libparse.cc: libparse.l 228 @if test "${LEXP}" = touch; then \ 229 touch libparse.cc; \ 230 echo Warning: could not rebuilt libparse.cc;\ 231 else \ 232 echo ${LEXP} -I -Pyylp -olibparse.cc libparse.l;\ 233 ${LEXP} -I -Pyylp -olibparse.cc libparse.l;\ 234 fi 216 235 217 236 Makefile: Makefile.in config.status -
Singular/binom.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: binom.cc,v 1.1 2 1998-01-28 22:11:19 SingularExp $ */4 /* $Id: binom.cc,v 1.13 1998-03-16 14:56:25 obachman Exp $ */ 5 5 6 6 /* … … 186 186 #endif 187 187 } 188 //o1=pGetComp(p1)-pGetComp(p2);189 //if (o1 == 0) return 0;190 //if (o1 > 0) return -pComponentOrder;191 //return pComponentOrder;188 o1=pGetComp(p1)-pGetComp(p2); 189 if (o1 == 0) return 0; 190 if (o1 > 0) return -pComponentOrder; 191 return pComponentOrder; 192 192 return 0; 193 193 } -
Singular/clapconv.cc
r057fd3 rf92fa13 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 // $Id: clapconv.cc,v 1.1 4 1998-02-09 11:29:00 SingularExp $5 // $Id: clapconv.cc,v 1.15 1998-03-16 14:56:25 obachman Exp $ 6 6 /* 7 7 * ABSTRACT: convert data between Singular and factory … … 126 126 else 127 127 { 128 poly term = p New();128 poly term = pInit(); 129 129 pNext( term ) = NULL; 130 130 for ( int i = 1; i <= pVariables; i++ ) … … 346 346 if (z!=NULL) 347 347 { 348 poly term = p New();348 poly term = pInit(); 349 349 pNext( term ) = NULL; 350 350 for ( int i = 1; i <= pVariables; i++ ) … … 513 513 else 514 514 { 515 poly term = p New();515 poly term = pInit(); 516 516 pNext( term ) = NULL; 517 517 for ( int i = 1; i <= pVariables; i++ ) … … 577 577 else 578 578 { 579 poly term = p New();579 poly term = pInit(); 580 580 pNext( term ) = NULL; 581 581 for ( int i = 1; i <= pVariables; i++ ) -
Singular/configure
r057fd3 rf92fa13 611 611 fi 612 612 613 # Extract the first word of "flex", so it can be a program name with args. 614 set dummy flex; ac_word=$2 615 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 616 echo "configure:617: checking for $ac_word" >&5 617 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then 618 echo $ac_n "(cached) $ac_c" 1>&6 619 else 620 if test -n "$LEX"; then 621 ac_cv_prog_LEX="$LEX" # Let the user override the test. 622 else 623 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" 624 for ac_dir in $PATH; do 625 test -z "$ac_dir" && ac_dir=. 626 if test -f $ac_dir/$ac_word; then 627 ac_cv_prog_LEX="flex" 628 break 629 fi 630 done 631 IFS="$ac_save_ifs" 632 test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" 633 fi 634 fi 635 LEX="$ac_cv_prog_LEX" 636 if test -n "$LEX"; then 637 echo "$ac_t""$LEX" 1>&6 638 else 639 echo "$ac_t""no" 1>&6 640 fi 641 642 if test -z "$LEXLIB" 643 then 644 case "$LEX" in 645 flex*) ac_lib=fl ;; 646 *) ac_lib=l ;; 647 esac 648 echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 649 echo "configure:650: checking for yywrap in -l$ac_lib" >&5 650 ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` 651 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 652 echo $ac_n "(cached) $ac_c" 1>&6 653 else 654 ac_save_LIBS="$LIBS" 655 LIBS="-l$ac_lib $LIBS" 656 cat > conftest.$ac_ext <<EOF 657 #line 658 "configure" 658 #include "confdefs.h" 659 /* Override any gcc2 internal prototype to avoid an error. */ 660 /* We use char because int might match the return type of a gcc2 661 builtin and then its argument prototype would still apply. */ 662 char yywrap(); 663 664 int main() { 665 yywrap() 666 ; return 0; } 667 EOF 668 if { (eval echo configure:669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 669 rm -rf conftest* 670 eval "ac_cv_lib_$ac_lib_var=yes" 671 else 672 echo "configure: failed program was:" >&5 673 cat conftest.$ac_ext >&5 674 rm -rf conftest* 675 eval "ac_cv_lib_$ac_lib_var=no" 676 fi 677 rm -f conftest* 678 LIBS="$ac_save_LIBS" 679 680 fi 681 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 682 echo "$ac_t""yes" 1>&6 683 LEXLIB="-l$ac_lib" 684 else 685 echo "$ac_t""no" 1>&6 686 fi 687 688 fi 689 690 # make sure lex accepts -P option 691 if test "${ac_cv_prog_LEX+set}" = set; then 692 echo $ac_n "checking whether ${ac_cv_prog_LEX} accepts -P""... $ac_c" 1>&6 693 echo "configure:694: checking whether ${ac_cv_prog_LEX} accepts -P" >&5 694 if ${ac_cv_prog_LEX} -P < /dev/null 2>&1| grep flag > /dev/null 2>&1; then 695 echo "$ac_t""no" 1>&6 696 echo "configure: warning: Can not run ${ac_cv_prog_LEX} with -P; make might fail" 1>&2 697 LEXP=touch 698 else 699 echo "$ac_t""yes" 1>&6 700 LEXP=${ac_cv_prog_LEX} 701 fi 702 fi 703 613 704 # Extract the first word of "gcc", so it can be a program name with args. 614 705 set dummy gcc; ac_word=$2 615 706 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 616 echo "configure: 617: checking for $ac_word" >&5707 echo "configure:708: checking for $ac_word" >&5 617 708 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then 618 709 echo $ac_n "(cached) $ac_c" 1>&6 … … 643 734 set dummy cc; ac_word=$2 644 735 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 645 echo "configure: 646: checking for $ac_word" >&5736 echo "configure:737: checking for $ac_word" >&5 646 737 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then 647 738 echo $ac_n "(cached) $ac_c" 1>&6 … … 691 782 692 783 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 693 echo "configure: 694: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5784 echo "configure:785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 694 785 695 786 ac_ext=c … … 701 792 702 793 cat > conftest.$ac_ext <<EOF 703 #line 7 04"configure"794 #line 795 "configure" 704 795 #include "confdefs.h" 705 796 main(){return(0);} 706 797 EOF 707 if { (eval echo configure:7 08: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then798 if { (eval echo configure:799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 708 799 ac_cv_prog_cc_works=yes 709 800 # If we can't run a trivial program, we are probably using a cross compiler. … … 725 816 fi 726 817 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 727 echo "configure: 728: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5818 echo "configure:819: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 728 819 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 729 820 cross_compiling=$ac_cv_prog_cc_cross 730 821 731 822 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 732 echo "configure: 733: checking whether we are using GNU C" >&5823 echo "configure:824: checking whether we are using GNU C" >&5 733 824 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then 734 825 echo $ac_n "(cached) $ac_c" 1>&6 … … 739 830 #endif 740 831 EOF 741 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure: 742: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then832 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then 742 833 ac_cv_prog_gcc=yes 743 834 else … … 754 845 CFLAGS= 755 846 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 756 echo "configure: 757: checking whether ${CC-cc} accepts -g" >&5847 echo "configure:848: checking whether ${CC-cc} accepts -g" >&5 757 848 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then 758 849 echo $ac_n "(cached) $ac_c" 1>&6 … … 782 873 783 874 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 784 echo "configure: 785: checking how to run the C preprocessor" >&5875 echo "configure:876: checking how to run the C preprocessor" >&5 785 876 # On Suns, sometimes $CPP names a directory. 786 877 if test -n "$CPP" && test -d "$CPP"; then … … 797 888 # not just through cpp. 798 889 cat > conftest.$ac_ext <<EOF 799 #line 8 00"configure"890 #line 891 "configure" 800 891 #include "confdefs.h" 801 892 #include <assert.h> … … 803 894 EOF 804 895 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 805 { (eval echo configure:8 06: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }896 { (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 806 897 ac_err=`grep -v '^ *+' conftest.out` 807 898 if test -z "$ac_err"; then … … 814 905 CPP="${CC-cc} -E -traditional-cpp" 815 906 cat > conftest.$ac_ext <<EOF 816 #line 817"configure"907 #line 908 "configure" 817 908 #include "confdefs.h" 818 909 #include <assert.h> … … 820 911 EOF 821 912 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 822 { (eval echo configure: 823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }913 { (eval echo configure:914: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 823 914 ac_err=`grep -v '^ *+' conftest.out` 824 915 if test -z "$ac_err"; then … … 847 938 set dummy $ac_prog; ac_word=$2 848 939 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 849 echo "configure: 850: checking for $ac_word" >&5940 echo "configure:941: checking for $ac_word" >&5 850 941 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then 851 942 echo $ac_n "(cached) $ac_c" 1>&6 … … 878 969 879 970 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 880 echo "configure: 881: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5971 echo "configure:972: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 881 972 882 973 ac_ext=C … … 888 979 889 980 cat > conftest.$ac_ext <<EOF 890 #line 891"configure"981 #line 982 "configure" 891 982 #include "confdefs.h" 892 983 main(){return(0);} 893 984 EOF 894 if { (eval echo configure: 895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then985 if { (eval echo configure:986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 895 986 ac_cv_prog_cxx_works=yes 896 987 # If we can't run a trivial program, we are probably using a cross compiler. … … 918 1009 fi 919 1010 echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 920 echo "configure: 921: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&51011 echo "configure:1012: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 921 1012 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 922 1013 cross_compiling=$ac_cv_prog_cxx_cross 923 1014 924 1015 echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 925 echo "configure: 926: checking whether we are using GNU C++" >&51016 echo "configure:1017: checking whether we are using GNU C++" >&5 926 1017 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then 927 1018 echo $ac_n "(cached) $ac_c" 1>&6 … … 932 1023 #endif 933 1024 EOF 934 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure: 935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then1025 if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1026: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then 935 1026 ac_cv_prog_gxx=yes 936 1027 else … … 947 1038 CXXFLAGS= 948 1039 echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 949 echo "configure: 950: checking whether ${CXX-g++} accepts -g" >&51040 echo "configure:1041: checking whether ${CXX-g++} accepts -g" >&5 950 1041 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then 951 1042 echo $ac_n "(cached) $ac_c" 1>&6 … … 975 1066 976 1067 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 977 echo "configure: 978: checking whether ${MAKE-make} sets \${MAKE}" >&51068 echo "configure:1069: checking whether ${MAKE-make} sets \${MAKE}" >&5 978 1069 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` 979 1070 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then … … 1066 1157 set dummy info; ac_word=$2 1067 1158 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 1068 echo "configure:1 069: checking for $ac_word" >&51159 echo "configure:1160: checking for $ac_word" >&5 1069 1160 if eval "test \"`echo '$''{'ac_cv_prog_INFO'+set}'`\" = set"; then 1070 1161 echo $ac_n "(cached) $ac_c" 1>&6 … … 1161 1252 1162 1253 echo $ac_n "checking for atof in -lm""... $ac_c" 1>&6 1163 echo "configure:1 164: checking for atof in -lm" >&51254 echo "configure:1255: checking for atof in -lm" >&5 1164 1255 ac_lib_var=`echo m'_'atof | sed 'y%./+-%__p_%'` 1165 1256 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1169 1260 LIBS="-lm $LIBS" 1170 1261 cat > conftest.$ac_ext <<EOF 1171 #line 1 172"configure"1262 #line 1263 "configure" 1172 1263 #include "confdefs.h" 1173 1264 /* Override any gcc2 internal prototype to avoid an error. */ … … 1180 1271 ; return 0; } 1181 1272 EOF 1182 if { (eval echo configure:1 183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1273 if { (eval echo configure:1274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1183 1274 rm -rf conftest* 1184 1275 eval "ac_cv_lib_$ac_lib_var=yes" … … 1208 1299 1209 1300 echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6 1210 echo "configure:1 211: checking for socket in -lbsd" >&51301 echo "configure:1302: checking for socket in -lbsd" >&5 1211 1302 ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'` 1212 1303 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1216 1307 LIBS="-lbsd $LIBS" 1217 1308 cat > conftest.$ac_ext <<EOF 1218 #line 1 219"configure"1309 #line 1310 "configure" 1219 1310 #include "confdefs.h" 1220 1311 /* Override any gcc2 internal prototype to avoid an error. */ … … 1227 1318 ; return 0; } 1228 1319 EOF 1229 if { (eval echo configure:1 230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1320 if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1230 1321 rm -rf conftest* 1231 1322 eval "ac_cv_lib_$ac_lib_var=yes" … … 1255 1346 1256 1347 echo $ac_n "checking for listen in -lsocket""... $ac_c" 1>&6 1257 echo "configure:1 258: checking for listen in -lsocket" >&51348 echo "configure:1349: checking for listen in -lsocket" >&5 1258 1349 ac_lib_var=`echo socket'_'listen | sed 'y%./+-%__p_%'` 1259 1350 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1263 1354 LIBS="-lsocket $LIBS" 1264 1355 cat > conftest.$ac_ext <<EOF 1265 #line 1 266"configure"1356 #line 1357 "configure" 1266 1357 #include "confdefs.h" 1267 1358 /* Override any gcc2 internal prototype to avoid an error. */ … … 1274 1365 ; return 0; } 1275 1366 EOF 1276 if { (eval echo configure:1 277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1367 if { (eval echo configure:1368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1277 1368 rm -rf conftest* 1278 1369 eval "ac_cv_lib_$ac_lib_var=yes" … … 1302 1393 1303 1394 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 1304 echo "configure:13 05: checking for gethostbyname in -lnsl" >&51395 echo "configure:1396: checking for gethostbyname in -lnsl" >&5 1305 1396 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` 1306 1397 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1310 1401 LIBS="-lnsl $LIBS" 1311 1402 cat > conftest.$ac_ext <<EOF 1312 #line 1 313"configure"1403 #line 1404 "configure" 1313 1404 #include "confdefs.h" 1314 1405 /* Override any gcc2 internal prototype to avoid an error. */ … … 1321 1412 ; return 0; } 1322 1413 EOF 1323 if { (eval echo configure:1 324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1414 if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1324 1415 rm -rf conftest* 1325 1416 eval "ac_cv_lib_$ac_lib_var=yes" … … 1349 1440 1350 1441 echo $ac_n "checking for index in -lucb""... $ac_c" 1>&6 1351 echo "configure:1 352: checking for index in -lucb" >&51442 echo "configure:1443: checking for index in -lucb" >&5 1352 1443 ac_lib_var=`echo ucb'_'index | sed 'y%./+-%__p_%'` 1353 1444 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1357 1448 LIBS="-lucb $LIBS" 1358 1449 cat > conftest.$ac_ext <<EOF 1359 #line 1 360"configure"1450 #line 1451 "configure" 1360 1451 #include "confdefs.h" 1361 1452 /* Override any gcc2 internal prototype to avoid an error. */ … … 1368 1459 ; return 0; } 1369 1460 EOF 1370 if { (eval echo configure:1 371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1461 if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1371 1462 rm -rf conftest* 1372 1463 eval "ac_cv_lib_$ac_lib_var=yes" … … 1398 1489 if test "$with_readline" != no; then 1399 1490 echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6 1400 echo "configure:14 01: checking for tgetent in -lncurses" >&51491 echo "configure:1492: checking for tgetent in -lncurses" >&5 1401 1492 ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'` 1402 1493 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1406 1497 LIBS="-lncurses $LIBS" 1407 1498 cat > conftest.$ac_ext <<EOF 1408 #line 1 409"configure"1499 #line 1500 "configure" 1409 1500 #include "confdefs.h" 1410 1501 /* Override any gcc2 internal prototype to avoid an error. */ … … 1417 1508 ; return 0; } 1418 1509 EOF 1419 if { (eval echo configure:1 420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1510 if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1420 1511 rm -rf conftest* 1421 1512 eval "ac_cv_lib_$ac_lib_var=yes" … … 1444 1535 \ 1445 1536 echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6 1446 echo "configure:1 447: checking for tgetent in -lcurses" >&51537 echo "configure:1538: checking for tgetent in -lcurses" >&5 1447 1538 ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'` 1448 1539 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1452 1543 LIBS="-lcurses $LIBS" 1453 1544 cat > conftest.$ac_ext <<EOF 1454 #line 1 455"configure"1545 #line 1546 "configure" 1455 1546 #include "confdefs.h" 1456 1547 /* Override any gcc2 internal prototype to avoid an error. */ … … 1463 1554 ; return 0; } 1464 1555 EOF 1465 if { (eval echo configure:1 466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1556 if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1466 1557 rm -rf conftest* 1467 1558 eval "ac_cv_lib_$ac_lib_var=yes" … … 1490 1581 \ 1491 1582 echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6 1492 echo "configure:1 493: checking for tgetent in -ltermcap" >&51583 echo "configure:1584: checking for tgetent in -ltermcap" >&5 1493 1584 ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'` 1494 1585 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1498 1589 LIBS="-ltermcap $LIBS" 1499 1590 cat > conftest.$ac_ext <<EOF 1500 #line 15 01"configure"1591 #line 1592 "configure" 1501 1592 #include "confdefs.h" 1502 1593 /* Override any gcc2 internal prototype to avoid an error. */ … … 1509 1600 ; return 0; } 1510 1601 EOF 1511 if { (eval echo configure:1 512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1602 if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1512 1603 rm -rf conftest* 1513 1604 eval "ac_cv_lib_$ac_lib_var=yes" … … 1541 1632 1542 1633 echo $ac_n "checking for rl_abort in -lreadline""... $ac_c" 1>&6 1543 echo "configure:1 544: checking for rl_abort in -lreadline" >&51634 echo "configure:1635: checking for rl_abort in -lreadline" >&5 1544 1635 ac_lib_var=`echo readline'_'rl_abort | sed 'y%./+-%__p_%'` 1545 1636 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1549 1640 LIBS="-lreadline $LIBS" 1550 1641 cat > conftest.$ac_ext <<EOF 1551 #line 1 552"configure"1642 #line 1643 "configure" 1552 1643 #include "confdefs.h" 1553 1644 /* Override any gcc2 internal prototype to avoid an error. */ … … 1560 1651 ; return 0; } 1561 1652 EOF 1562 if { (eval echo configure:1 563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1653 if { (eval echo configure:1654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1563 1654 rm -rf conftest* 1564 1655 eval "ac_cv_lib_$ac_lib_var=yes" … … 1592 1683 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1593 1684 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1594 echo "configure:1 595: checking for $ac_hdr" >&51685 echo "configure:1686: checking for $ac_hdr" >&5 1595 1686 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1596 1687 echo $ac_n "(cached) $ac_c" 1>&6 1597 1688 else 1598 1689 cat > conftest.$ac_ext <<EOF 1599 #line 16 00"configure"1690 #line 1691 "configure" 1600 1691 #include "confdefs.h" 1601 1692 #include <$ac_hdr> 1602 1693 EOF 1603 1694 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1604 { (eval echo configure:16 05: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1695 { (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1605 1696 ac_err=`grep -v '^ *+' conftest.out` 1606 1697 if test -z "$ac_err"; then … … 1651 1742 if test "$with_dld" = yes; then 1652 1743 echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6 1653 echo "configure:1 654: checking for dld_init in -ldld" >&51744 echo "configure:1745: checking for dld_init in -ldld" >&5 1654 1745 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'` 1655 1746 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1659 1750 LIBS="-ldld $LIBS" 1660 1751 cat > conftest.$ac_ext <<EOF 1661 #line 1 662"configure"1752 #line 1753 "configure" 1662 1753 #include "confdefs.h" 1663 1754 /* Override any gcc2 internal prototype to avoid an error. */ … … 1670 1761 ; return 0; } 1671 1762 EOF 1672 if { (eval echo configure:1 673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1763 if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1673 1764 rm -rf conftest* 1674 1765 eval "ac_cv_lib_$ac_lib_var=yes" … … 1696 1787 1697 1788 echo $ac_n "checking for mpq_init in -lgmp""... $ac_c" 1>&6 1698 echo "configure:1 699: checking for mpq_init in -lgmp" >&51789 echo "configure:1790: checking for mpq_init in -lgmp" >&5 1699 1790 ac_lib_var=`echo gmp'_'mpq_init | sed 'y%./+-%__p_%'` 1700 1791 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1704 1795 LIBS="-lgmp $LIBS" 1705 1796 cat > conftest.$ac_ext <<EOF 1706 #line 17 07"configure"1797 #line 1798 "configure" 1707 1798 #include "confdefs.h" 1708 1799 /* Override any gcc2 internal prototype to avoid an error. */ … … 1715 1806 ; return 0; } 1716 1807 EOF 1717 if { (eval echo configure:1 718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1808 if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1718 1809 rm -rf conftest* 1719 1810 eval "ac_cv_lib_$ac_lib_var=yes" … … 1746 1837 fi 1747 1838 echo $ac_n "checking for mpz_init in -lsmallgmp""... $ac_c" 1>&6 1748 echo "configure:1 749: checking for mpz_init in -lsmallgmp" >&51839 echo "configure:1840: checking for mpz_init in -lsmallgmp" >&5 1749 1840 ac_lib_var=`echo smallgmp'_'mpz_init | sed 'y%./+-%__p_%'` 1750 1841 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1754 1845 LIBS="-lsmallgmp $LIBS" 1755 1846 cat > conftest.$ac_ext <<EOF 1756 #line 1 757"configure"1847 #line 1848 "configure" 1757 1848 #include "confdefs.h" 1758 1849 /* Override any gcc2 internal prototype to avoid an error. */ … … 1765 1856 ; return 0; } 1766 1857 EOF 1767 if { (eval echo configure:1 768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1858 if { (eval echo configure:1859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1768 1859 rm -rf conftest* 1769 1860 eval "ac_cv_lib_$ac_lib_var=yes" … … 1793 1884 1794 1885 echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6 1795 echo "configure:1 796: checking for IMP_PutGmpInt in -lMP" >&51886 echo "configure:1887: checking for IMP_PutGmpInt in -lMP" >&5 1796 1887 ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'` 1797 1888 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1801 1892 LIBS="-lMP $LIBS" 1802 1893 cat > conftest.$ac_ext <<EOF 1803 #line 18 04"configure"1894 #line 1895 "configure" 1804 1895 #include "confdefs.h" 1805 1896 /* Override any gcc2 internal prototype to avoid an error. */ … … 1812 1903 ; return 0; } 1813 1904 EOF 1814 if { (eval echo configure:1 815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1905 if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1815 1906 rm -rf conftest* 1816 1907 eval "ac_cv_lib_$ac_lib_var=yes" … … 1840 1931 1841 1932 echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6 1842 echo "configure:1 843: checking for MPT_GetTree in -lMPT" >&51933 echo "configure:1934: checking for MPT_GetTree in -lMPT" >&5 1843 1934 ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'` 1844 1935 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1848 1939 LIBS="-lMPT $LIBS" 1849 1940 cat > conftest.$ac_ext <<EOF 1850 #line 1 851"configure"1941 #line 1942 "configure" 1851 1942 #include "confdefs.h" 1852 1943 /* Override any gcc2 internal prototype to avoid an error. */ … … 1859 1950 ; return 0; } 1860 1951 EOF 1861 if { (eval echo configure:1 862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1952 if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1862 1953 rm -rf conftest* 1863 1954 eval "ac_cv_lib_$ac_lib_var=yes" … … 1887 1978 1888 1979 echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6 1889 echo "configure:1 890: checking for atof in -lsingcf" >&51980 echo "configure:1981: checking for atof in -lsingcf" >&5 1890 1981 ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'` 1891 1982 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1895 1986 LIBS="-lsingcf $LIBS" 1896 1987 cat > conftest.$ac_ext <<EOF 1897 #line 1 898"configure"1988 #line 1989 "configure" 1898 1989 #include "confdefs.h" 1899 1990 /* Override any gcc2 internal prototype to avoid an error. */ … … 1906 1997 ; return 0; } 1907 1998 EOF 1908 if { (eval echo configure: 1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then1999 if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1909 2000 rm -rf conftest* 1910 2001 eval "ac_cv_lib_$ac_lib_var=yes" … … 1934 2025 1935 2026 echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6 1936 echo "configure: 1937: checking for atof in -lsingfac" >&52027 echo "configure:2028: checking for atof in -lsingfac" >&5 1937 2028 ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'` 1938 2029 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1942 2033 LIBS="-lsingfac $LIBS" 1943 2034 cat > conftest.$ac_ext <<EOF 1944 #line 1945"configure"2035 #line 2036 "configure" 1945 2036 #include "confdefs.h" 1946 2037 /* Override any gcc2 internal prototype to avoid an error. */ … … 1953 2044 ; return 0; } 1954 2045 EOF 1955 if { (eval echo configure: 1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then2046 if { (eval echo configure:2047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 1956 2047 rm -rf conftest* 1957 2048 eval "ac_cv_lib_$ac_lib_var=yes" … … 1985 2076 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1986 2077 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1987 echo "configure: 1988: checking for $ac_hdr" >&52078 echo "configure:2079: checking for $ac_hdr" >&5 1988 2079 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1989 2080 echo $ac_n "(cached) $ac_c" 1>&6 1990 2081 else 1991 2082 cat > conftest.$ac_ext <<EOF 1992 #line 1993"configure"2083 #line 2084 "configure" 1993 2084 #include "confdefs.h" 1994 2085 #include <$ac_hdr> 1995 2086 EOF 1996 2087 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1997 { (eval echo configure: 1998: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2088 { (eval echo configure:2089: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1998 2089 ac_err=`grep -v '^ *+' conftest.out` 1999 2090 if test -z "$ac_err"; then … … 2081 2172 fi 2082 2173 echo $ac_n "checking which apint package to use""... $ac_c" 1>&6 2083 echo "configure:2 084: checking which apint package to use" >&52174 echo "configure:2175: checking which apint package to use" >&5 2084 2175 if test "$ac_will_have_gmp" = yes; then 2085 2176 cat >> confdefs.h <<\EOF … … 2118 2209 fi 2119 2210 echo $ac_n "checking whether to use with MP""... $ac_c" 1>&6 2120 echo "configure:2 121: checking whether to use with MP" >&52211 echo "configure:2212: checking whether to use with MP" >&5 2121 2212 2122 2213 if test "$WITH_MP" = yes; then … … 2147 2238 fi 2148 2239 echo $ac_n "checking whether to use with factory""... $ac_c" 1>&6 2149 echo "configure:2 150: checking whether to use with factory" >&52240 echo "configure:2241: checking whether to use with factory" >&5 2150 2241 2151 2242 if test "$WITH_FACTORY" = yes; then … … 2176 2267 fi 2177 2268 echo $ac_n "checking whether to use with libfac""... $ac_c" 1>&6 2178 echo "configure:2 179: checking whether to use with libfac" >&52269 echo "configure:2270: checking whether to use with libfac" >&5 2179 2270 2180 2271 if test "$WITH_LIBFAC" = yes; then … … 2192 2283 2193 2284 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 2194 echo "configure:2 195: checking for ANSI C header files" >&52285 echo "configure:2286: checking for ANSI C header files" >&5 2195 2286 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then 2196 2287 echo $ac_n "(cached) $ac_c" 1>&6 2197 2288 else 2198 2289 cat > conftest.$ac_ext <<EOF 2199 #line 22 00"configure"2290 #line 2291 "configure" 2200 2291 #include "confdefs.h" 2201 2292 #include <stdlib.h> … … 2205 2296 EOF 2206 2297 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2207 { (eval echo configure:22 08: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2298 { (eval echo configure:2299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2208 2299 ac_err=`grep -v '^ *+' conftest.out` 2209 2300 if test -z "$ac_err"; then … … 2222 2313 # SunOS 4.x string.h does not declare mem*, contrary to ANSI. 2223 2314 cat > conftest.$ac_ext <<EOF 2224 #line 2 225"configure"2315 #line 2316 "configure" 2225 2316 #include "confdefs.h" 2226 2317 #include <string.h> … … 2240 2331 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. 2241 2332 cat > conftest.$ac_ext <<EOF 2242 #line 2 243"configure"2333 #line 2334 "configure" 2243 2334 #include "confdefs.h" 2244 2335 #include <stdlib.h> … … 2261 2352 else 2262 2353 cat > conftest.$ac_ext <<EOF 2263 #line 2 264"configure"2354 #line 2355 "configure" 2264 2355 #include "confdefs.h" 2265 2356 #include <ctype.h> … … 2272 2363 2273 2364 EOF 2274 if { (eval echo configure:2 275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null2365 if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 2275 2366 then 2276 2367 : … … 2300 2391 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2301 2392 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2302 echo "configure:23 03: checking for $ac_hdr" >&52393 echo "configure:2394: checking for $ac_hdr" >&5 2303 2394 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2304 2395 echo $ac_n "(cached) $ac_c" 1>&6 2305 2396 else 2306 2397 cat > conftest.$ac_ext <<EOF 2307 #line 23 08"configure"2398 #line 2399 "configure" 2308 2399 #include "confdefs.h" 2309 2400 #include <$ac_hdr> 2310 2401 EOF 2311 2402 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2312 { (eval echo configure:2 313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2403 { (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2313 2404 ac_err=`grep -v '^ *+' conftest.out` 2314 2405 if test -z "$ac_err"; then … … 2342 2433 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2343 2434 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2344 echo "configure:2 345: checking for $ac_hdr" >&52435 echo "configure:2436: checking for $ac_hdr" >&5 2345 2436 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2346 2437 echo $ac_n "(cached) $ac_c" 1>&6 2347 2438 else 2348 2439 cat > conftest.$ac_ext <<EOF 2349 #line 2 350"configure"2440 #line 2441 "configure" 2350 2441 #include "confdefs.h" 2351 2442 #include <$ac_hdr> 2352 2443 EOF 2353 2444 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2354 { (eval echo configure:2 355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2445 { (eval echo configure:2446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2355 2446 ac_err=`grep -v '^ *+' conftest.out` 2356 2447 if test -z "$ac_err"; then … … 2381 2472 WITH_DBM=no 2382 2473 echo $ac_n "checking whether to build with dbm links""... $ac_c" 1>&6 2383 echo "configure:2 384: checking whether to build with dbm links" >&52474 echo "configure:2475: checking whether to build with dbm links" >&5 2384 2475 if test "$with_dbm" != no; then 2385 2476 cat >> confdefs.h <<\EOF … … 2395 2486 2396 2487 echo $ac_n "checking for working const""... $ac_c" 1>&6 2397 echo "configure:2 398: checking for working const" >&52488 echo "configure:2489: checking for working const" >&5 2398 2489 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then 2399 2490 echo $ac_n "(cached) $ac_c" 1>&6 2400 2491 else 2401 2492 cat > conftest.$ac_ext <<EOF 2402 #line 24 03"configure"2493 #line 2494 "configure" 2403 2494 #include "confdefs.h" 2404 2495 … … 2449 2540 ; return 0; } 2450 2541 EOF 2451 if { (eval echo configure:2 452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2542 if { (eval echo configure:2543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2452 2543 rm -rf conftest* 2453 2544 ac_cv_c_const=yes … … 2470 2561 2471 2562 echo $ac_n "checking for inline""... $ac_c" 1>&6 2472 echo "configure:2 473: checking for inline" >&52563 echo "configure:2564: checking for inline" >&5 2473 2564 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then 2474 2565 echo $ac_n "(cached) $ac_c" 1>&6 … … 2477 2568 for ac_kw in inline __inline__ __inline; do 2478 2569 cat > conftest.$ac_ext <<EOF 2479 #line 2 480"configure"2570 #line 2571 "configure" 2480 2571 #include "confdefs.h" 2481 2572 … … 2484 2575 ; return 0; } 2485 2576 EOF 2486 if { (eval echo configure:2 487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2577 if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2487 2578 rm -rf conftest* 2488 2579 ac_cv_c_inline=$ac_kw; break … … 2510 2601 2511 2602 echo $ac_n "checking for size_t""... $ac_c" 1>&6 2512 echo "configure:2 513: checking for size_t" >&52603 echo "configure:2604: checking for size_t" >&5 2513 2604 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then 2514 2605 echo $ac_n "(cached) $ac_c" 1>&6 2515 2606 else 2516 2607 cat > conftest.$ac_ext <<EOF 2517 #line 2 518"configure"2608 #line 2609 "configure" 2518 2609 #include "confdefs.h" 2519 2610 #include <sys/types.h> … … 2543 2634 2544 2635 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 2545 echo "configure:2 546: checking whether time.h and sys/time.h may both be included" >&52636 echo "configure:2637: checking whether time.h and sys/time.h may both be included" >&5 2546 2637 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then 2547 2638 echo $ac_n "(cached) $ac_c" 1>&6 2548 2639 else 2549 2640 cat > conftest.$ac_ext <<EOF 2550 #line 2 551"configure"2641 #line 2642 "configure" 2551 2642 #include "confdefs.h" 2552 2643 #include <sys/types.h> … … 2557 2648 ; return 0; } 2558 2649 EOF 2559 if { (eval echo configure:2 560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2650 if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2560 2651 rm -rf conftest* 2561 2652 ac_cv_header_time=yes … … 2578 2669 2579 2670 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 2580 echo "configure:2 581: checking whether struct tm is in sys/time.h or time.h" >&52671 echo "configure:2672: checking whether struct tm is in sys/time.h or time.h" >&5 2581 2672 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then 2582 2673 echo $ac_n "(cached) $ac_c" 1>&6 2583 2674 else 2584 2675 cat > conftest.$ac_ext <<EOF 2585 #line 2 586"configure"2676 #line 2677 "configure" 2586 2677 #include "confdefs.h" 2587 2678 #include <sys/types.h> … … 2591 2682 ; return 0; } 2592 2683 EOF 2593 if { (eval echo configure:2 594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then2684 if { (eval echo configure:2685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 2594 2685 rm -rf conftest* 2595 2686 ac_cv_struct_tm=time.h … … 2615 2706 # for constant arguments. Useless! 2616 2707 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 2617 echo "configure:2 618: checking for working alloca.h" >&52708 echo "configure:2709: checking for working alloca.h" >&5 2618 2709 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then 2619 2710 echo $ac_n "(cached) $ac_c" 1>&6 2620 2711 else 2621 2712 cat > conftest.$ac_ext <<EOF 2622 #line 2 623"configure"2713 #line 2714 "configure" 2623 2714 #include "confdefs.h" 2624 2715 #include <alloca.h> … … 2627 2718 ; return 0; } 2628 2719 EOF 2629 if { (eval echo configure:2 630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then2720 if { (eval echo configure:2721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 2630 2721 rm -rf conftest* 2631 2722 ac_cv_header_alloca_h=yes … … 2648 2739 2649 2740 echo $ac_n "checking for alloca""... $ac_c" 1>&6 2650 echo "configure:2 651: checking for alloca" >&52741 echo "configure:2742: checking for alloca" >&5 2651 2742 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then 2652 2743 echo $ac_n "(cached) $ac_c" 1>&6 2653 2744 else 2654 2745 cat > conftest.$ac_ext <<EOF 2655 #line 2 656"configure"2746 #line 2747 "configure" 2656 2747 #include "confdefs.h" 2657 2748 … … 2676 2767 ; return 0; } 2677 2768 EOF 2678 if { (eval echo configure:2 679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then2769 if { (eval echo configure:2770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 2679 2770 rm -rf conftest* 2680 2771 ac_cv_func_alloca_works=yes … … 2708 2799 2709 2800 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 2710 echo "configure:2 711: checking whether alloca needs Cray hooks" >&52801 echo "configure:2802: checking whether alloca needs Cray hooks" >&5 2711 2802 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then 2712 2803 echo $ac_n "(cached) $ac_c" 1>&6 2713 2804 else 2714 2805 cat > conftest.$ac_ext <<EOF 2715 #line 2 716"configure"2806 #line 2807 "configure" 2716 2807 #include "confdefs.h" 2717 2808 #if defined(CRAY) && ! defined(CRAY2) … … 2738 2829 for ac_func in _getb67 GETB67 getb67; do 2739 2830 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2740 echo "configure:2 741: checking for $ac_func" >&52831 echo "configure:2832: checking for $ac_func" >&5 2741 2832 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2742 2833 echo $ac_n "(cached) $ac_c" 1>&6 2743 2834 else 2744 2835 cat > conftest.$ac_ext <<EOF 2745 #line 2 746"configure"2836 #line 2837 "configure" 2746 2837 #include "confdefs.h" 2747 2838 /* System header to define __stub macros and hopefully few prototypes, … … 2766 2857 ; return 0; } 2767 2858 EOF 2768 if { (eval echo configure:2 769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then2859 if { (eval echo configure:2860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 2769 2860 rm -rf conftest* 2770 2861 eval "ac_cv_func_$ac_func=yes" … … 2793 2884 2794 2885 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 2795 echo "configure:2 796: checking stack direction for C alloca" >&52886 echo "configure:2887: checking stack direction for C alloca" >&5 2796 2887 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then 2797 2888 echo $ac_n "(cached) $ac_c" 1>&6 … … 2801 2892 else 2802 2893 cat > conftest.$ac_ext <<EOF 2803 #line 28 04"configure"2894 #line 2895 "configure" 2804 2895 #include "confdefs.h" 2805 2896 find_stack_direction () … … 2820 2911 } 2821 2912 EOF 2822 if { (eval echo configure:2 823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null2913 if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 2823 2914 then 2824 2915 ac_cv_c_stack_direction=1 … … 2843 2934 if test $ac_cv_prog_gcc = yes; then 2844 2935 echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 2845 echo "configure:2 846: checking whether ${CC-cc} needs -traditional" >&52936 echo "configure:2937: checking whether ${CC-cc} needs -traditional" >&5 2846 2937 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then 2847 2938 echo $ac_n "(cached) $ac_c" 1>&6 … … 2849 2940 ac_pattern="Autoconf.*'x'" 2850 2941 cat > conftest.$ac_ext <<EOF 2851 #line 2 852"configure"2942 #line 2943 "configure" 2852 2943 #include "confdefs.h" 2853 2944 #include <sgtty.h> … … 2867 2958 if test $ac_cv_prog_gcc_traditional = no; then 2868 2959 cat > conftest.$ac_ext <<EOF 2869 #line 2 870"configure"2960 #line 2961 "configure" 2870 2961 #include "confdefs.h" 2871 2962 #include <termio.h> … … 2892 2983 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 2893 2984 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 2894 echo "configure:2 895: checking for $ac_hdr" >&52985 echo "configure:2986: checking for $ac_hdr" >&5 2895 2986 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 2896 2987 echo $ac_n "(cached) $ac_c" 1>&6 2897 2988 else 2898 2989 cat > conftest.$ac_ext <<EOF 2899 #line 29 00"configure"2990 #line 2991 "configure" 2900 2991 #include "confdefs.h" 2901 2992 #include <$ac_hdr> 2902 2993 EOF 2903 2994 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 2904 { (eval echo configure:29 05: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }2995 { (eval echo configure:2996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 2905 2996 ac_err=`grep -v '^ *+' conftest.out` 2906 2997 if test -z "$ac_err"; then … … 2931 3022 do 2932 3023 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 2933 echo "configure: 2934: checking for $ac_func" >&53024 echo "configure:3025: checking for $ac_func" >&5 2934 3025 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 2935 3026 echo $ac_n "(cached) $ac_c" 1>&6 2936 3027 else 2937 3028 cat > conftest.$ac_ext <<EOF 2938 #line 2939"configure"3029 #line 3030 "configure" 2939 3030 #include "confdefs.h" 2940 3031 /* System header to define __stub macros and hopefully few prototypes, … … 2959 3050 ; return 0; } 2960 3051 EOF 2961 if { (eval echo configure: 2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then3052 if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 2962 3053 rm -rf conftest* 2963 3054 eval "ac_cv_func_$ac_func=yes" … … 2984 3075 2985 3076 echo $ac_n "checking for working mmap""... $ac_c" 1>&6 2986 echo "configure: 2987: checking for working mmap" >&53077 echo "configure:3078: checking for working mmap" >&5 2987 3078 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then 2988 3079 echo $ac_n "(cached) $ac_c" 1>&6 … … 2992 3083 else 2993 3084 cat > conftest.$ac_ext <<EOF 2994 #line 2995"configure"3085 #line 3086 "configure" 2995 3086 #include "confdefs.h" 2996 3087 … … 3132 3223 3133 3224 EOF 3134 if { (eval echo configure:3 135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3225 if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3135 3226 then 3136 3227 ac_cv_func_mmap_fixed_mapped=yes … … 3155 3246 3156 3247 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 3157 echo "configure:3 158: checking return type of signal handlers" >&53248 echo "configure:3249: checking return type of signal handlers" >&5 3158 3249 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then 3159 3250 echo $ac_n "(cached) $ac_c" 1>&6 3160 3251 else 3161 3252 cat > conftest.$ac_ext <<EOF 3162 #line 3 163"configure"3253 #line 3254 "configure" 3163 3254 #include "confdefs.h" 3164 3255 #include <sys/types.h> … … 3177 3268 ; return 0; } 3178 3269 EOF 3179 if { (eval echo configure:3 180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3270 if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3180 3271 rm -rf conftest* 3181 3272 ac_cv_type_signal=void … … 3196 3287 3197 3288 echo $ac_n "checking for vprintf""... $ac_c" 1>&6 3198 echo "configure:3 199: checking for vprintf" >&53289 echo "configure:3290: checking for vprintf" >&5 3199 3290 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then 3200 3291 echo $ac_n "(cached) $ac_c" 1>&6 3201 3292 else 3202 3293 cat > conftest.$ac_ext <<EOF 3203 #line 32 04"configure"3294 #line 3295 "configure" 3204 3295 #include "confdefs.h" 3205 3296 /* System header to define __stub macros and hopefully few prototypes, … … 3224 3315 ; return 0; } 3225 3316 EOF 3226 if { (eval echo configure:3 227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then3317 if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 3227 3318 rm -rf conftest* 3228 3319 eval "ac_cv_func_vprintf=yes" … … 3248 3339 if test "$ac_cv_func_vprintf" != yes; then 3249 3340 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 3250 echo "configure:3 251: checking for _doprnt" >&53341 echo "configure:3342: checking for _doprnt" >&5 3251 3342 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then 3252 3343 echo $ac_n "(cached) $ac_c" 1>&6 3253 3344 else 3254 3345 cat > conftest.$ac_ext <<EOF 3255 #line 3 256"configure"3346 #line 3347 "configure" 3256 3347 #include "confdefs.h" 3257 3348 /* System header to define __stub macros and hopefully few prototypes, … … 3276 3367 ; return 0; } 3277 3368 EOF 3278 if { (eval echo configure:3 279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then3369 if { (eval echo configure:3370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 3279 3370 rm -rf conftest* 3280 3371 eval "ac_cv_func__doprnt=yes" … … 3303 3394 do 3304 3395 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 3305 echo "configure:33 06: checking for $ac_func" >&53396 echo "configure:3397: checking for $ac_func" >&5 3306 3397 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 3307 3398 echo $ac_n "(cached) $ac_c" 1>&6 3308 3399 else 3309 3400 cat > conftest.$ac_ext <<EOF 3310 #line 3 311"configure"3401 #line 3402 "configure" 3311 3402 #include "confdefs.h" 3312 3403 /* System header to define __stub macros and hopefully few prototypes, … … 3331 3422 ; return 0; } 3332 3423 EOF 3333 if { (eval echo configure:3 334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then3424 if { (eval echo configure:3425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then 3334 3425 rm -rf conftest* 3335 3426 eval "ac_cv_func_$ac_func=yes" … … 3358 3449 3359 3450 echo $ac_n "checking whether your machine has correct arithmetic shifts""... $ac_c" 1>&6 3360 echo "configure:3 361: checking whether your machine has correct arithmetic shifts" >&53451 echo "configure:3452: checking whether your machine has correct arithmetic shifts" >&5 3361 3452 if eval "test \"`echo '$''{'ac_cv_shift'+set}'`\" = set"; then 3362 3453 echo $ac_n "(cached) $ac_c" 1>&6 … … 3371 3462 else 3372 3463 cat > conftest.$ac_ext <<EOF 3373 #line 3 374"configure"3464 #line 3465 "configure" 3374 3465 #include "confdefs.h" 3375 3466 int main() { if (-2 >> 1 == -1) exit(0); else exit(1); } 3376 3467 EOF 3377 if { (eval echo configure:3 378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3468 if { (eval echo configure:3469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3378 3469 then 3379 3470 ac_cv_shift=yes … … 3398 3489 3399 3490 echo $ac_n "checking whether vsprintf returns number of printed chars""... $ac_c" 1>&6 3400 echo "configure:34 01: checking whether vsprintf returns number of printed chars" >&53491 echo "configure:3492: checking whether vsprintf returns number of printed chars" >&5 3401 3492 if eval "test \"`echo '$''{'ac_cv_returns_n_of_chars'+set}'`\" = set"; then 3402 3493 echo $ac_n "(cached) $ac_c" 1>&6 … … 3406 3497 else 3407 3498 cat > conftest.$ac_ext <<EOF 3408 #line 3 409"configure"3499 #line 3500 "configure" 3409 3500 #include "confdefs.h" 3410 3501 #include <stdio.h> 3411 3502 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); } 3412 3503 EOF 3413 if { (eval echo configure:3 414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3504 if { (eval echo configure:3505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3414 3505 then 3415 3506 ac_cv_returns_n_of_chars=yes … … 3437 3528 3438 3529 echo $ac_n "checking size of char""... $ac_c" 1>&6 3439 echo "configure:3 440: checking size of char" >&53530 echo "configure:3531: checking size of char" >&5 3440 3531 if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then 3441 3532 echo $ac_n "(cached) $ac_c" 1>&6 … … 3445 3536 else 3446 3537 cat > conftest.$ac_ext <<EOF 3447 #line 3 448"configure"3538 #line 3539 "configure" 3448 3539 #include "confdefs.h" 3449 3540 #include <stdio.h> … … 3456 3547 } 3457 3548 EOF 3458 if { (eval echo configure:3 459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3549 if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3459 3550 then 3460 3551 ac_cv_sizeof_char=`cat conftestval` … … 3476 3567 3477 3568 echo $ac_n "checking size of short""... $ac_c" 1>&6 3478 echo "configure:3 479: checking size of short" >&53569 echo "configure:3570: checking size of short" >&5 3479 3570 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then 3480 3571 echo $ac_n "(cached) $ac_c" 1>&6 … … 3484 3575 else 3485 3576 cat > conftest.$ac_ext <<EOF 3486 #line 3 487"configure"3577 #line 3578 "configure" 3487 3578 #include "confdefs.h" 3488 3579 #include <stdio.h> … … 3495 3586 } 3496 3587 EOF 3497 if { (eval echo configure:3 498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3588 if { (eval echo configure:3589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3498 3589 then 3499 3590 ac_cv_sizeof_short=`cat conftestval` … … 3515 3606 3516 3607 echo $ac_n "checking size of int""... $ac_c" 1>&6 3517 echo "configure:3 518: checking size of int" >&53608 echo "configure:3609: checking size of int" >&5 3518 3609 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then 3519 3610 echo $ac_n "(cached) $ac_c" 1>&6 … … 3523 3614 else 3524 3615 cat > conftest.$ac_ext <<EOF 3525 #line 3 526"configure"3616 #line 3617 "configure" 3526 3617 #include "confdefs.h" 3527 3618 #include <stdio.h> … … 3534 3625 } 3535 3626 EOF 3536 if { (eval echo configure:3 537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3627 if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3537 3628 then 3538 3629 ac_cv_sizeof_int=`cat conftestval` … … 3554 3645 3555 3646 echo $ac_n "checking size of long""... $ac_c" 1>&6 3556 echo "configure:3 557: checking size of long" >&53647 echo "configure:3648: checking size of long" >&5 3557 3648 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then 3558 3649 echo $ac_n "(cached) $ac_c" 1>&6 … … 3562 3653 else 3563 3654 cat > conftest.$ac_ext <<EOF 3564 #line 3 565"configure"3655 #line 3656 "configure" 3565 3656 #include "confdefs.h" 3566 3657 #include <stdio.h> … … 3573 3664 } 3574 3665 EOF 3575 if { (eval echo configure:3 576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3666 if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3576 3667 then 3577 3668 ac_cv_sizeof_long=`cat conftestval` … … 3593 3684 3594 3685 echo $ac_n "checking size of void*""... $ac_c" 1>&6 3595 echo "configure:3 596: checking size of void*" >&53686 echo "configure:3687: checking size of void*" >&5 3596 3687 if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then 3597 3688 echo $ac_n "(cached) $ac_c" 1>&6 … … 3601 3692 else 3602 3693 cat > conftest.$ac_ext <<EOF 3603 #line 36 04"configure"3694 #line 3695 "configure" 3604 3695 #include "confdefs.h" 3605 3696 #include <stdio.h> … … 3612 3703 } 3613 3704 EOF 3614 if { (eval echo configure:3 615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3705 if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3615 3706 then 3616 3707 ac_cv_sizeof_voidp=`cat conftestval` … … 3632 3723 3633 3724 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 3634 echo "configure:3 635: checking whether byte ordering is bigendian" >&53725 echo "configure:3726: checking whether byte ordering is bigendian" >&5 3635 3726 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then 3636 3727 echo $ac_n "(cached) $ac_c" 1>&6 … … 3639 3730 # See if sys/param.h defines the BYTE_ORDER macro. 3640 3731 cat > conftest.$ac_ext <<EOF 3641 #line 3 642"configure"3732 #line 3733 "configure" 3642 3733 #include "confdefs.h" 3643 3734 #include <sys/types.h> … … 3650 3741 ; return 0; } 3651 3742 EOF 3652 if { (eval echo configure:3 653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3743 if { (eval echo configure:3744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3653 3744 rm -rf conftest* 3654 3745 # It does; now see whether it defined to BIG_ENDIAN or not. 3655 3746 cat > conftest.$ac_ext <<EOF 3656 #line 3 657"configure"3747 #line 3748 "configure" 3657 3748 #include "confdefs.h" 3658 3749 #include <sys/types.h> … … 3665 3756 ; return 0; } 3666 3757 EOF 3667 if { (eval echo configure:3 668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then3758 if { (eval echo configure:3759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 3668 3759 rm -rf conftest* 3669 3760 ac_cv_c_bigendian=yes … … 3685 3776 else 3686 3777 cat > conftest.$ac_ext <<EOF 3687 #line 3 688"configure"3778 #line 3779 "configure" 3688 3779 #include "confdefs.h" 3689 3780 main () { … … 3698 3789 } 3699 3790 EOF 3700 if { (eval echo configure:37 01: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null3791 if { (eval echo configure:3792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null 3701 3792 then 3702 3793 ac_cv_c_bigendian=no … … 3731 3822 3732 3823 echo $ac_n "checking which exponent types to use""... $ac_c" 1>&6 3733 echo "configure:3 734: checking which exponent types to use" >&53824 echo "configure:3825: checking which exponent types to use" >&5 3734 3825 if test "$with_exp_type" = "char"; then 3735 3826 echo "$ac_t""char" 1>&6 … … 3765 3856 3766 3857 echo $ac_n "checking whether _AIX is defined""... $ac_c" 1>&6 3767 echo "configure:3 768: checking whether _AIX is defined" >&53858 echo "configure:3859: checking whether _AIX is defined" >&5 3768 3859 if eval "test \"`echo '$''{'ac_cv_is_aix'+set}'`\" = set"; then 3769 3860 echo $ac_n "(cached) $ac_c" 1>&6 3770 3861 else 3771 3862 cat > conftest.$ac_ext <<EOF 3772 #line 3 773"configure"3863 #line 3864 "configure" 3773 3864 #include "confdefs.h" 3774 3865 #ifdef _AIX … … 3952 4043 s%@SINGULAR_MINOR_VERSION@%$SINGULAR_MINOR_VERSION%g 3953 4044 s%@SINGULAR_SUB_VERSION@%$SINGULAR_SUB_VERSION%g 4045 s%@LEX@%$LEX%g 4046 s%@LEXLIB@%$LEXLIB%g 4047 s%@LEXP@%$LEXP%g 3954 4048 s%@CC@%$CC%g 3955 4049 s%@CPP@%$CPP%g -
Singular/configure.in
r057fd3 rf92fa13 8 8 SINGULAR_MAJOR_VERSION=1 9 9 SINGULAR_MINOR_VERSION=1 10 SINGULAR_SUB_VERSION= 610 SINGULAR_SUB_VERSION=7 11 11 VERSION_DATE="March 1998" 12 12 AC_SUBST(SINGULAR_MAJOR_VERSION) … … 67 67 fi 68 68 69 AC_PROG_LEX 70 # make sure lex accepts -P option 71 if test "${ac_cv_prog_LEX+set}" = set; then 72 AC_MSG_CHECKING(whether ${ac_cv_prog_LEX} accepts -P) 73 if ${ac_cv_prog_LEX} -P < /dev/null 2>&1| grep flag > /dev/null 2>&1; then 74 AC_MSG_RESULT(no) 75 AC_MSG_WARN(Can not run ${ac_cv_prog_LEX} with -P; make might fail) 76 LEXP=touch 77 else 78 AC_MSG_RESULT(yes) 79 LEXP=${ac_cv_prog_LEX} 80 fi 81 fi 82 AC_SUBST(LEXP) 69 83 AC_PROG_CC 70 84 AC_PROG_CPP -
Singular/febase.h
r057fd3 rf92fa13 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1. 7 1998-02-27 16:27:56 SingularExp $ */6 /* $Id: febase.h,v 1.8 1998-03-16 14:56:30 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT … … 100 100 void myyoldbuffer(void * oldb); 101 101 102 /* assume(x) -- a handy macro for assumptions */ 103 #ifdef NDEBUG 104 /* empty macro, if NDEBUG */ 105 #define assume(x) ((void*) 0) 106 #else /* ! NDEBUG */ 107 #define assume(x) _assume(x, __FILE__, __LINE__) 108 #define _assume(x, f, l) \ 109 do \ 110 { \ 111 if (! (x)) \ 112 { \ 113 Warn("Internal assume violation: file %s line %d\n", f, l); \ 114 } \ 115 } \ 116 while (0) 117 #endif /* NDEBUG */ 102 118 103 119 class Voice -
Singular/kstd1.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd1.cc,v 1.1 4 1998-01-17 18:07:57 SingularExp $ */4 /* $Id: kstd1.cc,v 1.15 1998-03-16 14:56:31 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: … … 1644 1644 initMora(F,strat); 1645 1645 #ifdef COMP_FAST 1646 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1646 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1647 1647 #endif 1648 1648 strat->enterS = enterSMoraNF; … … 1739 1739 /*- set T -*/ 1740 1740 #ifdef COMP_FAST 1741 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1741 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1742 1742 #endif 1743 1743 strat->tl = -1; … … 1877 1877 spSet(currRing); 1878 1878 #ifdef COMP_FAST 1879 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1879 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1880 1880 #endif 1881 1881 if (pOrdSgn==-1) … … 2078 2078 spSet(currRing); 2079 2079 #ifdef COMP_FAST 2080 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);2080 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 2081 2081 #endif 2082 2082 if (pOrdSgn==-1) … … 2154 2154 spSet(currRing); 2155 2155 #ifdef COMP_FAST 2156 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);2156 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 2157 2157 #endif 2158 2158 if (pOrdSgn==-1) … … 2175 2175 strat->syzComp = syzComp; 2176 2176 #ifdef COMP_FAST 2177 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);2177 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 2178 2178 #endif 2179 2179 if (pOrdSgn==-1) … … 2218 2218 strat->T = initT(); 2219 2219 #ifdef COMP_FAST 2220 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);2220 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 2221 2221 #endif 2222 2222 if (pOrdSgn == -1) strat->honey = TRUE; -
Singular/kstd2.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstd2.cc,v 1.1 1 1998-01-27 18:51:19 SingularExp $ */4 /* $Id: kstd2.cc,v 1.12 1998-03-16 14:56:32 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: alg. of Buchberger … … 1548 1548 strat->sl = -1; 1549 1549 #ifdef COMP_FAST 1550 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1550 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1551 1551 #endif 1552 1552 /*- init local data struct.---------------------------------------- -*/ … … 1593 1593 strat->sl = -1; 1594 1594 #ifdef COMP_FAST 1595 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1595 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1596 1596 #endif 1597 1597 /*- init local data struct.---------------------------------------- -*/ … … 1685 1685 spSet(currRing); 1686 1686 #ifdef COMP_FAST 1687 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);1687 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 1688 1688 #endif 1689 1689 initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/ -
Singular/kstdfac.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kstdfac.cc,v 1.1 1 1998-02-17 17:53:01 SingularExp $ */4 /* $Id: kstdfac.cc,v 1.12 1998-03-16 14:56:34 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT - Kernel: factorizing alg. of Buchberger … … 754 754 spSet(currRing); 755 755 #ifdef COMP_FAST 756 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);756 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 757 757 #endif 758 758 initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/ -
Singular/kutil.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: kutil.cc,v 1.1 1 1998-01-05 16:39:23 SingularExp $ */4 /* $Id: kutil.cc,v 1.12 1998-03-16 14:56:34 obachman Exp $ */ 5 5 /* 6 6 * ABSTRACT: kernel: utils for std … … 3633 3633 strat->noTailReduction = !TEST_OPT_REDTAIL; 3634 3634 #ifdef COMP_FAST 3635 strat->spSpolyLoop = sp SetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);3635 strat->spSpolyLoop = spGetSpolyLoop(currRing, strat); 3636 3636 #endif 3637 3637 if(!TEST_OPT_SB_1) … … 3807 3807 return FALSE; 3808 3808 } 3809 3810 rOrderType_t spGetOrderType(ring r, kStrategy strat) 3811 { 3812 if (strat->syzComp > 0) 3813 return rOrderType_Syz; 3814 else 3815 { 3816 rOrderType_t rot = rGetOrderType(r); 3817 3818 if ((rot == rOrderType_CompExp || rot == rOrderType_ExpComp) && 3819 (strat->ak == 0)) 3820 return rOrderType_Exp; 3821 else 3822 return rot; 3823 } 3824 } 3825 3826 -
Singular/kutil.h
r057fd3 rf92fa13 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: kutil.h,v 1. 4 1997-12-03 16:58:50obachman Exp $ */6 /* $Id: kutil.h,v 1.5 1998-03-16 14:56:35 obachman Exp $ */ 7 7 /* 8 8 * ABSTRACT: kernel: utils for std … … 10 10 #include "structs.h" 11 11 #include "mmemory.h" 12 #include "ring.h" 12 13 #include <string.h> 13 14 … … 172 173 BOOLEAN homogTest(polyset F, int Fmax); 173 174 BOOLEAN newHEdge(polyset S, int ak,kStrategy strat); 175 rOrderType_t spGetOrderType(ring r, kStrategy strat); 174 176 175 177 inline TSet initT () { return (TSet)Alloc0(setmax*sizeof(TObject)); } -
Singular/mod2.h.in
r057fd3 rf92fa13 233 233 234 234 #ifdef DO_PROFILE 235 /* define to enable explicit profiling of some crucial inline routines and defines */ 235 /* define to enable explicit profiling of some crucial inline 236 * routines and defines */ 236 237 #define DO_DEEP_PROFILE 237 238 #endif 239 238 240 /******************************************************************* 239 241 * DEBUG OPTIONS -
Singular/polys-comp.h
r057fd3 rf92fa13 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-comp.h,v 1. 4 1998-01-17 17:49:24obachman Exp $ */6 /* $Id: polys-comp.h,v 1.5 1998-03-16 14:56:38 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 21 21 #ifdef WORDS_BIGENDIAN 22 22 #ifndef COMP_NO_EXP_VECTOR_OPS 23 #define _pMonC mp_1(p1, p2, d, actionD, actionE) \23 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 24 24 do \ 25 25 { \ … … 30 30 while(0) 31 31 32 #define _pMonC mp_1_c(p1, p2, d, actionD, actionE) \32 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 33 33 do \ 34 34 { \ … … 44 44 while(0) 45 45 46 #define _pMonC mp_2(p1, p2, d, actionD, actionE) \46 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 47 47 do \ 48 48 { \ … … 57 57 while(0) 58 58 59 #define _pMonC mp_2_c(p1, p2, d, actionD, actionE) \59 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 60 60 do \ 61 61 { \ … … 75 75 while(0) 76 76 77 #define _pMonC mp_2i(p1, p2, length, d, actionD, actionE) \77 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 78 78 do \ 79 79 { \ … … 97 97 while(0) 98 98 99 #define _pMonC mp_2i_1(p1, p2, length, d, actionD, actionE) \99 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 100 100 do \ 101 101 { \ … … 119 119 while(0) 120 120 121 #define _pMonC mp_2i_c(p1, p2, length, d, actionD, actionE) \121 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 122 122 do \ 123 123 { \ … … 150 150 while(0) 151 151 152 #define _pMonC mp_2i_1_c(p1, p2, length, d, actionD, actionE) \152 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 153 153 do \ 154 154 { \ … … 206 206 while(0) 207 207 208 #define _pMonC mp_c(p1, p2, d, actionD, actionE) \208 #define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \ 209 209 do \ 210 210 { \ … … 229 229 while(0) 230 230 231 #define _pMonC mp_1(p1, p2, d, actionD, actionE) \232 _pMonCmp(p1, p2, d, actionD, actionE) 233 234 #define _pMonC mp_1_c(p1, p2, d, actionD, actionE) \235 _pMonC mp_c(p1, p2, d, actionD, actionE)236 237 #define _pMonC mp_2(p1, p2, d, actionD, actionE) \238 _pMonCmp(p1, p2, d, actionD, actionE) 239 240 #define _pMonC mp_2_c(p1, p2, d, actionD, actionE) \241 _pMonC mp_c(p1, p2, d, actionD, actionE)242 243 #define _pMonC mp_2i(p1, p2, length, d, actionD, actionE) \244 _pMonCmp(p1, p2, d, actionD, actionE) 245 246 #define _pMonC mp_2i_1(p1, p2, length, d, actionD, actionE) \247 _pMonCmp(p1, p2, d, actionD, actionE) 248 249 #define _pMonC mp_2i_c(p1, p2, length, d, actionD, actionE) \250 _pMonC mp_c(p1, p2, d, actionD, actionE)251 252 #define _pMonC mp_2i_1_c(p1, p2, length, d, actionD, actionE) \253 _pMonC mp_c(p1, p2, d, actionD, actionE)231 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 232 _pMonCmp(p1, p2, d, actionD, actionE) 233 234 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 235 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 236 237 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 238 _pMonCmp(p1, p2, d, actionD, actionE) 239 240 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 241 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 242 243 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 244 _pMonCmp(p1, p2, d, actionD, actionE) 245 246 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 247 _pMonCmp(p1, p2, d, actionD, actionE) 248 249 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 250 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 251 252 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 253 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 254 254 255 255 #endif // COMP_NO_EXP_VECTOR_OPS … … 258 258 259 259 #ifndef COMP_NO_EXP_VECTOR_OPS 260 #define _pMonC mp_1(p1, p2, d, actionD, actionE) \260 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 261 261 do \ 262 262 { \ … … 267 267 while(0) 268 268 269 #define _pMonC mp_1_c(p1, p2, d, actionD, actionE) \269 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 270 270 do \ 271 271 { \ … … 281 281 while(0) 282 282 283 #define _pMonC mp_2(p1, p2, d, actionD, actionE) \283 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 284 284 do \ 285 285 { \ … … 294 294 while(0) 295 295 296 #define _pMonC mp_2_c(p1, p2, d, actionD, actionE) \296 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 297 297 do \ 298 298 { \ … … 314 314 while(0) 315 315 316 #define _pMonC mp_2i(p1, p2, length, d, actionD, actionE) \316 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 317 317 do \ 318 318 { \ … … 335 335 while(0) 336 336 337 #define _pMonC mp_2i_1(p1, p2, length, d, actionD, actionE) \337 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 338 338 do \ 339 339 { \ … … 357 357 while(0) 358 358 359 #define _pMonC mp_2i_c(p1, p2, length, d, actionD, actionE) \359 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 360 360 do \ 361 361 { \ … … 388 388 while(0) 389 389 390 #define _pMonC mp_2i_1_c(p1, p2, length, d, actionD, actionE) \390 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 391 391 do \ 392 392 { \ … … 444 444 while(0) 445 445 446 #define _pMonC mp_c(p1, p2, d, actionD, actionE) \446 #define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \ 447 447 do \ 448 448 { \ … … 467 467 while(0) 468 468 469 #define _pMonC mp_1(p1, p2, d, actionD, actionE) \470 _pMonCmp(p1, p2, d, actionD, actionE) 471 472 #define _pMonC mp_1_c(p1, p2, d, actionD, actionE) \473 _pMonC mp_c(p1, p2, d, actionD, actionE)474 475 #define _pMonC mp_2(p1, p2, d, actionD, actionE) \476 _pMonCmp(p1, p2, d, actionD, actionE) 477 478 #define _pMonC mp_2_c(p1, p2, d, actionD, actionE) \479 _pMonC mp_c(p1, p2, d, actionD, actionE)480 481 #define _pMonC mp_2i(p1, p2, length, d, actionD, actionE) \482 _pMonCmp(p1, p2, d, actionD, actionE) 483 484 #define _pMonC mp_2i_1(p1, p2, length, d, actionD, actionE) \485 _pMonCmp(p1, p2, d, actionD, actionE) 486 487 #define _pMonC mp_2i_c(p1, p2, length, d, actionD, actionE) \488 _pMonC mp_c(p1, p2, d, actionD, actionE)489 490 #define _pMonC mp_2i_1_c(p1, p2, length, d, actionD, actionE) \491 _pMonC mp_c(p1, p2, d, actionD, actionE)469 #define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE) \ 470 _pMonCmp(p1, p2, d, actionD, actionE) 471 472 #define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE) \ 473 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 474 475 #define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE) \ 476 _pMonCmp(p1, p2, d, actionD, actionE) 477 478 #define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE) \ 479 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 480 481 #define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 482 _pMonCmp(p1, p2, d, actionD, actionE) 483 484 #define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE) \ 485 _pMonCmp(p1, p2, d, actionD, actionE) 486 487 #define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE) \ 488 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 489 490 #define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \ 491 _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) 492 492 493 493 #endif // COMP_NO_EXP_VECTOR_OPS -
Singular/polys-impl.h
r057fd3 rf92fa13 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: polys-impl.h,v 1.1 7 1998-01-28 22:11:22 SingularExp $ */6 /* $Id: polys-impl.h,v 1.18 1998-03-16 14:56:38 obachman Exp $ */ 7 7 8 8 /*************************************************************** … … 74 74 monomial operations, i.e. does everything exponent-wise. 75 75 ***************************************************************/ 76 //#define COMP_FAST76 #define COMP_FAST 77 77 // #define COMP_DEBUG 78 78 // #define COMP_NO_EXP_VECTOR_OPS … … 400 400 #else 401 401 #define _pNew() (poly) mmAllocSpecialized() 402 #endif403 402 // #define _pNew() _pInit() 403 #endif 404 404 405 405 #include <string.h> … … 624 624 DECLARE(BOOLEAN, __pDivisibleBy(poly a, poly b)) 625 625 { 626 const unsigned long* s1;627 const unsigned long* s2;628 const unsigned long* lb;629 630 626 #ifdef WORDS_BIGENDIAN 631 lb = (unsigned long*) &(a->exp[0]); 632 if (pVariables & ((SIZEOF_LONG / SIZEOF_EXPONENT) - 1)) 633 { 634 // now pVariables == pVariables1W, i.e. there are exponents in the 635 // "first" word of exponentvector 636 s1 = ((unsigned long*) a) + pMonomSizeW -1; 637 s2 = ((unsigned long*) b) + pMonomSizeW -1; 638 } 639 else 640 { 641 // first exponent word has only component as significant field -- 642 // Hence, do not bother 643 s1 = ((unsigned long*) a) + pMonomSizeW -2; 644 s2 = ((unsigned long*) b) + pMonomSizeW -2; 645 } 646 #else // !WORDS_BIGENDIAN 647 lb = ((unsigned long*) a) + pMonomSizeW; 648 if (pVariables & ((SIZEOF_LONG / SIZEOF_EXPONENT) - 1)) 649 { 650 s1 = (unsigned long*) &(a->exp[0]); 651 s2 = (unsigned long*) &(b->exp[0]); 652 } 653 else 654 { 655 s1 = (unsigned long*) &(a->exp[0]) + 1; 656 s2 = (unsigned long*) &(b->exp[0]) + 1; 657 } 658 #endif 627 const unsigned long* const lb = (unsigned long*) &(a->exp[0]);; 628 const unsigned long* s1 = ((unsigned long*) a) + pMonomSizeW -1; 629 const unsigned long* s2 = ((unsigned long*) b) + pMonomSizeW -1; 630 #else 631 const unsigned long* const lb = ((unsigned long*) a) + pMonomSizeW; 632 const unsigned long* s1 = (unsigned long*) &(a->exp[0]); 633 const unsigned long* s2 = (unsigned long*) &(b->exp[0]); 634 #endif 635 659 636 for (;;) 660 637 { 661 // O.K. -- and now comes a bit of magic. The following _really_ 662 // works. Think about it! If you can prove it, please tell me, for I 663 // did not bother to prove it formally (Hint: We can assume that our 664 // exponents are always positive). 638 // Yes, the following is correct, provided that the exponents do 639 // not have their first bit set 665 640 if ((*s2 - *s1) & P_DIV_MASK) return FALSE; 666 641 #ifdef WORDS_BIGENDIAN -
Singular/polys.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: polys.cc,v 1.1 5 1998-01-27 16:20:42 pohlExp $ */4 /* $Id: polys.cc,v 1.16 1998-03-16 14:56:39 obachman Exp $ */ 5 5 6 6 /* … … 226 226 #ifdef COMP_FAST 227 227 static pCompProc f_pComp0 = NULL; 228 static int f_comp_ 1(poly p1, poly p2);229 static int f_comp_ c_1(poly p1, poly p2);230 static int f_comp_ 1_c(poly p1, poly p2);231 static int f_comp_ 2(poly p1, poly p2);232 static int f_comp_ c_2(poly p1, poly p2);233 static int f_comp_ 2_c(poly p1, poly p2);234 static int f_comp_ 2i(poly p1, poly p2);235 static int f_comp_ c_2i(poly p1, poly p2);236 static int f_comp_ 2i_c(poly p1, poly p2);237 static int f_comp_ 2i_1(poly p1, poly p2);238 static int f_comp_ c_2i_1(poly p1, poly p2);239 static int f_comp_ 2i_1_c(poly p1, poly p2);228 static int f_comp_otEXP_nwONE(poly p1, poly p2); 229 static int f_comp_otCOMPEXP_nwONE(poly p1, poly p2); 230 static int f_comp_otEXPCOMP_nwONE(poly p1, poly p2); 231 static int f_comp_otEXP_nwTWO(poly p1, poly p2); 232 static int f_comp_otCOMPEXP_nwTWO(poly p1, poly p2); 233 static int f_comp_otEXPCOMP_nwTWO(poly p1, poly p2); 234 static int f_comp_otEXP_nwEVEN(poly p1, poly p2); 235 static int f_comp_otCOMPEXP_nwEVEN(poly p1, poly p2); 236 static int f_comp_otEXPCOMP_nwEVEN(poly p1, poly p2); 237 static int f_comp_otEXP_nwODD(poly p1, poly p2); 238 static int f_comp_otCOMPEXP_nwODD(poly p1, poly p2); 239 static int f_comp_otEXPCOMP_nwODD(poly p1, poly p2); 240 240 241 241 #define Mreturn(d, multiplier) \ … … 245 245 } 246 246 247 // comp_ 1is used if pVariables1W == 1 and component is compatible with ordering248 static int f_comp_ 1(poly p1, poly p2)247 // comp_nwONE is used if pVariables1W == 1 and component is compatible with ordering 248 static int f_comp_otEXP_nwONE(poly p1, poly p2) 249 249 { 250 250 register long d = pGetOrder(p1) - pGetOrder(p2); 251 251 252 252 if (d) Mreturn(d, pOrdSgn); 253 _pMonC mp_1(p1, p2, d, goto NotEqual, return 0);253 _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual, return 0); 254 254 255 255 NotEqual: … … 257 257 } 258 258 259 // comp_ 1_cis used if pVariables1W == 1, priority is given to exponents,259 // comp_otEXPCOMP_nwONE is used if pVariables1W == 1, priority is given to exponents, 260 260 // component is incompatible with ordering 261 static int f_comp_ 1_c(poly p1, poly p2)261 static int f_comp_otEXPCOMP_nwONE(poly p1, poly p2) 262 262 { 263 263 register long d = pGetOrder(p1) - pGetOrder(p2); 264 264 265 265 if (d) Mreturn(d, pOrdSgn); 266 _pMonC mp_1_c(p1, p2, d, goto NotEqual , return 0);266 _pMonComp_otEXPCOMP_nwONE(p1, p2, d, goto NotEqual , return 0); 267 267 268 268 NotEqual: … … 270 270 } 271 271 272 // comp_ 1_cis used if pVariables1W == 1, priority is given to component,272 // comp_otEXPCOMP_nwONE is used if pVariables1W == 1, priority is given to component, 273 273 // component is incompatible with ordering 274 static int f_comp_ c_1(poly p1, poly p2)274 static int f_comp_otCOMPEXP_nwONE(poly p1, poly p2) 275 275 { 276 276 register long d = pGetComp(p2) - pGetComp(p1); … … 278 278 d = pGetOrder(p1) - pGetOrder(p2); 279 279 if (d) Mreturn(d, pOrdSgn); 280 _pMonC mp_1(p1, p2, d, goto NotEqual , return 0);280 _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual , return 0); 281 281 282 282 NotEqual: … … 284 284 } 285 285 286 // comp_ 2is used if pVariables1W == 2 and component is compatible with ordering287 static int f_comp_ 2(poly p1, poly p2)286 // comp_nwTWO is used if pVariables1W == 2 and component is compatible with ordering 287 static int f_comp_otEXP_nwTWO(poly p1, poly p2) 288 288 { 289 289 register long d = pGetOrder(p1) - pGetOrder(p2); 290 290 291 291 if (d) Mreturn(d, pOrdSgn); 292 _pMonC mp_2(p1, p2, d, goto NotEqual , return 0);292 _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0); 293 293 294 294 NotEqual: … … 296 296 } 297 297 298 // comp_ 2_cis used if pVariables1W == 2, priority is given to exponents,298 // comp_otEXPCOMP_nwTWO is used if pVariables1W == 2, priority is given to exponents, 299 299 // component is incompatible with ordering 300 static int f_comp_ 2_c(poly p1, poly p2)300 static int f_comp_otEXPCOMP_nwTWO(poly p1, poly p2) 301 301 { 302 302 register long d = pGetOrder(p1) - pGetOrder(p2); 303 303 304 304 if (d) Mreturn(d, pOrdSgn); 305 _pMonC mp_2_c(p1, p2, d, goto NotEqual, return 0);305 _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, goto NotEqual, return 0); 306 306 307 307 NotEqual: … … 309 309 } 310 310 311 // comp_ 2_cis used if pVariables1W == 2, priority is given to component,311 // comp_otEXPCOMP_nwTWO is used if pVariables1W == 2, priority is given to component, 312 312 // component is incompatible with ordering 313 static int f_comp_ c_2(poly p1, poly p2)313 static int f_comp_otCOMPEXP_nwTWO(poly p1, poly p2) 314 314 { 315 315 register long d = pGetComp(p2) - pGetComp(p1); … … 317 317 d = pGetOrder(p1) - pGetOrder(p2); 318 318 if (d) Mreturn(d, pOrdSgn); 319 _pMonC mp_2(p1, p2, d, goto NotEqual , return 0);319 _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0); 320 320 321 321 NotEqual: … … 323 323 } 324 324 325 // comp_ 2iis used if pVariables1W == 2*i and component is compatible325 // comp_nwEVEN is used if pVariables1W == 2*i and component is compatible 326 326 // with ordering 327 static int f_comp_ 2i(poly p1, poly p2)327 static int f_comp_otEXP_nwEVEN(poly p1, poly p2) 328 328 { 329 329 register long d = pGetOrder(p1) - pGetOrder(p2); 330 330 331 331 if (d) Mreturn(d, pOrdSgn); 332 _pMonC mp_2i(p1, p2, pVariables1W, d, goto NotEqual , return 0);332 _pMonComp_otEXP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 333 333 334 334 NotEqual: … … 336 336 } 337 337 338 // comp_ 2i_cis used if pVariables1W == 2*i, priority is given to exponents,338 // comp_otEXPCOMP_nwEVEN is used if pVariables1W == 2*i, priority is given to exponents, 339 339 // component is incompatible with ordering 340 static int f_comp_ 2i_c(poly p1, poly p2)340 static int f_comp_otEXPCOMP_nwEVEN(poly p1, poly p2) 341 341 { 342 342 register long d = pGetOrder(p1) - pGetOrder(p2); 343 343 344 344 if (d) Mreturn(d, pOrdSgn); 345 _pMonC mp_2i_c(p1, p2, pVariables1W, d, goto NotEqual , return 0);345 _pMonComp_otEXPCOMP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0); 346 346 347 347 NotEqual: … … 349 349 } 350 350 351 // comp_ 2i_cis used if pVariables1W == 2*i, priority is given to component,351 // comp_otEXPCOMP_nwEVEN is used if pVariables1W == 2*i, priority is given to component, 352 352 // component is incompatible with ordering 353 static int f_comp_ c_2i(poly p1, poly p2)353 static int f_comp_otCOMPEXP_nwEVEN(poly p1, poly p2) 354 354 { 355 355 register long d = pGetComp(p2) - pGetComp(p1); … … 357 357 d = pGetOrder(p1) - pGetOrder(p2); 358 358 if (d) Mreturn(d, pOrdSgn); 359 _pMonC mp_2i(p1, p2, pVariablesW, d, goto NotEqual, return 0);359 _pMonComp_otEXP_nwEVEN(p1, p2, pVariablesW, d, goto NotEqual, return 0); 360 360 361 361 NotEqual: … … 363 363 } 364 364 365 // comp_ 2i_1is used if pVariables1W == 2*i and component is compatible365 // comp_nwODD is used if pVariables1W == 2*i and component is compatible 366 366 // with ordering 367 static int f_comp_ 2i_1(poly p1, poly p2)367 static int f_comp_otEXP_nwODD(poly p1, poly p2) 368 368 { 369 369 register long d = pGetOrder(p1) - pGetOrder(p2); 370 370 371 371 if (d) Mreturn(d, pOrdSgn); 372 _pMonC mp_2i_1(p1, p2, pVariables1W, d, goto NotEqual, return 0);372 _pMonComp_otEXP_nwODD(p1, p2, pVariables1W, d, goto NotEqual, return 0); 373 373 374 374 NotEqual: … … 376 376 } 377 377 378 // comp_ 2i_1_cis used if pVariables1W == 2*i, priority is given to exponents,378 // comp_otEXPCOMP_nwODD is used if pVariables1W == 2*i, priority is given to exponents, 379 379 // component is incompatible with ordering 380 static int f_comp_ 2i_1_c(poly p1, poly p2)380 static int f_comp_otEXPCOMP_nwODD(poly p1, poly p2) 381 381 { 382 382 register long d = pGetOrder(p1) - pGetOrder(p2); … … 387 387 } 388 388 389 _pMonC mp_2i_1_c(p1, p2, pVariables1W, d, goto NotEqual , return 0);389 _pMonComp_otEXPCOMP_nwODD(p1, p2, pVariables1W, d, goto NotEqual , return 0); 390 390 391 391 NotEqual: … … 393 393 } 394 394 395 // comp_ c_2i_1is used if pVariables1W == 2*i, priority is given to component,395 // comp_otCOMPEXP_nwODD is used if pVariables1W == 2*i, priority is given to component, 396 396 // component is incompatible with ordering 397 static int f_comp_ c_2i_1(poly p1, poly p2)397 static int f_comp_otCOMPEXP_nwODD(poly p1, poly p2) 398 398 { 399 399 register long d = pGetComp(p2) - pGetComp(p1); … … 401 401 d = pGetOrder(p1) - pGetOrder(p2); 402 402 if (d) Mreturn(d, pOrdSgn); 403 _pMonC mp_2i_1(p1, p2, pVariablesW, d, goto NotEqual, return 0);403 _pMonComp_otEXP_nwODD(p1, p2, pVariablesW, d, goto NotEqual, return 0); 404 404 405 405 NotEqual: … … 417 417 pCompProc t_pComp0; 418 418 419 static int t_comp_ c_1(poly p1, poly p2);420 static int t_comp_ 1_c(poly p1, poly p2);421 static int t_comp_lex_ c_i(poly p1, poly p2);422 static int t_comp_ c_lex_i(poly p1, poly p2);423 static int t_comp_revlex_ c_i(poly p1, poly p2);424 static int t_comp_ c_revlex_i(poly p1, poly p2);419 static int t_comp_otCOMPEXP_nwONE(poly p1, poly p2); 420 static int t_comp_otEXPCOMP_nwONE(poly p1, poly p2); 421 static int t_comp_lex_otCOMPEXP_i(poly p1, poly p2); 422 static int t_comp_otCOMPEXP_lex_i(poly p1, poly p2); 423 static int t_comp_revlex_otCOMPEXP_i(poly p1, poly p2); 424 static int t_comp_otCOMPEXP_revlex_i(poly p1, poly p2); 425 425 426 426 inline long LexComp(poly p1, poly p2) … … 446 446 } 447 447 448 static int t_comp_ c_1(poly p1, poly p2)448 static int t_comp_otCOMPEXP_nwONE(poly p1, poly p2) 449 449 { 450 450 NonZeroR(pGetComp(p1) - pGetComp(p2), … … 454 454 } 455 455 456 static int t_comp_ 1_c(poly p1, poly p2)456 static int t_comp_otEXPCOMP_nwONE(poly p1, poly p2) 457 457 { 458 458 NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn); … … 462 462 } 463 463 464 static int t_comp_lex_ c_i(poly p1, poly p2)464 static int t_comp_lex_otCOMPEXP_i(poly p1, poly p2) 465 465 { 466 466 NonZeroR(pGetComp(p1) - pGetComp(p2), … … 471 471 } 472 472 473 static int t_comp_ lex_i_c(poly p1, poly p2)473 static int t_comp_otEXPCOMP_lex_i(poly p1, poly p2) 474 474 { 475 475 NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn); … … 480 480 } 481 481 482 static int t_comp_revlex_ c_i(poly p1, poly p2)482 static int t_comp_revlex_otCOMPEXP_i(poly p1, poly p2) 483 483 { 484 484 NonZeroR(pGetComp(p1) - pGetComp(p2), … … 489 489 } 490 490 491 static int t_comp_ revlex_i_c(poly p1, poly p2)491 static int t_comp_otEXPCOMP_revlex_i(poly p1, poly p2) 492 492 { 493 493 NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn); … … 1297 1297 if (pVariables <= 1) 1298 1298 { 1299 t_pComp0 = t_comp_ 1_c;1299 t_pComp0 = t_comp_otEXPCOMP_nwONE; 1300 1300 } 1301 1301 else … … 1309 1309 case ringorder_Ws: 1310 1310 case ringorder_ls: 1311 t_pComp0 = t_comp_ lex_i_c;1311 t_pComp0 = t_comp_otEXPCOMP_lex_i; 1312 1312 pLexSgn = 1; 1313 1313 break; … … 1322 1322 default: 1323 1323 #endif 1324 t_pComp0 = t_comp_ revlex_i_c;1324 t_pComp0 = t_comp_otEXPCOMP_revlex_i; 1325 1325 pLexSgn = -1; 1326 1326 break; … … 1355 1355 { 1356 1356 if (pVariables1W == 1) 1357 f_pComp0 = f_comp_ 1_c;1357 f_pComp0 = f_comp_otEXPCOMP_nwONE; 1358 1358 else if (pVariables1W == 2) 1359 f_pComp0 = f_comp_ 2_c;1359 f_pComp0 = f_comp_otEXPCOMP_nwTWO; 1360 1360 else if (pVariables1W & 1) 1361 f_pComp0 = f_comp_ 2i_1_c;1361 f_pComp0 = f_comp_otEXPCOMP_nwODD; 1362 1362 else 1363 f_pComp0 = f_comp_ 2i_c;1363 f_pComp0 = f_comp_otEXPCOMP_nwEVEN; 1364 1364 } 1365 1365 else 1366 1366 { 1367 1367 if (pVariables1W == 1) 1368 f_pComp0 = f_comp_ 1;1368 f_pComp0 = f_comp_otEXP_nwONE; 1369 1369 else if (pVariables1W == 2) 1370 f_pComp0 = f_comp_ 2;1370 f_pComp0 = f_comp_otEXP_nwTWO; 1371 1371 else if (pVariables1W & 1) 1372 f_pComp0 = f_comp_ 2i_1;1372 f_pComp0 = f_comp_otEXP_nwODD; 1373 1373 else 1374 f_pComp0 = f_comp_ 2i;1374 f_pComp0 = f_comp_otEXP_nwEVEN; 1375 1375 } 1376 1376 break; … … 1390 1390 { 1391 1391 if (pVariables1W == 1) 1392 f_pComp0 = f_comp_ 1_c;1392 f_pComp0 = f_comp_otEXPCOMP_nwONE; 1393 1393 else if (pVariables1W == 2) 1394 f_pComp0 = f_comp_ 2_c;1394 f_pComp0 = f_comp_otEXPCOMP_nwTWO; 1395 1395 else if (pVariables1W & 1) 1396 f_pComp0 = f_comp_ 2i_1_c;1396 f_pComp0 = f_comp_otEXPCOMP_nwODD; 1397 1397 else 1398 f_pComp0 = f_comp_ 2i_c;1398 f_pComp0 = f_comp_otEXPCOMP_nwEVEN; 1399 1399 } 1400 1400 else 1401 1401 { 1402 1402 if (pVariables1W == 1) 1403 f_pComp0 = f_comp_ 1;1403 f_pComp0 = f_comp_otEXP_nwONE; 1404 1404 else if (pVariables1W == 2) 1405 f_pComp0 = f_comp_ 2;1405 f_pComp0 = f_comp_otEXP_nwTWO; 1406 1406 else if (pVariables1W & 1) 1407 f_pComp0 = f_comp_ 2i_1;1407 f_pComp0 = f_comp_otEXP_nwODD; 1408 1408 else 1409 f_pComp0 = f_comp_ 2i;1409 f_pComp0 = f_comp_otEXP_nwEVEN; 1410 1410 } 1411 1411 #ifdef PDEBUG … … 1488 1488 if (pVariables <= 1) 1489 1489 { 1490 t_pComp0 = t_comp_ c_1;1490 t_pComp0 = t_comp_otCOMPEXP_nwONE; 1491 1491 } 1492 1492 else … … 1500 1500 case ringorder_Ws: 1501 1501 case ringorder_ls: 1502 t_pComp0 = t_comp_lex_ c_i;1502 t_pComp0 = t_comp_lex_otCOMPEXP_i; 1503 1503 pLexSgn = 1; 1504 1504 break; … … 1513 1513 default: 1514 1514 #endif 1515 t_pComp0 = t_comp_revlex_ c_i;1515 t_pComp0 = t_comp_revlex_otCOMPEXP_i; 1516 1516 pLexSgn = -1; 1517 1517 break; … … 1543 1543 pLexSgn = -1; 1544 1544 if (pVariablesW == 1) 1545 f_pComp0 = f_comp_ c_1;1545 f_pComp0 = f_comp_otCOMPEXP_nwONE; 1546 1546 else if (pVariablesW == 2) 1547 f_pComp0 = f_comp_ c_2;1547 f_pComp0 = f_comp_otCOMPEXP_nwTWO; 1548 1548 else if (pVariablesW & 1) 1549 f_pComp0 = f_comp_ c_2i_1;1549 f_pComp0 = f_comp_otCOMPEXP_nwODD; 1550 1550 else 1551 f_pComp0 = f_comp_ c_2i;1551 f_pComp0 = f_comp_otCOMPEXP_nwEVEN; 1552 1552 break; 1553 1553 … … 1564 1564 pLexSgn = 1; 1565 1565 if (pVariablesW == 1) 1566 f_pComp0 = f_comp_ c_1;1566 f_pComp0 = f_comp_otCOMPEXP_nwONE; 1567 1567 else if (pVariablesW == 2) 1568 f_pComp0 = f_comp_ c_2;1568 f_pComp0 = f_comp_otCOMPEXP_nwTWO; 1569 1569 else if (pVariablesW & 1) 1570 f_pComp0 = f_comp_ c_2i_1;1570 f_pComp0 = f_comp_otCOMPEXP_nwODD; 1571 1571 else 1572 f_pComp0 = f_comp_ c_2i;1572 f_pComp0 = f_comp_otCOMPEXP_nwEVEN; 1573 1573 #ifdef PDEBUG 1574 1574 break; … … 3141 3141 3142 3142 #ifdef COMP_STATISTICS 3143 static int s_comp_lp_ c_1(poly p1, poly p2)3143 static int s_comp_lp_otCOMPEXP_1(poly p1, poly p2) 3144 3144 { 3145 3145 MonomCountTotal++; … … 3159 3159 3160 3160 #ifdef COMP_STATISTICS 3161 static int s_comp_lp_ c_i(poly p1, poly p2)3161 static int s_comp_lp_otCOMPEXP_i(poly p1, poly p2) 3162 3162 { 3163 3163 MonomCountTotal++; -
Singular/ring.cc
r057fd3 rf92fa13 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: ring.cc,v 1.1 5 1998-02-16 09:46:55 SingularExp $ */4 /* $Id: ring.cc,v 1.16 1998-03-16 14:56:40 obachman Exp $ */ 5 5 6 6 /* … … 1665 1665 return res; 1666 1666 } 1667 1668 rOrderType_t rGetOrderType(ring r) 1669 { 1670 // check for simple ordering 1671 if ((r->order[0] == ringorder_unspec) || 1672 ((r->order[2] == 0) && 1673 (r->order[1] != ringorder_M && 1674 r->order[0] != ringorder_M))) 1675 { 1676 if ((r->order[1]==ringorder_c)||(r->order[1]==ringorder_C)) 1677 { 1678 return rOrderType_ExpComp; 1679 } 1680 else 1681 { 1682 assume((r->order[0]==ringorder_c)||(r->order[0]==ringorder_C)); 1683 return rOrderType_CompExp; 1684 } 1685 } 1686 else 1687 return rOrderType_General; 1688 } -
Singular/ring.h
r057fd3 rf92fa13 7 7 * ABSTRACT - the interpreter related ring operations 8 8 */ 9 /* $Id: ring.h,v 1. 8 1998-01-12 18:59:58obachman Exp $ */9 /* $Id: ring.h,v 1.9 1998-03-16 14:56:41 obachman Exp $ */ 10 10 11 11 /* includes */ … … 67 67 }; 68 68 69 typedef enum rOrderType_t 70 { 71 rOrderType_General = 0, // non-simple ordering as specified by currRing 72 rOrderType_CompExp, // simple ordering, component has priority 73 rOrderType_ExpComp, // simple ordering, exponent vector has priority 74 rOrderType_Exp, // simple ordering, no components involved 75 rOrderType_Syz, // syzygy ordering 76 rOrderType_Schreyer // Schreyer ordering 77 } rOrderType_t; 78 79 rOrderType_t rGetOrderType(ring r); 80 69 81 #ifdef RDEBUG 70 82 extern short rNumber; -
Singular/spSpolyLoop.cc
r057fd3 rf92fa13 16 16 #include "spSpolyLoop.h" 17 17 18 // used in routines where component is not handled as a special case 19 static int LoopVariablesW; 20 21 static void spPSpolyLoop_1(poly p1, poly p2, poly m, poly spNoether); 22 static void spPSpolyLoop_2(poly p1, poly p2, poly m, poly spNoether); 23 static void spPSpolyLoop_2i(poly p1, poly p2, poly m, poly spNoether); 24 static void spPSpolyLoop_2i_1(poly p1, poly p2, poly m, poly spNoether); 25 static void spPSpolyLoop_1_c(poly p1, poly p2, poly m, poly spNoether); 26 static void spPSpolyLoop_2_c(poly p1, poly p2, poly m, poly spNoether); 27 static void spPSpolyLoop_2i_c(poly p1, poly p2, poly m, poly spNoether); 28 static void spPSpolyLoop_2i_1_c(poly p1, poly p2, poly m, poly spNoether); 29 static void spPSpolyLoop_c_1(poly p1, poly p2, poly m, poly spNoether); 30 static void spPSpolyLoop_c_2(poly p1, poly p2, poly m, poly spNoether); 31 static void spPSpolyLoop_c_2i(poly p1, poly p2, poly m, poly spNoether); 32 static void spPSpolyLoop_c_2i_1(poly p1, poly p2, poly m, poly spNoether); 33 static void spPSpolyLoop_1_Syz(poly p1, poly p2, poly m, poly spNoether); 34 static void spPSpolyLoop_2_Syz(poly p1, poly p2, poly m, poly spNoether); 35 static void spPSpolyLoop_2i_Syz(poly p1, poly p2, poly m, poly spNoether); 36 static void spPSpolyLoop_2i_1_Syz(poly p1, poly p2, poly m, poly spNoether); 37 static void spPSpolyLoop_1_c_Syz(poly p1, poly p2, poly m, poly spNoether); 38 static void spPSpolyLoop_2_c_Syz(poly p1, poly p2, poly m, poly spNoether); 39 static void spPSpolyLoop_2i_c_Syz(poly p1, poly p2, poly m, poly spNoether); 40 static void spPSpolyLoop_2i_1_c_Syz(poly p1, poly p2, poly m, poly spNoether); 41 static void spPSpolyLoop_c_1_Syz(poly p1, poly p2, poly m, poly spNoether); 42 static void spPSpolyLoop_c_2_Syz(poly p1, poly p2, poly m, poly spNoether); 43 static void spPSpolyLoop_c_2i_Syz(poly p1, poly p2, poly m, poly spNoether); 44 static void spPSpolyLoop_c_2i_1_Syz(poly p1, poly p2, poly m, poly spNoether); 45 static void spPSpolyLoop_1_homog(poly p1, poly p2, poly m, poly spNoether); 46 static void spPSpolyLoop_2_homog(poly p1, poly p2, poly m, poly spNoether); 47 static void spPSpolyLoop_2i_homog(poly p1, poly p2, poly m, poly spNoether); 48 static void spPSpolyLoop_2i_1_homog(poly p1, poly p2, poly m, poly spNoether); 49 #ifdef TEST_MAC_ORDER 50 static void spLoop_mac_1(poly p1, poly p2, poly m, poly spNoether); 51 static void spLoop_mac_2(poly p1, poly p2, poly m, poly spNoether); 52 static void spLoop_mac_2i(poly p1, poly p2, poly m, poly spNoether); 53 static void spLoop_mac_2i_1(poly p1, poly p2, poly m, poly spNoether); 54 static void spLoop_mac_1_c(poly p1, poly p2, poly m, poly spNoether); 55 static void spLoop_mac_1_Syz(poly p1, poly p2, poly m, poly spNoether); 56 static void spLoop_mac_1_c_Syz(poly p1, poly p2, poly m, poly spNoether); 57 static void spLoop_mac_2_c(poly p1, poly p2, poly m, poly spNoether); 58 static void spLoop_mac_2_Syz(poly p1, poly p2, poly m, poly spNoether); 59 static void spLoop_mac_2_c_Syz(poly p1, poly p2, poly m, poly spNoether); 60 static void spLoop_mac_2i_c(poly p1, poly p2, poly m, poly spNoether); 61 static void spLoop_mac_2i_Syz(poly p1, poly p2, poly m, poly spNoether); 62 static void spLoop_mac_2i_c_Syz(poly p1, poly p2, poly m, poly spNoether); 63 static void spLoop_mac_2i_1_c(poly p1, poly p2, poly m, poly spNoether); 64 static void spLoop_mac_2i_1_Syz(poly p1, poly p2, poly m, poly spNoether); 65 static void spLoop_mac_2i_1_c_Syz(poly p1, poly p2, poly m, poly spNoether); 66 static void spLoop_mac_c_1(poly p1, poly p2, poly m, poly spNoether); 67 static void spLoop_mac_c_1_Syz(poly p1, poly p2, poly m, poly spNoether); 68 static void spLoop_mac_c_2(poly p1, poly p2, poly m, poly spNoether); 69 static void spLoop_mac_c_2_Syz(poly p1, poly p2, poly m, poly spNoether); 70 static void spLoop_mac_c_2i(poly p1, poly p2, poly m, poly spNoether); 71 static void spLoop_mac_c_2i_Syz(poly p1, poly p2, poly m, poly spNoether); 72 static void spLoop_mac_c_2i_1(poly p1, poly p2, poly m, poly spNoether); 73 static void spLoop_mac_c_2i_1_Syz(poly p1, poly p2, poly m, poly spNoether); 18 19 #ifndef DO_DEEP_PROFILE 20 // undefine to disable fast spoly loops 21 #define FAST_SPOLY_LOOP 74 22 #endif 75 23 76 extern int maxBound;77 78 24 /*************************************************************** 79 25 * 80 * Sets the used spoly loop in the strategy 26 * General spoly loop which always works 27 * 28 * assume monom = L(monom) 29 * pNext(monom) = result = a2-a1*monom 30 * do not destroy a1, but a2 81 31 * 82 32 ***************************************************************/ 83 #ifndef DO_DEEP_PROFILE 84 #define FAST_SPOLY_LOOP 33 #if 1 34 void spSpolyLoop_General 35 (poly a1, poly a2, poly monom, poly spNoether) 36 { 37 poly a = monom, // collects the result 38 b = pNew(), // stores a1*monom 39 c; // used for temporary storage 40 number tm = pGetCoeff(monom), // coefficient of monom 41 tneg = nNeg(nCopy(tm)), // - (coefficient of monom) 42 tb; // used for tm*coeff(a1) 43 44 45 if (a2==NULL) goto Finish; // we are done if a2 is 0 46 47 pCopyAddFast(b, a1, monom); // now a2 != NULL -- set up b 48 49 // MAIN LOOP: 50 Top: // compare b = monom*a1 and a2 w.r.t. monomial ordering 51 register long d; 52 if ((d = pComp0(b, a2))) goto NotEqual; else goto Equal;; 53 54 Equal: // b equals a2 55 tb = nMult(pGetCoeff(a1), tm); 56 if (!nEqual(pGetCoeff(a2), tb)) 57 { 58 pSetCoeff0(a2,nSub(pGetCoeff(a2), tb)); // adjust coeff of a2 59 a = pNext(a) = a2; // append a2 to result and advance a2 60 pIter(a2); 61 } 62 else 63 { // coeffs are equal, so their difference is 0: 64 c = a2; // do not append anything to result: Delete a2 and advance 65 pIter(a2); 66 nDelete(&pGetCoeff(c)); 67 pFree1(c); 68 } 69 nDelete(&tb); 70 pIter(a1); 71 if (a2 == NULL || a1 == NULL) goto Finish; // are we done ? 72 pCopyAddFast(b, a1, monom); // No! So, get new b = a1*monom 73 goto Top; 74 75 NotEqual: // b != a2 76 if (d < 0) // b < a2: 77 { 78 a = pNext(a) = a2;// append a2 to result and advance a2 79 pIter(a2); 80 if (a2==NULL) goto Finish;; 81 goto Top; 82 } 83 else // now d >= 0, i.e., b > a2 84 { 85 pSetCoeff0(b,nMult(pGetCoeff(a1), tneg)); 86 a = pNext(a) = b; // append b to result and advance a1 87 pIter(a1); 88 b = pNew(); 89 if (a1 == NULL) goto Finish; // are we done? 90 pCopyAddFast(b, a1, monom); // No! So, update b = a1*monom 91 goto Top; 92 } 93 94 Finish: // a1 or a2 is NULL: Clean-up time 95 if (a1 == NULL) // append rest of a2 to result 96 pNext(a) = a2; 97 else // append (- a1*monom) to result 98 spGMultCopyX(a1, monom, a, tneg, spNoether); 99 nDelete(&tneg); 100 pFree1(b); 101 } 102 #else 103 extern void spGSpolyLoop(poly a1, poly a2, poly m,poly spNoether); 104 void spSpolyLoop_General 105 (poly a1, poly a2, poly m,poly spNoether) 106 { 107 spGSpolyLoop(a1, a2, m, spNoether); 108 } 85 109 #endif 86 110 87 spSpolyLoopProc spSetPSpolyLoop(ring r, int syzComp, int ak, BOOLEAN homog) 88 { 111 112 /*************************************************************** 113 * 114 * Fst spoly loops 115 * 116 ***************************************************************/ 89 117 #ifdef FAST_SPOLY_LOOP 90 // check for oredering with one real block only 91 if ((r->order[0] == ringorder_unspec) || 92 (r->order[2] == 0 && 93 r->order[0] != ringorder_M && r->order[1] != ringorder_M)) 94 { 95 // check whether components play a role 96 if (ak == 0 && syzComp == 0) 97 { 98 int or; 99 if (r->order[0] != ringorder_C && r->order[0] != ringorder_c) 100 or = r->order[0]; 101 else 102 or = r->order[1]; 103 104 LoopVariablesW = pVariablesW; 105 if (homog || or == ringorder_lp || or == ringorder_ls) 106 { 107 // wee do not need to compare the order field for the 108 // omogenous case and for non-degree orderings 109 if (LoopVariablesW == 1) 110 { 111 #ifdef TEST_MAC_ORDER 112 if (or==ringorder_dp) 113 { 114 //if (homog) 115 // return spLoop_mac_1_homog; 116 //else 117 return spLoop_mac_1; 118 } 119 #endif 120 return spPSpolyLoop_1_homog; 121 } 122 else if (LoopVariablesW == 2) 123 { 124 #ifdef TEST_MAC_ORDER 125 if (or==ringorder_dp) 126 { 127 //if (homog) 128 // return spLoop_mac_2_homog; 129 //else 130 return spLoop_mac_2; 131 } 132 #endif 133 return spPSpolyLoop_2_homog; 134 } 135 else if (LoopVariablesW & 1) 136 { 137 #ifdef TEST_MAC_ORDER 138 if (or==ringorder_dp) 139 { 140 //if (homog) 141 // return spLoop_mac_2i_1_homog; 142 //else 143 return spLoop_mac_2i_1; 144 } 145 #endif 146 return spPSpolyLoop_2i_1_homog; 147 } 148 else 149 { 150 #ifdef TEST_MAC_ORDER 151 if (or==ringorder_dp) 152 { 153 //if (homog) 154 // return spLoop_mac_2i_homog; 155 //else 156 return spLoop_mac_2i; 157 } 158 #endif 159 return spPSpolyLoop_2i_homog; 160 } 161 } 162 else 163 { 164 // no, components are not involved 165 if (LoopVariablesW == 1) 166 { 167 #ifdef TEST_MAC_ORDER 168 if (or==ringorder_dp) 169 { 170 //if (homog) 171 // return spLoop_mac_1_homog; 172 //else 173 return spLoop_mac_1; 174 } 175 #endif 176 return spPSpolyLoop_1; 177 } 178 else if (LoopVariablesW == 2) 179 { 180 #ifdef TEST_MAC_ORDER 181 if (or==ringorder_dp) 182 { 183 //if (homog) 184 // return spLoop_mac_2_homog; 185 //else 186 return spLoop_mac_2; 187 } 188 #endif 189 return spPSpolyLoop_2; 190 } 191 else if (LoopVariablesW & 1) 192 { 193 #ifdef TEST_MAC_ORDER 194 if (or==ringorder_dp) 195 { 196 //if (homog) 197 // return spLoop_mac_2i_1_homog; 198 //else 199 return spLoop_mac_2i_1; 200 } 201 #endif 202 return spPSpolyLoop_2i_1; 203 } 204 else 205 { 206 #ifdef TEST_MAC_ORDER 207 if (or==ringorder_dp) 208 { 209 //if (homog) 210 // return spLoop_mac_2i_homog; 211 //else 212 return spLoop_mac_2i; 213 } 214 #endif 215 return spPSpolyLoop_2i; 216 } 217 } 218 } 219 else 220 { 221 // components are invloved 222 // check for priority to exponents 223 LoopVariablesW = pVariables1W; 224 if ((r->order[1]==ringorder_c)||(r->order[1]==ringorder_C) || 225 (r->order[0] == ringorder_unspec)) 226 { 227 switch(r->order[0]) 228 { 229 case ringorder_dp: 230 #ifdef TEST_MAC_ORDER 231 //LoopVariablesW = pVariables1W; 232 if (r->order[1] == ringorder_C) 233 { 234 if (LoopVariablesW == 1) 235 return (syzComp ? 236 spLoop_mac_1_c_Syz : 237 spLoop_mac_1_c); 238 else if (LoopVariablesW == 2) 239 return (syzComp ? 240 spLoop_mac_2_c_Syz : 241 spLoop_mac_2_c); 242 else if (LoopVariablesW & 1) 243 return (syzComp ? 244 spLoop_mac_2i_1_c_Syz : 245 spLoop_mac_2i_1_c); 246 else 247 return (syzComp ? 248 spLoop_mac_2i_c_Syz : 249 spLoop_mac_2i_c); 250 } 251 else 252 { 253 if (LoopVariablesW == 1) 254 return (syzComp ? 255 spLoop_mac_1_Syz : 256 spLoop_mac_1); 257 else if (LoopVariablesW == 2) 258 return (syzComp ? 259 spLoop_mac_2_Syz : 260 spLoop_mac_2); 261 else if (LoopVariablesW & 1) 262 return (syzComp ? 263 spLoop_mac_2i_1_Syz : 264 spLoop_mac_2i_1); 265 else 266 return (syzComp ? 267 spLoop_mac_2i_Syz : 268 spLoop_mac_2i); 269 } 270 #endif 271 case ringorder_wp: 272 case ringorder_ds: 273 case ringorder_ws: 274 case ringorder_ls: 275 case ringorder_unspec: 276 277 if (r->order[1] == ringorder_C || 278 r->order[0] == ringorder_unspec) 279 { 280 if (LoopVariablesW == 1) 281 return (syzComp ? 282 spPSpolyLoop_1_c_Syz : 283 spPSpolyLoop_1_c); 284 else if (LoopVariablesW == 2) 285 return (syzComp ? 286 spPSpolyLoop_2_c_Syz : 287 spPSpolyLoop_2_c); 288 else if (LoopVariablesW & 1) 289 return (syzComp ? 290 spPSpolyLoop_2i_1_c_Syz : 291 spPSpolyLoop_2i_1_c); 292 else 293 return (syzComp ? 294 spPSpolyLoop_2i_c_Syz : 295 spPSpolyLoop_2i_c); 296 } 297 else 298 { 299 //LoopVariablesW = pVariables1W; 300 if (LoopVariablesW == 1) 301 return (syzComp ? 302 spPSpolyLoop_1_Syz : 303 spPSpolyLoop_1); 304 else if (LoopVariablesW == 2) 305 return (syzComp ? 306 spPSpolyLoop_2_Syz : 307 spPSpolyLoop_2); 308 else if (LoopVariablesW & 1) 309 return (syzComp ? 310 spPSpolyLoop_2i_1_Syz : 311 spPSpolyLoop_2i_1); 312 else 313 return (syzComp ? 314 spPSpolyLoop_2i_Syz : 315 spPSpolyLoop_2i); 316 } 317 #ifdef PDEBUG 318 case ringorder_lp: 319 case ringorder_Dp: 320 case ringorder_Wp: 321 case ringorder_Ds: 322 case ringorder_Ws: 323 #else 324 default: 325 #endif 326 if (r->order[1] == ringorder_c) 327 { 328 if (LoopVariablesW == 1) 329 return (syzComp ? 330 spPSpolyLoop_1_c_Syz : 331 spPSpolyLoop_1_c); 332 else if (LoopVariablesW == 2) 333 return (syzComp ? 334 spPSpolyLoop_2_c_Syz : 335 spPSpolyLoop_2_c); 336 else if (LoopVariablesW & 1) 337 return (syzComp ? 338 spPSpolyLoop_2i_1_c_Syz : 339 spPSpolyLoop_2i_1_c); 340 else 341 return (syzComp ? 342 spPSpolyLoop_2i_c_Syz : 343 spPSpolyLoop_2i_c); 344 } 345 else 346 { 347 //LoopVariablesW = pVariables1W; 348 if (LoopVariablesW == 1) 349 return (syzComp ? 350 spPSpolyLoop_1_Syz : spPSpolyLoop_1); 351 else if (LoopVariablesW == 2) 352 return (syzComp ? 353 spPSpolyLoop_2_Syz : spPSpolyLoop_2); 354 else if (LoopVariablesW & 1) 355 return (syzComp ? 356 spPSpolyLoop_2i_1_Syz : 357 spPSpolyLoop_2i_1); 358 else 359 return (syzComp ? 360 spPSpolyLoop_2i_Syz : 361 spPSpolyLoop_2i); 362 } 363 #ifdef PDEBUG 364 default: 365 Werror("wrong internal ordering:%d at %s, l:%d\n",r->order[0],__FILE__,__LINE__); 366 return NULL; 367 #endif 368 } 369 } 370 else if (r->order[0] == ringorder_c || r->order[0] == ringorder_C) 371 { 372 if (LoopVariablesW == 1) 373 { 374 #ifdef TEST_MAC_ORDER 375 if (r->order[1] == ringorder_dp) 376 { 377 return (syzComp ? 378 spLoop_mac_c_1_Syz : spLoop_mac_c_1); 379 } 380 #endif 381 return (syzComp ? 382 spPSpolyLoop_c_1_Syz : spPSpolyLoop_c_1); 383 } 384 else if (LoopVariablesW == 2) 385 { 386 #ifdef TEST_MAC_ORDER 387 if (r->order[1] == ringorder_dp) 388 { 389 return (syzComp ? 390 spLoop_mac_c_2_Syz : spLoop_mac_c_2); 391 } 392 #endif 393 return (syzComp ? 394 spPSpolyLoop_c_2_Syz : spPSpolyLoop_c_2); 395 } 396 else if (LoopVariablesW & 1) 397 { 398 #ifdef TEST_MAC_ORDER 399 if (r->order[1] == ringorder_dp) 400 { 401 return (syzComp ? 402 spLoop_mac_c_2i_1_Syz : spLoop_mac_c_2i_1); 403 } 404 #endif 405 return (syzComp ? 406 spPSpolyLoop_c_2i_1_Syz : spPSpolyLoop_c_2i_1); 407 } 408 else 409 { 410 #ifdef TEST_MAC_ORDER 411 if (r->order[1] == ringorder_dp) 412 { 413 return (syzComp ? 414 spLoop_mac_c_2i_Syz : spLoop_mac_c_2i); 415 } 416 #endif 417 return (syzComp ? 418 spPSpolyLoop_c_2i_Syz : spPSpolyLoop_c_2i); 419 } 420 } 421 else 422 return spPSpolyLoop_General; 423 } 424 } 425 else 426 #endif // FAST_SPOLY_LOOP 427 return spPSpolyLoop_General; 428 } 429 430 spSpolyLoopProc spSetSpolyLoop(ring r, int syzComp, int ak, BOOLEAN homog) 431 { 432 if (r->ch > 0) 433 { 434 return spSetPSpolyLoop(r, syzComp, ak, homog); 435 } 436 else return NULL; 437 } 438 439 /*************************************************************** 440 * 441 * The general case 442 * 443 ***************************************************************/ 444 void spPSpolyLoop_General(poly a1, poly a2, poly m,poly spNoether) 445 { 446 poly a, b, s; 447 number tm = pGetCoeff(m); 448 number tneg,tb; 449 int c; 450 451 tneg = npNegM(tm); 452 if (a2==NULL) 453 { 454 spMultCopyX(a1, m, m, tneg,spNoether); 455 return; 456 } 457 a = m; 458 b = pNew(); 459 pCopyAddFast(b, a1, m); 460 loop 461 { 462 c = pComp0(b, a2); 463 if (c == -1) 464 { 465 a = pNext(a) = a2; 466 pIter(a2); 467 if (a2==NULL) 468 { 469 pFree1(b); 470 spMultCopyX(a1, m, a, tneg,spNoether); 471 return; 472 } 473 } 474 else if (c == 1) 475 { 476 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg)); 477 a = pNext(a) = b; 478 pIter(a1); 479 if (a1!=NULL) 480 { 481 b = pNew(); 482 pCopyAddFast(b, a1, m); 483 } 484 else 485 { 486 pNext(a) = a2; 487 return; 488 } 489 } 490 else 491 { 492 tb = npMultM(pGetCoeff(a1),tm); 493 if (!npEqualM(pGetCoeff(a2),tb)) 494 { 495 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb)); 496 a = pNext(a) = a2; 497 pIter(a2); 498 } 499 else 500 { 501 s = a2; 502 pIter(a2); 503 pFree1(s); 504 } 505 pIter(a1); 506 if (a1==NULL) 507 { 508 pFree1(b); 509 pNext(a) = a2; 510 return; 511 } 512 if (a2==NULL) 513 { 514 pFree1(b); 515 spMultCopyX(a1, m, a, tneg,spNoether); 516 return; 517 } 518 pCopyAddFast(b, a1, m); 519 } 520 } 521 } 522 523 /*************************************************************** 524 * 525 * comp != 0 cases 526 * 527 ***************************************************************/ 118 528 119 #define NonZeroA(d, multiplier, actionE) \ 529 120 { \ … … 542 133 } \ 543 134 while(0) 544 545 static void spPSpolyLoop_1(poly a1, poly a2, poly m,poly spNoether) 135 #include "spSpolyLoop.inc" // the loops and spGetSpolyLoop 136 137 #endif // FAST_SPOLY_LOOP 138 139 140 spSpolyLoopProc spGetSpolyLoop(ring r, rOrderType_t rot, BOOLEAN homog) 546 141 { 547 poly a, b, s; 548 number tm = pGetCoeff(m); 549 number tneg,tb; 550 int c; 551 552 553 tneg = npNegM(tm); 554 if (a2==NULL) 142 #ifdef FAST_SPOLY_LOOP 143 Characteristics ch = chGEN; 144 OrderingTypes ot = otGEN; 145 Homogs hom = homGEN; 146 NumWords nw = nwGEN; 147 spSpolyLoopProc spolyloop; 148 int Variables1W; 149 150 // set characterisic 151 if (r->ch > 0) ch = chMODP; 152 153 // set Ordering Type 154 switch (rot) 155 { 156 rOrderType_Exp: 157 ot = otEXP; 158 break; 159 160 rOrderType_CompExp: 161 ot = otCOMPEXP; 162 break; 163 164 rOrderType_ExpComp: 165 ot = otEXPCOMP; 166 break; 167 168 default: 169 ot = otGEN; 170 break; 171 } 172 173 // set homogenous 174 if (homog) hom = homYES; 175 176 // set NumWords 177 if ((((r->N+1)*sizeof(Exponent_t)) % sizeof(void*)) == 0) 178 Variables1W = (r->N+1)*sizeof(Exponent_t) / sizeof(void*); 179 else 180 Variables1W = ((r->N+1)*sizeof(Exponent_t) / sizeof(void*)) + 1; 181 if (Variables1W > 2) 555 182 { 556 spMultCopyX(a1, m, m, tneg,spNoether); 557 return; 183 if (Variables1W & 1) 184 nw = nwODD; 185 else 186 nw = nwEVEN; 558 187 } 559 a = m; 560 b = pNew(); 561 pCopyAddFast(b, a1, m); 562 563 Top: 564 register long d; 565 566 d = pGetOrder(b) - pGetOrder(a2); 567 NonZeroTestA(d, pOrdSgn, goto NotEqual); 568 _pMonCmp_1(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal); 569 570 Equal: 571 tb = npMultM(pGetCoeff(a1),tm); 572 if (!npEqualM(pGetCoeff(a2),tb)) 188 else 573 189 { 574 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb)); 575 a = pNext(a) = a2; 576 pIter(a2); 190 if (Variables1W == 2) 191 nw = nwTWO; 192 else 193 nw = nwONE; 577 194 } 578 else 579 { 580 s = a2; 581 pIter(a2); 582 pFree1(s); 583 } 584 pIter(a1); 585 if (a1==NULL) 586 { 587 pFree1(b); 588 pNext(a) = a2; 589 return; 590 } 591 if (a2==NULL) 592 { 593 pFree1(b); 594 spMultCopyX(a1, m, a, tneg,spNoether); 595 return; 596 } 597 pCopyAddFast(b, a1, m); 598 goto Top; 599 600 NotEqual: // i.e., b smaller than a2 601 if (d < 0) 602 { 603 a = pNext(a) = a2; 604 pIter(a2); 605 if (a2==NULL) 606 { 607 pFree1(b); 608 spMultCopyX(a1, m, a, tneg,spNoether); 609 return; 610 } 611 goto Top; 612 } 613 614 // now d >= 0, i.e., b greater than a2 615 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg)); 616 a = pNext(a) = b; 617 pIter(a1); 618 if (a1!=NULL) 619 { 620 b = pNew(); 621 pCopyAddFast(b, a1, m); 622 } 623 else 624 { 625 pNext(a) = a2; 626 return; 627 } 628 goto Top; 195 196 // GetSpolyLoop 197 spolyloop = spGetSpolyLoop(ch, ot, hom, nw); 198 if (spolyloop != NULL) return spolyloop; 199 // still here? -- no special spolyloop found, return the general loop 200 #endif // FAST_SPOLY_LOOP 201 return spSpolyLoop_General; 629 202 } 630 203 631 static void spPSpolyLoop_1_c(poly a1, poly a2, poly m,poly spNoether)632 {633 poly a, b, s;634 number tm = pGetCoeff(m);635 number tneg,tb;636 int c;637 638 639 tneg = npNegM(tm);640 if (a2==NULL)641 {642 spMultCopyX(a1, m, m, tneg,spNoether);643 return;644 }645 a = m;646 b = pNew();647 pCopyAddFast(b, a1, m);648 649 Top:650 register long d;651 652 d = pGetOrder(b) - pGetOrder(a2);653 NonZeroTestA(d, pOrdSgn, goto NotEqual);654 _pMonCmp_1_c(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);655 656 Equal:657 tb = npMultM(pGetCoeff(a1),tm);658 if (!npEqualM(pGetCoeff(a2),tb))659 {660 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));661 a = pNext(a) = a2;662 pIter(a2);663 }664 else665 {666 s = a2;667 pIter(a2);668 pFree1(s);669 }670 pIter(a1);671 if (a1==NULL)672 {673 pFree1(b);674 pNext(a) = a2;675 return;676 }677 if (a2==NULL)678 {679 pFree1(b);680 spMultCopyX(a1, m, a, tneg,spNoether);681 return;682 }683 pCopyAddFast(b, a1, m);684 goto Top;685 686 NotEqual: // i.e., b smaller than a2687 if (d < 0)688 {689 a = pNext(a) = a2;690 pIter(a2);691 if (a2==NULL)692 {693 pFree1(b);694 spMultCopyX(a1, m, a, tneg,spNoether);695 return;696 }697 goto Top;698 }699 700 // now d >= 0, i.e., b greater than a2701 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));702 a = pNext(a) = b;703 pIter(a1);704 if (a1!=NULL)705 {706 b = pNew();707 pCopyAddFast(b, a1, m);708 }709 else710 {711 pNext(a) = a2;712 return;713 }714 goto Top;715 }716 717 static void spPSpolyLoop_c_1(poly a1, poly a2, poly m,poly spNoether)718 {719 poly a, b, s;720 number tm = pGetCoeff(m);721 number tneg,tb;722 int c;723 724 725 tneg = npNegM(tm);726 if (a2==NULL)727 {728 spMultCopyX(a1, m, m, tneg,spNoether);729 return;730 }731 a = m;732 b = pNew();733 pCopyAddFast(b, a1, m);734 735 Top:736 register long d;737 738 d = pGetComp(a2) - pGetComp(b);739 NonZeroTestA(d, pComponentOrder, goto NotEqual);740 d = pGetOrder(b) - pGetOrder(a2);741 NonZeroTestA(d, pOrdSgn, goto NotEqual);742 _pMonCmp_1(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);743 744 Equal:745 tb = npMultM(pGetCoeff(a1),tm);746 if (!npEqualM(pGetCoeff(a2),tb))747 {748 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));749 a = pNext(a) = a2;750 pIter(a2);751 }752 else753 {754 s = a2;755 pIter(a2);756 pFree1(s);757 }758 pIter(a1);759 if (a1==NULL)760 {761 pFree1(b);762 pNext(a) = a2;763 return;764 }765 if (a2==NULL)766 {767 pFree1(b);768 spMultCopyX(a1, m, a, tneg,spNoether);769 return;770 }771 pCopyAddFast(b, a1, m);772 goto Top;773 774 NotEqual: // i.e., b smaller than a2775 if (d < 0)776 {777 a = pNext(a) = a2;778 pIter(a2);779 if (a2==NULL)780 {781 pFree1(b);782 spMultCopyX(a1, m, a, tneg,spNoether);783 return;784 }785 goto Top;786 }787 788 789 // now d >= 0, i.e., b greater than a2790 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));791 a = pNext(a) = b;792 pIter(a1);793 if (a1!=NULL)794 {795 b = pNew();796 pCopyAddFast(b, a1, m);797 }798 else799 {800 pNext(a) = a2;801 return;802 }803 goto Top;804 }805 806 static void spPSpolyLoop_2(poly a1, poly a2, poly m,poly spNoether)807 {808 poly a, b, s;809 number tm = pGetCoeff(m);810 number tneg,tb;811 int c;812 813 814 tneg = npNegM(tm);815 if (a2==NULL)816 {817 spMultCopyX(a1, m, m, tneg,spNoether);818 return;819 }820 a = m;821 b = pNew();822 pCopyAddFast(b, a1, m);823 824 Top:825 register long d;826 827 d = pGetOrder(b) - pGetOrder(a2);828 NonZeroTestA(d, pOrdSgn, goto NotEqual);829 _pMonCmp_2(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);830 831 Equal:832 tb = npMultM(pGetCoeff(a1),tm);833 if (!npEqualM(pGetCoeff(a2),tb))834 {835 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));836 a = pNext(a) = a2;837 pIter(a2);838 }839 else840 {841 s = a2;842 pIter(a2);843 pFree1(s);844 }845 pIter(a1);846 if (a1==NULL)847 {848 pFree1(b);849 pNext(a) = a2;850 return;851 }852 if (a2==NULL)853 {854 pFree1(b);855 spMultCopyX(a1, m, a, tneg,spNoether);856 return;857 }858 pCopyAddFast(b, a1, m);859 goto Top;860 861 NotEqual: // i.e., b smaller than a2862 if (d < 0)863 {864 a = pNext(a) = a2;865 pIter(a2);866 if (a2==NULL)867 {868 pFree1(b);869 spMultCopyX(a1, m, a, tneg,spNoether);870 return;871 }872 goto Top;873 }874 875 // now d >= 0, i.e., b greater than a2876 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));877 a = pNext(a) = b;878 pIter(a1);879 if (a1!=NULL)880 {881 b = pNew();882 pCopyAddFast(b, a1, m);883 }884 else885 {886 pNext(a) = a2;887 return;888 }889 goto Top;890 }891 892 static void spPSpolyLoop_2_c(poly a1, poly a2, poly m,poly spNoether)893 {894 poly a, b, s;895 number tm = pGetCoeff(m);896 number tneg,tb;897 int c;898 899 900 tneg = npNegM(tm);901 if (a2==NULL)902 {903 spMultCopyX(a1, m, m, tneg,spNoether);904 return;905 }906 a = m;907 b = pNew();908 pCopyAddFast(b, a1, m);909 910 Top:911 register long d;912 913 d = pGetOrder(b) - pGetOrder(a2);914 NonZeroTestA(d, pOrdSgn, goto NotEqual);915 _pMonCmp_2_c(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);916 917 Equal:918 tb = npMultM(pGetCoeff(a1),tm);919 if (!npEqualM(pGetCoeff(a2),tb))920 {921 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));922 a = pNext(a) = a2;923 pIter(a2);924 }925 else926 {927 s = a2;928 pIter(a2);929 pFree1(s);930 }931 pIter(a1);932 if (a1==NULL)933 {934 pFree1(b);935 pNext(a) = a2;936 return;937 }938 if (a2==NULL)939 {940 pFree1(b);941 spMultCopyX(a1, m, a, tneg,spNoether);942 return;943 }944 pCopyAddFast(b, a1, m);945 goto Top;946 947 NotEqual: // i.e., b smaller than a2948 if (d < 0)949 {950 a = pNext(a) = a2;951 pIter(a2);952 if (a2==NULL)953 {954 pFree1(b);955 spMultCopyX(a1, m, a, tneg,spNoether);956 return;957 }958 goto Top;959 }960 961 // now d >= 0, i.e., b greater than a2962 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));963 a = pNext(a) = b;964 pIter(a1);965 if (a1!=NULL)966 {967 b = pNew();968 pCopyAddFast(b, a1, m);969 }970 else971 {972 pNext(a) = a2;973 return;974 }975 goto Top;976 }977 978 static void spPSpolyLoop_c_2(poly a1, poly a2, poly m,poly spNoether)979 {980 poly a, b, s;981 number tm = pGetCoeff(m);982 number tneg,tb;983 int c;984 985 986 tneg = npNegM(tm);987 if (a2==NULL)988 {989 spMultCopyX(a1, m, m, tneg,spNoether);990 return;991 }992 a = m;993 b = pNew();994 pCopyAddFast(b, a1, m);995 996 Top:997 register long d;998 999 d = pGetComp(a2) - pGetComp(b);1000 NonZeroTestA(d, pComponentOrder, goto NotEqual);1001 d = pGetOrder(b) - pGetOrder(a2);1002 NonZeroTestA(d, pOrdSgn, goto NotEqual);1003 _pMonCmp_2(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1004 1005 Equal:1006 tb = npMultM(pGetCoeff(a1),tm);1007 if (!npEqualM(pGetCoeff(a2),tb))1008 {1009 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1010 a = pNext(a) = a2;1011 pIter(a2);1012 }1013 else1014 {1015 s = a2;1016 pIter(a2);1017 pFree1(s);1018 }1019 pIter(a1);1020 if (a1==NULL)1021 {1022 pFree1(b);1023 pNext(a) = a2;1024 return;1025 }1026 if (a2==NULL)1027 {1028 pFree1(b);1029 spMultCopyX(a1, m, a, tneg,spNoether);1030 return;1031 }1032 pCopyAddFast(b, a1, m);1033 goto Top;1034 1035 NotEqual: // i.e., b smaller than a21036 if (d < 0)1037 {1038 a = pNext(a) = a2;1039 pIter(a2);1040 if (a2==NULL)1041 {1042 pFree1(b);1043 spMultCopyX(a1, m, a, tneg,spNoether);1044 return;1045 }1046 goto Top;1047 }1048 1049 1050 // now d >= 0, i.e., b greater than a21051 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1052 a = pNext(a) = b;1053 pIter(a1);1054 if (a1!=NULL)1055 {1056 b = pNew();1057 pCopyAddFast(b, a1, m);1058 }1059 else1060 {1061 pNext(a) = a2;1062 return;1063 }1064 goto Top;1065 }1066 1067 static void spPSpolyLoop_2i(poly a1, poly a2, poly m,poly spNoether)1068 {1069 poly a, b, s;1070 number tm = pGetCoeff(m);1071 number tneg,tb;1072 int c;1073 1074 1075 tneg = npNegM(tm);1076 if (a2==NULL)1077 {1078 spMultCopyX(a1, m, m, tneg,spNoether);1079 return;1080 }1081 a = m;1082 b = pNew();1083 pCopyAddFast(b, a1, m);1084 1085 Top:1086 register long d;1087 1088 d = pGetOrder(b) - pGetOrder(a2);1089 NonZeroTestA(d, pOrdSgn, goto NotEqual);1090 _pMonCmp_2i(b, a2, LoopVariablesW, d,1091 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1092 1093 Equal:1094 tb = npMultM(pGetCoeff(a1),tm);1095 if (!npEqualM(pGetCoeff(a2),tb))1096 {1097 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1098 a = pNext(a) = a2;1099 pIter(a2);1100 }1101 else1102 {1103 s = a2;1104 pIter(a2);1105 pFree1(s);1106 }1107 pIter(a1);1108 if (a1==NULL)1109 {1110 pFree1(b);1111 pNext(a) = a2;1112 return;1113 }1114 if (a2==NULL)1115 {1116 pFree1(b);1117 spMultCopyX(a1, m, a, tneg,spNoether);1118 return;1119 }1120 pCopyAddFast(b, a1, m);1121 goto Top;1122 1123 NotEqual: // i.e., b smaller than a21124 if (d < 0)1125 {1126 a = pNext(a) = a2;1127 pIter(a2);1128 if (a2==NULL)1129 {1130 pFree1(b);1131 spMultCopyX(a1, m, a, tneg,spNoether);1132 return;1133 }1134 goto Top;1135 }1136 1137 // now d >= 0, i.e., b greater than a21138 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1139 a = pNext(a) = b;1140 pIter(a1);1141 if (a1!=NULL)1142 {1143 b = pNew();1144 pCopyAddFast(b, a1, m);1145 }1146 else1147 {1148 pNext(a) = a2;1149 return;1150 }1151 goto Top;1152 }1153 1154 static void spPSpolyLoop_2i_c(poly a1, poly a2, poly m,poly spNoether)1155 {1156 poly a, b, s;1157 number tm = pGetCoeff(m);1158 number tneg,tb;1159 int c;1160 1161 1162 tneg = npNegM(tm);1163 if (a2==NULL)1164 {1165 spMultCopyX(a1, m, m, tneg,spNoether);1166 return;1167 }1168 a = m;1169 b = pNew();1170 pCopyAddFast(b, a1, m);1171 1172 Top:1173 register long d;1174 1175 d = pGetOrder(b) - pGetOrder(a2);1176 NonZeroTestA(d, pOrdSgn, goto NotEqual);1177 _pMonCmp_2i_c(b, a2, pVariables1W, d,1178 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1179 1180 Equal:1181 tb = npMultM(pGetCoeff(a1),tm);1182 if (!npEqualM(pGetCoeff(a2),tb))1183 {1184 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1185 a = pNext(a) = a2;1186 pIter(a2);1187 }1188 else1189 {1190 s = a2;1191 pIter(a2);1192 pFree1(s);1193 }1194 pIter(a1);1195 if (a1==NULL)1196 {1197 pFree1(b);1198 pNext(a) = a2;1199 return;1200 }1201 if (a2==NULL)1202 {1203 pFree1(b);1204 spMultCopyX(a1, m, a, tneg,spNoether);1205 return;1206 }1207 pCopyAddFast(b, a1, m);1208 goto Top;1209 1210 NotEqual: // i.e., b smaller than a21211 if (d < 0)1212 {1213 a = pNext(a) = a2;1214 pIter(a2);1215 if (a2==NULL)1216 {1217 pFree1(b);1218 spMultCopyX(a1, m, a, tneg,spNoether);1219 return;1220 }1221 goto Top;1222 }1223 1224 // now d >= 0, i.e., b greater than a21225 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1226 a = pNext(a) = b;1227 pIter(a1);1228 if (a1!=NULL)1229 {1230 b = pNew();1231 pCopyAddFast(b, a1, m);1232 }1233 else1234 {1235 pNext(a) = a2;1236 return;1237 }1238 goto Top;1239 }1240 1241 static void spPSpolyLoop_c_2i(poly a1, poly a2, poly m,poly spNoether)1242 {1243 poly a, b, s;1244 number tm = pGetCoeff(m);1245 number tneg,tb;1246 int c;1247 1248 1249 tneg = npNegM(tm);1250 if (a2==NULL)1251 {1252 spMultCopyX(a1, m, m, tneg,spNoether);1253 return;1254 }1255 a = m;1256 b = pNew();1257 pCopyAddFast(b, a1, m);1258 1259 Top:1260 register long d;1261 1262 d = pGetComp(a2) - pGetComp(b);1263 NonZeroTestA(d, pComponentOrder, goto NotEqual);1264 d = pGetOrder(b) - pGetOrder(a2);1265 NonZeroTestA(d, pOrdSgn, goto NotEqual);1266 _pMonCmp_2i(b, a2, pVariablesW,1267 d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1268 1269 Equal:1270 tb = npMultM(pGetCoeff(a1),tm);1271 if (!npEqualM(pGetCoeff(a2),tb))1272 {1273 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1274 a = pNext(a) = a2;1275 pIter(a2);1276 }1277 else1278 {1279 s = a2;1280 pIter(a2);1281 pFree1(s);1282 }1283 pIter(a1);1284 if (a1==NULL)1285 {1286 pFree1(b);1287 pNext(a) = a2;1288 return;1289 }1290 if (a2==NULL)1291 {1292 pFree1(b);1293 spMultCopyX(a1, m, a, tneg,spNoether);1294 return;1295 }1296 pCopyAddFast(b, a1, m);1297 goto Top;1298 1299 NotEqual: // i.e., b smaller than a21300 if (d < 0)1301 {1302 a = pNext(a) = a2;1303 pIter(a2);1304 if (a2==NULL)1305 {1306 pFree1(b);1307 spMultCopyX(a1, m, a, tneg,spNoether);1308 return;1309 }1310 goto Top;1311 }1312 1313 1314 // now d >= 0, i.e., b greater than a21315 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1316 a = pNext(a) = b;1317 pIter(a1);1318 if (a1!=NULL)1319 {1320 b = pNew();1321 pCopyAddFast(b, a1, m);1322 }1323 else1324 {1325 pNext(a) = a2;1326 return;1327 }1328 goto Top;1329 }1330 1331 static void spPSpolyLoop_2i_1(poly a1, poly a2, poly m,poly spNoether)1332 {1333 poly a, b, s;1334 number tm = pGetCoeff(m);1335 number tneg,tb;1336 int c;1337 1338 1339 tneg = npNegM(tm);1340 if (a2==NULL)1341 {1342 spMultCopyX(a1, m, m, tneg,spNoether);1343 return;1344 }1345 a = m;1346 b = pNew();1347 pCopyAddFast(b, a1, m);1348 1349 Top:1350 register long d;1351 1352 d = pGetOrder(b) - pGetOrder(a2);1353 NonZeroTestA(d, pOrdSgn, goto NotEqual);1354 _pMonCmp_2i_1(b, a2, LoopVariablesW, d,1355 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1356 1357 Equal:1358 tb = npMultM(pGetCoeff(a1),tm);1359 if (!npEqualM(pGetCoeff(a2),tb))1360 {1361 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1362 a = pNext(a) = a2;1363 pIter(a2);1364 }1365 else1366 {1367 s = a2;1368 pIter(a2);1369 pFree1(s);1370 }1371 pIter(a1);1372 if (a1==NULL)1373 {1374 pFree1(b);1375 pNext(a) = a2;1376 return;1377 }1378 if (a2==NULL)1379 {1380 pFree1(b);1381 spMultCopyX(a1, m, a, tneg,spNoether);1382 return;1383 }1384 pCopyAddFast(b, a1, m);1385 goto Top;1386 1387 NotEqual: // i.e., b smaller than a21388 if (d < 0)1389 {1390 a = pNext(a) = a2;1391 pIter(a2);1392 if (a2==NULL)1393 {1394 pFree1(b);1395 spMultCopyX(a1, m, a, tneg,spNoether);1396 return;1397 }1398 goto Top;1399 }1400 1401 // now d >= 0, i.e., b greater than a21402 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1403 a = pNext(a) = b;1404 pIter(a1);1405 if (a1!=NULL)1406 {1407 b = pNew();1408 pCopyAddFast(b, a1, m);1409 }1410 else1411 {1412 pNext(a) = a2;1413 return;1414 }1415 goto Top;1416 }1417 1418 static void spPSpolyLoop_2i_1_c(poly a1, poly a2, poly m,poly spNoether)1419 {1420 poly a, b, s;1421 number tm = pGetCoeff(m);1422 number tneg,tb;1423 int c;1424 1425 1426 tneg = npNegM(tm);1427 if (a2==NULL)1428 {1429 spMultCopyX(a1, m, m, tneg,spNoether);1430 return;1431 }1432 a = m;1433 b = pNew();1434 pCopyAddFast(b, a1, m);1435 1436 Top:1437 register long d;1438 1439 d = pGetOrder(b) - pGetOrder(a2);1440 NonZeroTestA(d, pOrdSgn, goto NotEqual);1441 _pMonCmp_2i_1_c(b, a2, pVariables1W,1442 d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1443 1444 Equal:1445 tb = npMultM(pGetCoeff(a1),tm);1446 if (!npEqualM(pGetCoeff(a2),tb))1447 {1448 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1449 a = pNext(a) = a2;1450 pIter(a2);1451 }1452 else1453 {1454 s = a2;1455 pIter(a2);1456 pFree1(s);1457 }1458 pIter(a1);1459 if (a1==NULL)1460 {1461 pFree1(b);1462 pNext(a) = a2;1463 return;1464 }1465 if (a2==NULL)1466 {1467 pFree1(b);1468 spMultCopyX(a1, m, a, tneg,spNoether);1469 return;1470 }1471 pCopyAddFast(b, a1, m);1472 goto Top;1473 1474 NotEqual: // i.e., b smaller than a21475 if (d < 0)1476 {1477 a = pNext(a) = a2;1478 pIter(a2);1479 if (a2==NULL)1480 {1481 pFree1(b);1482 spMultCopyX(a1, m, a, tneg,spNoether);1483 return;1484 }1485 goto Top;1486 }1487 1488 // now d >= 0, i.e., b greater than a21489 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1490 a = pNext(a) = b;1491 pIter(a1);1492 if (a1!=NULL)1493 {1494 b = pNew();1495 pCopyAddFast(b, a1, m);1496 }1497 else1498 {1499 pNext(a) = a2;1500 return;1501 }1502 goto Top;1503 }1504 1505 static void spPSpolyLoop_c_2i_1(poly a1, poly a2, poly m,poly spNoether)1506 {1507 poly a, b, s;1508 number tm = pGetCoeff(m);1509 number tneg,tb;1510 int c;1511 1512 1513 tneg = npNegM(tm);1514 if (a2==NULL)1515 {1516 spMultCopyX(a1, m, m, tneg,spNoether);1517 return;1518 }1519 a = m;1520 b = pNew();1521 pCopyAddFast(b, a1, m);1522 1523 Top:1524 register long d;1525 1526 d = pGetComp(a2) - pGetComp(b);1527 NonZeroTestA(d, pComponentOrder, goto NotEqual);1528 d = pGetOrder(b) - pGetOrder(a2);1529 NonZeroTestA(d, pOrdSgn, goto NotEqual);1530 _pMonCmp_2i_1(b, a2, pVariablesW,1531 d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1532 1533 Equal:1534 tb = npMultM(pGetCoeff(a1),tm);1535 if (!npEqualM(pGetCoeff(a2),tb))1536 {1537 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1538 a = pNext(a) = a2;1539 pIter(a2);1540 }1541 else1542 {1543 s = a2;1544 pIter(a2);1545 pFree1(s);1546 }1547 pIter(a1);1548 if (a1==NULL)1549 {1550 pFree1(b);1551 pNext(a) = a2;1552 return;1553 }1554 if (a2==NULL)1555 {1556 pFree1(b);1557 spMultCopyX(a1, m, a, tneg,spNoether);1558 return;1559 }1560 pCopyAddFast(b, a1, m);1561 goto Top;1562 1563 NotEqual: // i.e., b smaller than a21564 if (d < 0)1565 {1566 a = pNext(a) = a2;1567 pIter(a2);1568 if (a2==NULL)1569 {1570 pFree1(b);1571 spMultCopyX(a1, m, a, tneg,spNoether);1572 return;1573 }1574 goto Top;1575 }1576 1577 1578 // now d >= 0, i.e., b greater than a21579 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1580 a = pNext(a) = b;1581 pIter(a1);1582 if (a1!=NULL)1583 {1584 b = pNew();1585 pCopyAddFast(b, a1, m);1586 }1587 else1588 {1589 pNext(a) = a2;1590 return;1591 }1592 goto Top;1593 }1594 1595 1596 /***************************************************************1597 *1598 * Syzygies orderings1599 *1600 ***************************************************************/1601 #define _SyzComp(p1, p2, actionG, actionS) \1602 do \1603 { \1604 if (pGetComp(p1) <= maxBound) \1605 { \1606 if (pGetComp(p2) > maxBound) actionG; \1607 } \1608 else if (pGetComp(p2)<=maxBound) actionS; \1609 } \1610 while(0)1611 1612 #define _SyzComp_d(p1, p2, d, actionG, actionS) \1613 do \1614 { \1615 Exponent_t c1 = pGetComp(p1); \1616 Exponent_t c2 = pGetComp(p2); \1617 d = c2 -c1; \1618 if (d) \1619 { \1620 if (c1 <= maxBound) \1621 { \1622 if (c2 > maxBound) actionG; \1623 } \1624 else \1625 { \1626 if (c2 <= maxBound) actionS; \1627 } \1628 d ^= pComponentOrder; \1629 if (d < 0) actionS; \1630 actionG; \1631 } \1632 } \1633 while(0)1634 1635 static void spPSpolyLoop_1_Syz(poly a1, poly a2, poly m,poly spNoether)1636 {1637 poly a, b, s;1638 number tm = pGetCoeff(m);1639 number tneg,tb;1640 int c;1641 1642 1643 tneg = npNegM(tm);1644 if (a2==NULL)1645 {1646 spMultCopyX(a1, m, m, tneg,spNoether);1647 return;1648 }1649 a = m;1650 b = pNew();1651 pCopyAddFast(b, a1, m);1652 1653 Top:1654 register long d;1655 1656 1657 _SyzComp(b, a2, goto Greater, goto Smaller);1658 d = pGetOrder(b) - pGetOrder(a2);1659 NonZeroTestA(d, pOrdSgn, goto NotEqual);1660 _pMonCmp_1(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1661 1662 Equal:1663 tb = npMultM(pGetCoeff(a1),tm);1664 if (!npEqualM(pGetCoeff(a2),tb))1665 {1666 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1667 a = pNext(a) = a2;1668 pIter(a2);1669 }1670 else1671 {1672 s = a2;1673 pIter(a2);1674 pFree1(s);1675 }1676 pIter(a1);1677 if (a1==NULL)1678 {1679 pFree1(b);1680 pNext(a) = a2;1681 return;1682 }1683 if (a2==NULL)1684 {1685 pFree1(b);1686 spMultCopyX(a1, m, a, tneg,spNoether);1687 return;1688 }1689 pCopyAddFast(b, a1, m);1690 goto Top;1691 1692 NotEqual: // i.e., b smaller than a21693 if (d < 0)1694 {1695 Smaller:1696 a = pNext(a) = a2;1697 pIter(a2);1698 if (a2==NULL)1699 {1700 pFree1(b);1701 spMultCopyX(a1, m, a, tneg,spNoether);1702 return;1703 }1704 goto Top;1705 }1706 1707 // now d >= 0, i.e., b greater than a21708 Greater:1709 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1710 a = pNext(a) = b;1711 pIter(a1);1712 if (a1!=NULL)1713 {1714 b = pNew();1715 pCopyAddFast(b, a1, m);1716 }1717 else1718 {1719 pNext(a) = a2;1720 return;1721 }1722 goto Top;1723 1724 }1725 1726 static void spPSpolyLoop_1_c_Syz(poly a1, poly a2, poly m,poly spNoether)1727 {1728 poly a, b, s;1729 number tm = pGetCoeff(m);1730 number tneg,tb;1731 int c;1732 1733 1734 tneg = npNegM(tm);1735 if (a2==NULL)1736 {1737 spMultCopyX(a1, m, m, tneg,spNoether);1738 return;1739 }1740 a = m;1741 b = pNew();1742 pCopyAddFast(b, a1, m);1743 1744 Top:1745 register long d;1746 1747 _SyzComp(b, a2, goto Greater, goto Smaller);1748 d = pGetOrder(b) - pGetOrder(a2);1749 NonZeroTestA(d, pOrdSgn, goto NotEqual);1750 _pMonCmp_1_c(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1751 1752 Equal:1753 tb = npMultM(pGetCoeff(a1),tm);1754 if (!npEqualM(pGetCoeff(a2),tb))1755 {1756 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1757 a = pNext(a) = a2;1758 pIter(a2);1759 }1760 else1761 {1762 s = a2;1763 pIter(a2);1764 pFree1(s);1765 }1766 pIter(a1);1767 if (a1==NULL)1768 {1769 pFree1(b);1770 pNext(a) = a2;1771 return;1772 }1773 if (a2==NULL)1774 {1775 pFree1(b);1776 spMultCopyX(a1, m, a, tneg,spNoether);1777 return;1778 }1779 pCopyAddFast(b, a1, m);1780 goto Top;1781 NotEqual: // i.e., b smaller than a21782 if (d < 0)1783 {1784 Smaller:1785 a = pNext(a) = a2;1786 pIter(a2);1787 if (a2==NULL)1788 {1789 pFree1(b);1790 spMultCopyX(a1, m, a, tneg,spNoether);1791 return;1792 }1793 goto Top;1794 }1795 1796 // now d >= 0, i.e., b greater than a21797 Greater:1798 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1799 a = pNext(a) = b;1800 pIter(a1);1801 if (a1!=NULL)1802 {1803 b = pNew();1804 pCopyAddFast(b, a1, m);1805 }1806 else1807 {1808 pNext(a) = a2;1809 return;1810 }1811 goto Top;1812 1813 }1814 1815 static void spPSpolyLoop_c_1_Syz(poly a1, poly a2, poly m,poly spNoether)1816 {1817 poly a, b, s;1818 number tm = pGetCoeff(m);1819 number tneg,tb;1820 int c;1821 1822 1823 tneg = npNegM(tm);1824 if (a2==NULL)1825 {1826 spMultCopyX(a1, m, m, tneg,spNoether);1827 return;1828 }1829 a = m;1830 b = pNew();1831 pCopyAddFast(b, a1, m);1832 1833 Top:1834 register long d;1835 1836 1837 _SyzComp_d(b, a2, d, goto Greater, goto Smaller);1838 d = pGetOrder(b) - pGetOrder(a2);1839 NonZeroTestA(d, pOrdSgn, goto NotEqual);1840 _pMonCmp_1(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1841 1842 Equal:1843 tb = npMultM(pGetCoeff(a1),tm);1844 if (!npEqualM(pGetCoeff(a2),tb))1845 {1846 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1847 a = pNext(a) = a2;1848 pIter(a2);1849 }1850 else1851 {1852 s = a2;1853 pIter(a2);1854 pFree1(s);1855 }1856 pIter(a1);1857 if (a1==NULL)1858 {1859 pFree1(b);1860 pNext(a) = a2;1861 return;1862 }1863 if (a2==NULL)1864 {1865 pFree1(b);1866 spMultCopyX(a1, m, a, tneg,spNoether);1867 return;1868 }1869 pCopyAddFast(b, a1, m);1870 goto Top;1871 1872 NotEqual: // i.e., b smaller than a21873 if (d < 0)1874 {1875 Smaller:1876 a = pNext(a) = a2;1877 pIter(a2);1878 if (a2==NULL)1879 {1880 pFree1(b);1881 spMultCopyX(a1, m, a, tneg,spNoether);1882 return;1883 }1884 goto Top;1885 }1886 1887 // now d >= 0, i.e., b greater than a21888 Greater:1889 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1890 a = pNext(a) = b;1891 pIter(a1);1892 if (a1!=NULL)1893 {1894 b = pNew();1895 pCopyAddFast(b, a1, m);1896 }1897 else1898 {1899 pNext(a) = a2;1900 return;1901 }1902 goto Top;1903 }1904 1905 static void spPSpolyLoop_2_Syz(poly a1, poly a2, poly m,poly spNoether)1906 {1907 poly a, b, s;1908 number tm = pGetCoeff(m);1909 number tneg,tb;1910 int c;1911 1912 1913 tneg = npNegM(tm);1914 if (a2==NULL)1915 {1916 spMultCopyX(a1, m, m, tneg,spNoether);1917 return;1918 }1919 a = m;1920 b = pNew();1921 pCopyAddFast(b, a1, m);1922 1923 Top:1924 register long d;1925 1926 _SyzComp(b, a2, goto Greater, goto Smaller);1927 d = pGetOrder(b) - pGetOrder(a2);1928 NonZeroTestA(d, pOrdSgn, goto NotEqual);1929 _pMonCmp_2(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);1930 1931 Equal:1932 tb = npMultM(pGetCoeff(a1),tm);1933 if (!npEqualM(pGetCoeff(a2),tb))1934 {1935 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));1936 a = pNext(a) = a2;1937 pIter(a2);1938 }1939 else1940 {1941 s = a2;1942 pIter(a2);1943 pFree1(s);1944 }1945 pIter(a1);1946 if (a1==NULL)1947 {1948 pFree1(b);1949 pNext(a) = a2;1950 return;1951 }1952 if (a2==NULL)1953 {1954 pFree1(b);1955 spMultCopyX(a1, m, a, tneg,spNoether);1956 return;1957 }1958 pCopyAddFast(b, a1, m);1959 goto Top;1960 1961 NotEqual: // i.e., b smaller than a21962 if (d < 0)1963 {1964 Smaller:1965 a = pNext(a) = a2;1966 pIter(a2);1967 if (a2==NULL)1968 {1969 pFree1(b);1970 spMultCopyX(a1, m, a, tneg,spNoether);1971 return;1972 }1973 goto Top;1974 }1975 1976 // now d >= 0, i.e., b greater than a21977 Greater:1978 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));1979 a = pNext(a) = b;1980 pIter(a1);1981 if (a1!=NULL)1982 {1983 b = pNew();1984 pCopyAddFast(b, a1, m);1985 }1986 else1987 {1988 pNext(a) = a2;1989 return;1990 }1991 goto Top;1992 }1993 1994 static void spPSpolyLoop_2_c_Syz(poly a1, poly a2, poly m,poly spNoether)1995 {1996 poly a, b, s;1997 number tm = pGetCoeff(m);1998 number tneg,tb;1999 int c;2000 2001 2002 tneg = npNegM(tm);2003 if (a2==NULL)2004 {2005 spMultCopyX(a1, m, m, tneg,spNoether);2006 return;2007 }2008 a = m;2009 b = pNew();2010 pCopyAddFast(b, a1, m);2011 2012 Top:2013 register long d;2014 2015 _SyzComp(b, a2, goto Greater, goto Smaller);2016 d = pGetOrder(b) - pGetOrder(a2);2017 NonZeroTestA(d, pOrdSgn, goto NotEqual);2018 _pMonCmp_2_c(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2019 2020 Equal:2021 tb = npMultM(pGetCoeff(a1),tm);2022 if (!npEqualM(pGetCoeff(a2),tb))2023 {2024 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2025 a = pNext(a) = a2;2026 pIter(a2);2027 }2028 else2029 {2030 s = a2;2031 pIter(a2);2032 pFree1(s);2033 }2034 pIter(a1);2035 if (a1==NULL)2036 {2037 pFree1(b);2038 pNext(a) = a2;2039 return;2040 }2041 if (a2==NULL)2042 {2043 pFree1(b);2044 spMultCopyX(a1, m, a, tneg,spNoether);2045 return;2046 }2047 pCopyAddFast(b, a1, m);2048 goto Top;2049 2050 NotEqual: // i.e., b smaller than a22051 if (d < 0)2052 {2053 Smaller:2054 a = pNext(a) = a2;2055 pIter(a2);2056 if (a2==NULL)2057 {2058 pFree1(b);2059 spMultCopyX(a1, m, a, tneg,spNoether);2060 return;2061 }2062 goto Top;2063 }2064 2065 // now d >= 0, i.e., b greater than a22066 Greater:2067 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2068 a = pNext(a) = b;2069 pIter(a1);2070 if (a1!=NULL)2071 {2072 b = pNew();2073 pCopyAddFast(b, a1, m);2074 }2075 else2076 {2077 pNext(a) = a2;2078 return;2079 }2080 goto Top;2081 }2082 2083 static void spPSpolyLoop_c_2_Syz(poly a1, poly a2, poly m,poly spNoether)2084 {2085 poly a, b, s;2086 number tm = pGetCoeff(m);2087 number tneg,tb;2088 int c;2089 2090 2091 tneg = npNegM(tm);2092 if (a2==NULL)2093 {2094 spMultCopyX(a1, m, m, tneg,spNoether);2095 return;2096 }2097 a = m;2098 b = pNew();2099 pCopyAddFast(b, a1, m);2100 2101 Top:2102 register long d;2103 2104 _SyzComp_d(b, a2, d, goto Greater, goto Smaller);2105 2106 d = pGetOrder(b) - pGetOrder(a2);2107 NonZeroTestA(d, pOrdSgn, goto NotEqual);2108 _pMonCmp_2(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2109 2110 Equal:2111 tb = npMultM(pGetCoeff(a1),tm);2112 if (!npEqualM(pGetCoeff(a2),tb))2113 {2114 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2115 a = pNext(a) = a2;2116 pIter(a2);2117 }2118 else2119 {2120 s = a2;2121 pIter(a2);2122 pFree1(s);2123 }2124 pIter(a1);2125 if (a1==NULL)2126 {2127 pFree1(b);2128 pNext(a) = a2;2129 return;2130 }2131 if (a2==NULL)2132 {2133 pFree1(b);2134 spMultCopyX(a1, m, a, tneg,spNoether);2135 return;2136 }2137 pCopyAddFast(b, a1, m);2138 goto Top;2139 2140 NotEqual: // i.e., b smaller than a22141 if (d < 0)2142 {2143 Smaller:2144 a = pNext(a) = a2;2145 pIter(a2);2146 if (a2==NULL)2147 {2148 pFree1(b);2149 spMultCopyX(a1, m, a, tneg,spNoether);2150 return;2151 }2152 goto Top;2153 }2154 2155 // now d >= 0, i.e., b greater than a22156 Greater:2157 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2158 a = pNext(a) = b;2159 pIter(a1);2160 if (a1!=NULL)2161 {2162 b = pNew();2163 pCopyAddFast(b, a1, m);2164 }2165 else2166 {2167 pNext(a) = a2;2168 return;2169 }2170 goto Top;2171 }2172 2173 static void spPSpolyLoop_2i_Syz(poly a1, poly a2, poly m,poly spNoether)2174 {2175 poly a, b, s;2176 number tm = pGetCoeff(m);2177 number tneg,tb;2178 int c;2179 2180 2181 tneg = npNegM(tm);2182 if (a2==NULL)2183 {2184 spMultCopyX(a1, m, m, tneg,spNoether);2185 return;2186 }2187 a = m;2188 b = pNew();2189 pCopyAddFast(b, a1, m);2190 2191 Top:2192 register long d;2193 2194 _SyzComp(b, a2, goto Greater, goto Smaller);2195 d = pGetOrder(b) - pGetOrder(a2);2196 NonZeroTestA(d, pOrdSgn, goto NotEqual);2197 _pMonCmp_2i(b, a2, LoopVariablesW, d,2198 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2199 2200 Equal:2201 tb = npMultM(pGetCoeff(a1),tm);2202 if (!npEqualM(pGetCoeff(a2),tb))2203 {2204 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2205 a = pNext(a) = a2;2206 pIter(a2);2207 }2208 else2209 {2210 s = a2;2211 pIter(a2);2212 pFree1(s);2213 }2214 pIter(a1);2215 if (a1==NULL)2216 {2217 pFree1(b);2218 pNext(a) = a2;2219 return;2220 }2221 if (a2==NULL)2222 {2223 pFree1(b);2224 spMultCopyX(a1, m, a, tneg,spNoether);2225 return;2226 }2227 pCopyAddFast(b, a1, m);2228 goto Top;2229 2230 NotEqual: // i.e., b smaller than a22231 if (d < 0)2232 {2233 Smaller:2234 a = pNext(a) = a2;2235 pIter(a2);2236 if (a2==NULL)2237 {2238 pFree1(b);2239 spMultCopyX(a1, m, a, tneg,spNoether);2240 return;2241 }2242 goto Top;2243 }2244 2245 // now d >= 0, i.e., b greater than a22246 Greater:2247 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2248 a = pNext(a) = b;2249 pIter(a1);2250 if (a1!=NULL)2251 {2252 b = pNew();2253 pCopyAddFast(b, a1, m);2254 }2255 else2256 {2257 pNext(a) = a2;2258 return;2259 }2260 goto Top;2261 }2262 2263 static void spPSpolyLoop_2i_c_Syz(poly a1, poly a2, poly m,poly spNoether)2264 {2265 poly a, b, s;2266 number tm = pGetCoeff(m);2267 number tneg,tb;2268 int c;2269 2270 2271 tneg = npNegM(tm);2272 if (a2==NULL)2273 {2274 spMultCopyX(a1, m, m, tneg,spNoether);2275 return;2276 }2277 a = m;2278 b = pNew();2279 pCopyAddFast(b, a1, m);2280 2281 Top:2282 register long d;2283 2284 _SyzComp(b, a2, goto Greater, goto Smaller);2285 d = pGetOrder(b) - pGetOrder(a2);2286 NonZeroTestA(d, pOrdSgn, goto NotEqual);2287 _pMonCmp_2i_c(b, a2, pVariables1W, d,2288 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2289 2290 Equal:2291 tb = npMultM(pGetCoeff(a1),tm);2292 if (!npEqualM(pGetCoeff(a2),tb))2293 {2294 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2295 a = pNext(a) = a2;2296 pIter(a2);2297 }2298 else2299 {2300 s = a2;2301 pIter(a2);2302 pFree1(s);2303 }2304 pIter(a1);2305 if (a1==NULL)2306 {2307 pFree1(b);2308 pNext(a) = a2;2309 return;2310 }2311 if (a2==NULL)2312 {2313 pFree1(b);2314 spMultCopyX(a1, m, a, tneg,spNoether);2315 return;2316 }2317 pCopyAddFast(b, a1, m);2318 goto Top;2319 2320 NotEqual: // i.e., b smaller than a22321 if (d < 0)2322 {2323 Smaller:2324 a = pNext(a) = a2;2325 pIter(a2);2326 if (a2==NULL)2327 {2328 pFree1(b);2329 spMultCopyX(a1, m, a, tneg,spNoether);2330 return;2331 }2332 goto Top;2333 }2334 2335 // now d >= 0, i.e., b greater than a22336 Greater:2337 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2338 a = pNext(a) = b;2339 pIter(a1);2340 if (a1!=NULL)2341 {2342 b = pNew();2343 pCopyAddFast(b, a1, m);2344 }2345 else2346 {2347 pNext(a) = a2;2348 return;2349 }2350 goto Top;2351 }2352 2353 static void spPSpolyLoop_c_2i_Syz(poly a1, poly a2, poly m,poly spNoether)2354 {2355 poly a, b, s;2356 number tm = pGetCoeff(m);2357 number tneg,tb;2358 int c;2359 2360 2361 tneg = npNegM(tm);2362 if (a2==NULL)2363 {2364 spMultCopyX(a1, m, m, tneg,spNoether);2365 return;2366 }2367 a = m;2368 b = pNew();2369 pCopyAddFast(b, a1, m);2370 2371 Top:2372 register long d;2373 2374 _SyzComp_d(b, a2, d, goto Greater, goto Smaller);2375 d = pGetOrder(b) - pGetOrder(a2);2376 NonZeroTestA(d, pOrdSgn, goto NotEqual);2377 _pMonCmp_2i(b, a2, pVariablesW,2378 d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2379 2380 Equal:2381 tb = npMultM(pGetCoeff(a1),tm);2382 if (!npEqualM(pGetCoeff(a2),tb))2383 {2384 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2385 a = pNext(a) = a2;2386 pIter(a2);2387 }2388 else2389 {2390 s = a2;2391 pIter(a2);2392 pFree1(s);2393 }2394 pIter(a1);2395 if (a1==NULL)2396 {2397 pFree1(b);2398 pNext(a) = a2;2399 return;2400 }2401 if (a2==NULL)2402 {2403 pFree1(b);2404 spMultCopyX(a1, m, a, tneg,spNoether);2405 return;2406 }2407 pCopyAddFast(b, a1, m);2408 goto Top;2409 2410 NotEqual: // i.e., b smaller than a22411 if (d < 0)2412 {2413 Smaller:2414 a = pNext(a) = a2;2415 pIter(a2);2416 if (a2==NULL)2417 {2418 pFree1(b);2419 spMultCopyX(a1, m, a, tneg,spNoether);2420 return;2421 }2422 goto Top;2423 }2424 2425 // now d >= 0, i.e., b greater than a22426 Greater:2427 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2428 a = pNext(a) = b;2429 pIter(a1);2430 if (a1!=NULL)2431 {2432 b = pNew();2433 pCopyAddFast(b, a1, m);2434 }2435 else2436 {2437 pNext(a) = a2;2438 return;2439 }2440 goto Top;2441 }2442 2443 static void spPSpolyLoop_2i_1_Syz(poly a1, poly a2, poly m,poly spNoether)2444 {2445 poly a, b, s;2446 number tm = pGetCoeff(m);2447 number tneg,tb;2448 int c;2449 2450 2451 tneg = npNegM(tm);2452 if (a2==NULL)2453 {2454 spMultCopyX(a1, m, m, tneg,spNoether);2455 return;2456 }2457 a = m;2458 b = pNew();2459 pCopyAddFast(b, a1, m);2460 2461 Top:2462 register long d;2463 2464 _SyzComp(b, a2, goto Greater, goto Smaller);2465 d = pGetOrder(b) - pGetOrder(a2);2466 NonZeroTestA(d, pOrdSgn, goto NotEqual);2467 _pMonCmp_2i_1(b, a2, LoopVariablesW, d,2468 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2469 2470 Equal:2471 tb = npMultM(pGetCoeff(a1),tm);2472 if (!npEqualM(pGetCoeff(a2),tb))2473 {2474 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2475 a = pNext(a) = a2;2476 pIter(a2);2477 }2478 else2479 {2480 s = a2;2481 pIter(a2);2482 pFree1(s);2483 }2484 pIter(a1);2485 if (a1==NULL)2486 {2487 pFree1(b);2488 pNext(a) = a2;2489 return;2490 }2491 if (a2==NULL)2492 {2493 pFree1(b);2494 spMultCopyX(a1, m, a, tneg,spNoether);2495 return;2496 }2497 pCopyAddFast(b, a1, m);2498 goto Top;2499 2500 NotEqual: // i.e., b smaller than a22501 if (d < 0)2502 {2503 Smaller:2504 a = pNext(a) = a2;2505 pIter(a2);2506 if (a2==NULL)2507 {2508 pFree1(b);2509 spMultCopyX(a1, m, a, tneg,spNoether);2510 return;2511 }2512 goto Top;2513 }2514 2515 // now d >= 0, i.e., b greater than a22516 Greater:2517 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2518 a = pNext(a) = b;2519 pIter(a1);2520 if (a1!=NULL)2521 {2522 b = pNew();2523 pCopyAddFast(b, a1, m);2524 }2525 else2526 {2527 pNext(a) = a2;2528 return;2529 }2530 goto Top;2531 }2532 2533 static void spPSpolyLoop_2i_1_c_Syz(poly a1, poly a2, poly m,poly spNoether)2534 {2535 poly a, b, s;2536 number tm = pGetCoeff(m);2537 number tneg,tb;2538 int c;2539 2540 2541 tneg = npNegM(tm);2542 if (a2==NULL)2543 {2544 spMultCopyX(a1, m, m, tneg,spNoether);2545 return;2546 }2547 a = m;2548 b = pNew();2549 pCopyAddFast(b, a1, m);2550 2551 Top:2552 register long d;2553 2554 _SyzComp(b,a2, goto Greater, goto Smaller);2555 d = pGetOrder(b) - pGetOrder(a2);2556 NonZeroTestA(d, pOrdSgn, goto NotEqual);2557 _pMonCmp_2i_1_c(b, a2, pVariables1W, d,2558 NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2559 2560 Equal:2561 tb = npMultM(pGetCoeff(a1),tm);2562 if (!npEqualM(pGetCoeff(a2),tb))2563 {2564 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2565 a = pNext(a) = a2;2566 pIter(a2);2567 }2568 else2569 {2570 s = a2;2571 pIter(a2);2572 pFree1(s);2573 }2574 pIter(a1);2575 if (a1==NULL)2576 {2577 pFree1(b);2578 pNext(a) = a2;2579 return;2580 }2581 if (a2==NULL)2582 {2583 pFree1(b);2584 spMultCopyX(a1, m, a, tneg,spNoether);2585 return;2586 }2587 pCopyAddFast(b, a1, m);2588 goto Top;2589 2590 NotEqual: // i.e., b smaller than a22591 if (d < 0)2592 {2593 Smaller:2594 a = pNext(a) = a2;2595 pIter(a2);2596 if (a2==NULL)2597 {2598 pFree1(b);2599 spMultCopyX(a1, m, a, tneg,spNoether);2600 return;2601 }2602 goto Top;2603 }2604 2605 // now d >= 0, i.e., b greater than a22606 Greater:2607 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2608 a = pNext(a) = b;2609 pIter(a1);2610 if (a1!=NULL)2611 {2612 b = pNew();2613 pCopyAddFast(b, a1, m);2614 }2615 else2616 {2617 pNext(a) = a2;2618 return;2619 }2620 goto Top;2621 }2622 2623 static void spPSpolyLoop_c_2i_1_Syz(poly a1, poly a2, poly m,poly spNoether)2624 {2625 poly a, b, s;2626 number tm = pGetCoeff(m);2627 number tneg,tb;2628 int c;2629 2630 2631 tneg = npNegM(tm);2632 if (a2==NULL)2633 {2634 spMultCopyX(a1, m, m, tneg,spNoether);2635 return;2636 }2637 a = m;2638 b = pNew();2639 pCopyAddFast(b, a1, m);2640 2641 Top:2642 register long d;2643 2644 _SyzComp_d(b, a2, d, goto Greater, goto Smaller);2645 d = pGetOrder(b) - pGetOrder(a2);2646 NonZeroTestA(d, pOrdSgn, goto NotEqual);2647 _pMonCmp_2i_1(b, a2, pVariablesW,2648 d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);2649 2650 Equal:2651 tb = npMultM(pGetCoeff(a1),tm);2652 if (!npEqualM(pGetCoeff(a2),tb))2653 {2654 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2655 a = pNext(a) = a2;2656 pIter(a2);2657 }2658 else2659 {2660 s = a2;2661 pIter(a2);2662 pFree1(s);2663 }2664 pIter(a1);2665 if (a1==NULL)2666 {2667 pFree1(b);2668 pNext(a) = a2;2669 return;2670 }2671 if (a2==NULL)2672 {2673 pFree1(b);2674 spMultCopyX(a1, m, a, tneg,spNoether);2675 return;2676 }2677 pCopyAddFast(b, a1, m);2678 goto Top;2679 2680 NotEqual: // i.e., b smaller than a22681 if (d < 0)2682 {2683 Smaller:2684 a = pNext(a) = a2;2685 pIter(a2);2686 if (a2==NULL)2687 {2688 pFree1(b);2689 spMultCopyX(a1, m, a, tneg,spNoether);2690 return;2691 }2692 goto Top;2693 }2694 2695 // now d >= 02696 Greater:2697 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2698 a = pNext(a) = b;2699 pIter(a1);2700 if (a1!=NULL)2701 {2702 b = pNew();2703 pCopyAddFast(b, a1, m);2704 }2705 else2706 {2707 pNext(a) = a2;2708 return;2709 }2710 goto Top;2711 }2712 2713 /***************************************************************2714 *2715 * Comp == 0, homogenous case (i.e. no order comparisons)2716 *2717 ***************************************************************/2718 2719 static void spPSpolyLoop_1_homog(poly a1, poly a2, poly m,poly spNoether)2720 {2721 poly a, b, s;2722 number tm = pGetCoeff(m);2723 number tneg,tb;2724 int c;2725 2726 2727 tneg = npNegM(tm);2728 if (a2==NULL)2729 {2730 spMultCopyX(a1, m, m, tneg,spNoether);2731 return;2732 }2733 a = m;2734 b = pNew();2735 pCopyAddFast1(b, a1, m);2736 2737 Top:2738 register long d;2739 2740 _pMonCmp_1(b, a2, d, goto NotEqual, goto Equal);2741 2742 Equal:2743 tb = npMultM(pGetCoeff(a1),tm);2744 if (!npEqualM(pGetCoeff(a2),tb))2745 {2746 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2747 a = pNext(a) = a2;2748 pIter(a2);2749 }2750 else2751 {2752 s = a2;2753 pIter(a2);2754 pFree1(s);2755 }2756 pIter(a1);2757 if (a1==NULL)2758 {2759 pFree1(b);2760 pNext(a) = a2;2761 return;2762 }2763 if (a2==NULL)2764 {2765 pFree1(b);2766 spMultCopyX(a1, m, a, tneg,spNoether);2767 return;2768 }2769 pCopyAddFast1(b, a1, m);2770 goto Top;2771 2772 NotEqual: // i.e., b smaller than a22773 d ^= pLexSgn;2774 if (d < 0)2775 {2776 a = pNext(a) = a2;2777 pIter(a2);2778 if (a2==NULL)2779 {2780 pFree1(b);2781 spMultCopyX(a1, m, a, tneg,spNoether);2782 return;2783 }2784 goto Top;2785 }2786 2787 // now d >= 0, i.e., b greater than a22788 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2789 a = pNext(a) = b;2790 pIter(a1);2791 if (a1!=NULL)2792 {2793 b = pNew();2794 pCopyAddFast1(b, a1, m);2795 }2796 else2797 {2798 pNext(a) = a2;2799 return;2800 }2801 goto Top;2802 }2803 2804 static void spPSpolyLoop_2_homog(poly a1, poly a2, poly m,poly spNoether)2805 {2806 poly a, b, s;2807 number tm = pGetCoeff(m);2808 number tneg,tb;2809 int c;2810 2811 2812 tneg = npNegM(tm);2813 if (a2==NULL)2814 {2815 spMultCopyX(a1, m, m, tneg,spNoether);2816 return;2817 }2818 a = m;2819 b = pNew();2820 pCopyAddFast1(b, a1, m);2821 2822 Top:2823 register long d;2824 2825 _pMonCmp_2(b, a2, d, goto NotEqual, goto Equal);2826 2827 Equal:2828 tb = npMultM(pGetCoeff(a1),tm);2829 if (!npEqualM(pGetCoeff(a2),tb))2830 {2831 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2832 a = pNext(a) = a2;2833 pIter(a2);2834 }2835 else2836 {2837 s = a2;2838 pIter(a2);2839 pFree1(s);2840 }2841 pIter(a1);2842 if (a1==NULL)2843 {2844 pFree1(b);2845 pNext(a) = a2;2846 return;2847 }2848 if (a2==NULL)2849 {2850 pFree1(b);2851 spMultCopyX(a1, m, a, tneg,spNoether);2852 return;2853 }2854 pCopyAddFast1(b, a1, m);2855 goto Top;2856 2857 NotEqual: // i.e., b smaller than a22858 d ^= pLexSgn;2859 if (d < 0)2860 {2861 a = pNext(a) = a2;2862 pIter(a2);2863 if (a2==NULL)2864 {2865 pFree1(b);2866 spMultCopyX(a1, m, a, tneg,spNoether);2867 return;2868 }2869 goto Top;2870 }2871 2872 // now d >= 0, i.e., b greater than a22873 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2874 a = pNext(a) = b;2875 pIter(a1);2876 if (a1!=NULL)2877 {2878 b = pNew();2879 pCopyAddFast1(b, a1, m);2880 }2881 else2882 {2883 pNext(a) = a2;2884 return;2885 }2886 goto Top;2887 }2888 2889 static void spPSpolyLoop_2i_homog(poly a1, poly a2, poly m,poly spNoether)2890 {2891 poly a, b, s;2892 number tm = pGetCoeff(m);2893 number tneg,tb;2894 int c;2895 2896 2897 tneg = npNegM(tm);2898 if (a2==NULL)2899 {2900 spMultCopyX(a1, m, m, tneg,spNoether);2901 return;2902 }2903 a = m;2904 b = pNew();2905 pCopyAddFast1(b, a1, m);2906 2907 Top:2908 register long d;2909 2910 _pMonCmp_2i(b, a2, pVariablesW, d,2911 goto NotEqual, goto Equal);2912 2913 Equal:2914 tb = npMultM(pGetCoeff(a1),tm);2915 if (!npEqualM(pGetCoeff(a2),tb))2916 {2917 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));2918 a = pNext(a) = a2;2919 pIter(a2);2920 }2921 else2922 {2923 s = a2;2924 pIter(a2);2925 pFree1(s);2926 }2927 pIter(a1);2928 if (a1==NULL)2929 {2930 pFree1(b);2931 pNext(a) = a2;2932 return;2933 }2934 if (a2==NULL)2935 {2936 pFree1(b);2937 spMultCopyX(a1, m, a, tneg,spNoether);2938 return;2939 }2940 pCopyAddFast1(b, a1, m);2941 goto Top;2942 2943 NotEqual: // i.e., b smaller than a22944 d ^= pLexSgn;2945 if (d < 0)2946 {2947 a = pNext(a) = a2;2948 pIter(a2);2949 if (a2==NULL)2950 {2951 pFree1(b);2952 spMultCopyX(a1, m, a, tneg,spNoether);2953 return;2954 }2955 goto Top;2956 }2957 2958 // now d >= 0, i.e., b greater than a22959 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));2960 a = pNext(a) = b;2961 pIter(a1);2962 if (a1!=NULL)2963 {2964 b = pNew();2965 pCopyAddFast1(b, a1, m);2966 }2967 else2968 {2969 pNext(a) = a2;2970 return;2971 }2972 goto Top;2973 }2974 2975 static void spPSpolyLoop_2i_1_homog(poly a1, poly a2, poly m,poly spNoether)2976 {2977 poly a, b, s;2978 number tm = pGetCoeff(m);2979 number tneg,tb;2980 int c;2981 2982 2983 tneg = npNegM(tm);2984 if (a2==NULL)2985 {2986 spMultCopyX(a1, m, m, tneg,spNoether);2987 return;2988 }2989 a = m;2990 b = pNew();2991 pCopyAddFast1(b, a1, m);2992 2993 Top:2994 register long d;2995 _pMonCmp_2i_1(b, a2, pVariablesW, d, goto NotEqual, goto Equal);2996 2997 Equal:2998 tb = npMultM(pGetCoeff(a1),tm);2999 if (!npEqualM(pGetCoeff(a2),tb))3000 {3001 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));3002 a = pNext(a) = a2;3003 pIter(a2);3004 }3005 else3006 {3007 s = a2;3008 pIter(a2);3009 pFree1(s);3010 }3011 pIter(a1);3012 if (a1==NULL)3013 {3014 pFree1(b);3015 pNext(a) = a2;3016 return;3017 }3018 if (a2==NULL)3019 {3020 pFree1(b);3021 spMultCopyX(a1, m, a, tneg,spNoether);3022 return;3023 }3024 pCopyAddFast1(b, a1, m);3025 goto Top;3026 3027 NotEqual: // i.e., b smaller than a23028 d ^= pLexSgn;3029 if (d < 0)3030 {3031 a = pNext(a) = a2;3032 pIter(a2);3033 if (a2==NULL)3034 {3035 pFree1(b);3036 spMultCopyX(a1, m, a, tneg,spNoether);3037 return;3038 }3039 goto Top;3040 }3041 3042 // now d >= 0, i.e., b greater than a23043 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));3044 a = pNext(a) = b;3045 pIter(a1);3046 if (a1!=NULL)3047 {3048 b = pNew();3049 pCopyAddFast1(b, a1, m);3050 }3051 else3052 {3053 pNext(a) = a2;3054 return;3055 }3056 goto Top;3057 }3058 3059 /***************************************************************3060 *3061 * The Macaulay-order case3062 *3063 ***************************************************************/3064 #ifdef TEST_MAC_ORDER3065 /*23066 * assume m = L(m) and Lc(m) = exp3067 * pNext(n) = result = p*m3068 * do not destroy p3069 */3070 inline void bMultCopyX(poly p, poly m, poly n, number exp)3071 {3072 #ifdef PDEBUG3073 poly pp=n;3074 #endif3075 poly a = n;3076 do3077 {3078 pNext(a) = pNew();3079 a = pNext(a);3080 spMemcpy(a,p);3081 pbMonAddFast(a,m);3082 pSetCoeff0(a,npMultM(pGetCoeff(p),exp));3083 pIter(p);3084 }3085 while (p!=NULL);3086 pNext(a) = NULL;3087 pTest(pp);3088 }3089 3090 /*23091 * assume m = L(m) and Lc(m) = exp3092 * pNext(n) = result = p*m3093 * do not destroy p3094 */3095 inline void bMultCopyX0(poly p, poly m, poly n, number exp)3096 {3097 poly a = n;3098 do3099 {3100 pNext(a) = pNew();3101 a = pNext(a);3102 spMemcpy(a,p);3103 pbMonAddFast0(a,m);3104 pSetCoeff0(a,npMultM(pGetCoeff(p),exp));3105 pIter(p);3106 }3107 while (p!=NULL);3108 pNext(a) = NULL;3109 }3110 3111 3112 // no components involved3113 void spLoop_mac_1(poly a1, poly a2, poly m,poly spNoether)3114 {3115 poly a, b, s;3116 number tm = pGetCoeff(m);3117 number tneg,tb;3118 int c;3119 3120 tneg = npNegM(tm);3121 if (a2==NULL)3122 {3123 //bMultCopyX(a1, m, m, tneg);3124 spMultCopyX(a1, m, m, tneg,NULL);3125 pTest(pNext(m));3126 return;3127 }3128 a = m;3129 b = pNew();3130 pCopyAddFast(b, a1, m);3131 3132 Top:3133 register long d;3134 3135 3136 if ((pGetOrder(b)<0) && (pGetOrder(a2)<0)) goto Top0;3137 3138 //d = (long long)pGetOrder(b) - (long long)pGetOrder(a2);3139 //NonZeroTestA(d, 1 /*pOrdSgn*/, goto NotEqual);3140 if (pGetOrder(b) > pGetOrder(a2)) { goto C_1; /*d=1; goto NotEqual;*/ }3141 else if (pGetOrder(b) < pGetOrder(a2)) { goto C_M1; /*d=-1; goto NotEqual;*/ }3142 3143 // now pGetOrder(b)==pGetOrder(a2):3144 _pMonCmp_1(b, a2, d, NonZeroA(d, pLexSgn, goto NotEqual ), goto Equal);3145 3146 Equal:3147 tb = npMultM(pGetCoeff(a1),tm);3148 if (!npEqualM(pGetCoeff(a2),tb))3149 {3150 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));3151 a = pNext(a) = a2;3152 pIter(a2);3153 }3154 else3155 {3156 s = a2;3157 pIter(a2);3158 pFree1(s);3159 }3160 pIter(a1);3161 if (a1==NULL)3162 {3163 pFree1(b);3164 pNext(a) = a2;3165 pTest(pNext(m));3166 return;3167 }3168 if (a2==NULL)3169 {3170 pFree1(b);3171 //bMultCopyX(a1, m, a, tneg);3172 spMultCopyX(a1, m, a, tneg,NULL);3173 pTest(pNext(m));3174 return;3175 }3176 pCopyAddFast(b, a1, m);3177 goto Top;3178 3179 NotEqual: // i.e., b smaller than a23180 if (d >= 0) goto C_1;3181 C_M1:3182 {3183 a = pNext(a) = a2;3184 pIter(a2);3185 if (a2==NULL)3186 {3187 pFree1(b);3188 //bMultCopyX(a1, m, a, tneg);3189 spMultCopyX(a1, m, a, tneg,NULL);3190 pTest(pNext(m));3191 return;3192 }3193 goto Top;3194 }3195 3196 C_1:3197 // now d >= 0, i.e., b greater than a23198 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));3199 a = pNext(a) = b;3200 pIter(a1);3201 if (a1!=NULL)3202 {3203 b = pNew();3204 pCopyAddFast(b, a1, m);3205 }3206 else3207 {3208 pNext(a) = a2;3209 pTest(pNext(m));3210 return;3211 }3212 goto Top;3213 3214 3215 // below degree limit =================================================3216 Top0:3217 if (pGetOrder(b) > pGetOrder(a2)) { goto C_1_0; }3218 else if (pGetOrder(b) < pGetOrder(a2)) { goto C_M1_0; }3219 3220 3221 //Equal0:3222 {3223 tb = npMultM(pGetCoeff(a1),tm);3224 if (!npEqualM(pGetCoeff(a2),tb))3225 {3226 pSetCoeff0(a2,npSubM(pGetCoeff(a2),tb));3227 a = pNext(a) = a2;3228 pIter(a2);3229 }3230 else3231 {3232 s = a2;3233 pIter(a2);3234 pFree1(s);3235 }3236 pIter(a1);3237 if (a1==NULL)3238 {3239 pFree1(b);3240 pNext(a) = a2;3241 return;3242 }3243 if (a2==NULL)3244 {3245 pFree1(b);3246 bMultCopyX(a1, m, a, tneg);3247 return;3248 }3249 pbCopyAddFast0(b, a1, m);3250 }3251 goto Top0;3252 3253 C_M1_0: // b < a23254 {3255 a = pNext(a) = a2;3256 pIter(a2);3257 if (a2==NULL)3258 {3259 pFree1(b);3260 bMultCopyX(a1, m, a, tneg);3261 return;3262 }3263 }3264 goto Top0;3265 3266 C_1_0: // b >a23267 {3268 pSetCoeff0(b,npMultM(pGetCoeff(a1),tneg));3269 a = pNext(a) = b;3270 pIter(a1);3271 if (a1!=NULL)3272 {3273 b = pNew();3274 pbCopyAddFast0(b, a1, m);3275 }3276 else3277 {3278 pNext(a) = a2;3279 return;3280 }3281 }3282 goto Top0;3283 }3284 void spLoop_mac_2(poly a1, poly a2, poly m,poly spNoether)3285 {3286 poly a, b, s;3287 number tm = pGetCoeff(m);3288 number tneg,tb;3289 int c;3290 3291 tneg = npNegM(tm);3292 if (a2==NULL)3293 {3294 bMultCopyX(a1, m, m, tneg);3295 //spMultCopyX(a1, m, m, tneg,NULL);3296 pTest(pNext(m));3297 return;3298 }