Changeset f92fa13 in git


Ignore:
Timestamp:
Mar 16, 1998, 3:56:48 PM (25 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
Children:
5c8eae0ee4adf297d4ee70c4eb367499625899d8
Parents:
057fd3b14dfe97c1070a5e6e9ea465fb317ae57f
Message:
1998-03-16  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* polys-impl.h: #define COMP_FAST

	* configure.in,Makefile.in: check for flex -P; increased version
	number to 1.1.7

1998-03-04  Olaf Bachmann  <obachman@mathematik.uni-kl.de>

	* febase.h: added macro assume()

	* spSpolyLoop.cc: Automatic generation of SpolyLoops using
	spSpolyLoop.pl

	* kstd*.cc: New calling interface to get SpolyLoop

	* ring.h: Introduced rOrderType_t


git-svn-id: file:///usr/local/Singular/svn/trunk@1236 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • Singular/ChangeLog

    r057fd3 rf92fa13  
     11998-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
    18Fri Mar 13 16:16:27 MET 1998 hannes
    29  * fixed: Singular crashed while changing the minpoly in GF(q)
     
    1623          made fixes requested by libparse (s.a. brackets, ....)
    1724       
     251998-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
    1836Mon Mar  2 16:18:25 MET 1998 hannes
    1937   * changed handling of "echo" in examples: do not report file + lineno
  • Singular/Makefile.in

    r057fd3 rf92fa13  
    3232CC              = @CC@
    3333CXX             = @CXX@
     34LEXP            = @LEXP@
    3435BISON           = bison
    35 LEX             = flex
     36PERL            = perl
    3637@SET_MAKE@
    3738INSTALL         = ./install-sh -c
     
    4647CXXFLAGS        = @CXXFLAGS@ -pipe
    4748CXXTEMPLFLAGS   = @CXXTEMPLFLAGS@
    48 CPPFLAGS        = -I${srcdir} @CPPFLAGS@ 
     49CPPFLAGS        = -I${srcdir} @CPPFLAGS@
    4950DEFS            = @DEFS@ -DNDEBUG
    5051LDFLAGS         = @LDFLAGS@
     
    100101CSOURCES=mmalloc.c mmallocb.c mmallocs.c mmblock.c mmheap.c mmspec.c mmutil.c weight0.c
    101102
    102 SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l
     103SOURCES=${CSOURCES} ${CXXSOURCES} grammar.y scanner.l libparse.l spSpolyLoop.pl
    103104
    104105HEADERS=algmap.h hutil.h lists.h stairc.h attrib.h ideals.h \
     
    150151
    151152.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
    154160.y.cc:
    155161        ${BISON} -d -t -o grammar.cc $<
     
    175181        ${OBJS} ${STATIC_LDFLAGS} ${LDFLAGS} ${LIBS}
    176182
    177 libparse: libparse_main.o utils.o
    178         ${CXX} -o libparse libparse_main.o utils.o
    179 
    180 libparse_main.o: libparse.cc
    181         ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER
    182183
    183184iparith.o mpsr_Tok.o : iparith.inc mpsr_Tok.inc
     
    204205        fi
    205206
    206 libparse.cc: libparse.l
    207         ${LEX} -I -Pyylp -olibparse.cc libparse.l
    208207
    209208version.h: ${SOURCES} ${HEADERS} Makefile.in mod2.h.in configure.in
     
    214213stamp-h : config.status mod2.h.in
    215214        CONFIG_FILES= CONFIG_HEADERS=mod2.h ./config.status
     215
     216spSpolyLoop.cc spSpolyLoop.dd : spSpolyLoop.inc
     217
     218spSpolyLoop.inc: spSpolyLoop.pl
     219        ${PERL} spSpolyLoop.pl > spSpolyLoop.inc
     220
     221libparse: libparse_main.o utils.o
     222        ${CXX} -o libparse libparse_main.o utils.o
     223
     224libparse_main.o: libparse.cc
     225        ${CXX} -c -o libparse_main.o libparse.cc -DSTANDALONE_PARSER
     226
     227libparse.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
    216235
    217236Makefile: Makefile.in config.status
  • Singular/binom.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: binom.cc,v 1.12 1998-01-28 22:11:19 Singular Exp $ */
     4/* $Id: binom.cc,v 1.13 1998-03-16 14:56:25 obachman Exp $ */
    55
    66/*
     
    186186  #endif
    187187  }
    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;
    192192  return 0;
    193193}
  • Singular/clapconv.cc

    r057fd3 rf92fa13  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 // $Id: clapconv.cc,v 1.14 1998-02-09 11:29:00 Singular Exp $
     5// $Id: clapconv.cc,v 1.15 1998-03-16 14:56:25 obachman Exp $
    66/*
    77* ABSTRACT: convert data between Singular and factory
     
    126126  else
    127127  {
    128     poly term = pNew();
     128    poly term = pInit();
    129129    pNext( term ) = NULL;
    130130    for ( int i = 1; i <= pVariables; i++ )
     
    346346    if (z!=NULL)
    347347    {
    348       poly term = pNew();
     348      poly term = pInit();
    349349      pNext( term ) = NULL;
    350350      for ( int i = 1; i <= pVariables; i++ )
     
    513513  else
    514514  {
    515     poly term = pNew();
     515    poly term = pInit();
    516516    pNext( term ) = NULL;
    517517    for ( int i = 1; i <= pVariables; i++ )
     
    577577  else
    578578  {
    579     poly term = pNew();
     579    poly term = pInit();
    580580    pNext( term ) = NULL;
    581581    for ( int i = 1; i <= pVariables; i++ )
  • Singular/configure

    r057fd3 rf92fa13  
    611611fi
    612612
     613# Extract the first word of "flex", so it can be a program name with args.
     614set dummy flex; ac_word=$2
     615echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
     616echo "configure:617: checking for $ac_word" >&5
     617if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then
     618  echo $ac_n "(cached) $ac_c" 1>&6
     619else
     620  if test -n "$LEX"; then
     621  ac_cv_prog_LEX="$LEX" # Let the user override the test.
     622else
     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"
     633fi
     634fi
     635LEX="$ac_cv_prog_LEX"
     636if test -n "$LEX"; then
     637  echo "$ac_t""$LEX" 1>&6
     638else
     639  echo "$ac_t""no" 1>&6
     640fi
     641
     642if test -z "$LEXLIB"
     643then
     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
     649echo "configure:650: checking for yywrap in -l$ac_lib" >&5
     650ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'`
     651if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     652  echo $ac_n "(cached) $ac_c" 1>&6
     653else
     654  ac_save_LIBS="$LIBS"
     655LIBS="-l$ac_lib  $LIBS"
     656cat > 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.  */
     662char yywrap();
     663
     664int main() {
     665yywrap()
     666; return 0; }
     667EOF
     668if { (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"
     671else
     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"
     676fi
     677rm -f conftest*
     678LIBS="$ac_save_LIBS"
     679
     680fi
     681if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
     682  echo "$ac_t""yes" 1>&6
     683  LEXLIB="-l$ac_lib"
     684else
     685  echo "$ac_t""no" 1>&6
     686fi
     687
     688fi
     689
     690# make sure lex accepts -P option
     691if test "${ac_cv_prog_LEX+set}" = set; then
     692  echo $ac_n "checking whether ${ac_cv_prog_LEX} accepts -P""... $ac_c" 1>&6
     693echo "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
     702fi
     703
    613704# Extract the first word of "gcc", so it can be a program name with args.
    614705set dummy gcc; ac_word=$2
    615706echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    616 echo "configure:617: checking for $ac_word" >&5
     707echo "configure:708: checking for $ac_word" >&5
    617708if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    618709  echo $ac_n "(cached) $ac_c" 1>&6
     
    643734set dummy cc; ac_word=$2
    644735echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    645 echo "configure:646: checking for $ac_word" >&5
     736echo "configure:737: checking for $ac_word" >&5
    646737if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
    647738  echo $ac_n "(cached) $ac_c" 1>&6
     
    691782
    692783echo $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" >&5
     784echo "configure:785: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
    694785
    695786ac_ext=c
     
    701792
    702793cat > conftest.$ac_ext <<EOF
    703 #line 704 "configure"
     794#line 795 "configure"
    704795#include "confdefs.h"
    705796main(){return(0);}
    706797EOF
    707 if { (eval echo configure:708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     798if { (eval echo configure:799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    708799  ac_cv_prog_cc_works=yes
    709800  # If we can't run a trivial program, we are probably using a cross compiler.
     
    725816fi
    726817echo $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" >&5
     818echo "configure:819: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
    728819echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
    729820cross_compiling=$ac_cv_prog_cc_cross
    730821
    731822echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
    732 echo "configure:733: checking whether we are using GNU C" >&5
     823echo "configure:824: checking whether we are using GNU C" >&5
    733824if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
    734825  echo $ac_n "(cached) $ac_c" 1>&6
     
    739830#endif
    740831EOF
    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; then
     832if { 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
    742833  ac_cv_prog_gcc=yes
    743834else
     
    754845  CFLAGS=
    755846  echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
    756 echo "configure:757: checking whether ${CC-cc} accepts -g" >&5
     847echo "configure:848: checking whether ${CC-cc} accepts -g" >&5
    757848if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
    758849  echo $ac_n "(cached) $ac_c" 1>&6
     
    782873
    783874echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    784 echo "configure:785: checking how to run the C preprocessor" >&5
     875echo "configure:876: checking how to run the C preprocessor" >&5
    785876# On Suns, sometimes $CPP names a directory.
    786877if test -n "$CPP" && test -d "$CPP"; then
     
    797888  # not just through cpp.
    798889  cat > conftest.$ac_ext <<EOF
    799 #line 800 "configure"
     890#line 891 "configure"
    800891#include "confdefs.h"
    801892#include <assert.h>
     
    803894EOF
    804895ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    805 { (eval echo configure:806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     896{ (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    806897ac_err=`grep -v '^ *+' conftest.out`
    807898if test -z "$ac_err"; then
     
    814905  CPP="${CC-cc} -E -traditional-cpp"
    815906  cat > conftest.$ac_ext <<EOF
    816 #line 817 "configure"
     907#line 908 "configure"
    817908#include "confdefs.h"
    818909#include <assert.h>
     
    820911EOF
    821912ac_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; }
    823914ac_err=`grep -v '^ *+' conftest.out`
    824915if test -z "$ac_err"; then
     
    847938set dummy $ac_prog; ac_word=$2
    848939echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    849 echo "configure:850: checking for $ac_word" >&5
     940echo "configure:941: checking for $ac_word" >&5
    850941if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
    851942  echo $ac_n "(cached) $ac_c" 1>&6
     
    878969
    879970echo $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" >&5
     971echo "configure:972: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
    881972
    882973ac_ext=C
     
    888979
    889980cat > conftest.$ac_ext <<EOF
    890 #line 891 "configure"
     981#line 982 "configure"
    891982#include "confdefs.h"
    892983main(){return(0);}
    893984EOF
    894 if { (eval echo configure:895: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     985if { (eval echo configure:986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    895986  ac_cv_prog_cxx_works=yes
    896987  # If we can't run a trivial program, we are probably using a cross compiler.
     
    9181009fi
    9191010echo $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" >&5
     1011echo "configure:1012: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
    9211012echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
    9221013cross_compiling=$ac_cv_prog_cxx_cross
    9231014
    9241015echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
    925 echo "configure:926: checking whether we are using GNU C++" >&5
     1016echo "configure:1017: checking whether we are using GNU C++" >&5
    9261017if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
    9271018  echo $ac_n "(cached) $ac_c" 1>&6
     
    9321023#endif
    9331024EOF
    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; then
     1025if { 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
    9351026  ac_cv_prog_gxx=yes
    9361027else
     
    9471038  CXXFLAGS=
    9481039  echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
    949 echo "configure:950: checking whether ${CXX-g++} accepts -g" >&5
     1040echo "configure:1041: checking whether ${CXX-g++} accepts -g" >&5
    9501041if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
    9511042  echo $ac_n "(cached) $ac_c" 1>&6
     
    9751066
    9761067echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
    977 echo "configure:978: checking whether ${MAKE-make} sets \${MAKE}" >&5
     1068echo "configure:1069: checking whether ${MAKE-make} sets \${MAKE}" >&5
    9781069set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
    9791070if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
     
    10661157set dummy info; ac_word=$2
    10671158echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
    1068 echo "configure:1069: checking for $ac_word" >&5
     1159echo "configure:1160: checking for $ac_word" >&5
    10691160if eval "test \"`echo '$''{'ac_cv_prog_INFO'+set}'`\" = set"; then
    10701161  echo $ac_n "(cached) $ac_c" 1>&6
     
    11611252 
    11621253echo $ac_n "checking for atof in -lm""... $ac_c" 1>&6
    1163 echo "configure:1164: checking for atof in -lm" >&5
     1254echo "configure:1255: checking for atof in -lm" >&5
    11641255ac_lib_var=`echo m'_'atof | sed 'y%./+-%__p_%'`
    11651256if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    11691260LIBS="-lm  $LIBS"
    11701261cat > conftest.$ac_ext <<EOF
    1171 #line 1172 "configure"
     1262#line 1263 "configure"
    11721263#include "confdefs.h"
    11731264/* Override any gcc2 internal prototype to avoid an error.  */
     
    11801271; return 0; }
    11811272EOF
    1182 if { (eval echo configure:1183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1273if { (eval echo configure:1274: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    11831274  rm -rf conftest*
    11841275  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12081299
    12091300echo $ac_n "checking for socket in -lbsd""... $ac_c" 1>&6
    1210 echo "configure:1211: checking for socket in -lbsd" >&5
     1301echo "configure:1302: checking for socket in -lbsd" >&5
    12111302ac_lib_var=`echo bsd'_'socket | sed 'y%./+-%__p_%'`
    12121303if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12161307LIBS="-lbsd  $LIBS"
    12171308cat > conftest.$ac_ext <<EOF
    1218 #line 1219 "configure"
     1309#line 1310 "configure"
    12191310#include "confdefs.h"
    12201311/* Override any gcc2 internal prototype to avoid an error.  */
     
    12271318; return 0; }
    12281319EOF
    1229 if { (eval echo configure:1230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1320if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    12301321  rm -rf conftest*
    12311322  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12551346
    12561347echo $ac_n "checking for listen in -lsocket""... $ac_c" 1>&6
    1257 echo "configure:1258: checking for listen in -lsocket" >&5
     1348echo "configure:1349: checking for listen in -lsocket" >&5
    12581349ac_lib_var=`echo socket'_'listen | sed 'y%./+-%__p_%'`
    12591350if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12631354LIBS="-lsocket  $LIBS"
    12641355cat > conftest.$ac_ext <<EOF
    1265 #line 1266 "configure"
     1356#line 1357 "configure"
    12661357#include "confdefs.h"
    12671358/* Override any gcc2 internal prototype to avoid an error.  */
     
    12741365; return 0; }
    12751366EOF
    1276 if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1367if { (eval echo configure:1368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    12771368  rm -rf conftest*
    12781369  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13021393
    13031394echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
    1304 echo "configure:1305: checking for gethostbyname in -lnsl" >&5
     1395echo "configure:1396: checking for gethostbyname in -lnsl" >&5
    13051396ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
    13061397if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13101401LIBS="-lnsl  $LIBS"
    13111402cat > conftest.$ac_ext <<EOF
    1312 #line 1313 "configure"
     1403#line 1404 "configure"
    13131404#include "confdefs.h"
    13141405/* Override any gcc2 internal prototype to avoid an error.  */
     
    13211412; return 0; }
    13221413EOF
    1323 if { (eval echo configure:1324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1414if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    13241415  rm -rf conftest*
    13251416  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13491440
    13501441echo $ac_n "checking for index in -lucb""... $ac_c" 1>&6
    1351 echo "configure:1352: checking for index in -lucb" >&5
     1442echo "configure:1443: checking for index in -lucb" >&5
    13521443ac_lib_var=`echo ucb'_'index | sed 'y%./+-%__p_%'`
    13531444if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13571448LIBS="-lucb  $LIBS"
    13581449cat > conftest.$ac_ext <<EOF
    1359 #line 1360 "configure"
     1450#line 1451 "configure"
    13601451#include "confdefs.h"
    13611452/* Override any gcc2 internal prototype to avoid an error.  */
     
    13681459; return 0; }
    13691460EOF
    1370 if { (eval echo configure:1371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1461if { (eval echo configure:1462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    13711462  rm -rf conftest*
    13721463  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13981489if test "$with_readline" != no; then
    13991490  echo $ac_n "checking for tgetent in -lncurses""... $ac_c" 1>&6
    1400 echo "configure:1401: checking for tgetent in -lncurses" >&5
     1491echo "configure:1492: checking for tgetent in -lncurses" >&5
    14011492ac_lib_var=`echo ncurses'_'tgetent | sed 'y%./+-%__p_%'`
    14021493if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    14061497LIBS="-lncurses  $LIBS"
    14071498cat > conftest.$ac_ext <<EOF
    1408 #line 1409 "configure"
     1499#line 1500 "configure"
    14091500#include "confdefs.h"
    14101501/* Override any gcc2 internal prototype to avoid an error.  */
     
    14171508; return 0; }
    14181509EOF
    1419 if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1510if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    14201511  rm -rf conftest*
    14211512  eval "ac_cv_lib_$ac_lib_var=yes"
     
    14441535\
    14451536   echo $ac_n "checking for tgetent in -lcurses""... $ac_c" 1>&6
    1446 echo "configure:1447: checking for tgetent in -lcurses" >&5
     1537echo "configure:1538: checking for tgetent in -lcurses" >&5
    14471538ac_lib_var=`echo curses'_'tgetent | sed 'y%./+-%__p_%'`
    14481539if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    14521543LIBS="-lcurses  $LIBS"
    14531544cat > conftest.$ac_ext <<EOF
    1454 #line 1455 "configure"
     1545#line 1546 "configure"
    14551546#include "confdefs.h"
    14561547/* Override any gcc2 internal prototype to avoid an error.  */
     
    14631554; return 0; }
    14641555EOF
    1465 if { (eval echo configure:1466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1556if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    14661557  rm -rf conftest*
    14671558  eval "ac_cv_lib_$ac_lib_var=yes"
     
    14901581\
    14911582   echo $ac_n "checking for tgetent in -ltermcap""... $ac_c" 1>&6
    1492 echo "configure:1493: checking for tgetent in -ltermcap" >&5
     1583echo "configure:1584: checking for tgetent in -ltermcap" >&5
    14931584ac_lib_var=`echo termcap'_'tgetent | sed 'y%./+-%__p_%'`
    14941585if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    14981589LIBS="-ltermcap  $LIBS"
    14991590cat > conftest.$ac_ext <<EOF
    1500 #line 1501 "configure"
     1591#line 1592 "configure"
    15011592#include "confdefs.h"
    15021593/* Override any gcc2 internal prototype to avoid an error.  */
     
    15091600; return 0; }
    15101601EOF
    1511 if { (eval echo configure:1512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1602if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    15121603  rm -rf conftest*
    15131604  eval "ac_cv_lib_$ac_lib_var=yes"
     
    15411632
    15421633  echo $ac_n "checking for rl_abort in -lreadline""... $ac_c" 1>&6
    1543 echo "configure:1544: checking for rl_abort in -lreadline" >&5
     1634echo "configure:1635: checking for rl_abort in -lreadline" >&5
    15441635ac_lib_var=`echo readline'_'rl_abort | sed 'y%./+-%__p_%'`
    15451636if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    15491640LIBS="-lreadline  $LIBS"
    15501641cat > conftest.$ac_ext <<EOF
    1551 #line 1552 "configure"
     1642#line 1643 "configure"
    15521643#include "confdefs.h"
    15531644/* Override any gcc2 internal prototype to avoid an error.  */
     
    15601651; return 0; }
    15611652EOF
    1562 if { (eval echo configure:1563: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1653if { (eval echo configure:1654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    15631654  rm -rf conftest*
    15641655  eval "ac_cv_lib_$ac_lib_var=yes"
     
    15921683ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    15931684echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1594 echo "configure:1595: checking for $ac_hdr" >&5
     1685echo "configure:1686: checking for $ac_hdr" >&5
    15951686if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    15961687  echo $ac_n "(cached) $ac_c" 1>&6
    15971688else
    15981689  cat > conftest.$ac_ext <<EOF
    1599 #line 1600 "configure"
     1690#line 1691 "configure"
    16001691#include "confdefs.h"
    16011692#include <$ac_hdr>
    16021693EOF
    16031694ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1604 { (eval echo configure:1605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1695{ (eval echo configure:1696: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    16051696ac_err=`grep -v '^ *+' conftest.out`
    16061697if test -z "$ac_err"; then
     
    16511742if test "$with_dld" = yes; then
    16521743  echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
    1653 echo "configure:1654: checking for dld_init in -ldld" >&5
     1744echo "configure:1745: checking for dld_init in -ldld" >&5
    16541745ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
    16551746if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    16591750LIBS="-ldld  $LIBS"
    16601751cat > conftest.$ac_ext <<EOF
    1661 #line 1662 "configure"
     1752#line 1753 "configure"
    16621753#include "confdefs.h"
    16631754/* Override any gcc2 internal prototype to avoid an error.  */
     
    16701761; return 0; }
    16711762EOF
    1672 if { (eval echo configure:1673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1763if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    16731764  rm -rf conftest*
    16741765  eval "ac_cv_lib_$ac_lib_var=yes"
     
    16961787
    16971788echo $ac_n "checking for mpq_init in -lgmp""... $ac_c" 1>&6
    1698 echo "configure:1699: checking for mpq_init in -lgmp" >&5
     1789echo "configure:1790: checking for mpq_init in -lgmp" >&5
    16991790ac_lib_var=`echo gmp'_'mpq_init | sed 'y%./+-%__p_%'`
    17001791if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    17041795LIBS="-lgmp  $LIBS"
    17051796cat > conftest.$ac_ext <<EOF
    1706 #line 1707 "configure"
     1797#line 1798 "configure"
    17071798#include "confdefs.h"
    17081799/* Override any gcc2 internal prototype to avoid an error.  */
     
    17151806; return 0; }
    17161807EOF
    1717 if { (eval echo configure:1718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1808if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    17181809  rm -rf conftest*
    17191810  eval "ac_cv_lib_$ac_lib_var=yes"
     
    17461837fi
    17471838echo $ac_n "checking for mpz_init in -lsmallgmp""... $ac_c" 1>&6
    1748 echo "configure:1749: checking for mpz_init in -lsmallgmp" >&5
     1839echo "configure:1840: checking for mpz_init in -lsmallgmp" >&5
    17491840ac_lib_var=`echo smallgmp'_'mpz_init | sed 'y%./+-%__p_%'`
    17501841if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    17541845LIBS="-lsmallgmp  $LIBS"
    17551846cat > conftest.$ac_ext <<EOF
    1756 #line 1757 "configure"
     1847#line 1848 "configure"
    17571848#include "confdefs.h"
    17581849/* Override any gcc2 internal prototype to avoid an error.  */
     
    17651856; return 0; }
    17661857EOF
    1767 if { (eval echo configure:1768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1858if { (eval echo configure:1859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    17681859  rm -rf conftest*
    17691860  eval "ac_cv_lib_$ac_lib_var=yes"
     
    17931884
    17941885echo $ac_n "checking for IMP_PutGmpInt in -lMP""... $ac_c" 1>&6
    1795 echo "configure:1796: checking for IMP_PutGmpInt in -lMP" >&5
     1886echo "configure:1887: checking for IMP_PutGmpInt in -lMP" >&5
    17961887ac_lib_var=`echo MP'_'IMP_PutGmpInt | sed 'y%./+-%__p_%'`
    17971888if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    18011892LIBS="-lMP  $LIBS"
    18021893cat > conftest.$ac_ext <<EOF
    1803 #line 1804 "configure"
     1894#line 1895 "configure"
    18041895#include "confdefs.h"
    18051896/* Override any gcc2 internal prototype to avoid an error.  */
     
    18121903; return 0; }
    18131904EOF
    1814 if { (eval echo configure:1815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1905if { (eval echo configure:1906: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    18151906  rm -rf conftest*
    18161907  eval "ac_cv_lib_$ac_lib_var=yes"
     
    18401931
    18411932echo $ac_n "checking for MPT_GetTree in -lMPT""... $ac_c" 1>&6
    1842 echo "configure:1843: checking for MPT_GetTree in -lMPT" >&5
     1933echo "configure:1934: checking for MPT_GetTree in -lMPT" >&5
    18431934ac_lib_var=`echo MPT'_'MPT_GetTree | sed 'y%./+-%__p_%'`
    18441935if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    18481939LIBS="-lMPT  $LIBS"
    18491940cat > conftest.$ac_ext <<EOF
    1850 #line 1851 "configure"
     1941#line 1942 "configure"
    18511942#include "confdefs.h"
    18521943/* Override any gcc2 internal prototype to avoid an error.  */
     
    18591950; return 0; }
    18601951EOF
    1861 if { (eval echo configure:1862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1952if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    18621953  rm -rf conftest*
    18631954  eval "ac_cv_lib_$ac_lib_var=yes"
     
    18871978
    18881979echo $ac_n "checking for atof in -lsingcf""... $ac_c" 1>&6
    1889 echo "configure:1890: checking for atof in -lsingcf" >&5
     1980echo "configure:1981: checking for atof in -lsingcf" >&5
    18901981ac_lib_var=`echo singcf'_'atof | sed 'y%./+-%__p_%'`
    18911982if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    18951986LIBS="-lsingcf  $LIBS"
    18961987cat > conftest.$ac_ext <<EOF
    1897 #line 1898 "configure"
     1988#line 1989 "configure"
    18981989#include "confdefs.h"
    18991990/* Override any gcc2 internal prototype to avoid an error.  */
     
    19061997; return 0; }
    19071998EOF
    1908 if { (eval echo configure:1909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     1999if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    19092000  rm -rf conftest*
    19102001  eval "ac_cv_lib_$ac_lib_var=yes"
     
    19342025
    19352026echo $ac_n "checking for atof in -lsingfac""... $ac_c" 1>&6
    1936 echo "configure:1937: checking for atof in -lsingfac" >&5
     2027echo "configure:2028: checking for atof in -lsingfac" >&5
    19372028ac_lib_var=`echo singfac'_'atof | sed 'y%./+-%__p_%'`
    19382029if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    19422033LIBS="-lsingfac  $LIBS"
    19432034cat > conftest.$ac_ext <<EOF
    1944 #line 1945 "configure"
     2035#line 2036 "configure"
    19452036#include "confdefs.h"
    19462037/* Override any gcc2 internal prototype to avoid an error.  */
     
    19532044; return 0; }
    19542045EOF
    1955 if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     2046if { (eval echo configure:2047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    19562047  rm -rf conftest*
    19572048  eval "ac_cv_lib_$ac_lib_var=yes"
     
    19852076ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    19862077echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1987 echo "configure:1988: checking for $ac_hdr" >&5
     2078echo "configure:2079: checking for $ac_hdr" >&5
    19882079if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    19892080  echo $ac_n "(cached) $ac_c" 1>&6
    19902081else
    19912082  cat > conftest.$ac_ext <<EOF
    1992 #line 1993 "configure"
     2083#line 2084 "configure"
    19932084#include "confdefs.h"
    19942085#include <$ac_hdr>
    19952086EOF
    19962087ac_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; }
    19982089ac_err=`grep -v '^ *+' conftest.out`
    19992090if test -z "$ac_err"; then
     
    20812172fi
    20822173echo $ac_n "checking which apint package to use""... $ac_c" 1>&6
    2083 echo "configure:2084: checking which apint package to use" >&5
     2174echo "configure:2175: checking which apint package to use" >&5
    20842175if test "$ac_will_have_gmp" = yes; then
    20852176  cat >> confdefs.h <<\EOF
     
    21182209fi
    21192210echo $ac_n "checking whether to use with MP""... $ac_c" 1>&6
    2120 echo "configure:2121: checking whether to use with MP" >&5
     2211echo "configure:2212: checking whether to use with MP" >&5
    21212212
    21222213if test "$WITH_MP" = yes; then
     
    21472238fi
    21482239echo $ac_n "checking whether to use with factory""... $ac_c" 1>&6
    2149 echo "configure:2150: checking whether to use with factory" >&5
     2240echo "configure:2241: checking whether to use with factory" >&5
    21502241
    21512242if test "$WITH_FACTORY" = yes; then
     
    21762267fi
    21772268echo $ac_n "checking whether to use with libfac""... $ac_c" 1>&6
    2178 echo "configure:2179: checking whether to use with libfac" >&5
     2269echo "configure:2270: checking whether to use with libfac" >&5
    21792270
    21802271if test "$WITH_LIBFAC" = yes; then
     
    21922283
    21932284echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
    2194 echo "configure:2195: checking for ANSI C header files" >&5
     2285echo "configure:2286: checking for ANSI C header files" >&5
    21952286if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    21962287  echo $ac_n "(cached) $ac_c" 1>&6
    21972288else
    21982289  cat > conftest.$ac_ext <<EOF
    2199 #line 2200 "configure"
     2290#line 2291 "configure"
    22002291#include "confdefs.h"
    22012292#include <stdlib.h>
     
    22052296EOF
    22062297ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2207 { (eval echo configure:2208: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2298{ (eval echo configure:2299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    22082299ac_err=`grep -v '^ *+' conftest.out`
    22092300if test -z "$ac_err"; then
     
    22222313  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    22232314cat > conftest.$ac_ext <<EOF
    2224 #line 2225 "configure"
     2315#line 2316 "configure"
    22252316#include "confdefs.h"
    22262317#include <string.h>
     
    22402331  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    22412332cat > conftest.$ac_ext <<EOF
    2242 #line 2243 "configure"
     2333#line 2334 "configure"
    22432334#include "confdefs.h"
    22442335#include <stdlib.h>
     
    22612352else
    22622353  cat > conftest.$ac_ext <<EOF
    2263 #line 2264 "configure"
     2354#line 2355 "configure"
    22642355#include "confdefs.h"
    22652356#include <ctype.h>
     
    22722363
    22732364EOF
    2274 if { (eval echo configure:2275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2365if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    22752366then
    22762367  :
     
    23002391ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    23012392echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    2302 echo "configure:2303: checking for $ac_hdr" >&5
     2393echo "configure:2394: checking for $ac_hdr" >&5
    23032394if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    23042395  echo $ac_n "(cached) $ac_c" 1>&6
    23052396else
    23062397  cat > conftest.$ac_ext <<EOF
    2307 #line 2308 "configure"
     2398#line 2399 "configure"
    23082399#include "confdefs.h"
    23092400#include <$ac_hdr>
    23102401EOF
    23112402ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2312 { (eval echo configure:2313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2403{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    23132404ac_err=`grep -v '^ *+' conftest.out`
    23142405if test -z "$ac_err"; then
     
    23422433ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    23432434echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    2344 echo "configure:2345: checking for $ac_hdr" >&5
     2435echo "configure:2436: checking for $ac_hdr" >&5
    23452436if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    23462437  echo $ac_n "(cached) $ac_c" 1>&6
    23472438else
    23482439  cat > conftest.$ac_ext <<EOF
    2349 #line 2350 "configure"
     2440#line 2441 "configure"
    23502441#include "confdefs.h"
    23512442#include <$ac_hdr>
    23522443EOF
    23532444ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2354 { (eval echo configure:2355: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2445{ (eval echo configure:2446: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    23552446ac_err=`grep -v '^ *+' conftest.out`
    23562447if test -z "$ac_err"; then
     
    23812472WITH_DBM=no
    23822473echo $ac_n "checking whether to build with dbm links""... $ac_c" 1>&6
    2383 echo "configure:2384: checking whether to build with dbm links" >&5
     2474echo "configure:2475: checking whether to build with dbm links" >&5
    23842475if test "$with_dbm" != no; then
    23852476  cat >> confdefs.h <<\EOF
     
    23952486
    23962487echo $ac_n "checking for working const""... $ac_c" 1>&6
    2397 echo "configure:2398: checking for working const" >&5
     2488echo "configure:2489: checking for working const" >&5
    23982489if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
    23992490  echo $ac_n "(cached) $ac_c" 1>&6
    24002491else
    24012492  cat > conftest.$ac_ext <<EOF
    2402 #line 2403 "configure"
     2493#line 2494 "configure"
    24032494#include "confdefs.h"
    24042495
     
    24492540; return 0; }
    24502541EOF
    2451 if { (eval echo configure:2452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     2542if { (eval echo configure:2543: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    24522543  rm -rf conftest*
    24532544  ac_cv_c_const=yes
     
    24702561
    24712562echo $ac_n "checking for inline""... $ac_c" 1>&6
    2472 echo "configure:2473: checking for inline" >&5
     2563echo "configure:2564: checking for inline" >&5
    24732564if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
    24742565  echo $ac_n "(cached) $ac_c" 1>&6
     
    24772568for ac_kw in inline __inline__ __inline; do
    24782569  cat > conftest.$ac_ext <<EOF
    2479 #line 2480 "configure"
     2570#line 2571 "configure"
    24802571#include "confdefs.h"
    24812572
     
    24842575; return 0; }
    24852576EOF
    2486 if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     2577if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    24872578  rm -rf conftest*
    24882579  ac_cv_c_inline=$ac_kw; break
     
    25102601
    25112602echo $ac_n "checking for size_t""... $ac_c" 1>&6
    2512 echo "configure:2513: checking for size_t" >&5
     2603echo "configure:2604: checking for size_t" >&5
    25132604if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
    25142605  echo $ac_n "(cached) $ac_c" 1>&6
    25152606else
    25162607  cat > conftest.$ac_ext <<EOF
    2517 #line 2518 "configure"
     2608#line 2609 "configure"
    25182609#include "confdefs.h"
    25192610#include <sys/types.h>
     
    25432634
    25442635echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
    2545 echo "configure:2546: checking whether time.h and sys/time.h may both be included" >&5
     2636echo "configure:2637: checking whether time.h and sys/time.h may both be included" >&5
    25462637if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
    25472638  echo $ac_n "(cached) $ac_c" 1>&6
    25482639else
    25492640  cat > conftest.$ac_ext <<EOF
    2550 #line 2551 "configure"
     2641#line 2642 "configure"
    25512642#include "confdefs.h"
    25522643#include <sys/types.h>
     
    25572648; return 0; }
    25582649EOF
    2559 if { (eval echo configure:2560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     2650if { (eval echo configure:2651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    25602651  rm -rf conftest*
    25612652  ac_cv_header_time=yes
     
    25782669
    25792670echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
    2580 echo "configure:2581: checking whether struct tm is in sys/time.h or time.h" >&5
     2671echo "configure:2672: checking whether struct tm is in sys/time.h or time.h" >&5
    25812672if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
    25822673  echo $ac_n "(cached) $ac_c" 1>&6
    25832674else
    25842675  cat > conftest.$ac_ext <<EOF
    2585 #line 2586 "configure"
     2676#line 2677 "configure"
    25862677#include "confdefs.h"
    25872678#include <sys/types.h>
     
    25912682; return 0; }
    25922683EOF
    2593 if { (eval echo configure:2594: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     2684if { (eval echo configure:2685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    25942685  rm -rf conftest*
    25952686  ac_cv_struct_tm=time.h
     
    26152706# for constant arguments.  Useless!
    26162707echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
    2617 echo "configure:2618: checking for working alloca.h" >&5
     2708echo "configure:2709: checking for working alloca.h" >&5
    26182709if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
    26192710  echo $ac_n "(cached) $ac_c" 1>&6
    26202711else
    26212712  cat > conftest.$ac_ext <<EOF
    2622 #line 2623 "configure"
     2713#line 2714 "configure"
    26232714#include "confdefs.h"
    26242715#include <alloca.h>
     
    26272718; return 0; }
    26282719EOF
    2629 if { (eval echo configure:2630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     2720if { (eval echo configure:2721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    26302721  rm -rf conftest*
    26312722  ac_cv_header_alloca_h=yes
     
    26482739
    26492740echo $ac_n "checking for alloca""... $ac_c" 1>&6
    2650 echo "configure:2651: checking for alloca" >&5
     2741echo "configure:2742: checking for alloca" >&5
    26512742if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
    26522743  echo $ac_n "(cached) $ac_c" 1>&6
    26532744else
    26542745  cat > conftest.$ac_ext <<EOF
    2655 #line 2656 "configure"
     2746#line 2747 "configure"
    26562747#include "confdefs.h"
    26572748
     
    26762767; return 0; }
    26772768EOF
    2678 if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     2769if { (eval echo configure:2770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    26792770  rm -rf conftest*
    26802771  ac_cv_func_alloca_works=yes
     
    27082799
    27092800echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
    2710 echo "configure:2711: checking whether alloca needs Cray hooks" >&5
     2801echo "configure:2802: checking whether alloca needs Cray hooks" >&5
    27112802if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
    27122803  echo $ac_n "(cached) $ac_c" 1>&6
    27132804else
    27142805  cat > conftest.$ac_ext <<EOF
    2715 #line 2716 "configure"
     2806#line 2807 "configure"
    27162807#include "confdefs.h"
    27172808#if defined(CRAY) && ! defined(CRAY2)
     
    27382829for ac_func in _getb67 GETB67 getb67; do
    27392830  echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    2740 echo "configure:2741: checking for $ac_func" >&5
     2831echo "configure:2832: checking for $ac_func" >&5
    27412832if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    27422833  echo $ac_n "(cached) $ac_c" 1>&6
    27432834else
    27442835  cat > conftest.$ac_ext <<EOF
    2745 #line 2746 "configure"
     2836#line 2837 "configure"
    27462837#include "confdefs.h"
    27472838/* System header to define __stub macros and hopefully few prototypes,
     
    27662857; return 0; }
    27672858EOF
    2768 if { (eval echo configure:2769: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     2859if { (eval echo configure:2860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    27692860  rm -rf conftest*
    27702861  eval "ac_cv_func_$ac_func=yes"
     
    27932884
    27942885echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
    2795 echo "configure:2796: checking stack direction for C alloca" >&5
     2886echo "configure:2887: checking stack direction for C alloca" >&5
    27962887if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
    27972888  echo $ac_n "(cached) $ac_c" 1>&6
     
    28012892else
    28022893  cat > conftest.$ac_ext <<EOF
    2803 #line 2804 "configure"
     2894#line 2895 "configure"
    28042895#include "confdefs.h"
    28052896find_stack_direction ()
     
    28202911}
    28212912EOF
    2822 if { (eval echo configure:2823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     2913if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    28232914then
    28242915  ac_cv_c_stack_direction=1
     
    28432934if test $ac_cv_prog_gcc = yes; then
    28442935    echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
    2845 echo "configure:2846: checking whether ${CC-cc} needs -traditional" >&5
     2936echo "configure:2937: checking whether ${CC-cc} needs -traditional" >&5
    28462937if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
    28472938  echo $ac_n "(cached) $ac_c" 1>&6
     
    28492940    ac_pattern="Autoconf.*'x'"
    28502941  cat > conftest.$ac_ext <<EOF
    2851 #line 2852 "configure"
     2942#line 2943 "configure"
    28522943#include "confdefs.h"
    28532944#include <sgtty.h>
     
    28672958  if test $ac_cv_prog_gcc_traditional = no; then
    28682959    cat > conftest.$ac_ext <<EOF
    2869 #line 2870 "configure"
     2960#line 2961 "configure"
    28702961#include "confdefs.h"
    28712962#include <termio.h>
     
    28922983ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    28932984echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    2894 echo "configure:2895: checking for $ac_hdr" >&5
     2985echo "configure:2986: checking for $ac_hdr" >&5
    28952986if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    28962987  echo $ac_n "(cached) $ac_c" 1>&6
    28972988else
    28982989  cat > conftest.$ac_ext <<EOF
    2899 #line 2900 "configure"
     2990#line 2991 "configure"
    29002991#include "confdefs.h"
    29012992#include <$ac_hdr>
    29022993EOF
    29032994ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    2904 { (eval echo configure:2905: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     2995{ (eval echo configure:2996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    29052996ac_err=`grep -v '^ *+' conftest.out`
    29062997if test -z "$ac_err"; then
     
    29313022do
    29323023echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    2933 echo "configure:2934: checking for $ac_func" >&5
     3024echo "configure:3025: checking for $ac_func" >&5
    29343025if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    29353026  echo $ac_n "(cached) $ac_c" 1>&6
    29363027else
    29373028  cat > conftest.$ac_ext <<EOF
    2938 #line 2939 "configure"
     3029#line 3030 "configure"
    29393030#include "confdefs.h"
    29403031/* System header to define __stub macros and hopefully few prototypes,
     
    29593050; return 0; }
    29603051EOF
    2961 if { (eval echo configure:2962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     3052if { (eval echo configure:3053: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    29623053  rm -rf conftest*
    29633054  eval "ac_cv_func_$ac_func=yes"
     
    29843075
    29853076echo $ac_n "checking for working mmap""... $ac_c" 1>&6
    2986 echo "configure:2987: checking for working mmap" >&5
     3077echo "configure:3078: checking for working mmap" >&5
    29873078if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
    29883079  echo $ac_n "(cached) $ac_c" 1>&6
     
    29923083else
    29933084  cat > conftest.$ac_ext <<EOF
    2994 #line 2995 "configure"
     3085#line 3086 "configure"
    29953086#include "confdefs.h"
    29963087
     
    31323223
    31333224EOF
    3134 if { (eval echo configure:3135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3225if { (eval echo configure:3226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    31353226then
    31363227  ac_cv_func_mmap_fixed_mapped=yes
     
    31553246
    31563247echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
    3157 echo "configure:3158: checking return type of signal handlers" >&5
     3248echo "configure:3249: checking return type of signal handlers" >&5
    31583249if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
    31593250  echo $ac_n "(cached) $ac_c" 1>&6
    31603251else
    31613252  cat > conftest.$ac_ext <<EOF
    3162 #line 3163 "configure"
     3253#line 3254 "configure"
    31633254#include "confdefs.h"
    31643255#include <sys/types.h>
     
    31773268; return 0; }
    31783269EOF
    3179 if { (eval echo configure:3180: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3270if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    31803271  rm -rf conftest*
    31813272  ac_cv_type_signal=void
     
    31963287
    31973288echo $ac_n "checking for vprintf""... $ac_c" 1>&6
    3198 echo "configure:3199: checking for vprintf" >&5
     3289echo "configure:3290: checking for vprintf" >&5
    31993290if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
    32003291  echo $ac_n "(cached) $ac_c" 1>&6
    32013292else
    32023293  cat > conftest.$ac_ext <<EOF
    3203 #line 3204 "configure"
     3294#line 3295 "configure"
    32043295#include "confdefs.h"
    32053296/* System header to define __stub macros and hopefully few prototypes,
     
    32243315; return 0; }
    32253316EOF
    3226 if { (eval echo configure:3227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     3317if { (eval echo configure:3318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    32273318  rm -rf conftest*
    32283319  eval "ac_cv_func_vprintf=yes"
     
    32483339if test "$ac_cv_func_vprintf" != yes; then
    32493340echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
    3250 echo "configure:3251: checking for _doprnt" >&5
     3341echo "configure:3342: checking for _doprnt" >&5
    32513342if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
    32523343  echo $ac_n "(cached) $ac_c" 1>&6
    32533344else
    32543345  cat > conftest.$ac_ext <<EOF
    3255 #line 3256 "configure"
     3346#line 3347 "configure"
    32563347#include "confdefs.h"
    32573348/* System header to define __stub macros and hopefully few prototypes,
     
    32763367; return 0; }
    32773368EOF
    3278 if { (eval echo configure:3279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     3369if { (eval echo configure:3370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    32793370  rm -rf conftest*
    32803371  eval "ac_cv_func__doprnt=yes"
     
    33033394do
    33043395echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    3305 echo "configure:3306: checking for $ac_func" >&5
     3396echo "configure:3397: checking for $ac_func" >&5
    33063397if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    33073398  echo $ac_n "(cached) $ac_c" 1>&6
    33083399else
    33093400  cat > conftest.$ac_ext <<EOF
    3310 #line 3311 "configure"
     3401#line 3402 "configure"
    33113402#include "confdefs.h"
    33123403/* System header to define __stub macros and hopefully few prototypes,
     
    33313422; return 0; }
    33323423EOF
    3333 if { (eval echo configure:3334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
     3424if { (eval echo configure:3425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
    33343425  rm -rf conftest*
    33353426  eval "ac_cv_func_$ac_func=yes"
     
    33583449
    33593450echo $ac_n "checking whether your machine has correct arithmetic shifts""... $ac_c" 1>&6
    3360 echo "configure:3361: checking whether your machine has correct arithmetic shifts" >&5
     3451echo "configure:3452: checking whether your machine has correct arithmetic shifts" >&5
    33613452if eval "test \"`echo '$''{'ac_cv_shift'+set}'`\" = set"; then
    33623453  echo $ac_n "(cached) $ac_c" 1>&6
     
    33713462else
    33723463  cat > conftest.$ac_ext <<EOF
    3373 #line 3374 "configure"
     3464#line 3465 "configure"
    33743465#include "confdefs.h"
    33753466 int main() { if (-2 >> 1 == -1) exit(0); else exit(1); }
    33763467EOF
    3377 if { (eval echo configure:3378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3468if { (eval echo configure:3469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    33783469then
    33793470  ac_cv_shift=yes
     
    33983489
    33993490echo $ac_n "checking whether vsprintf returns number of printed chars""... $ac_c" 1>&6
    3400 echo "configure:3401: checking whether vsprintf returns number of printed chars" >&5
     3491echo "configure:3492: checking whether vsprintf returns number of printed chars" >&5
    34013492if eval "test \"`echo '$''{'ac_cv_returns_n_of_chars'+set}'`\" = set"; then
    34023493  echo $ac_n "(cached) $ac_c" 1>&6
     
    34063497else
    34073498  cat > conftest.$ac_ext <<EOF
    3408 #line 3409 "configure"
     3499#line 3500 "configure"
    34093500#include "confdefs.h"
    34103501#include <stdio.h>
    34113502 main() { char *str=(char*)malloc(20); if (((int) sprintf(str,"123456789")) == 9) exit(0); else exit(1); }
    34123503EOF
    3413 if { (eval echo configure:3414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3504if { (eval echo configure:3505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    34143505then
    34153506  ac_cv_returns_n_of_chars=yes
     
    34373528
    34383529echo $ac_n "checking size of char""... $ac_c" 1>&6
    3439 echo "configure:3440: checking size of char" >&5
     3530echo "configure:3531: checking size of char" >&5
    34403531if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
    34413532  echo $ac_n "(cached) $ac_c" 1>&6
     
    34453536else
    34463537  cat > conftest.$ac_ext <<EOF
    3447 #line 3448 "configure"
     3538#line 3539 "configure"
    34483539#include "confdefs.h"
    34493540#include <stdio.h>
     
    34563547}
    34573548EOF
    3458 if { (eval echo configure:3459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3549if { (eval echo configure:3550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    34593550then
    34603551  ac_cv_sizeof_char=`cat conftestval`
     
    34763567
    34773568echo $ac_n "checking size of short""... $ac_c" 1>&6
    3478 echo "configure:3479: checking size of short" >&5
     3569echo "configure:3570: checking size of short" >&5
    34793570if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
    34803571  echo $ac_n "(cached) $ac_c" 1>&6
     
    34843575else
    34853576  cat > conftest.$ac_ext <<EOF
    3486 #line 3487 "configure"
     3577#line 3578 "configure"
    34873578#include "confdefs.h"
    34883579#include <stdio.h>
     
    34953586}
    34963587EOF
    3497 if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3588if { (eval echo configure:3589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    34983589then
    34993590  ac_cv_sizeof_short=`cat conftestval`
     
    35153606
    35163607echo $ac_n "checking size of int""... $ac_c" 1>&6
    3517 echo "configure:3518: checking size of int" >&5
     3608echo "configure:3609: checking size of int" >&5
    35183609if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
    35193610  echo $ac_n "(cached) $ac_c" 1>&6
     
    35233614else
    35243615  cat > conftest.$ac_ext <<EOF
    3525 #line 3526 "configure"
     3616#line 3617 "configure"
    35263617#include "confdefs.h"
    35273618#include <stdio.h>
     
    35343625}
    35353626EOF
    3536 if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3627if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    35373628then
    35383629  ac_cv_sizeof_int=`cat conftestval`
     
    35543645
    35553646echo $ac_n "checking size of long""... $ac_c" 1>&6
    3556 echo "configure:3557: checking size of long" >&5
     3647echo "configure:3648: checking size of long" >&5
    35573648if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
    35583649  echo $ac_n "(cached) $ac_c" 1>&6
     
    35623653else
    35633654  cat > conftest.$ac_ext <<EOF
    3564 #line 3565 "configure"
     3655#line 3656 "configure"
    35653656#include "confdefs.h"
    35663657#include <stdio.h>
     
    35733664}
    35743665EOF
    3575 if { (eval echo configure:3576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3666if { (eval echo configure:3667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    35763667then
    35773668  ac_cv_sizeof_long=`cat conftestval`
     
    35933684
    35943685echo $ac_n "checking size of void*""... $ac_c" 1>&6
    3595 echo "configure:3596: checking size of void*" >&5
     3686echo "configure:3687: checking size of void*" >&5
    35963687if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
    35973688  echo $ac_n "(cached) $ac_c" 1>&6
     
    36013692else
    36023693  cat > conftest.$ac_ext <<EOF
    3603 #line 3604 "configure"
     3694#line 3695 "configure"
    36043695#include "confdefs.h"
    36053696#include <stdio.h>
     
    36123703}
    36133704EOF
    3614 if { (eval echo configure:3615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3705if { (eval echo configure:3706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    36153706then
    36163707  ac_cv_sizeof_voidp=`cat conftestval`
     
    36323723
    36333724echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
    3634 echo "configure:3635: checking whether byte ordering is bigendian" >&5
     3725echo "configure:3726: checking whether byte ordering is bigendian" >&5
    36353726if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
    36363727  echo $ac_n "(cached) $ac_c" 1>&6
     
    36393730# See if sys/param.h defines the BYTE_ORDER macro.
    36403731cat > conftest.$ac_ext <<EOF
    3641 #line 3642 "configure"
     3732#line 3733 "configure"
    36423733#include "confdefs.h"
    36433734#include <sys/types.h>
     
    36503741; return 0; }
    36513742EOF
    3652 if { (eval echo configure:3653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3743if { (eval echo configure:3744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    36533744  rm -rf conftest*
    36543745  # It does; now see whether it defined to BIG_ENDIAN or not.
    36553746cat > conftest.$ac_ext <<EOF
    3656 #line 3657 "configure"
     3747#line 3748 "configure"
    36573748#include "confdefs.h"
    36583749#include <sys/types.h>
     
    36653756; return 0; }
    36663757EOF
    3667 if { (eval echo configure:3668: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     3758if { (eval echo configure:3759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    36683759  rm -rf conftest*
    36693760  ac_cv_c_bigendian=yes
     
    36853776else
    36863777  cat > conftest.$ac_ext <<EOF
    3687 #line 3688 "configure"
     3778#line 3779 "configure"
    36883779#include "confdefs.h"
    36893780main () {
     
    36983789}
    36993790EOF
    3700 if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
     3791if { (eval echo configure:3792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
    37013792then
    37023793  ac_cv_c_bigendian=no
     
    37313822
    37323823echo $ac_n "checking which exponent types to use""... $ac_c" 1>&6
    3733 echo "configure:3734: checking which exponent types to use" >&5
     3824echo "configure:3825: checking which exponent types to use" >&5
    37343825if test "$with_exp_type" = "char"; then
    37353826  echo "$ac_t""char" 1>&6
     
    37653856
    37663857echo $ac_n "checking whether _AIX is defined""... $ac_c" 1>&6
    3767 echo "configure:3768: checking whether _AIX is defined" >&5
     3858echo "configure:3859: checking whether _AIX is defined" >&5
    37683859if eval "test \"`echo '$''{'ac_cv_is_aix'+set}'`\" = set"; then
    37693860  echo $ac_n "(cached) $ac_c" 1>&6
    37703861else
    37713862  cat > conftest.$ac_ext <<EOF
    3772 #line 3773 "configure"
     3863#line 3864 "configure"
    37733864#include "confdefs.h"
    37743865#ifdef _AIX
     
    39524043s%@SINGULAR_MINOR_VERSION@%$SINGULAR_MINOR_VERSION%g
    39534044s%@SINGULAR_SUB_VERSION@%$SINGULAR_SUB_VERSION%g
     4045s%@LEX@%$LEX%g
     4046s%@LEXLIB@%$LEXLIB%g
     4047s%@LEXP@%$LEXP%g
    39544048s%@CC@%$CC%g
    39554049s%@CPP@%$CPP%g
  • Singular/configure.in

    r057fd3 rf92fa13  
    88SINGULAR_MAJOR_VERSION=1
    99SINGULAR_MINOR_VERSION=1
    10 SINGULAR_SUB_VERSION=6
     10SINGULAR_SUB_VERSION=7
    1111VERSION_DATE="March 1998"
    1212AC_SUBST(SINGULAR_MAJOR_VERSION)
     
    6767fi
    6868
     69AC_PROG_LEX
     70# make sure lex accepts -P option
     71if 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
     81fi
     82AC_SUBST(LEXP)
    6983AC_PROG_CC
    7084AC_PROG_CPP
  • Singular/febase.h

    r057fd3 rf92fa13  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.7 1998-02-27 16:27:56 Singular Exp $ */
     6/* $Id: febase.h,v 1.8 1998-03-16 14:56:30 obachman Exp $ */
    77/*
    88* ABSTRACT
     
    100100void    myyoldbuffer(void * oldb);
    101101
     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)                                        \
     109do                                                              \
     110{                                                               \
     111  if (! (x))                                                    \
     112  {                                                             \
     113    Warn("Internal assume violation: file %s line %d\n", f, l); \
     114  }                                                             \
     115}                                                               \
     116while (0)
     117#endif /* NDEBUG */
    102118
    103119class Voice
  • Singular/kstd1.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd1.cc,v 1.14 1998-01-17 18:07:57 Singular Exp $ */
     4/* $Id: kstd1.cc,v 1.15 1998-03-16 14:56:31 obachman Exp $ */
    55/*
    66* ABSTRACT:
     
    16441644  initMora(F,strat);
    16451645#ifdef COMP_FAST
    1646   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1646  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    16471647#endif 
    16481648  strat->enterS = enterSMoraNF;
     
    17391739  /*- set T -*/
    17401740#ifdef COMP_FAST
    1741   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1741  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    17421742#endif 
    17431743  strat->tl = -1;
     
    18771877  spSet(currRing);
    18781878#ifdef COMP_FAST
    1879   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1879  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    18801880#endif 
    18811881  if (pOrdSgn==-1)
     
    20782078  spSet(currRing);
    20792079#ifdef COMP_FAST
    2080   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     2080  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    20812081#endif
    20822082  if (pOrdSgn==-1)
     
    21542154  spSet(currRing);
    21552155#ifdef COMP_FAST
    2156   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     2156  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    21572157#endif 
    21582158  if (pOrdSgn==-1)
     
    21752175  strat->syzComp = syzComp;
    21762176#ifdef COMP_FAST
    2177   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     2177  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    21782178#endif 
    21792179  if (pOrdSgn==-1)
     
    22182218  strat->T           = initT();
    22192219#ifdef COMP_FAST
    2220   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     2220  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    22212221#endif 
    22222222  if (pOrdSgn == -1)   strat->honey = TRUE;
  • Singular/kstd2.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstd2.cc,v 1.11 1998-01-27 18:51:19 Singular Exp $ */
     4/* $Id: kstd2.cc,v 1.12 1998-03-16 14:56:32 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: alg. of Buchberger
     
    15481548  strat->sl = -1;
    15491549#ifdef COMP_FAST
    1550   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1550  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    15511551#endif
    15521552  /*- init local data struct.---------------------------------------- -*/
     
    15931593  strat->sl = -1;
    15941594#ifdef COMP_FAST
    1595   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1595  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    15961596#endif
    15971597  /*- init local data struct.---------------------------------------- -*/
     
    16851685  spSet(currRing);
    16861686#ifdef COMP_FAST
    1687   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     1687  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    16881688#endif
    16891689  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
  • Singular/kstdfac.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kstdfac.cc,v 1.11 1998-02-17 17:53:01 Singular Exp $ */
     4/* $Id: kstdfac.cc,v 1.12 1998-03-16 14:56:34 obachman Exp $ */
    55/*
    66*  ABSTRACT -  Kernel: factorizing alg. of Buchberger
     
    754754  spSet(currRing);
    755755#ifdef COMP_FAST
    756   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     756  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    757757#endif 
    758758  initBuchMoraCrit(strat); /*set Gebauer, honey, sugarCrit*/
  • Singular/kutil.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: kutil.cc,v 1.11 1998-01-05 16:39:23 Singular Exp $ */
     4/* $Id: kutil.cc,v 1.12 1998-03-16 14:56:34 obachman Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for std
     
    36333633  strat->noTailReduction = !TEST_OPT_REDTAIL;
    36343634#ifdef COMP_FAST
    3635   strat->spSpolyLoop = spSetSpolyLoop(currRing, strat->syzComp, strat->ak, strat->homog);
     3635  strat->spSpolyLoop = spGetSpolyLoop(currRing, strat);
    36363636#endif
    36373637  if(!TEST_OPT_SB_1)
     
    38073807  return FALSE;
    38083808}
     3809
     3810rOrderType_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  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: kutil.h,v 1.4 1997-12-03 16:58:50 obachman Exp $ */
     6/* $Id: kutil.h,v 1.5 1998-03-16 14:56:35 obachman Exp $ */
    77/*
    88* ABSTRACT: kernel: utils for std
     
    1010#include "structs.h"
    1111#include "mmemory.h"
     12#include "ring.h"
    1213#include <string.h>
    1314
     
    172173BOOLEAN homogTest(polyset F, int Fmax);
    173174BOOLEAN newHEdge(polyset S, int ak,kStrategy strat);
     175rOrderType_t spGetOrderType(ring r, kStrategy strat);
    174176
    175177inline TSet initT () { return (TSet)Alloc0(setmax*sizeof(TObject)); }
  • Singular/mod2.h.in

    r057fd3 rf92fa13  
    233233
    234234#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  */
    236237#define DO_DEEP_PROFILE
    237238#endif
     239
    238240/*******************************************************************
    239241 * DEBUG OPTIONS
  • Singular/polys-comp.h

    r057fd3 rf92fa13  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-comp.h,v 1.4 1998-01-17 17:49:24 obachman Exp $ */
     6/* $Id: polys-comp.h,v 1.5 1998-03-16 14:56:38 obachman Exp $ */
    77
    88/***************************************************************
     
    2121#ifdef WORDS_BIGENDIAN
    2222#ifndef COMP_NO_EXP_VECTOR_OPS
    23 #define _pMonCmp_1(p1, p2, d, actionD, actionE)              \
     23#define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE)              \
    2424do                                                          \
    2525{                                                           \
     
    3030while(0)
    3131 
    32 #define _pMonCmp_1_c(p1, p2, d, actionD, actionE)            \
     32#define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE)            \
    3333do                                                          \
    3434{                                                           \
     
    4444while(0)
    4545
    46 #define _pMonCmp_2(p1, p2, d, actionD, actionE)  \
     46#define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE)  \
    4747do                                              \
    4848{                                               \
     
    5757while(0)
    5858 
    59 #define _pMonCmp_2_c(p1, p2, d, actionD, actionE)        \
     59#define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE)        \
    6060do                                                      \
    6161{                                                       \
     
    7575while(0)
    7676 
    77 #define _pMonCmp_2i(p1, p2, length, d, actionD, actionE) \
     77#define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    7878do                                                      \
    7979{                                                       \
     
    9797while(0)
    9898
    99 #define _pMonCmp_2i_1(p1, p2, length, d, actionD, actionE)   \
     99#define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE)   \
    100100do                                                          \
    101101{                                                           \
     
    119119while(0)
    120120 
    121 #define _pMonCmp_2i_c(p1, p2, length, d, actionD, actionE)  \
     121#define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE)  \
    122122do                                                          \
    123123{                                                           \
     
    150150while(0)
    151151 
    152 #define _pMonCmp_2i_1_c(p1, p2, length, d, actionD, actionE)    \
     152#define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE)    \
    153153do                                                              \
    154154{                                                               \
     
    206206while(0)
    207207
    208 #define _pMonCmp_c(p1, p2, d, actionD, actionE) \
     208#define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \
    209209do                                              \
    210210{                                               \
     
    229229while(0)
    230230
    231 #define _pMonCmp_1(p1, p2, d, actionD, actionE)  \
    232   _pMonCmp(p1, p2, d, actionD, actionE)
    233 
    234 #define _pMonCmp_1_c(p1, p2, d, actionD, actionE)  \
    235   _pMonCmp_c(p1, p2, d, actionD, actionE)
    236  
    237 #define _pMonCmp_2(p1, p2, d, actionD, actionE)  \
    238   _pMonCmp(p1, p2, d, actionD, actionE)
    239 
    240 #define _pMonCmp_2_c(p1, p2, d, actionD, actionE)  \
    241   _pMonCmp_c(p1, p2, d, actionD, actionE)
    242  
    243 #define _pMonCmp_2i(p1, p2, length, d, actionD, actionE) \
    244   _pMonCmp(p1, p2, d, actionD, actionE)
    245 
    246 #define _pMonCmp_2i_1(p1, p2, length, d, actionD, actionE) \
    247   _pMonCmp(p1, p2, d, actionD, actionE)
    248 
    249 #define _pMonCmp_2i_c(p1, p2, length, d, actionD, actionE)   \
    250   _pMonCmp_c(p1, p2, d, actionD, actionE)
    251 
    252 #define _pMonCmp_2i_1_c(p1, p2, length, d, actionD, actionE) \
    253   _pMonCmp_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)
    254254
    255255#endif // COMP_NO_EXP_VECTOR_OPS
     
    258258
    259259#ifndef COMP_NO_EXP_VECTOR_OPS 
    260 #define _pMonCmp_1(p1, p2, d, actionD, actionE)                              \
     260#define _pMonComp_otEXP_nwONE(p1, p2, d, actionD, actionE)                              \
    261261do                                                                          \
    262262{                                                                           \
     
    267267while(0)
    268268 
    269 #define _pMonCmp_1_c(p1, p2, d, actionD, actionE)                            \
     269#define _pMonComp_otEXPCOMP_nwONE(p1, p2, d, actionD, actionE)                            \
    270270do                                                                          \
    271271{                                                                           \
     
    281281while(0)
    282282
    283 #define _pMonCmp_2(p1, p2, d, actionD, actionE)  \
     283#define _pMonComp_otEXP_nwTWO(p1, p2, d, actionD, actionE)  \
    284284do                                              \
    285285{                                               \
     
    294294while(0)
    295295 
    296 #define _pMonCmp_2_c(p1, p2, d, actionD, actionE)        \
     296#define _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, actionD, actionE)        \
    297297do                                                      \
    298298{                                                       \
     
    314314while(0)
    315315 
    316 #define _pMonCmp_2i(p1, p2, length, d, actionD, actionE) \
     316#define _pMonComp_otEXP_nwEVEN(p1, p2, length, d, actionD, actionE) \
    317317do                                                      \
    318318{                                                       \
     
    335335while(0)
    336336
    337 #define _pMonCmp_2i_1(p1, p2, length, d, actionD, actionE)   \
     337#define _pMonComp_otEXP_nwODD(p1, p2, length, d, actionD, actionE)   \
    338338do                                                          \
    339339{                                                           \
     
    357357while(0)
    358358 
    359 #define _pMonCmp_2i_c(p1, p2, length, d, actionD, actionE)   \
     359#define _pMonComp_otEXPCOMP_nwEVEN(p1, p2, length, d, actionD, actionE)   \
    360360do                                                          \
    361361{                                                           \
     
    388388while(0)
    389389 
    390 #define _pMonCmp_2i_1_c(p1, p2, length, d, actionD, actionE) \
     390#define _pMonComp_otEXPCOMP_nwODD(p1, p2, length, d, actionD, actionE) \
    391391do                                                          \
    392392{                                                           \
     
    444444while(0)
    445445
    446 #define _pMonCmp_c(p1, p2, d, actionD, actionE) \
     446#define _pMonComp_otEXP_c(p1, p2, d, actionD, actionE) \
    447447do                                              \
    448448{                                               \
     
    467467while(0)
    468468
    469 #define _pMonCmp_1(p1, p2, d, actionD, actionE)  \
    470   _pMonCmp(p1, p2, d, actionD, actionE)
    471 
    472 #define _pMonCmp_1_c(p1, p2, d, actionD, actionE)  \
    473   _pMonCmp_c(p1, p2, d, actionD, actionE)
    474  
    475 #define _pMonCmp_2(p1, p2, d, actionD, actionE)  \
    476   _pMonCmp(p1, p2, d, actionD, actionE)
    477 
    478 #define _pMonCmp_2_c(p1, p2, d, actionD, actionE)  \
    479   _pMonCmp_c(p1, p2, d, actionD, actionE)
    480  
    481 #define _pMonCmp_2i(p1, p2, length, d, actionD, actionE) \
    482   _pMonCmp(p1, p2, d, actionD, actionE)
    483 
    484 #define _pMonCmp_2i_1(p1, p2, length, d, actionD, actionE) \
    485   _pMonCmp(p1, p2, d, actionD, actionE)
    486 
    487 #define _pMonCmp_2i_c(p1, p2, length, d, actionD, actionE)   \
    488   _pMonCmp_c(p1, p2, d, actionD, actionE)
    489 
    490 #define _pMonCmp_2i_1_c(p1, p2, length, d, actionD, actionE) \
    491   _pMonCmp_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)
    492492 
    493493#endif // COMP_NO_EXP_VECTOR_OPS
  • Singular/polys-impl.h

    r057fd3 rf92fa13  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: polys-impl.h,v 1.17 1998-01-28 22:11:22 Singular Exp $ */
     6/* $Id: polys-impl.h,v 1.18 1998-03-16 14:56:38 obachman Exp $ */
    77
    88/***************************************************************
     
    7474    monomial operations, i.e. does everything exponent-wise.
    7575 ***************************************************************/
    76 // #define COMP_FAST
     76#define COMP_FAST
    7777// #define COMP_DEBUG
    7878// #define COMP_NO_EXP_VECTOR_OPS
     
    400400#else
    401401#define _pNew()         (poly) mmAllocSpecialized()
    402 #endif
    403402// #define _pNew() _pInit()
     403#endif
    404404
    405405#include <string.h>
     
    624624DECLARE(BOOLEAN, __pDivisibleBy(poly a, poly b))
    625625{
    626   const unsigned long* s1;
    627   const unsigned long* s2;
    628   const unsigned long* lb;
    629 
    630626#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 
    659636  for (;;)
    660637  {
    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
    665640    if ((*s2 - *s1) & P_DIV_MASK) return FALSE;
    666641#ifdef WORDS_BIGENDIAN
  • Singular/polys.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: polys.cc,v 1.15 1998-01-27 16:20:42 pohl Exp $ */
     4/* $Id: polys.cc,v 1.16 1998-03-16 14:56:39 obachman Exp $ */
    55
    66/*
     
    226226#ifdef COMP_FAST
    227227static 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);
     228static int f_comp_otEXP_nwONE(poly p1, poly p2);
     229static int f_comp_otCOMPEXP_nwONE(poly p1, poly p2);
     230static int f_comp_otEXPCOMP_nwONE(poly p1, poly p2);
     231static int f_comp_otEXP_nwTWO(poly p1, poly p2);
     232static int f_comp_otCOMPEXP_nwTWO(poly p1, poly p2);
     233static int f_comp_otEXPCOMP_nwTWO(poly p1, poly p2);
     234static int f_comp_otEXP_nwEVEN(poly p1, poly p2);
     235static int f_comp_otCOMPEXP_nwEVEN(poly p1, poly p2);
     236static int f_comp_otEXPCOMP_nwEVEN(poly p1, poly p2);
     237static int f_comp_otEXP_nwODD(poly p1, poly p2);
     238static int f_comp_otCOMPEXP_nwODD(poly p1, poly p2);
     239static int f_comp_otEXPCOMP_nwODD(poly p1, poly p2);
    240240
    241241#define Mreturn(d, multiplier)                      \
     
    245245}                                               
    246246 
    247 // comp_1 is used if pVariables1W == 1 and component is compatible with ordering
    248 static int f_comp_1(poly p1, poly p2) 
     247// comp_nwONE is used if pVariables1W == 1 and component is compatible with ordering
     248static int f_comp_otEXP_nwONE(poly p1, poly p2) 
    249249{
    250250  register long d = pGetOrder(p1) - pGetOrder(p2);
    251251
    252252  if (d) Mreturn(d, pOrdSgn);
    253   _pMonCmp_1(p1, p2, d, goto NotEqual, return 0);
     253  _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual, return 0);
    254254
    255255  NotEqual:
     
    257257}
    258258
    259 // comp_1_c is used if pVariables1W == 1, priority is given to exponents,
     259// comp_otEXPCOMP_nwONE is used if pVariables1W == 1, priority is given to exponents,
    260260// component is incompatible with ordering
    261 static int f_comp_1_c(poly p1, poly p2) 
     261static int f_comp_otEXPCOMP_nwONE(poly p1, poly p2) 
    262262{
    263263  register long d = pGetOrder(p1) - pGetOrder(p2);
    264264
    265265  if (d) Mreturn(d, pOrdSgn);
    266   _pMonCmp_1_c(p1, p2, d, goto NotEqual , return 0);
     266  _pMonComp_otEXPCOMP_nwONE(p1, p2, d, goto NotEqual , return 0);
    267267
    268268  NotEqual:
     
    270270}
    271271
    272 // comp_1_c is used if pVariables1W == 1, priority is given to component,
     272// comp_otEXPCOMP_nwONE is used if pVariables1W == 1, priority is given to component,
    273273// component is incompatible with ordering
    274 static int f_comp_c_1(poly p1, poly p2) 
     274static int f_comp_otCOMPEXP_nwONE(poly p1, poly p2) 
    275275{
    276276  register long d = pGetComp(p2) - pGetComp(p1);
     
    278278  d = pGetOrder(p1) - pGetOrder(p2);
    279279  if (d) Mreturn(d, pOrdSgn);
    280   _pMonCmp_1(p1, p2, d, goto NotEqual , return 0);
     280  _pMonComp_otEXP_nwONE(p1, p2, d, goto NotEqual , return 0);
    281281 
    282282  NotEqual:
     
    284284}
    285285
    286 // comp_2 is used if pVariables1W == 2 and component is compatible with ordering
    287 static int f_comp_2(poly p1, poly p2) 
     286// comp_nwTWO is used if pVariables1W == 2 and component is compatible with ordering
     287static int f_comp_otEXP_nwTWO(poly p1, poly p2) 
    288288{
    289289  register long d = pGetOrder(p1) - pGetOrder(p2);
    290290
    291291  if (d) Mreturn(d, pOrdSgn);
    292   _pMonCmp_2(p1, p2, d, goto NotEqual , return 0);
     292  _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0);
    293293
    294294  NotEqual:
     
    296296}
    297297
    298 // comp_2_c is used if pVariables1W == 2, priority is given to exponents,
     298// comp_otEXPCOMP_nwTWO is used if pVariables1W == 2, priority is given to exponents,
    299299// component is incompatible with ordering
    300 static int f_comp_2_c(poly p1, poly p2) 
     300static int f_comp_otEXPCOMP_nwTWO(poly p1, poly p2) 
    301301{
    302302  register long d = pGetOrder(p1) - pGetOrder(p2);
    303303
    304304  if (d) Mreturn(d, pOrdSgn);
    305   _pMonCmp_2_c(p1, p2, d, goto NotEqual, return 0);
     305  _pMonComp_otEXPCOMP_nwTWO(p1, p2, d, goto NotEqual, return 0);
    306306
    307307  NotEqual:
     
    309309}
    310310
    311 // comp_2_c is used if pVariables1W == 2, priority is given to component,
     311// comp_otEXPCOMP_nwTWO is used if pVariables1W == 2, priority is given to component,
    312312// component is incompatible with ordering
    313 static int f_comp_c_2(poly p1, poly p2) 
     313static int f_comp_otCOMPEXP_nwTWO(poly p1, poly p2) 
    314314{
    315315  register long d = pGetComp(p2) - pGetComp(p1);
     
    317317  d = pGetOrder(p1) - pGetOrder(p2);
    318318  if (d) Mreturn(d, pOrdSgn);
    319   _pMonCmp_2(p1, p2, d, goto NotEqual , return 0);
     319  _pMonComp_otEXP_nwTWO(p1, p2, d, goto NotEqual , return 0);
    320320 
    321321  NotEqual:
     
    323323}
    324324
    325 // comp_2i is used if pVariables1W == 2*i and component is compatible
     325// comp_nwEVEN is used if pVariables1W == 2*i and component is compatible
    326326// with ordering
    327 static int f_comp_2i(poly p1, poly p2) 
     327static int f_comp_otEXP_nwEVEN(poly p1, poly p2) 
    328328{
    329329  register long d = pGetOrder(p1) - pGetOrder(p2);
    330330
    331331  if (d) Mreturn(d, pOrdSgn);
    332   _pMonCmp_2i(p1, p2, pVariables1W, d, goto NotEqual , return 0);
     332  _pMonComp_otEXP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    333333
    334334  NotEqual:
     
    336336}
    337337
    338 // comp_2i_c is 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,
    339339// component is incompatible with ordering
    340 static int f_comp_2i_c(poly p1, poly p2) 
     340static int f_comp_otEXPCOMP_nwEVEN(poly p1, poly p2) 
    341341{
    342342  register long d = pGetOrder(p1) - pGetOrder(p2);
    343343
    344344  if (d) Mreturn(d, pOrdSgn);
    345   _pMonCmp_2i_c(p1, p2, pVariables1W, d, goto NotEqual , return 0);
     345  _pMonComp_otEXPCOMP_nwEVEN(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    346346
    347347  NotEqual:
     
    349349}
    350350
    351 // comp_2i_c is 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,
    352352// component is incompatible with ordering
    353 static int f_comp_c_2i(poly p1, poly p2) 
     353static int f_comp_otCOMPEXP_nwEVEN(poly p1, poly p2) 
    354354{
    355355  register long d = pGetComp(p2) - pGetComp(p1);
     
    357357  d = pGetOrder(p1) - pGetOrder(p2);
    358358  if (d) Mreturn(d, pOrdSgn);
    359   _pMonCmp_2i(p1, p2, pVariablesW, d, goto NotEqual, return 0);
     359  _pMonComp_otEXP_nwEVEN(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    360360 
    361361  NotEqual:
     
    363363}
    364364
    365 // comp_2i_1 is used if pVariables1W == 2*i and component is compatible
     365// comp_nwODD is used if pVariables1W == 2*i and component is compatible
    366366// with ordering
    367 static int f_comp_2i_1(poly p1, poly p2) 
     367static int f_comp_otEXP_nwODD(poly p1, poly p2) 
    368368{
    369369  register long d = pGetOrder(p1) - pGetOrder(p2);
    370370
    371371  if (d) Mreturn(d, pOrdSgn);
    372   _pMonCmp_2i_1(p1, p2, pVariables1W, d, goto NotEqual, return 0);
     372  _pMonComp_otEXP_nwODD(p1, p2, pVariables1W, d, goto NotEqual, return 0);
    373373
    374374  NotEqual:
     
    376376}
    377377
    378 // comp_2i_1_c is 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,
    379379// component is incompatible with ordering
    380 static int f_comp_2i_1_c(poly p1, poly p2) 
     380static int f_comp_otEXPCOMP_nwODD(poly p1, poly p2) 
    381381{
    382382  register long d = pGetOrder(p1) - pGetOrder(p2);
     
    387387  }
    388388 
    389   _pMonCmp_2i_1_c(p1, p2, pVariables1W, d, goto NotEqual , return 0);
     389  _pMonComp_otEXPCOMP_nwODD(p1, p2, pVariables1W, d, goto NotEqual , return 0);
    390390 
    391391  NotEqual:
     
    393393}
    394394
    395 // comp_c_2i_1 is 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,
    396396// component is incompatible with ordering
    397 static int f_comp_c_2i_1(poly p1, poly p2) 
     397static int f_comp_otCOMPEXP_nwODD(poly p1, poly p2) 
    398398{
    399399  register long d = pGetComp(p2) - pGetComp(p1);
     
    401401  d = pGetOrder(p1) - pGetOrder(p2);
    402402  if (d) Mreturn(d, pOrdSgn);
    403   _pMonCmp_2i_1(p1, p2, pVariablesW, d, goto NotEqual, return 0);
     403  _pMonComp_otEXP_nwODD(p1, p2, pVariablesW, d, goto NotEqual, return 0);
    404404 
    405405  NotEqual:
     
    417417pCompProc t_pComp0;
    418418
    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);
     419static int t_comp_otCOMPEXP_nwONE(poly p1, poly p2);
     420static int t_comp_otEXPCOMP_nwONE(poly p1, poly p2);
     421static int t_comp_lex_otCOMPEXP_i(poly p1, poly p2);
     422static int t_comp_otCOMPEXP_lex_i(poly p1, poly p2);
     423static int t_comp_revlex_otCOMPEXP_i(poly p1, poly p2);
     424static int t_comp_otCOMPEXP_revlex_i(poly p1, poly p2);
    425425
    426426inline long LexComp(poly p1, poly p2)
     
    446446}
    447447
    448 static int t_comp_c_1(poly p1, poly p2)
     448static int t_comp_otCOMPEXP_nwONE(poly p1, poly p2)
    449449{
    450450  NonZeroR(pGetComp(p1) - pGetComp(p2),
     
    454454}
    455455
    456 static int t_comp_1_c(poly p1, poly p2)
     456static int t_comp_otEXPCOMP_nwONE(poly p1, poly p2)
    457457{
    458458  NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn);
     
    462462}
    463463
    464 static int t_comp_lex_c_i(poly p1, poly p2)
     464static int t_comp_lex_otCOMPEXP_i(poly p1, poly p2)
    465465{
    466466  NonZeroR(pGetComp(p1) - pGetComp(p2),
     
    471471}
    472472
    473 static int t_comp_lex_i_c(poly p1, poly p2)
     473static int t_comp_otEXPCOMP_lex_i(poly p1, poly p2)
    474474{
    475475  NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn);
     
    480480}
    481481
    482 static int t_comp_revlex_c_i(poly p1, poly p2)
     482static int t_comp_revlex_otCOMPEXP_i(poly p1, poly p2)
    483483{
    484484  NonZeroR(pGetComp(p1) - pGetComp(p2),
     
    489489}
    490490
    491 static int t_comp_revlex_i_c(poly p1, poly p2)
     491static int t_comp_otEXPCOMP_revlex_i(poly p1, poly p2)
    492492{
    493493  NonZeroR(pGetOrder(p1) - pGetOrder(p2), return pOrdSgn, return -pOrdSgn);
     
    12971297  if (pVariables <= 1)
    12981298  {
    1299     t_pComp0 = t_comp_1_c;
     1299    t_pComp0 = t_comp_otEXPCOMP_nwONE;
    13001300  }
    13011301  else
     
    13091309        case ringorder_Ws:
    13101310        case ringorder_ls:
    1311           t_pComp0 = t_comp_lex_i_c;
     1311          t_pComp0 = t_comp_otEXPCOMP_lex_i;
    13121312          pLexSgn = 1;
    13131313          break;
     
    13221322        default:
    13231323#endif     
    1324           t_pComp0 = t_comp_revlex_i_c;
     1324          t_pComp0 = t_comp_otEXPCOMP_revlex_i;
    13251325          pLexSgn = -1;
    13261326          break;
     
    13551355        {
    13561356          if (pVariables1W == 1)
    1357             f_pComp0 = f_comp_1_c;
     1357            f_pComp0 = f_comp_otEXPCOMP_nwONE;
    13581358          else if (pVariables1W == 2)
    1359             f_pComp0 = f_comp_2_c;
     1359            f_pComp0 = f_comp_otEXPCOMP_nwTWO;
    13601360          else if (pVariables1W & 1)
    1361             f_pComp0 = f_comp_2i_1_c;
     1361            f_pComp0 = f_comp_otEXPCOMP_nwODD;
    13621362          else
    1363             f_pComp0 = f_comp_2i_c;
     1363            f_pComp0 = f_comp_otEXPCOMP_nwEVEN;
    13641364        }
    13651365        else
    13661366        {
    13671367          if (pVariables1W == 1)
    1368             f_pComp0 = f_comp_1;
     1368            f_pComp0 = f_comp_otEXP_nwONE;
    13691369          else if (pVariables1W == 2)
    1370             f_pComp0 = f_comp_2;
     1370            f_pComp0 = f_comp_otEXP_nwTWO;
    13711371          else if (pVariables1W & 1)
    1372             f_pComp0 = f_comp_2i_1;
     1372            f_pComp0 = f_comp_otEXP_nwODD;
    13731373          else
    1374             f_pComp0 = f_comp_2i;
     1374            f_pComp0 = f_comp_otEXP_nwEVEN;
    13751375        }
    13761376        break;
     
    13901390        {
    13911391          if (pVariables1W == 1)
    1392             f_pComp0 = f_comp_1_c;
     1392            f_pComp0 = f_comp_otEXPCOMP_nwONE;
    13931393          else if (pVariables1W == 2)
    1394             f_pComp0 = f_comp_2_c;
     1394            f_pComp0 = f_comp_otEXPCOMP_nwTWO;
    13951395          else if (pVariables1W & 1)
    1396             f_pComp0 = f_comp_2i_1_c;
     1396            f_pComp0 = f_comp_otEXPCOMP_nwODD;
    13971397          else
    1398             f_pComp0 = f_comp_2i_c;
     1398            f_pComp0 = f_comp_otEXPCOMP_nwEVEN;
    13991399        }
    14001400        else
    14011401        {
    14021402          if (pVariables1W == 1)
    1403             f_pComp0 = f_comp_1;
     1403            f_pComp0 = f_comp_otEXP_nwONE;
    14041404          else if (pVariables1W == 2)
    1405             f_pComp0 = f_comp_2;
     1405            f_pComp0 = f_comp_otEXP_nwTWO;
    14061406          else if (pVariables1W & 1)
    1407             f_pComp0 = f_comp_2i_1;
     1407            f_pComp0 = f_comp_otEXP_nwODD;
    14081408          else
    1409             f_pComp0 = f_comp_2i;
     1409            f_pComp0 = f_comp_otEXP_nwEVEN;
    14101410        }
    14111411#ifdef PDEBUG
     
    14881488  if (pVariables <= 1)
    14891489  {
    1490     t_pComp0 = t_comp_c_1;
     1490    t_pComp0 = t_comp_otCOMPEXP_nwONE;
    14911491  }
    14921492  else
     
    15001500        case ringorder_Ws:
    15011501        case ringorder_ls:
    1502           t_pComp0 = t_comp_lex_c_i;
     1502          t_pComp0 = t_comp_lex_otCOMPEXP_i;
    15031503          pLexSgn = 1;
    15041504          break;
     
    15131513        default:
    15141514#endif     
    1515           t_pComp0 = t_comp_revlex_c_i;
     1515          t_pComp0 = t_comp_revlex_otCOMPEXP_i;
    15161516          pLexSgn = -1;
    15171517          break;
     
    15431543        pLexSgn = -1;
    15441544        if (pVariablesW == 1)
    1545           f_pComp0 = f_comp_c_1;
     1545          f_pComp0 = f_comp_otCOMPEXP_nwONE;
    15461546        else if (pVariablesW == 2)
    1547           f_pComp0 = f_comp_c_2;
     1547          f_pComp0 = f_comp_otCOMPEXP_nwTWO;
    15481548        else if (pVariablesW & 1)
    1549           f_pComp0 = f_comp_c_2i_1;
     1549          f_pComp0 = f_comp_otCOMPEXP_nwODD;
    15501550        else
    1551           f_pComp0 = f_comp_c_2i;
     1551          f_pComp0 = f_comp_otCOMPEXP_nwEVEN;
    15521552        break;
    15531553       
     
    15641564        pLexSgn = 1;
    15651565        if (pVariablesW == 1)
    1566           f_pComp0 = f_comp_c_1;
     1566          f_pComp0 = f_comp_otCOMPEXP_nwONE;
    15671567        else if (pVariablesW == 2)
    1568           f_pComp0 = f_comp_c_2;
     1568          f_pComp0 = f_comp_otCOMPEXP_nwTWO;
    15691569        else if (pVariablesW & 1)
    1570           f_pComp0 = f_comp_c_2i_1;
     1570          f_pComp0 = f_comp_otCOMPEXP_nwODD;
    15711571        else
    1572           f_pComp0 = f_comp_c_2i;
     1572          f_pComp0 = f_comp_otCOMPEXP_nwEVEN;
    15731573#ifdef PDEBUG
    15741574        break;
     
    31413141
    31423142#ifdef COMP_STATISTICS
    3143 static int s_comp_lp_c_1(poly p1, poly p2) 
     3143static int s_comp_lp_otCOMPEXP_1(poly p1, poly p2) 
    31443144{
    31453145  MonomCountTotal++;
     
    31593159
    31603160#ifdef COMP_STATISTICS
    3161 static int s_comp_lp_c_i(poly p1, poly p2) 
     3161static int s_comp_lp_otCOMPEXP_i(poly p1, poly p2) 
    31623162{
    31633163  MonomCountTotal++;
  • Singular/ring.cc

    r057fd3 rf92fa13  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.15 1998-02-16 09:46:55 Singular Exp $ */
     4/* $Id: ring.cc,v 1.16 1998-03-16 14:56:40 obachman Exp $ */
    55
    66/*
     
    16651665  return res;
    16661666}
     1667
     1668rOrderType_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  
    77* ABSTRACT - the interpreter related ring operations
    88*/
    9 /* $Id: ring.h,v 1.8 1998-01-12 18:59:58 obachman Exp $ */
     9/* $Id: ring.h,v 1.9 1998-03-16 14:56:41 obachman Exp $ */
    1010
    1111/* includes */
     
    6767};
    6868
     69typedef 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
     79rOrderType_t rGetOrderType(ring r);
     80
    6981#ifdef RDEBUG
    7082extern short rNumber;
  • Singular/spSpolyLoop.cc

    r057fd3 rf92fa13  
    1616#include "spSpolyLoop.h"
    1717
    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
    7422#endif
    7523
    76 extern int maxBound;
    77 
    7824/***************************************************************
    7925 *
    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
    8131 *
    8232 ***************************************************************/
    83 #ifndef DO_DEEP_PROFILE
    84 #define FAST_SPOLY_LOOP
     33#if 1
     34void 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
     103extern void spGSpolyLoop(poly a1, poly a2, poly m,poly spNoether);
     104void spSpolyLoop_General
     105(poly a1, poly a2, poly m,poly spNoether)
     106{
     107  spGSpolyLoop(a1, a2, m, spNoether);
     108}
    85109#endif
    86110
    87 spSpolyLoopProc spSetPSpolyLoop(ring r, int syzComp, int ak, BOOLEAN homog)
    88 {
     111
     112/***************************************************************
     113 *
     114 * Fst spoly loops
     115 *
     116 ***************************************************************/
    89117#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
    528119#define NonZeroA(d, multiplier, actionE)        \
    529120{                                               \
     
    542133}                                               \
    543134while(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
     140spSpolyLoopProc spGetSpolyLoop(ring r, rOrderType_t rot, BOOLEAN homog)
    546141{
    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)
    555182  {
    556     spMultCopyX(a1, m, m, tneg,spNoether);
    557     return;
     183    if (Variables1W & 1)
     184      nw = nwODD;
     185    else
     186      nw = nwEVEN;
    558187  }
    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
    573189  {
    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;
    577194  }
    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;
    629202}
    630203
    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   else
    665   {
    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 a2
    687   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 a2
    701   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   else
    710   {
    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   else
    753   {
    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 a2
    775   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 a2
    790   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   else
    799   {
    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   else
    840   {
    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 a2
    862   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 a2
    876   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   else
    885   {
    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   else
    926   {
    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 a2
    948   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 a2
    962   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   else
    971   {
    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   else
    1014   {
    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 a2
    1036   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 a2
    1051   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   else
    1060   {
    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   else
    1102   {
    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 a2
    1124   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 a2
    1138   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   else
    1147   {
    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   else
    1189   {
    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 a2
    1211   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 a2
    1225   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   else
    1234   {
    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   else
    1278   {
    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 a2
    1300   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 a2
    1315   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   else
    1324   {
    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   else
    1366   {
    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 a2
    1388   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 a2
    1402   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   else
    1411   {
    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   else
    1453   {
    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 a2
    1475   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 a2
    1489   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   else
    1498   {
    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   else
    1542   {
    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 a2
    1564   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 a2
    1579   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   else
    1588   {
    1589     pNext(a) = a2;
    1590     return;
    1591   }
    1592   goto Top;
    1593 }
    1594 
    1595 
    1596 /***************************************************************
    1597  *
    1598  * Syzygies orderings
    1599  *
    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   else
    1671   {
    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 a2
    1693   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 a2
    1708   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   else
    1718   {
    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   else
    1761   {
    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 a2
    1782   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 a2
    1797   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   else
    1807   {
    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   else
    1851   {
    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 a2
    1873   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 a2
    1888   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   else
    1898   {
    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   else
    1940   {
    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 a2
    1962   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 a2
    1977   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   else
    1987   {
    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   else
    2029   {
    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 a2
    2051   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 a2
    2066   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   else
    2076   {
    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   else
    2119   {
    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 a2
    2141   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 a2
    2156   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   else
    2166   {
    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   else
    2209   {
    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 a2
    2231   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 a2
    2246   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   else
    2256   {
    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   else
    2299   {
    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 a2
    2321   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 a2
    2336   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   else
    2346   {
    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   else
    2389   {
    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 a2
    2411   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 a2
    2426   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   else
    2436   {
    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   else
    2479   {
    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 a2
    2501   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 a2
    2516   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   else
    2526   {
    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   else
    2569   {
    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 a2
    2591   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 a2
    2606   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   else
    2616   {
    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   else
    2659   {
    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 a2
    2681   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 >=  0
    2696   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   else
    2706   {
    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   else
    2751   {
    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 a2
    2773   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 a2
    2788   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   else
    2797   {
    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   else
    2836   {
    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 a2
    2858   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 a2
    2873   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   else
    2882   {
    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   else
    2922   {
    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 a2
    2944   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 a2
    2959   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   else
    2968   {
    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   else
    3006   {
    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 a2
    3028   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 a2
    3043   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   else
    3052   {
    3053     pNext(a) = a2;
    3054     return;
    3055   }
    3056   goto Top;
    3057 }
    3058 
    3059 /***************************************************************
    3060  *
    3061  * The Macaulay-order case
    3062  *
    3063  ***************************************************************/
    3064 #ifdef TEST_MAC_ORDER
    3065 /*2
    3066 * assume m = L(m) and Lc(m) = exp
    3067 * pNext(n) = result = p*m
    3068 * do not destroy p
    3069 */
    3070 inline void bMultCopyX(poly p, poly m, poly n, number exp)
    3071 {
    3072 #ifdef PDEBUG
    3073   poly pp=n;
    3074 #endif
    3075   poly a = n;
    3076   do
    3077   {
    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 /*2
    3091 * assume m = L(m) and Lc(m) = exp
    3092 * pNext(n) = result = p*m
    3093 * do not destroy p
    3094 */
    3095 inline void bMultCopyX0(poly p, poly m, poly n, number exp)
    3096 {
    3097   poly a = n;
    3098   do
    3099   {
    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 involved
    3113 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   else
    3155   {
    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 a2
    3180   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 a2
    3198   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   else
    3207   {
    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       else
    3231       {
    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 < a2
    3254     {
    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 >a2
    3267     {
    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       else
    3277       {
    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   }