[singular] 15/45: import 3-1-5.orig.tgz correctly

felix salfelder felix-guest at alioth.debian.org
Sat Sep 14 13:57:02 UTC 2013


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master-3-1-5
in repository singular.

commit c2d0b997183a0cc911fdef0861638995bafededc
Author: Felix Salfelder <felix at salfelder.org>
Date:   Tue Aug 20 10:20:20 2013 +0200

    import 3-1-5.orig.tgz correctly
---
 Singular/LIB/polymake.lib     | 2688 ------------------------
 Singular/bbcone.cc            | 1271 ------------
 Singular/bbfan.cc             |  733 -------
 Singular/bbpolytope.cc        |  481 -----
 Singular/install-sh           |  246 ---
 Singular/svnver               |    1 -
 Tst/Old/lib0.lib              | 1068 ----------
 Tst/Old/lib0.test             | 1072 ----------
 callpolymake/Makefile         |   17 -
 callpolymake/polymake.cc      |  451 ----
 factory/abs_fac.cc            | 1074 ----------
 factory/bifac.cc              | 1294 ------------
 factory/bifac.h               |  100 -
 factory/bifacConfig.h         |   49 -
 factory/fex/ChangeLog         |   29 -
 factory/fex/gcdUnivP.fex      |  407 ----
 factory/fex/gcdUnivPAlpha.fex |  304 ---
 factory/fex/insert.fex        |  100 -
 factory/fex/runfex            |  533 -----
 factory/fex/stdUnivPGcd.in    |  268 ---
 factory/fieldGCD.cc           |  248 ---
 factory/fieldGCD.h            |    8 -
 factory/ftest/ChangeLog       |  566 ------
 factory/ftest/GNUmakefile.in  |  156 --
 factory/ftest/bextgcd.m4      |  125 --
 factory/ftest/bgcd.m4         |  116 --
 factory/ftest/commonden.m4    |   51 -
 factory/ftest/degree.m4       |   62 -
 factory/ftest/deriv.m4        |   61 -
 factory/ftest/divides.m4      |  120 --
 factory/ftest/divrem.m4       |  119 --
 factory/ftest/extgcd.m4       |  132 --
 factory/ftest/factorize.m4    |   62 -
 factory/ftest/fbinops.m4      |  345 ----
 factory/ftest/feval.m4        |  204 --
 factory/ftest/ftest_io.cc     |  221 --
 factory/ftest/ftest_io.h      |   26 -
 factory/ftest/ftest_util.cc   | 1164 -----------
 factory/ftest/ftest_util.h    |   66 -
 factory/ftest/ftest_util.m4   |  292 ---
 factory/ftest/gcd.m4          |  121 --
 factory/ftest/gcd.ntl.m4      |  159 --
 factory/ftest/insert.m4       |   64 -
 factory/ftest/norm.m4         |   62 -
 factory/ftest/ntl_util.cc     |  242 ---
 factory/ftest/ntl_util.h      |   31 -
 factory/ftest/resultant.m4    |   56 -
 factory/ftest/revert.m4       |   49 -
 factory/ftest/size.m4         |   62 -
 factory/ftest/sqrfree.m4      |   58 -
 factory/ftest/totaldegree.m4  |   65 -
 factory/lgs.cc                |  309 ---
 factory/lgs.h                 |   62 -
 factory/sm_sparsemod.cc       |  629 ------
 factory/sm_sparsemod.h        |   21 -
 factory/sm_util.cc            |  328 ---
 factory/sm_util.h             |   33 -
 factory/winnt/INSTALL.nt      |   29 -
 factory/winnt/config.h        |   79 -
 factory/winnt/factory.h       | 1048 ----------
 factory/winnt/factoryconf.h   |  237 ---
 factory/winnt/nt.mak          |   81 -
 kernel/bbcone.h               |   26 -
 kernel/bbfan.h                |   17 -
 kernel/bbpolytope.h           |   17 -
 kernel/gfan.cc                | 4512 -----------------------------------------
 kernel/gfan.h                 |  274 ---
 kernel/install-sh             |  246 ---
 kernel/mod2.h.in              |  622 ------
 kernel/testgh                 |   19 -
 70 files changed, 25888 deletions(-)

diff --git a/Singular/LIB/polymake.lib b/Singular/LIB/polymake.lib
deleted file mode 100644
index aba451d..0000000
--- a/Singular/LIB/polymake.lib
+++ /dev/null
@@ -1,2688 +0,0 @@
-//
-version="$Id: polymake.lib 14082 2011-03-29 12:15:56Z hannes $";
-category="Tropical Geometry";
-info="
-LIBRARY:   polymake.lib    Computations with polytopes and fans,
-                           interface to polymake and TOPCOM
-AUTHOR:    Thomas Markwig,  email: keilen at mathematik.uni-kl.de
-
-WARNING:
-   Most procedures will not work unless polymake or topcom is installed and
-   if so, they will only work with the operating system LINUX!
-   For more detailed information see the following note or consult the
-   help string of the procedures.
-
-NOTE:
-   Even though this is a Singular library for computing polytopes and fans
-   such as the Newton polytope or the Groebner fan of a polynomial, most of
-   the hard computations are NOT done by Singular but by the program
-@* - polymake by Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt
-@*   (see http://www.math.tu-berlin.de/polymake/),
-@* respectively (only in the procedure triangularions) by the program
-@* - topcom by Joerg Rambau, Universitaet Bayreuth (see http://www.uni-bayreuth.de/
-     departments/wirtschaftsmathematik/rambau/TOPCOM);
-@*   This library should rather be seen as an interface which allows to use a
-     (very limited) number of options which polymake respectively topcom offers
-     to compute with polytopes and fans and to make the results available in
-     Singular for further computations;
-     moreover, the user familiar with Singular does not have to learn the syntax
-     of polymake or topcom, if the options offered here are sufficient for his
-     purposes.
-@*   Note, though, that the procedures concerned with planar polygons are
-     independent of both, polymake and topcom.
-
-PROCEDURES USING POLYMAKE:
-  polymakePolytope()   computes the vertices of a polytope using polymake
-  newtonPolytope()     computes the Newton polytope of a polynomial
-  newtonPolytopeLP()   computes the lattice points of the Newton polytope
-  normalFan()          computes the normal fan of a polytope
-  groebnerFan()        computes the Groebner fan of a polynomial
-  intmatToPolymake()   transforms an integer matrix into polymake format
-  polymakeToIntmat()   transforms polymake output into an integer matrix
-
-PROCEDURES USING TOPCOM:
-  triangulations()     computes all triangulations of a marked polytope
-  secondaryPolytope()  computes the secondary polytope of a marked polytope
-
-PROCEDURES USING POLYMAKE AND TOPCOM:
-  secondaryFan()       computes the secondary fan of a marked polytope
-
-PROCEDURES CONCERNED WITH PLANAR POLYGONS:
-  cycleLength()      computes the cycleLength of cycle
-  splitPolygon()     splits a marked polygon into vertices, facets, interior points
-  eta()              computes the eta-vector of a triangulation
-  findOrientedBoundary()    computes the boundary of a convex hull
-  cyclePoints()      computes lattice points connected to some lattice point
-  latticeArea()      computes the lattice area of a polygon
-  picksFormula()     computes the ingrediants of Pick's formula for a polygon
-  ellipticNF()       computes the normal form of an elliptic polygon
-  ellipticNFDB()     displays the 16 normal forms of elliptic polygons
-
-AUXILARY PROCEDURES:
-  polymakeKeepTmpFiles()  determines if the files created in /tmp should be kept
-
-KEYWORDS:    polytope; fan; secondary fan; secondary polytope; polymake;
-             Newton polytope; Groebner fan
-";
-
-////////////////////////////////////////////////////////////////////////////////
-/// Auxilary Static Procedures in this Library
-////////////////////////////////////////////////////////////////////////////////
-/// - scalarproduct
-/// - intmatcoldelete
-/// - intmatconcat
-/// - sortlist
-/// - minInList
-/// - stringdelete
-/// - abs
-/// - commondenominator
-/// - maxPosInIntvec
-/// - maxPosInIntmat
-/// - sortintvec
-/// - matrixtointmat
-////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////
-LIB "poly.lib";
-LIB "linalg.lib";
-LIB "random.lib";
-////////////////////////////////////////////////////////////////////////////////
-
-
-/////////////////////////////////////////////////////////////////////////////
-/// PROCEDURES USING POLYMAKE
-/////////////////////////////////////////////////////////////////////////////
-
-proc polymakePolytope (intmat polytope,list #)
-"USAGE:  polymakePolytope(polytope[,#]);   polytope list, # string
-ASSUME:  each row of polytope gives the coordinates of a lattice point of a
-         polytope with their affine coordinates as given by the output of
-         secondaryPolytope
-PURPOSE: the procedure calls polymake to compute the vertices of the polytope
-         as well as its dimension and information on its facets
-RETURN:  list L with four entries
-@*            L[1] : an integer matrix whose rows are the coordinates of vertices
-                     of the polytope
-@*            L[2] : the dimension of the polytope
-@*            L[3] : a list whose i-th entry explains to which vertices the
-                     ith vertex of the Newton polytope is connected
-                     -- i.e. L[3][i] is an integer vector and an entry k in
-                        there means that the vertex L[1][i] is connected to the
-                        vertex L[1][k]
-@*            L[4] : an integer matrix whose rows mulitplied by
-                     (1,var(1),...,var(nvar)) give a linear system of equations
-                     describing the affine hull of the polytope,
-                     i.e. the smallest affine space containing the polytope
-NOTE: -  for its computations the procedure calls the program polymake by
-         Ewgenij Gawrilow, TU Berlin and Michael Joswig, TU Darmstadt;
-         it therefore is necessary that this program is installed in order
-         to use this procedure;
-         see http://www.math.tu-berlin.de/polymake/
-@*    -  note that in the vertex edge graph we have changed the polymake
-         convention which starts indexing its vertices by zero while we start
-         with one !
-@*    -  the procedure creates the file  /tmp/polytope.polymake which contains
-         the polytope in polymake format; if you wish to use this for further
-         computations with polymake, you have to use the procedure
-         polymakeKeepTmpFiles in before
-@*    -  moreover, the procedure creates the file /tmp/polytope.output which
-         it deletes again before ending
-@*    -  it is possible to provide an optional second argument a string
-         which then will be used instead of 'polytope' in the name of the
-         polymake output file
-EXAMPLE: example polymakePolytope;   shows an example"
-{
-  // the header for the file secendarypolytope.polymake
-  string sp="_application polytope
-_version 2.2
-_type RationalPolytope
-
-POINTS
-";
-  int i,j;
-  // set the name for the polymake output file
-  if (size(#)>0)
-  {
-    if (typeof(#[1])=="string")
-    {
-      string dateiname=#[1];
-    }
-    else
-    {
-      string dateiname="polytope";
-    }
-  }
-  else
-  {
-    string dateiname="polytope";
-  }
-  // create the lattice point list for polymake
-  sp=sp+intmatToPolymake(polytope,"points");
-  // initialise dateiname.polymake and compute the vertices
-  write(":w /tmp/"+dateiname+".polymake",sp);
-  system("sh","cd /tmp; polymake "+dateiname+".polymake VERTICES > "+dateiname+".output");
-  string vertices=read("/tmp/"+dateiname+".output");
-  system("sh","/bin/rm /tmp/"+dateiname+".output");
-  intmat np=polymakeToIntmat(vertices,"affine");
-  // compute the dimension
-  system("sh","cd /tmp; polymake "+dateiname+".polymake DIM > "+dateiname+".output");
-  string pdim=read("/tmp/"+dateiname+".output");
-  system("sh","/bin/rm /tmp/"+dateiname+".output");
-  pdim=pdim[5,size(pdim)-6];
-  execute("int nd="+pdim+";");
-  // compute the vertex-edge graph
-  system("sh","cd /tmp; polymake "+dateiname+".polymake GRAPH > "+dateiname+".output");
-  string vertexedgegraph=read("/tmp/"+dateiname+".output");
-  system("sh","/bin/rm /tmp/"+dateiname+".output");
-  vertexedgegraph=vertexedgegraph[7,size(vertexedgegraph)-8];
-  string newveg;
-  for (i=1;i<=size(vertexedgegraph);i++)
-  {
-    if (vertexedgegraph[i]=="{")
-    {
-      newveg=newveg+"intvec(";
-    }
-    else
-    {
-      if (vertexedgegraph[i]=="}")
-      {
-        newveg=newveg+"),";
-      }
-      else
-      {
-        if (vertexedgegraph[i]==" ")
-        {
-          newveg=newveg+",";
-        }
-        else
-        {
-          newveg=newveg+vertexedgegraph[i];
-        }
-      }
-    }
-  }
-  newveg=newveg[1,size(newveg)-1];
-  execute("list nveg="+newveg+";");
-  // raise each entry in nveg by one
-  for (i=1;i<=size(nveg);i++)
-  {
-    for (j=1;j<=size(nveg[i]);j++)
-    {
-      nveg[i][j]=nveg[i][j]+1;
-    }
-  }
-  // compute the affine hull
-  system("sh","cd /tmp; polymake "+dateiname+".polymake AFFINE_HULL > "+dateiname+".output");
-  string equations=read("/tmp/"+dateiname+".output");
-  system("sh","/bin/rm /tmp/"+dateiname+".output");
-  if (size(equations)>14)
-  {
-    intmat neq=polymakeToIntmat(equations,"cleardenom");
-  }
-  else
-  {
-    intmat neq[1][ncols(polytope)+1];
-  }
-  // delete the tmp-files, if polymakekeeptmpfiles is not set
-  if (defined(polymakekeeptmpfiles)==0)
-  {
-    system("sh","/bin/rm /tmp/"+dateiname+".polymake");
-  }
-  // return the files
-  return(list(np,nd,nveg,neq));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice points of the unit square in the plane
-   list points=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
-   // the secondary polytope of this lattice point configuration is computed
-   intmat secpoly=secondaryPolytope(points)[1];
-   list np=polymakePolytope(secpoly);
-   // the vertices of the secondary polytope are:
-   np[1];
-   // its dimension is
-   np[2];
-   // np[3] contains information how the vertices are connected to each other,
-   // e.g. the first vertex (number 0) is connected to the second one
-   np[3][1];
-   // the affine hull has the equation
-   ring r=0,x(1..4),dp;
-   matrix M[5][1]=1,x(1),x(2),x(3),x(4);
-   np[4]*M;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc newtonPolytope (poly f,list #)
-"USAGE: newtonPolytope(f[,#]);  f poly, # string
-RETURN: list L with four entries
-@*            L[1] : an integer matrix whose rows are the coordinates of vertices
-                     of the Newton polytope of f
-@*            L[2] : the dimension of the Newton polytope of f
-@*            L[3] : a list whose ith entry explains to which vertices the
-                     ith vertex of the Newton polytope is connected
-                     -- i.e. L[3][i] is an integer vector and an entry k in
-                        there means that the vertex L[1][i] is
-                        connected to the vertex L[1][k]
-@*            L[4] : an integer matrix whose rows mulitplied by
-                     (1,var(1),...,var(nvar)) give a linear system of equations
-                     describing the affine hull of the Newton polytope, i.e. the
-                     smallest affine space containing the Newton polytope
-NOTE: -  if we replace the first column of L[4] by zeros, i.e. if we move
-         the affine hull to the origin, then we get the equations for the
-         orthogonal comploment of the linearity space of the normal fan dual
-         to the Newton polytope, i.e. we get the EQUATIONS that
-         we need as input for polymake when computing the normal fan
-@*    -  the procedure calls for its computation polymake by Ewgenij Gawrilow,
-         TU Berlin and Michael Joswig, so it only works if polymake is installed;
-         see http://www.math.tu-berlin.de/polymake/
-@*    -  the procedure creates the file  /tmp/newtonPolytope.polymake which
-         contains the polytope in polymake format and which can be used for
-         further computations with polymake
-@*    -  moreover, the procedure creates the file /tmp/newtonPolytope.output
-         and deletes it again before ending
-@*    -  it is possible to give as an optional second argument a string
-         which then will be used instead of 'newtonPolytope' in the name of
-         the polymake output file
-EXAMPLE: example newtonPolytope;   shows an example"
-{
-  int i,j;
-  // compute the list of exponent vectors of the polynomial,
-  // which are the lattice points
-  // whose convex hull is the Newton polytope of f
-  intmat exponents[size(f)][nvars(basering)];
-  while (f!=0)
-  {
-    i++;
-    exponents[i,1..nvars(basering)]=leadexp(f);
-    f=f-lead(f);
-  }
-  if (size(#)==0)
-  {
-    #[1]="newtonPolytope";
-  }
-  // call polymakePolytope with exponents
-  return(polymakePolytope(exponents,#));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   ring r=0,(x,y,z),dp;
-   matrix M[4][1]=1,x,y,z;
-   poly f=y3+x2+xy+2xz+yz+z2+1;
-   // the Newton polytope of f is
-   list np=newtonPolytope(f);
-   // the vertices of the Newton polytope are:
-   np[1];
-   // its dimension is
-   np[2];
-   // np[3] contains information how the vertices are connected to each other,
-   // e.g. the first vertex (number 0) is connected to the second, third and
-   //      fourth vertex
-   np[3][1];
-   //////////////////////////
-   f=x2-y3;
-   // the Newton polytope of f is
-   np=newtonPolytope(f);
-   // the vertices of the Newton polytope are:
-   np[1];
-   // its dimension is
-   np[2];
-   // the Newton polytope is contained in the affine space given
-   //     by the equations
-   np[4]*M;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc newtonPolytopeLP (poly f)
-"USAGE:  newtonPolytopeLP(f);  f poly
-RETURN: list, the exponent vectors of the monomials occuring in f,
-              i.e. the lattice points of the Newton polytope of f
-EXAMPLE: example normalFan;   shows an example"
-{
-  list np;
-  int i=1;
-  while (f!=0)
-  {
-    np[i]=leadexp(f);
-    f=f-lead(f);
-    i++;
-  }
-  return(np);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   ring r=0,(x,y,z),dp;
-   poly f=y3+x2+xy+2xz+yz+z2+1;
-   // the lattice points of the Newton polytope of f are
-   newtonPolytopeLP(f);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc normalFan (intmat vertices,intmat affinehull,list graph,int er,list #)
-"USAGE:  normalFan (vert,aff,graph,rays,[,#]);   vert,aff intmat,  graph list, rays int, # string
-ASSUME:  - vert is an integer matrix whose rows are the coordinate of
-           the vertices of a convex lattice polytope;
-@*       - aff describes the affine hull of this polytope, i.e.
-           the smallest affine space containing it, in the following sense:
-           denote by n the number of columns of vert, then multiply aff by
-           (1,x(1),...,x(n)) and set the resulting terms to zero in order to
-           get the equations for the affine hull;
-@*       - the ith entry of graph is an integer vector describing to which
-           vertices the ith vertex is connected, i.e. a k as entry means that
-           the vertex vert[i] is connected to vert[k];
-@*       - the integer rays is either one (if the extreme rays should be
-           computed) or zero (otherwise)
-RETURN:  list, the ith entry of L[1] contains information about the cone in the
-               normal fan dual to the ith vertex of the polytope
-@*             L[1][i][1] = integer matrix representing the inequalities which
-                            describe the cone dual to the ith vertex
-@*             L[1][i][2] = a list which contains the inequalities represented
-                            by L[i][1] as a list of strings, where we use the
-                            variables x(1),...,x(n)
-@*             L[1][i][3] = only present if 'er' is set to 1; in that case it is
-                            an interger matrix whose rows are the extreme rays
-                            of the cone
-@*             L[2] = is an integer matrix whose rows span the linearity space
-                      of the fan, i.e. the linear space which is contained in
-                      each cone
-NOTE:    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
-           TU Berlin and Michael Joswig, so it only works if polymake is
-           installed;
-           see http://www.math.tu-berlin.de/polymake/
-@*       - in the optional argument # it is possible to hand over other names
-           for the variables to be used -- be careful, the format must be correct
-           which is not tested, e.g. if you want the variable names to be
-           u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
-EXAMPLE: example normalFan;   shows an example"
-{
-  list ineq; // stores the inequalities of the cones
-  int i,j,k;
-  // we work over the following ring
-  execute("ring ineqring=0,x(1.."+string(ncols(vertices))+"),lp;");
-  string greatersign=">";
-  // create the variable names
-  if (size(#)>0)
-  {
-    if (typeof(#[1])=="string")
-    {
-      kill ineqring;
-      execute("ring ineqring=0,("+#[1]+"),lp;");
-    }
-    if (size(#)>1)
-    {
-      greatersign="<";
-    }
-  }
-  //////////////////////////////////////////////////////////////////
-  // Compute first the inequalities of the cones
-  //////////////////////////////////////////////////////////////////
-  matrix VAR[1][ncols(vertices)]=maxideal(1);
-  matrix EXP[ncols(vertices)][1];
-  poly p,pl,pr;
-  // consider all vertices of the polytope
-  for (i=1;i<=nrows(vertices);i++)
-  {
-    // first we produce for each vertex in the polytope
-    // the inequalities describing the dual cone in the normal fan
-    list pp;  // contain strings representing the inequalities
-              // describing the normal cone
-    intmat ie[size(graph[i])][ncols(vertices)]; // contains the inequalities
-                                                // as rows
-    // consider all the vertices to which the ith vertex in the
-    // polytope is connected by an edge
-    for (j=1;j<=size(graph[i]);j++)
-    {
-      // produce the vector ie_j pointing from the jth vertex to the ith vertex;
-      // this will be the jth inequality for the cone in the normal fan dual to
-      // the ith vertex
-      ie[j,1..ncols(vertices)]=vertices[i,1..ncols(vertices)]-vertices[graph[i][j],1..ncols(vertices)];
-      EXP=ie[j,1..ncols(vertices)];
-      // build a linear polynomial with the entries of ie_j as coefficients
-      p=(VAR*EXP)[1,1];
-      pl,pr=0,0;
-      // separate the terms with positive coefficients in p from
-      // those with negative coefficients
-      for (k=1;k<=size(p);k++)
-      {
-        if (leadcoef(p[k])<0)
-        {
-          pr=pr-p[k];
-        }
-        else
-        {
-          pl=pl+p[k];
-        }
-      }
-      // build the string which represents the jth inequality
-      // for the cone dual to the ith vertex
-      // as polynomial inequality of type string, and store this
-      // in the list pp as jth entry
-      pp[j]=string(pl)+" "+greatersign+" "+string(pr);
-    }
-    // all inequalities for the ith vertex are stored in the list ineq
-    ineq[i]=list(ie,pp);
-    kill ie,pp; // kill certain lists
-  }
-  // remove the first column of affine hull to compute the linearity space
-  intmat linearity=intmatcoldelete(affinehull,1);
-  //////////////////////////////////////////////////////////////////
-  // Compute next the extreme rays of the cones
-  //////////////////////////////////////////////////////////////////
-  if (er==1)
-  {
-    list extremerays; // keeps the result
-    string polymake; // keeps polymake output
-    // the header for ineq.polymake
-    string head="_application polytope
-_version 2.2
-_type RationalPolytope
-
-INEQUALITIES
-";
-    // the tail for both polymake files
-    string tail="
-EQUATIONS
-";
-    tail=tail+intmatToPolymake(linearity,"rays");
-    string ungleichungen; // keeps the inequalities for the polymake code
-    intmat M; // the matrix keeping the inequalities
-    // create the file ineq.output
-    write(":w /tmp/ineq.output","");
-    int dimension; // keeps the dimension of the intersection the
-                   // bad cones with the u11tobeseencone
-    for (i=1;i<=size(ineq);i++)
-    {
-      i,". Cone of ",nrows(vertices); // indicate how many
-                                      // vertices have been dealt with
-      ungleichungen=intmatToPolymake(ineq[i][1],"rays");
-      // write the inequalities to ineq.polymake and call polymake
-      write(":w /tmp/ineq.polymake",head+ungleichungen+tail);
-      ungleichungen=""; // clear ungleichungen
-      system("sh","cd /tmp; /bin/rm ineq.output; polymake ineq.polymake VERTICES > ineq.output");
-      // read the result of polymake
-      polymake=read("/tmp/ineq.output");
-      intmat VERT=polymakeToIntmat(polymake,"affine");
-      extremerays[i]=VERT;
-      kill VERT;
-    }
-    for (i=1;i<=size(ineq);i++)
-    {
-      ineq[i]=ineq[i]+list(extremerays[i]);
-    }
-  }
-  // delete the tmp-files, if polymakekeeptmpfiles is not set
-  if (defined(polymakekeeptmpfiles)==0)
-  {
-    system("sh","/bin/rm /tmp/ineq.polymake");
-    system("sh","/bin/rm /tmp/ineq.output");
-  }
-  // get the linearity space
-  return(list(ineq,linearity));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   ring r=0,(x,y,z),dp;
-   matrix M[4][1]=1,x,y,z;
-   poly f=y3+x2+xy+2xz+yz+z2+1;
-   // the Newton polytope of f is
-   list np=newtonPolytope(f);
-   // the Groebner fan of f, i.e. the normal fan of the Newton polytope
-   list gf=normalFan(np[1],np[4],np[3],1,"x,y,z");
-   // the number of cones in the Groebner fan of f is:
-   size(gf[1]);
-   // the inequalities of the first cone as matrix are:
-   print(gf[1][1][1]);
-   // the inequalities of the first cone as string are:
-   print(gf[1][1][2]);
-   // the rows of the following matrix are the extreme rays of the first cone:
-   print(gf[1][1][3]);
-   // each cone contains the linearity space spanned by:
-   print(gf[2]);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc groebnerFan (poly f,list #)
-"USAGE:  groebnerFan(f[,#]);  f poly, # string
-RETURN:  list, the ith entry of L[1] contains information about the ith cone
-               in the Groebner fan dual to the ith vertex in the Newton
-               polytope of the f
-@*             L[1][i][1] = integer matrix representing the inequalities
-                            which describe the cone
-@*             L[1][i][2] = a list which contains the inequalities represented
-                            by L[1][i][1] as a list of strings
-@*             L[1][i][3] = an interger matrix whose rows are the extreme rays
-                            of the cone
-@*             L[2] = is an integer matrix whose rows span the linearity space
-                      of the fan, i.e. the linear space which is contained
-                      in each cone
-@*             L[3] = the Newton polytope of f in the format of the procedure
-                      newtonPolytope
-@*             L[4] = integer matrix where each row represents the exponet
-                      vector of one monomial occuring in the input polynomial
-NOTE: - if you have already computed the Newton polytope of f then you might want
-        to use the procedure normalFan instead in order to avoid doing costly
-        computation twice
-@*    - the procedure calls for its computation polymake by Ewgenij Gawrilow,
-        TU Berlin and Michael Joswig, so it only works if polymake is installed;
-        see http://www.math.tu-berlin.de/polymake/
-@*    - the procedure creates the file  /tmp/newtonPolytope.polymake which
-        contains the Newton polytope of f in polymake format and which can
-        be used for further computations with polymake
-@*    - it is possible to give as an optional second argument as string which
-        then will be used instead of 'newtonPolytope' in the name of the
-        polymake output file
-EXAMPLE: example groebnerFan;   shows an example"
-{
-  int i,j;
-  // compute the list of exponent vectors of the polynomial, which are
-  // the lattice points whose convex hull is the Newton polytope of f
-  intmat exponents[size(f)][nvars(basering)];
-  while (f!=0)
-  {
-    i++;
-    exponents[i,1..nvars(basering)]=leadexp(f);
-    f=f-lead(f);
-  }
-  if (size(#)==0)
-  {
-    #[1]="newtonPolytope";
-  }
-  // call polymakePolytope with exponents
-  list newtonp=polymakePolytope(exponents,"newtonPolytope");
-  // get the variables as string
-  string variablen;
-  for (i=1;i<=nvars(basering);i++)
-  {
-    variablen=variablen+string(var(i))+",";
-  }
-  variablen=variablen[1,size(variablen)-1];
-  // call normalFan in order to compute the Groebner fan
-  list gf=normalFan(newtonp[1],newtonp[4],newtonp[3],1,variablen);
-  // append newtonp to gf
-  gf[3]=newtonp;
-  // append the exponent vectors to gf
-  gf[4]=exponents;
-  return(gf);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   ring r=0,(x,y,z),dp;
-   matrix M[4][1]=1,x,y,z;
-   poly f=y3+x2+xy+2xz+yz+z2+1;
-   // the Newton polytope of f is
-   list gf=groebnerFan(f);
-   // the exponent vectors of f are ordered as follows
-   gf[4];
-   // the first cone of the groebner fan has the inequalities
-   gf[1][1][1];
-   // as a string they look like
-   gf[1][1][2];
-   // and it has the extreme rays
-   print(gf[1][1][3]);
-   // the linearity space is spanned by
-   print(gf[2]);
-   // the vertices of the Newton polytope are:
-   gf[3][1];
-   // its dimension is
-   gf[3][2];
-   // np[3] contains information how the vertices are connected to each other,
-   // e.g. the 1st vertex is connected to the 2nd, 3rd and 4th vertex
-   gf[3][3][1];
-}
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc intmatToPolymake (intmat M,string art)
-"USAGE:  intmatToPolymake(M,art);  M intmat, art string
-ASSUME:  - M is an integer matrix which should be transformed into polymake
-           format;
-@*       - art is one of the following strings:
-@*           + 'rays'   : indicating that a first column of 0's should be added
-@*           + 'points' : indicating that a first column of 1's should be added
-RETURN:  string, the matrix is transformed in a string and a first column has
-                 been added
-EXAMPLE: example intmatToPolymake;   shows an example"
-{
-  if (art=="rays")
-  {
-    string anf="0 ";
-  }
-  else
-  {
-    string anf="1 ";
-  }
-  string sp;
-  int i,j;
-  // create the lattice point list for polymake
-  for (i=1;i<=nrows(M);i++)
-  {
-    sp=sp+anf;
-    for (j=1;j<=ncols(M);j++)
-    {
-      sp=sp+string(M[i,j])+" ";
-      if (j==ncols(M))
-      {
-        sp=sp+"
-";
-      }
-    }
-  }
-  return(sp);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   intmat M[3][4]=1,2,3,4,5,6,7,8,9,10,11,12;
-   intmatToPolymake(M,"rays");
-   intmatToPolymake(M,"points");
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc polymakeToIntmat (string pm,string art)
-"USAGE:  polymakeToIntmat(pm,art);  pm, art string
-ASSUME:  pm is the result of calling polymake with one 'argument' like
-         VERTICES, AFFINE_HULL, etc., so that the first row of the string is
-         the name of the corresponding 'argument' and the further rows contain
-         the result which consists of vectors either over the integers
-         or over the rationals
-RETURN:  intmat, the rows of the matrix are basically the vectors in pm, starting
-                 from the second row, where each row has been multiplied with the
-                 lowest common multiple of the denominators of its entries as if
-                 it is an integer matrix; moreover, if art=='affine', then
-                 the first column is omitted since we only want affine
-                 coordinates
-EXAMPLE: example polymakeToIntmat;   shows an example"
-{
-  // we need a line break
-  string zeilenumbruch="
-";
-  // remove the 'argment' name, i.e. the first row of pm
-  while (pm[1]!=zeilenumbruch)
-  {
-    pm=stringdelete(pm,1);
-  }
-  pm=stringdelete(pm,1);
-  // find out how many entries each vector has, namely one more
-  // than 'spaces' in a row
-  int i=1;
-  int s=1;
-  int z=1;
-  while (pm[i]!=zeilenumbruch)
-  {
-    if (pm[i]==" ")
-    {
-      s++;
-    }
-    i++;
-  }
-  // if we want to have affine coordinates
-  if (art=="affine")
-  {
-    s--; // then there is one column less
-    // and the entry of the first column (in the first row) has to be removed
-    while (pm[1]!=" ")
-    {
-      pm=stringdelete(pm,1);
-    }
-    pm=stringdelete(pm,1);
-  }
-  // we add two line breaks at the end in order to have this as
-  // a stopping criterion
-  pm=pm+zeilenumbruch+zeilenumbruch;
-  // we now have to work through each row
-  for (i=1;i<=size(pm);i++)
-  {
-    // if there are two consecutive line breaks we are done
-    if ((pm[i]==zeilenumbruch) and (pm[i+1]==zeilenumbruch))
-    {
-      i=size(pm)+1;
-    }
-    else
-    {
-      // a line break has to be replaced by a comma
-      if (pm[i]==zeilenumbruch)
-      {
-        z++;
-        pm[i]=",";
-        // if we want to have affine coordinates,
-        // then we have to delete the first entry in each row
-        if (art=="affine")
-        {
-         while (pm[i+1]!=" ")
-         {
-           pm=stringdelete(pm,i+1);
-         }
-         pm=stringdelete(pm,i+1);
-        }
-      }
-      // a space has to be replaced by a comma
-      if (pm[i]==" ")
-      {
-        pm[i]=",";
-      }
-    }
-  }
-  // if we have introduced superflous commata at the end, they should be removed
-  while (pm[size(pm)]==",")
-  {
-    pm=stringdelete(pm,size(pm));
-  }
-  // since the matrix could be over the rationals,
-  // we need a ring with rational coefficients
-  ring zwischering=0,x,lp;
-  // create the matrix with the elements of pm as entries
-  execute("matrix mm["+string(z)+"]["+string(s)+"]="+pm+";");
-  // transform this into an integer matrix
-  matrix M[1][ncols(mm)]; // takes a row of mm
-  int cm;  // takes a lowest common multiple
-  // multiply each row by an integer such that its entries are integers
-  for (int j=1;j<=nrows(mm);j++)
-  {
-    M=mm[j,1..ncols(mm)];
-    cm=commondenominator(M);
-    for (i=1;i<=ncols(mm);i++)
-    {
-      mm[j,i]=cm*mm[j,i];
-    }
-  }
-  // transform the matrix mm into an integer matrix
-  execute("intmat im["+string(z)+"]["+string(s)+"]="+string(mm)+";");
-  return(im);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // this is the usual output of some polymake computation
-   string pm="VERTICES
-0 1 3 5/3 1/3 -1 -23/3 -1/3 5/3 1/3 1
-0 1 3 -23/3 5/3 1 5/3 1/3 1/3 -1/3 -1
-0 1 1 1/3 -1/3 -1 5/3 1/3 -23/3 5/3 3
-0 1 1 5/3 -23/3 3 1/3 5/3 -1/3 1/3 -1
-0 1 -1 1/3 5/3 3 -1/3 -23/3 1/3 5/3 1
-0 1 -1 -1/3 1/3 1 1/3 5/3 5/3 -23/3 3
-0 1 -1 1 3 -5 -1 3 -1 1 -1
-0 1 -1 -1 -1 -1 1 1 3 3 -5
-0 1 -5 3 1 -1 3 -1 1 -1 -1
-
-";
-   intmat PM=polymakeToIntmat(pm,"affine");
-   // note that the first column has been removed, since we asked for
-   // affine coordinates, and the denominators have been cleared
-   print(PM);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// PROCEDURES USING TOPCOM
-///////////////////////////////////////////////////////////////////////////////
-
-proc triangulations (list polygon)
-"USAGE:  triangulations(polygon); list polygon
-ASSUME:  polygon is a list of integer vectors of the same size representing
-         the affine coordinates of the lattice points
-PURPOSE: the procedure considers the marked polytope given as the convex hull of
-         the lattice points and with these lattice points as markings; it then
-         computes all possible triangulations of this marked polytope
-RETURN:  list, each entry corresponds to one triangulation and the ith entry is
-               itself a list of integer vectors of size three, where each integer
-               vector defines one triangle in the triangulation by telling which
-               points of the input are the vertices of the triangle
-NOTE:- the procedure calls for its computations the program points2triangs
-       from the program topcom by Joerg Rambau, Universitaet Bayreuth; it
-       therefore is necessary that this program is installed in order to use
-       this  procedure; see
-@*     http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
-@*   - the procedure creates the files /tmp/triangulationsinput and
-       /tmp/triangulationsoutput;
-       the former is used as input for points2triangs and the latter is its
-       output containing the triangulations of corresponding to points in the
-       format of points2triangs; if you wish to use this for further
-       computations with topcom, you have to use the procedure
-       polymakeKeepTmpFiles in before
-@*   - note that an integer i in an integer vector representing a triangle
-       refers to the ith lattice point, i.e. polygon[i]; this convention is
-       different from TOPCOM's convention, where i would refer to the i-1st
-       lattice point
-EXAMPLE: example triangulations;   shows an example"
-{
-  int i,j;
-  // prepare the input for points2triangs by writing the input polygon in the
-  // necessary format
-  string spi="[";
-  for (i=1;i<=size(polygon);i++)
-  {
-    polygon[i][size(polygon[i])+1]=1;
-    spi=spi+"["+string(polygon[i])+"]";
-    if (i<size(polygon))
-    {
-      spi=spi+",";
-    }
-  }
-  spi=spi+"]";
-  write(":w /tmp/triangulationsinput",spi);
-  // call points2triangs
-  system("sh","cd /tmp; points2triangs < triangulationsinput > triangulationsoutput");
-  string p2t=read("/tmp/triangulationsoutput"); // takes result of points2triangs
-  // delete the tmp-files, if polymakekeeptmpfiles is not set
-  if (defined(polymakekeeptmpfiles)==0)
-  {
-    system("sh","cd /tmp; rm -f triangulationsinput; rm -f triangulationsoutput");
-  }
-  // preprocessing of p2t if points2triangs is version >= 0.15
-  // brings p2t to the format of version 0.14
-  string np2t; // takes the triangulations in Singular format
-  for (i=1;i<=size(p2t)-2;i++)
-  {
-    if ((p2t[i]==":") and (p2t[i+1]=="=") and (p2t[i+2]=="["))
-    {
-      np2t=np2t+p2t[i]+p2t[i+1];
-      i=i+3;
-      while (p2t[i]!=":")
-      {
-        i=i+1;
-      }
-    }
-    else
-    {
-      if ((p2t[i]=="]") and (p2t[i+1]==";"))
-      {
-        np2t=np2t+p2t[i+1];
-        i=i+1;
-      }
-      else
-      {
-        np2t=np2t+p2t[i];
-      }
-    }
-  }
-  if (p2t[size(p2t)-1]=="]")
-  {
-    np2t=np2t+p2t[size(p2t)];
-  }
-  else
-  {
-    if (np2t[size(np2t)]!=";")
-    {
-      np2t=np2t+p2t[size(p2t)-1]+p2t[size(p2t)];
-    }
-  }
-  p2t=np2t;
-  np2t="";
-  // transform the points2triangs output of version 0.14 into Singular format
-  for (i=1;i<=size(p2t);i++)
-  {
-    if (p2t[i]=="=")
-    {
-      np2t=np2t+p2t[i]+"list(";
-      i++;
-    }
-    else
-    {
-      if (p2t[i]!=":")
-      {
-        if ((p2t[i]=="}") and (p2t[i+1]=="}"))
-        {
-          np2t=np2t+"))";
-          i++;
-        }
-        else
-        {
-          if (p2t[i]=="{")
-          {
-            np2t=np2t+"intvec(";
-          }
-          else
-          {
-            if (p2t[i]=="}")
-            {
-              np2t=np2t+")";
-            }
-            else
-            {
-              np2t=np2t+p2t[i];
-            }
-          }
-        }
-      }
-    }
-  }
-  list T;
-  execute(np2t);
-  // raise each index by one
-  for (i=1;i<=size(T);i++)
-  {
-    for (j=1;j<=size(T[i]);j++)
-    {
-      T[i][j]=T[i][j]+1;
-    }
-  }
-  return(T);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice points of the unit square in the plane
-   list polygon=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
-   // the triangulations of this lattice point configuration are computed
-   list triang=triangulations(polygon);
-   triang;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc secondaryPolytope (list polygon,list #)
-"USAGE:  secondaryPolytope(polygon[,#]); list polygon, list #
-ASSUME:  - polygon is a list of integer vectors of the same size representing
-           the affine coordinates of lattice points
-@*       - if the triangulations of the corresponding polygon have already been
-           computed with the procedure triangulations then these can be given as
-           a second (optional) argument in order to avoid doing this computation
-           again
-PURPOSE: the procedure considers the marked polytope given as the convex hull of
-         the lattice points and with these lattice points as markings; it then
-         computes the lattice points of the secondary polytope given by this
-         marked polytope which correspond to the triangulations computed by
-         the procedure triangulations
-RETURN:  list, say L, such that:
-@*             L[1] = intmat, each row gives the affine coordinates of a lattice
-                      point in the secondary polytope given by the marked polytope
-                      corresponding to polygon
-@*             L[2] = the list of corresponding triangulations
-NOTE: if the triangluations are not handed over as optional argument the
-      procedure calls for its computation of these triangulations the program
-      points2triangs from the program topcom by Joerg Rambau, Universitaet
-      Bayreuth; it therefore is necessary that this program is installed in
-      order to use this procedure; see
-@*    http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
-EXAMPLE: example secondaryPolytope;   shows an example"
-{
-  // compute the triangulations of the point configuration with points2triangs
-  if (size(#)==0)
-  {
-    list triangs=triangulations(polygon);
-  }
-  else
-  {
-    list triangs=#;
-  }
-  int i,j,k,l;
-  intmat N[2][2]; // is used to compute areas of triangles
-  intvec vertex;  // stores a point in the secondary polytope as
-                  // intermediate result
-  int eintrag;
-  int halt;
-  intmat secpoly[size(triangs)][size(polygon)];   // stores all lattice points
-                                                  // of the secondary polytope
-  // consider each triangulation and compute the corresponding point
-  // in the secondary polytope
-  for (i=1;i<=size(triangs);i++)
-  {
-    // for each triangulation we have to compute the coordinates
-    // corresponding to each marked point
-    for (j=1;j<=size(polygon);j++)
-    {
-      eintrag=0;
-      // for each marked point we have to consider all triangles in the
-      // triangulation which involve this particular point
-      for (k=1;k<=size(triangs[i]);k++)
-      {
-        halt=0;
-        for (l=1;(l<=3) and (halt==0);l++)
-        {
-          if (triangs[i][k][l]==j)
-          {
-            halt=1;
-            N[1,1]=polygon[triangs[i][k][3]][1]-polygon[triangs[i][k][1]][1];
-            N[1,2]=polygon[triangs[i][k][2]][1]-polygon[triangs[i][k][1]][1];
-            N[2,1]=polygon[triangs[i][k][3]][2]-polygon[triangs[i][k][1]][2];
-            N[2,2]=polygon[triangs[i][k][2]][2]-polygon[triangs[i][k][1]][2];
-            eintrag=eintrag+abs(det(N));
-          }
-        }
-      }
-      vertex[j]=eintrag;
-    }
-    secpoly[i,1..size(polygon)]=vertex;
-  }
-  return(list(secpoly,triangs));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice points of the unit square in the plane
-   list polygon=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
-   // the secondary polytope of this lattice point configuration is computed
-   list secpoly=secondaryPolytope(polygon);
-   // the points in the secondary polytope
-   print(secpoly[1]);
-   // the corresponding triangulations
-   secpoly[2];
-}
-
-///////////////////////////////////////////////////////////////////////////////
-/// PROCEDURES USING POLYMAKE AND TOPCOM
-///////////////////////////////////////////////////////////////////////////////
-
-proc secondaryFan (list polygon,list #)
-"USAGE:  secondaryFan(polygon[,#]); list polygon, list #
-ASSUME:  - polygon is a list of integer vectors of the same size representing
-           the affine coordinates of lattice points
-@*       - if the triangulations of the corresponding polygon have already been
-           computed with the procedure triangulations then these can be given
-           as a second (optional) argument in order to avoid doing this
-           computation again
-PURPOSE: the procedure considers the marked polytope given as the convex hull of
-         the lattice points and with these lattice points as markings; it then
-         computes the lattice points of the secondary polytope given by this
-         marked polytope which correspond to the triangulations computed by
-         the procedure triangulations
-RETURN:  list, the ith entry of L[1] contains information about the ith cone in
-               the secondary fan of the polygon, i.e. the cone dual to the
-               ith vertex of the secondary polytope
-@*             L[1][i][1] = integer matrix representing the inequalities which
-                            describe the cone dual to the ith vertex
-@*             L[1][i][2] = a list which contains the inequalities represented
-                            by L[1][i][1] as a list of strings, where we use the
-                            variables x(1),...,x(n)
-@*             L[1][i][3] = only present if 'er' is set to 1; in that case it is
-                            an interger matrix whose rows are the extreme rays
-                            of the cone
-@*             L[2] = is an integer matrix whose rows span the linearity space
-                      of the fan, i.e. the linear space which is contained in
-                      each cone
-@*             L[3] = the secondary polytope in the format of the procedure
-                      polymakePolytope
-@*             L[4] = the list of triangulations corresponding to the vertices
-                      of the secondary polytope
-NOTE:- the procedure calls for its computation polymake by Ewgenij Gawrilow,
-       TU Berlin and Michael Joswig, so it only works if polymake is installed;
-       see http://www.math.tu-berlin.de/polymake/
-@*   - in the optional argument # it is possible to hand over other names for
-       the variables to be used -- be careful, the format must be correct
-       which is not tested, e.g. if you want the variable names to be
-       u00,u10,u01,u11 then you must hand over the string 'u11,u10,u01,u11'
-@*   - if the triangluations are not handed over as optional argument the
-       procedure calls for its computation of these triangulations the program
-       points2triangs from the program topcom by Joerg Rambau, Universitaet
-       Bayreuth; it therefore is necessary that this program is installed in
-       order to use this procedure; see
-@*     http://www.uni-bayreuth.de/departments/wirtschaftsmathematik/rambau/TOPCOM
-EXAMPLE: example secondaryFan;   shows an example"
-{
-  if (size(#)==0)
-  {
-    list triang=triangulations(polygon);
-  }
-  else
-  {
-    list triang=#[1];
-  }
-  list sp=secondaryPolytope(polygon,triang);
-  list spp=polymakePolytope(sp[1]);
-  list sf=normalFan(spp[1],spp[4],spp[3],1);
-  return(list(sf[1],sf[2],spp,triang));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice points of the unit square in the plane
-   list polygon=intvec(0,0),intvec(0,1),intvec(1,0),intvec(1,1);
-   // the secondary polytope of this lattice point configuration is computed
-   list secfan=secondaryFan(polygon);
-   // the number of cones in the secondary fan of the polygon
-   size(secfan[1]);
-   // the inequalities of the first cone as matrix are:
-   print(secfan[1][1][1]);
-   // the inequalities of the first cone as string are:
-   print(secfan[1][1][2]);
-   // the rows of the following matrix are the extreme rays of the first cone:
-   print(secfan[1][1][3]);
-   // each cone contains the linearity space spanned by:
-   print(secfan[2]);
-   // the points in the secondary polytope
-   print(secfan[3][1]);
-   // the corresponding triangulations
-   secfan[4];
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-/// PROCEDURES CONCERNED WITH PLANAR POLYGONS
-////////////////////////////////////////////////////////////////////////////////
-
-proc cycleLength (list boundary,intvec interior)
-"USAGE:  cycleLength(boundary,interior); list boundary, intvec interior
-ASSUME:  boundary is a list of integer vectors describing a cycle in some
-         convex lattice polygon around the lattice point interior ordered
-         clock wise
-RETURN:  string, the cycle length of the corresponding cycle in the dual
-                 tropical curve
-EXAMPLE: example cycleLength;   shows an example"
-{
-  int j;
-  // create a ring whose variables are indexed by the points in
-  // boundary resp. by interior
-  string rst="ring cyclering=0,(u"+string(interior[1])+string(interior[2]);
-  for (j=1;j<=size(boundary);j++)
-  {
-    rst=rst+",u"+string(boundary[j][1])+string(boundary[j][2]);
-  }
-  rst=rst+"),lp;";
-  execute(rst);
-  // add the first and second point at the end of boundary
-  boundary[size(boundary)+1]=boundary[1];
-  boundary[size(boundary)+1]=boundary[2];
-  poly cl,summand; // takes the cycle length
-  matrix N1[2][2]; // used to compute the area of a triangle
-  matrix N2[2][2]; // used to compute the area of a triangle
-  matrix N3[2][2]; // used to compute the area of a triangle
-  // for each original point in boundary compute its contribution to the cycle
-  for (j=2;j<=size(boundary)-1;j++)
-  {
-    N1=boundary[j-1]-interior,boundary[j]-interior;
-    N2=boundary[j]-interior,boundary[j+1]-interior;
-    N3=boundary[j+1]-interior,boundary[j-1]-interior;
-    execute("summand=-u"+string(boundary[j][1])+string(boundary[j][2])+"+u"+string(interior[1])+string(interior[2])+";");
-    summand=summand*(det(N1)+det(N2)+det(N3))/(det(N1)*det(N2));
-    cl=cl+summand;
-  }
-  return(string(cl));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the integer vectors in boundary are lattice points on the boundary
-   // of a convex lattice polygon in the plane
-   list boundary=intvec(0,0),intvec(0,1),intvec(0,2),intvec(2,2),
-                 intvec(2,1),intvec(2,0);
-   // interior is a lattice point in the interior of this lattice polygon
-   intvec interior=1,1;
-   // compute the general cycle length of a cycle of the corresponding cycle
-   // in the dual tropical curve, note that (0,1) and (2,1) do not contribute
-   cycleLength(boundary,interior);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc splitPolygon (list markings)
-"USAGE:  splitPolygon (markings);  markings list
-ASSUME:  markings is a list of integer vectors representing lattice points in
-         the plane which we consider as the marked points of the convex lattice
-         polytope spanned by them
-PURPOSE: split the marked points in the vertices, the points on the facets
-         which are not vertices, and the interior points
-RETURN:  list, L consisting of three lists
-@*             L[1]    : represents the vertices the polygon ordered clockwise
-@*                       L[1][i][1] = intvec, the coordinates of the ith vertex
-@*                       L[1][i][2] = int, the position of L[1][i][1] in markings
-@*             L[2][i] : represents the lattice points on the facet of the
-                         polygon with endpoints L[1][i] and L[1][i+1]
-                         (i considered modulo size(L[1]))
-@*                       L[2][i][j][1] = intvec, the coordinates of the jth
-                                                 lattice point on that facet
-@*                       L[2][i][j][2] = int, the position of L[2][i][j][1]
-                                              in markings
-@*             L[3]    : represents the interior lattice points of the polygon
-@*                       L[3][i][1] = intvec, coordinates of ith interior point
-@*                       L[3][i][2] = int, the position of L[3][i][1] in markings
-EXAMPLE: example splitPolygon;   shows an example"
-{
-  list vert; // stores the result
-  // compute the boundary of the polygon in an oriented way
-  list pb=findOrientedBoundary(markings);
-  // the vertices are just the second entry of pb
-  vert[1]=pb[2];
-  int i,j,k;      // indices
-  list boundary;  // stores the points on the facets of the
-                  // polygon which are not vertices
-  // append to the boundary points as well as to the vertices
-  // the first vertex a second time
-  pb[1]=pb[1]+list(pb[1][1]);
-  pb[2]=pb[2]+list(pb[2][1]);
-  // for each vertex find all points on the facet of the polygon with this vertex
-  // and the next vertex as endpoints
-  int z=2;
-  for (i=1;i<=size(vert[1]);i++)
-  {
-    j=1;
-    list facet; // stores the points on this facet which are not vertices
-    // while the next vertex is not reached, store the boundary lattice point
-    while (pb[1][z]!=pb[2][i+1])
-    {
-      facet[j]=pb[1][z];
-      j++;
-      z++;
-    }
-    // store the points on the ith facet as boundary[i]
-    boundary[i]=facet;
-    kill facet;
-    z++;
-  }
-  // store the information on the boundary in vert[2]
-  vert[2]=boundary;
-  // find the remaining points in the input which are not on
-  // the boundary by checking
-  // for each point in markings if it is contained in pb[1]
-  list interior=markings;
-  for (i=size(interior);i>=1;i--)
-  {
-    for (j=1;j<=size(pb[1])-1;j++)
-    {
-      if (interior[i]==pb[1][j])
-      {
-        interior=delete(interior,i);
-        j=size(pb[1]);
-      }
-    }
-  }
-  // store the interior points in vert[3]
-  vert[3]=interior;
-  // add to each point in vert the index which it gets from
-  // its position in the input markings;
-  // do so for ver[1]
-  for (i=1;i<=size(vert[1]);i++)
-  {
-    j=1;
-    while (markings[j]!=vert[1][i])
-    {
-      j++;
-    }
-    vert[1][i]=list(vert[1][i],j);
-  }
-  // do so for ver[2]
-  for (i=1;i<=size(vert[2]);i++)
-  {
-    for (k=1;k<=size(vert[2][i]);k++)
-    {
-      j=1;
-      while (markings[j]!=vert[2][i][k])
-      {
-        j++;
-      }
-      vert[2][i][k]=list(vert[2][i][k],j);
-    }
-  }
-  // do so for ver[3]
-  for (i=1;i<=size(vert[3]);i++)
-  {
-    j=1;
-    while (markings[j]!=vert[3][i])
-    {
-      j++;
-    }
-    vert[3][i]=list(vert[3][i],j);
-  }
-  return(vert);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
-   // with all integer points as markings
-   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
-                intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
-                intvec(0,2),intvec(0,3);
-   // split the polygon in its vertices, its facets and its interior points
-   list sp=splitPolygon(polygon);
-   // the vertices
-   sp[1];
-   // the points on facets which are not vertices
-   sp[2];
-   // the interior points
-   sp[3];
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc eta (list triang,list polygon)
-"USAGE:  eta(triang,polygon);  triang, polygon list
-ASSUME:  polygon has the format of the output of splitPolygon, i.e. it is a
-         list with three entries describing a convex lattice polygon in the
-         following way:
-@*       polygon[1] : is a list of lists; for each i the entry polygon[1][i][1]
-                      is a lattice point which is a vertex of the lattice
-                      polygon, and polygon[1][i][2] is an integer assigned to
-                      this lattice point as identifying index
-@*       polygon[2] : is a list of lists; for each vertex of the polygon,
-                      i.e. for each entry in polygon[1], it contains a list
-                      polygon[2][i], which contains the lattice points on the
-                      facet with endpoints polygon[1][i] and polygon[1][i+1]
-                      - i considered mod size(polygon[1]);
-                      each such lattice point contributes an entry
-                      polygon[2][i][j][1] which is an integer
-                      vector giving the coordinate of the lattice point and an
-                      entry polygon[2][i][j][2] which is the identifying index
-@*       polygon[3] : is a list of lists, where each entry corresponds to a
-                      lattice point in the interior of the polygon, with
-                      polygon[3][j][1] being the coordinates of the point
-                      and polygon[3][j][2] being the identifying index;
-@*       triang is a list of integer vectors all of size three describing a
-         triangulation of the polygon described by polygon; if an entry of
-         triang is the vector (i,j,k) then the triangle is built from the vertices
-         with indices i, j and k
-RETURN:  intvec, the integer vector eta describing that vertex of the Newton
-                 polytope discriminant of the polygone whose dual cone in the
-                 Groebner fan contains the cone of the secondary fan of the
-                 polygon corresponding to the given triangulation
-NOTE:  for a better description of eta see Gelfand, Kapranov,
-       Zelevinski: Discriminants, Resultants and multidimensional Determinants.
-       Chapter 10.
-EXAMPLE: example eta;   shows an example"
-{
-  int i,j,k,l,m,n; // index variables
-  list ordpolygon;   // stores the lattice points in the order
-                     // used in the triangulation
-  list triangarea; // stores the areas of the triangulations
-  intmat N[2][2];  // used to compute triangle areas
-  // 1) store the lattice points in the order used in the triangulation
-  // go first through all vertices of the polytope
-  for (j=1;j<=size(polygon[1]);j++)
-  {
-    ordpolygon[polygon[1][j][2]]=polygon[1][j][1];
-  }
-  // then consider all inner points
-  for (j=1;j<=size(polygon[3]);j++)
-  {
-    ordpolygon[polygon[3][j][2]]=polygon[3][j][1];
-  }
-  // finally consider all lattice points on the boundary which are not vertices
-  for (j=1;j<=size(polygon[2]);j++)
-  {
-    for (i=1;i<=size(polygon[2][j]);i++)
-    {
-      ordpolygon[polygon[2][j][i][2]]=polygon[2][j][i][1];
-    }
-  }
-  // 2) compute for each triangle in the triangulation the area of the triangle
-  for (i=1;i<=size(triang);i++)
-  {
-    // Note that the ith lattice point in orderedpolygon has the
-    // number i-1 in the triangulation!
-    N=ordpolygon[triang[i][1]]-ordpolygon[triang[i][2]],ordpolygon[triang[i][1]]-ordpolygon[triang[i][3]];
-    triangarea[i]=abs(det(N));
-  }
-  intvec ETA;        // stores the eta_ij
-  int etaij;         // stores the part of eta_ij during computations
-                     // which comes from triangle areas
-  int seitenlaenge;  // stores the part of eta_ij during computations
-                     // which comes from boundary facets
-  list seiten;       // stores the lattice points on facets of the polygon
-  intvec v;          // used to compute a facet length
-  // 3) store first in seiten[i] all lattice points on the facet
-  //    connecting the ith vertex,
-  //    i.e. polygon[1][i], with the i+1st vertex, i.e. polygon[1][i+1],
-  //    where we replace i+1
-  //    1 if i=size(polygon[1]);
-  //    then append the last entry of seiten once more at the very
-  //    beginning of seiten, so
-  //    that the index is shifted by one
-  for (i=1;i<=size(polygon[1]);i++)
-  {
-    if (i<size(polygon[1]))
-    {
-      seiten[i]=list(polygon[1][i])+polygon[2][i]+list(polygon[1][i+1]);
-    }
-    else
-    {
-      seiten[i]=list(polygon[1][i])+polygon[2][i]+list(polygon[1][1]);
-    }
-  }
-  seiten=insert(seiten,seiten[size(seiten)],0);
-  // 4) compute the eta_ij for all vertices of the polygon
-  for (j=1;j<=size(polygon[1]);j++)
-  {
-    // the vertex itself contributes a 1
-    etaij=1;
-    // check for each triangle in the triangulation ...
-    for (k=1;k<=size(triang);k++)
-    {
-      // ... if the vertex is actually a vertex of the triangle ...
-      if ((polygon[1][j][2]==triang[k][1]) or (polygon[1][j][2]==triang[k][2]) or (polygon[1][j][2]==triang[k][3]))
-      {
-        // ... if so, add the area of the triangle to etaij
-        etaij=etaij+triangarea[k];
-        // then check if that triangle has a facet which is contained
-        // in one of the
-        // two facets of the polygon which are adjecent to the given vertex ...
-        // these two facets are seiten[j] and seiten[j+1]
-        for (n=j;n<=j+1;n++)
-        {
-          // check for each lattice point in the facet of the polygon ...
-          for (l=1;l<=size(seiten[n]);l++)
-          {
-            // ... and for each lattice point in the triangle ...
-            for (m=1;m<=size(triang[k]);m++)
-            {
-              // ... if they coincide and are not the vertex itself ...
-              if ((seiten[n][l][2]==triang[k][m]) and (seiten[n][l][2]!=polygon[1][j][2]))
-              {
-                // if so, then compute the vector pointing from this
-                // lattice point to the vertex
-                v=polygon[1][j][1]-seiten[n][l][1];
-                // and the lattice length of this vector has to be
-                // subtracted from etaij
-                etaij=etaij-abs(gcd(v[1],v[2]));
-              }
-            }
-          }
-        }
-      }
-    }
-    // store etaij in the list
-    ETA[polygon[1][j][2]]=etaij;
-  }
-  // 5) compute the eta_ij for all lattice points on the facets
-  //    of the polygon which are not vertices, these are the
-  //    lattice points in polygon[2][1] to polygon[2][size(polygon[1])]
-  for (i=1;i<=size(polygon[2]);i++)
-  {
-    for (j=1;j<=size(polygon[2][i]);j++)
-    {
-      // initialise etaij
-      etaij=0;
-      // initialise seitenlaenge
-      seitenlaenge=0;
-      // check for each triangle in the triangulation ...
-      for (k=1;k<=size(triang);k++)
-      {
-        // ... if the vertex is actually a vertex of the triangle ...
-        if ((polygon[2][i][j][2]==triang[k][1]) or (polygon[2][i][j][2]==triang[k][2]) or (polygon[2][i][j][2]==triang[k][3]))
-        {
-          // ... if so, add the area of the triangle to etaij
-          etaij=etaij+triangarea[k];
-          // then check if that triangle has a facet which is contained in the
-          // facet of the polygon which contains the lattice point in question,
-          // this is the facet seiten[i+1];
-          // check for each lattice point in the facet of the polygon ...
-          for (l=1;l<=size(seiten[i+1]);l++)
-          {
-            // ... and for each lattice point in the triangle ...
-            for (m=1;m<=size(triang[k]);m++)
-            {
-              // ... if they coincide and are not the vertex itself ...
-              if ((seiten[i+1][l][2]==triang[k][m]) and (seiten[i+1][l][2]!=polygon[2][i][j][2]))
-              {
-                // if so, then compute the vector pointing from
-                // this lattice point to the vertex
-                v=polygon[2][i][j][1]-seiten[i+1][l][1];
-                // and the lattice length of this vector contributes
-                // to seitenlaenge
-                seitenlaenge=seitenlaenge+abs(gcd(v[1],v[2]));
-              }
-            }
-          }
-        }
-      }
-      // if the lattice point was a vertex of any triangle
-      // in the triangulation ...
-      if (etaij!=0)
-      {
-        // then eta_ij is the sum of the triangle areas minus seitenlaenge
-        ETA[polygon[2][i][j][2]]=etaij-seitenlaenge;
-      }
-      else
-      {
-        // otherwise it is just zero
-        ETA[polygon[2][i][j][2]]=0;
-      }
-    }
-  }
-  // 4) compute the eta_ij for all inner lattice points of the polygon
-  for (j=1;j<=size(polygon[3]);j++)
-  {
-    // initialise etaij
-    etaij=0;
-    // check for each triangle in the triangulation ...
-    for (k=1;k<=size(triang);k++)
-    {
-      // ... if the vertex is actually a vertex of the triangle ...
-      if ((polygon[3][j][2]==triang[k][1]) or (polygon[3][j][2]==triang[k][2]) or (polygon[3][j][2]==triang[k][3]))
-      {
-        // ... if so, add the area of the triangle to etaij
-        etaij=etaij+triangarea[k];
-      }
-    }
-    // store etaij in ETA
-    ETA[polygon[3][j][2]]=etaij;
-  }
-  return(ETA);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
-   // with all integer points as markings
-   list polygon=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
-                intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
-                intvec(0,2),intvec(0,3);
-   // split the polygon in its vertices, its facets and its interior points
-   list sp=splitPolygon(polygon);
-   // define a triangulation by connecting the only interior point
-   //        with the vertices
-   list triang=intvec(1,2,5),intvec(1,5,10),intvec(1,5,10);
-   // compute the eta-vector of this triangulation
-   eta(triang,sp);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc findOrientedBoundary (list polygon)
-"USAGE: findOrientedBoundary(polygon); polygon list
-ASSUME: polygon is a list of integer vectors defining integer lattice points
-        in the plane
-RETURN: list l with the following interpretation
-@*            l[1] = list of integer vectors such that the polygonal path
-                     defined by these is the boundary of the convex hull of
-                     the lattice points in polygon
-@*            l[2] = list, the redundant points in l[1] have been removed
-EXAMPLE:     example findOrientedBoundary;   shows an example"
-{
-  // Order the vertices such that passing from one to the next we travel along
-  // the boundary of the convex hull of the vertices clock wise
-  int d,k,i,j;
-  intmat D[2][2];
-  /////////////////////////////////////
-  // Treat first the pathological cases that the polygon is not two-dimensional:
-  /////////////////////////////////////
-  // if the polygon is empty or only one point or a line segment of two points
-  if (size(polygon)<=2)
-  {
-    return(list(polygon,polygon));
-  }
-  // check is the polygon is only a line segment given by more than two points;
-  // for this first compute sum of the absolute values of the determinants
-  // of the matrices whose
-  // rows are the vectors pointing from the first to the second point
-  // and from the
-  // the first point to the ith point for i=3,...,size(polygon);
-  // if this sum is zero
-  // then the polygon is a line segment and we have to find its end points
-  d=0;
-  for (i=3;i<=size(polygon);i++)
-  {
-    D=polygon[2]-polygon[1],polygon[i]-polygon[1];
-    d=d+abs(det(D));
-  }
-  if (d==0) // then polygon is a line segment
-  {
-    intmat laenge[size(polygon)][size(polygon)];
-    intvec mp;
-    //   for this collect first all vectors pointing from one lattice
-    //   point to the next,
-    //   compute their pairwise angles and their lengths
-    for (i=1;i<=size(polygon)-1;i++)
-    {
-      for (j=i+1;j<=size(polygon);j++)
-      {
-        mp=polygon[i]-polygon[j];
-        laenge[i,j]=abs(gcd(mp[1],mp[2]));
-      }
-    }
-    mp=maxPosInIntmat(laenge);
-    list endpoints=polygon[mp[1]],polygon[mp[2]];
-    intvec abstand;
-    for (i=1;i<=size(polygon);i++)
-    {
-      abstand[i]=0;
-      if (i<mp[1])
-      {
-        abstand[i]=laenge[i,mp[1]];
-      }
-      if (i>mp[1])
-      {
-        abstand[i]=laenge[mp[1],i];
-      }
-    }
-    polygon=sortlistbyintvec(polygon,abstand);
-    return(list(polygon,endpoints));
-  }
-  ///////////////////////////////////////////////////////////////
-  list orderedvertices;  // stores the vertices in an ordered way
-  list minimisedorderedvertices;  // stores the vertices in an ordered way;
-                                  // redundant ones removed
-  list comparevertices; // stores vertices which should be compared to
-                        // the testvertex
-  orderedvertices[1]=polygon[1]; // set the starting vertex
-  minimisedorderedvertices[1]=polygon[1]; // set the starting vertex
-  intvec testvertex=polygon[1];  //vertex to which the others have to be compared
-  intvec startvertex=polygon[1]; // keep the starting vertex to test,
-                                 // when the end is reached
-  int endtest;                   // is set to one, when the end is reached
-  int startvertexfound;// is 1, once for some testvertex a candidate
-                       // for the next vertex has been found
-  polygon=delete(polygon,1);    // delete the testvertex
-  intvec v,w;
-  int l=1;  // counts the vertices
-  // the basic idea is that a vertex can be
-  // the next one on the boundary if all other vertices
-  // lie to the right of the vector v pointing
-  // from the testvertex to this one; this can be tested
-  // by checking if the determinant of the 2x2-matrix
-  // with first column v and second column the vector w,
-  // pointing from the testvertex to the new vertex,
-  // is non-positive; if this is the case for all
-  // new vertices, then the one in consideration is
-  // a possible choice for the next vertex on the boundary
-  // and it is stored in naechste; we can then order
-  // the candidates according to their distance from
-  // the testvertex; then they occur on the boundary in that order!
-  while (endtest==0)
-  {
-    list naechste;  // stores the possible choices for the next vertex
-    k=1;
-    for (i=1;i<=size(polygon);i++)
-    {
-      d=0;  // stores the value of the determinant of (v,w)
-      v=polygon[i]-testvertex; // points from the testvertex to the ith vertex
-      comparevertices=delete(polygon,i); // we needn't compare v to itself
-      // we should compare v to the startvertex-testvertex;
-      // in the first calling of the loop
-      // this is irrelevant since the difference will be zero;
-      // however, later on it will
-      // be vital, since we delete the vertices
-      // which we have already tested from the list
-      // of all vertices, and when all vertices
-      // on the boundary have been found we would
-      // therefore find a vertex in the interior
-      // as candidate; but always testing against
-      // the starting vertex, this cannot happen
-      comparevertices[size(comparevertices)+1]=startvertex;
-      for (j=1;(j<=size(comparevertices)) and (d<=0);j++)
-      {
-        w=comparevertices[j]-testvertex; // points form the testvertex
-                                         // to the jth vertex
-        D=v,w;
-        d=det(D);
-      }
-      if (d<=0) // if all determinants are non-positive,
-      { // then the ith vertex is a candidate
-        naechste[k]=list(polygon[i],i,scalarproduct(v,v));// we store the vertex,
-                                                          //its position, and its
-        k++; // distance from the testvertex
-      }
-    }
-    if (size(naechste)>0) // then a candidate for the next vertex has been found
-    {
-      startvertexfound=1; // at least once a candidate has been found
-      naechste=sortlist(naechste,3);  // we order the candidates according
-                                      // to their distance from testvertex;
-      for (j=1;j<=size(naechste);j++) // then we store them in this
-      { // order in orderedvertices
-        l++;
-        orderedvertices[l]=naechste[j][1];
-      }
-      testvertex=naechste[size(naechste)][1];  // we store the last one as
-                                               // next testvertex;
-      // store the next corner of NSD
-      minimisedorderedvertices[size(minimisedorderedvertices)+1]=testvertex;
-      naechste=sortlist(naechste,2); // then we reorder the vertices
-                                     // according to their position
-      for (j=size(naechste);j>=1;j--) // and we delete them from the vertices
-      {
-        polygon=delete(polygon,naechste[j][2]);
-      }
-    }
-    else // that means either that the vertex was inside the polygon,
-    {    // or that we have reached the last vertex on the boundary
-         // of the polytope
-      if (startvertexfound==0) // the vertex was in the interior;
-      { // we delete it and start all over again
-        orderedvertices[1]=polygon[1];
-        minimisedorderedvertices[1]=polygon[1];
-        testvertex=polygon[1];
-        startvertex=polygon[1];
-        polygon=delete(polygon,1);
-      }
-      else // we have reached the last vertex on the boundary of
-      { // the polytope and can stop
-        endtest=1;
-      }
-    }
-    kill naechste;
-  }
-  // test if the first vertex in minimisedorderedvertices
-  // is on the same line with the second and
-  // the last, i.e. if we started our search in the
-  // middle of a face; if so, delete it
-  v=minimisedorderedvertices[2]-minimisedorderedvertices[1];
-  w=minimisedorderedvertices[size(minimisedorderedvertices)]-minimisedorderedvertices[1];
-  D=v,w;
-  if (det(D)==0)
-  {
-    minimisedorderedvertices=delete(minimisedorderedvertices,1);
-  }
-  // test if the first vertex in minimisedorderedvertices
-  // is on the same line with the two
-  // last ones, i.e. if we started our search at the end of a face;
-  // if so, delete it
-  v=minimisedorderedvertices[size(minimisedorderedvertices)-1]-minimisedorderedvertices[1];
-  w=minimisedorderedvertices[size(minimisedorderedvertices)]-minimisedorderedvertices[1];
-  D=v,w;
-  if (det(D)==0)
-  {
-    minimisedorderedvertices=delete(minimisedorderedvertices,size(minimisedorderedvertices));
-  }
-  return(list(orderedvertices,minimisedorderedvertices));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-// the following lattice points in the plane define a polygon
-   list polygon=intvec(0,0),intvec(3,1),intvec(1,0),intvec(2,0),
-                intvec(1,1),intvec(3,2),intvec(1,2),intvec(2,3),
-                intvec(2,4);
-// we compute its boundary
-   list boundarypolygon=findOrientedBoundary(polygon);
-// the points on the boundary ordered clockwise are boundarypolygon[1]
-   boundarypolygon[1];
-// the vertices of the boundary are boundarypolygon[2]
-   boundarypolygon[2];
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc cyclePoints (list triang,list points,int pt)
-"USAGE:      cyclePoints(triang,points,pt)  triang,points list, pt int
-ASSUME:      - points is a list of integer vectors describing the lattice
-               points of a marked polygon;
-@*           - triang is a list of integer vectors describing a triangulation
-               of the marked polygon in the sense that an integer vector of
-               the form (i,j,k) describes the triangle formed by polygon[i],
-               polygon[j] and polygon[k];
-@*           - pt is an integer between 1 and size(points), singling out a
-               lattice point among the marked points
-PURPOSE:     consider the convex lattice polygon, say P, spanned by all lattice
-             points in points which in the triangulation triang are connected
-             to the point points[pt]; the procedure computes all marked points
-             in points which lie on the boundary of that polygon, ordered
-             clockwise
-RETURN:      list, of integer vectors which are the coordinates of the lattice
-                   points on the boundary of the above mentioned polygon P, if
-                   this polygon is not the empty set (that would be the case if
-                   points[pt] is not a vertex of any triangle in the
-                   triangulation); otherwise return the empty list
-EXAMPLE:     example cyclePoints;   shows an example"
-{
-  int i,j; // indices
-  list v;  // saves the indices of lattice points connected to the
-           // interior point in the triangulation
-  // save all points in triangulations containing pt in v
-  for (i=1;i<=size(triang);i++)
-  {
-    if ((triang[i][1]==pt) or (triang[i][2]==pt) or (triang[i][3]==pt))
-    {
-      j++;
-      v[3*j-2]=triang[i][1];
-      v[3*j-1]=triang[i][2];
-      v[3*j]=triang[i][3];
-    }
-  }
-  if (size(v)==0)
-  {
-    return(list());
-  }
-  // remove pt itself and redundancies in v
-  for (i=size(v);i>=1;i--)
-  {
-    j=1;
-    while ((j<i) and (v[i]!=v[j]))
-    {
-      j++;
-    }
-    if ((j<i) or (v[i]==pt))
-    {
-      v=delete(v,i);
-    }
-  }
-  // save in pts the coordinates of the points with indices in v
-  list pts;
-  for (i=1;i<=size(v);i++)
-  {
-    pts[i]=points[v[i]];
-  }
-  // consider the convex polytope spanned by the points in pts,
-  // find the points on the
-  // boundary and order them clockwise
-  return(findOrientedBoundary(pts)[1]);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // the lattice polygon spanned by the points (0,0), (3,0) and (0,3)
-   // with all integer points as markings
-   list points=intvec(1,1),intvec(3,0),intvec(2,0),intvec(1,0),
-               intvec(0,0),intvec(2,1),intvec(0,1),intvec(1,2),
-               intvec(0,2),intvec(0,3);
-   // define a triangulation
-   list triang=intvec(1,2,5),intvec(1,5,7),intvec(1,7,9),intvec(8,9,10),
-               intvec(1,8,9),intvec(1,2,8);
-   // compute the points connected to (1,1) in triang
-   cyclePoints(triang,points,1);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc latticeArea (list polygon)
-"USAGE:  latticeArea(polygon);   polygon list
-ASSUME:  polygon is a list of integer vectors in the plane
-RETURN:  int, the lattice area of the convex hull of the lattice points in
-              polygon, i.e. twice the Euclidean area
-EXAMPLE: example polygonlatticeArea;   shows an example"
-{
-  list pg=findOrientedBoundary(polygon)[2];
-  int area;
-  intmat M[2][2];
-  for (int i=2;i<=size(pg)-1;i++)
-  {
-    M[1,1..2]=pg[i]-pg[1];
-    M[2,1..2]=pg[i+1]-pg[1];
-    area=area+abs(det(M));
-  }
-  return(area);
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // define a polygon with lattice area 5
-   list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),
-                intvec(2,1),intvec(0,0);
-   latticeArea(polygon);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc picksFormula (list polygon)
-"USAGE:  picksFormula(polygon);   polygon list
-ASSUME:  polygon is a list of integer vectors in the plane and consider their
-         convex hull C
-RETURN:  list, L of three integersthe
-@*             L[1] : the lattice area of C, i.e. twice the Euclidean area
-@*             L[2] : the number of lattice points on the boundary of C
-@*             L[3] : the number of interior lattice points of C
-NOTE: the integers in L are related by Pick's formula, namely: L[1]=L[2]+2*L[3]-2
-EXAMPLE: example picksFormula;   shows an example"
-{
-  list pg=findOrientedBoundary(polygon)[2];
-  int area,bdpts,i;
-  intmat M[2][2];
-  // compute the lattice area of the polygon, i.e. twice the Euclidean area
-  for (i=2;i<=size(pg)-1;i++)
-  {
-    M[1,1..2]=pg[i]-pg[1];
-    M[2,1..2]=pg[i+1]-pg[1];
-    area=area+abs(det(M));
-  }
-  // compute the number of lattice points on the boundary
-  intvec edge;
-  pg[size(pg)+1]=pg[1];
-  for (i=1;i<=size(pg)-1;i++)
-  {
-    edge=pg[i]-pg[i+1];
-    bdpts=bdpts+abs(gcd(edge[1],edge[2]));
-  }
-  // Pick's formula says that the lattice area A, the number g of interior
-  // points and
-  // the number b of boundary points are connected by the formula: A=b+2g-2
-  return(list(area,bdpts,(area-bdpts+2)/2));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   // define a polygon with lattice area 5
-   list polygon=intvec(1,2),intvec(1,0),intvec(2,0),intvec(1,1),
-                intvec(2,1),intvec(0,0);
-   list pick=picksFormula(polygon);
-   // the lattice area of the polygon is:
-   pick[1];
-   // the number of lattice points on the boundary is:
-   pick[2];
-   // the number of interior lattice points is:
-   pick[3];
-   // the number's are related by Pick's formula:
-   pick[1]-pick[2]-2*pick[3]+2;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc ellipticNF (list polygon)
-"USAGE:  ellipticNF(polygon);   polygon list
-ASSUME:  polygon is a list of integer vectors in the plane such that their
-         convex hull C has precisely one interior lattice point, i.e. C is the
-         Newton polygon of an elliptic curve
-PURPOSE: compute the normal form of the polygon with respect to the unimodular
-         affine transformations T=A*x+v; there are sixteen different normal forms
-         (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons
-                   and the number 12.  Amer. Math. Monthly  107  (2000),  no. 3,
-                   238--250.)
-RETURN:  list, L such that
-@*             L[1] : list whose entries are the vertices of the normal form of
-                      the polygon
-@*             L[2] : the matrix A of the unimodular transformation
-@*             L[3] : the translation vector v of the unimodular transformation
-@*             L[4] : list such that the ith entry is the image of polygon[i]
-                      under the unimodular transformation T
-EXAMPLE: example ellipticNF;   shows an example"
-{
-  int i;            // index
-  intvec edge;      // stores the vector of an edge
-  intvec boundary;  // stores lattice lengths of the edges of the Newton cylce
-  // find the vertices of the Newton cycle and order it clockwise
-  list pg=findOrientedBoundary(polygon)[2];
-  // check if there is precisely one interior point in the Newton polygon
-  if (picksFormula(pg)[3]!=1)
-  {
-    ERROR("The polygon has not precisely one interior point!");
-  }
-  // insert the first vertex at the end once again
-  pg[size(pg)+1]=pg[1];
-  // compute the number of lattice points on each edge
-  for (i=1;i<=size(pg)-1;i++)
-  {
-    edge=pg[i]-pg[i+1];
-    boundary[i]=1+abs(gcd(edge[1],edge[2]));
-  }
-  // store the values of boundary once more adding the first two at the end
-  intvec tboundary=boundary,boundary[1],boundary[2];
-  // sort boundary in an asecending way
-  intvec sbd=sortintvec(boundary);
-  // find the first edge having the maximal number of lattice points
-  int max=maxPosInIntvec(boundary);
-  // some computations have to be done over the rationals
-  ring transformationring=0,x,lp;
-  intvec trans;    // stores the vector by which we have to translate the polygon
-  intmat A[2][2];  // stores the matrix by which we have to transform the polygon
-  matrix M[3][3];  // stores the projective coordinates of the points
-                   // which are to be transformed
-  matrix N[3][3];  // stores the projective coordinates of the points to
-                   // which M is to be transformed
-  intmat T[3][3];  // stores the unimodular affine transformation in
-                   // projective form
-  // add the second point of pg once again at the end
-  pg=insert(pg,pg[2],size(pg));
-  // if there is only one edge which has the maximal number of lattice points,
-  // then M should be:
-  M=pg[max],1,pg[max+1],1,pg[max+2],1;
-  // consider the 16 different cases which can occur:
-  // Case 1:
-  if (sbd==intvec(2,2,2))
-  {
-    N=0,1,1,1,2,1,2,0,1;
-  }
-  // Case 2:
-  if (sbd==intvec(2,2,3))
-  {
-    N=2,0,1,0,0,1,1,2,1;
-  }
-  // Case 3:
-  if (sbd==intvec(2,3,4))
-  {
-    // here the orientation of the Newton polygon is important !
-    if (tboundary[max+1]==3)
-    {
-      N=3,0,1,0,0,1,0,2,1;
-    }
-    else
-    {
-      N=0,0,1,3,0,1,0,2,1;
-    }
-  }
-  // Case 4:
-  if (sbd==intvec(3,3,5))
-  {
-    N=4,0,1,0,0,1,0,2,1;
-  }
-  // Case 5:
-  if (sbd==intvec(4,4,4))
-  {
-    N=3,0,1,0,0,1,0,3,1;
-  }
-  // Case 6+7:
-  if (sbd==intvec(2,2,2,2))
-  {
-    // there are two different polygons which has four edges all of length 2,
-    // but only one of them has two edges whose direction vectors form a matrix
-    // of determinant 3
-    A=pg[1]-pg[2],pg[3]-pg[2];
-    while ((max<4) and (det(A)!=3))
-    {
-      max++;
-      A=pg[max]-pg[max+1],pg[max+2]-pg[max+1];
-    }
-    // Case 6:
-    if (det(A)==3)
-    {
-      M=pg[max],1,pg[max+1],1,pg[max+2],1;
-      N=1,0,1,0,2,1,2,1,1;
-    }
-    // Case 7:
-    else
-    {
-      N=2,1,1,1,0,1,0,1,1;
-    }
-  }
-  // Case 8:
-  if (sbd==intvec(2,2,2,3))
-  {
-    // the orientation of the polygon is important
-    A=pg[max]-pg[max+1],pg[max+2]-pg[max+1];
-    if (det(A)==2)
-    {
-      N=2,0,1,0,0,1,0,1,1;
-    }
-    else
-    {
-      N=0,0,1,2,0,1,1,2,1;
-    }
-  }
-  // Case 9:
-  if (sbd==intvec(2,2,3,3))
-  {
-    // if max==1, then the 5th entry in tboundary is the same as the first
-    if (max==1)
-    {
-      max=5;
-    }
-    // if boundary=3,2,2,3 then set max=4
-    if (tboundary[max+1]!=3)
-    {
-      max=4;
-    }
-    M=pg[max],1,pg[max+1],1,pg[max+2],1;
-    // the orientation of the polygon matters
-    A=pg[max-1]-pg[max],pg[max+1]-pg[max];
-    if (det(A)==4)
-    {
-      N=2,0,1,0,0,1,0,2,1;
-    }
-    else
-    {
-      N=0,2,1,0,0,1,2,0,1;
-    }
-  }
-  // Case 10:
-  if (sbd==intvec(2,2,3,4))
-  {
-    // the orientation of the polygon matters
-    if (tboundary[max+1]==3)
-    {
-      N=3,0,1,0,0,1,0,2,1;
-    }
-    else
-    {
-      N=0,0,1,3,0,1,2,1,1;
-    }
-  }
-  // Case 11:
-  if (sbd==intvec(2,3,3,4))
-  {
-    N=3,0,1,0,0,1,0,2,1;
-  }
-  // Case 12:
-  if (sbd==intvec(3,3,3,3))
-  {
-    N=2,0,1,0,0,1,0,2,1;
-  }
-  // Case 13:
-  if (sbd==intvec(2,2,2,2,2))
-  {
-    // compute the angles of the polygon vertices
-    intvec dt;
-    for (i=1;i<=5;i++)
-    {
-      A=pg[i]-pg[i+1],pg[i+2]-pg[i+1];
-      dt[i]=det(A);
-    }
-    dt[6]=dt[1];
-    // find the vertex to be mapped to (0,1)
-    max=1;
-    while ((dt[max]!=2) or (dt[max+1]!=2))
-    {
-      max++;
-    }
-    M=pg[max],1,pg[max+1],1,pg[max+2],1;
-    N=0,1,1,1,2,1,2,1,1;
-  }
-  // Case 14:
-  if (sbd==intvec(2,2,2,2,3))
-  {
-    N=2,0,1,0,0,1,0,1,1;
-  }
-  // Case 15:
-  if (sbd==intvec(2,2,2,3,3))
-  {
-    // find the vertix to be mapped to (2,0)
-    if (tboundary[max+1]!=3)
-    {
-      max=5;
-      M=pg[max],1,pg[max+1],1,pg[max+2],1;
-    }
-    N=2,0,1,0,0,1,0,2,1;
-  }
-  // Case 16:
-  if (sbd==intvec(2,2,2,2,2,2))
-  {
-    N=2,0,1,1,0,1,0,1,1;
-  }
-  // we have to transpose the matrices M and N
-  M=transpose(M);
-  N=transpose(N);
-  // compute the unimodular affine transformation, which is of the form
-  // A11 A12 | T1
-  // A21 A22 | T2
-  //  0   0  | 1
-  T=matrixtointmat(N*inverse(M));
-  // the upper-left 2x2-block is A
-  A=T[1..2,1..2];
-  // the upper-right 2x1-block is the translation vector
-  trans=T[1,3],T[2,3];
-  // transform now the lattice points of the polygon with respect to A and T
-  list nf;
-  for (i=1;i<=size(polygon);i++)
-  {
-    intmat V[2][1]=polygon[i];
-    V=A*V;
-    nf[i]=intvec(V[1,1]+trans[1],V[2,1]+trans[2]);
-    kill V;
-  }
-  return(list(findOrientedBoundary(nf)[2],A,trans,nf));
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   ring r=0,(x,y),dp;
-   // the Newton polygon of the following polynomial
-   //     has precisely one interior point
-   poly f=x22y11+x19y10+x17y9+x16y9+x12y7+x9y6+x7y5+x2y3;
-   list polygon=newtonPolytopeLP(f);
-   // its lattice points are
-   polygon;
-   // find its normal form
-   list nf=ellipticNF(polygon);
-   // the vertices of the normal form are
-   nf[1];
-   // it has been transformed by the unimodular affine transformation A*x+v
-   // with matrix A
-   nf[2];
-   // and translation vector v
-   nf[3];
-   // the 3rd lattice point ...
-   polygon[3];
-   // ... has been transformed to
-   nf[4][3];
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-proc ellipticNFDB (int n,list #)
-"USAGE:  ellipticNFDB(n[,#]);   n int, # list
-ASSUME:  n is an integer between 1 and 16
-PURPOSE: this is a database storing the 16 normal forms of planar polygons with
-         precisely one interior point up to unimodular affine transformations
-@*       (see e.g. Bjorn Poonen, Fernando Rodriguez-Villegas: Lattice Polygons
-                   and the number 12.  Amer. Math. Monthly  107  (2000),  no. 3,
-                   238--250.)
-RETURN:  list, L such that
-@*             L[1] : list whose entries are the vertices of the nth normal form
-@*             L[2] : list whose entries are all the lattice points of the
-                      nth normal form
-@*             L[3] : only present if the optional parameter # is present, and
-                      then it is a polynomial in the variables (x,y) whose
-                      Newton polygon is the nth normal form
-NOTE:    the optional parameter is only allowed if the basering has the
-         variables x and y
-EXAMPLE: example ellipticNFDB;   shows an example"
-{
-  if ((n<1) or (n>16))
-  {
-    ERROR("n is not between 1 and 16.");
-  }
-  if (size(#)>0)
-  {
-    if ((defined(x)==0) or (defined(y)==0))
-    {
-      ERROR("The variables x and y are not defined.");
-    }
-  }
-  if ((defined(x)==0) or (defined(y)==0))
-  {
-    ring nfring=0,(x,y),dp;
-  }
-  // store the normal forms as polynomials
-  list nf=x2+y+xy2,x2+x+1+xy2,x3+x2+x+1+y2+y,x4+x3+x2+x+1+y2+y+x2y,x3+x2+x+1+x2y+y+xy2+y2+y3,
-    x2+x+x2y+y2,x2y+x+y+xy2,x2+x+1+y+xy2,x2+x+1+y+xy2+y2,x3+x2+x+1+x2y+y+y2,x3+x2+x+1+x2y+y+xy2+y2,
-    x2+x+1+x2y+y+x2y2+xy2+y2,x+1+x2y+y+xy2,x2+x+1+x2y+y+xy2,x2+x+1+x2y+y+xy2+y2,x2+x+x2y+y+xy2+y2;
-  list pg=newtonPolytopeLP(nf[n]);
-  if (size(#)==0)
-  {
-    return(list(findOrientedBoundary(pg)[2],pg));
-  }
-  else
-  {
-    return(list(findOrientedBoundary(pg)[2],pg,nf[n]));
-  }
-}
-example
-{
-   "EXAMPLE:";
-   echo=2;
-   list nf=ellipticNFDB(5);
-   // the vertices of the 5th normal form are
-   nf[1];
-   // its lattice points are
-   nf[2];
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////
-/// AUXILARY PROCEDURES
-/////////////////////////////////////////////////////////////////////////////////
-
-proc polymakeKeepTmpFiles (int i)
-"USAGE:  polymakeKeepTmpFiles(int i);   i int
-PURPOSE: some procedures create files in the directory /tmp which are used for
-         computations with polymake respectively topcom; these will be removed
-         when the corresponding procedure is left; however, it might be
-         desireable to keep them for further computations with either polymake or
-         topcom; this can be achieved by this procedure; call the procedure as:
-@*       - polymakeKeepTmpFiles(1); - then the files will be kept
-@*       - polymakeKeepTmpFiles(0); - then files will be removed in the future
-RETURN:  none"
-{
-  if ((i==1) and (defined(polymakekeeptmpfiles)==0))
-  {
-    int polymakekeeptmpfiles;
-    export(polymakekeeptmpfiles);
-  }
-  if (i!=1)
-  {
-    if (defined(polymakekeeptmpfiles))
-    {
-      kill polymakekeeptmpfiles;
-    }
-  }
-}
-
-
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-/// AUXILARY PROCEDURES, WHICH ARE DECLARED STATIC
-/////////////////////////////////////////////////////////////////////////////////
-/////////////////////////////////////////////////////////////////////////////////
-/// - scalarproduct
-/// - intmatcoldelete
-/// - intmatconcat
-/// - sortlist
-/// - minInList
-/// - stringdelete
-/// - abs
-/// - commondenominator
-/// - maxPosInIntvec
-/// - maxPosInIntmat
-/// - sortintvec
-/// - matrixtointmat
-/////////////////////////////////////////////////////////////////////////////////
-
-static proc scalarproduct (intvec w,intvec v)
-"USAGE:      scalarproduct(w,v); w,v intvec
-ASSUME:      w and v are integer vectors of the same length
-RETURN:      int, the scalarproduct of v and w
-NOTE:        the procedure is called by findOrientedBoundary"
-{
-  int sp;
-  for (int i=1;i<=size(w);i++)
-  {
-    sp=sp+v[i]*w[i];
-  }
-  return(sp);
-}
-
-static proc intmatcoldelete (intmat w,int i)
-"USAGE:      intmatcoldelete(w,i); w intmat, i int
-RETURN:      intmat, the integer matrix w with the ith comlumn deleted
-NOTE:        the procedure is called by intmatsort and normalFan"
-{
-  if ((i<1) or (i>ncols(w)) or (ncols(w)==1))
-  {
-    return(w);
-  }
-  if (i==1)
-  {
-    intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),2..ncols(w)];
-    return(M);
-  }
-  if (i==ncols(w))
-  {
-    intmat M[nrows(w)][ncols(w)-1]=w[1..nrows(w),1..ncols(w)-1];
-    return(M);
-  }
-  else
-  {
-    intmat M[nrows(w)][i-1]=w[1..nrows(w),1..i-1];
-    intmat N[nrows(w)][ncols(w)-i]=w[1..nrows(w),i+1..ncols(w)];
-    return(intmatconcat(M,N));
-  }
-}
-
-static proc intmatconcat (intmat M,intmat N)
-"USAGE:      intmatconcat(M,N); M,N intmat
-RETURN:      intmat, M and N concatenated
-NOTE:        the procedure is called by intmatcoldelete and sortintmat"
-{
-  if (nrows(M)>=nrows(N))
-  {
-    int m=nrows(M);
-
-  }
-  else
-  {
-    int m=nrows(N);
-  }
-  intmat P[m][ncols(M)+ncols(N)];
-  P[1..nrows(M),1..ncols(M)]=M[1..nrows(M),1..ncols(M)];
-  P[1..nrows(N),ncols(M)+1..ncols(M)+ncols(N)]=N[1..nrows(N),1..ncols(N)];
-  return(P);
-}
-
-static proc sortlist (list v,int pos)
-"USAGE:      sortlist(v,pos); v list, pos int
-RETURN:      list, the list L ordered in an ascending way according to the pos-th entries
-NOTE:        called by tropicalCurve"
-{
-  if(size(v)==1)
-  {
-    return(v);
-  }
-  list w=minInList(v,pos);
-  v=delete(v,w[2]);
-  v=sortlist(v,pos);
-  v=list(w[1])+v;
-  return(v);
-}
-
-static proc minInList (list v,int pos)
-"USAGE:      minInList(v,pos); v list, pos int
-RETURN:      list, (v[i],i) such that v[i][pos] is minimal
-NOTE:        called by sortlist"
-{
-  int min=v[1][pos];
-  int minpos=1;
-  for (int i=2;i<=size(v);i++)
-  {
-    if (v[i][pos]<min)
-    {
-      min=v[i][pos];
-      minpos=i;
-    }
-  }
-  return(list(v[minpos],minpos));
-}
-
-static proc stringdelete (string w,int i)
-"USAGE:      stringdelete(w,i); w string, i int
-RETURN:      string, the string w with the ith component deleted
-NOTE:        the procedure is called by texnumber and choosegfanvector"
-{
-  if ((i>size(w)) or (i<=0))
-  {
-    return(w);
-  }
-  if ((size(w)==1) and (i==1))
-  {
-    return("");
-
-  }
-  if (i==1)
-  {
-    return(w[2..size(w)]);
-  }
-  if (i==size(w))
-  {
-    return(w[1..size(w)-1]);
-  }
-  else
-  {
-    string erg=w[1..i-1],w[i+1..size(w)];
-    return(erg);
-  }
-}
-
-static proc abs (def n)
-"USAGE:      abs(n); n poly or int
-RETURN:      poly or int, the absolute value of n"
-{
-  if (n>=0)
-  {
-    return(n);
-  }
-  else
-  {
-    return(-n);
-  }
-}
-
-static proc commondenominator (matrix M)
-"USAGE:   commondenominator(M);  M matrix
-ASSUME:   the base ring has characteristic zero
-RETURN:   int, the lowest common multiple of the denominators of the leading coefficients
-               of the entries in M
-NOTE:        the procedure is called from polymakeToIntmat"
-{
-  int i,j;
-  int kgV=1;
-  // successively build the lowest common multiple of the denominators of the leading coefficients
-  // of the entries in M
-  for (i=1;i<=nrows(M);i++)
-  {
-    for (j=1;j<=ncols(M);j++)
-    {
-      kgV=lcm(kgV,int(denominator(leadcoef(M[i,j]))));
-    }
-  }
-  return(kgV);
-}
-
-static proc maxPosInIntvec (intvec v)
-"USAGE:      maxPosInIntvec(v); v intvec
-RETURN:      int, the first position of a maximal entry in v
-NOTE:        called by sortintmat"
-{
-  int max=v[1];
-  int maxpos=1;
-  for (int i=2;i<=size(v);i++)
-  {
-    if (v[i]>max)
-    {
-      max=v[i];
-      maxpos=i;
-    }
-  }
-  return(maxpos);
-}
-
-static proc maxPosInIntmat (intmat v)
-"USAGE:      maxPosInIntmat(v); v intmat
-ASSUME:      v has a unique maximal entry
-RETURN:      intvec, the position (i,j) of the maximal entry in v
-NOTE:        called by findOrientedBoundary"
-{
-  int max=v[1,1];
-  intvec maxpos=1,1;
-  int i,j;
-  for (i=1;i<=nrows(v);i++)
-  {
-    for (j=1;j<=ncols(v);j++)
-    {
-      if (v[i,j]>max)
-      {
-        max=v[i,j];
-        maxpos=i,j;
-      }
-    }
-  }
-  return(maxpos);
-}
-
-static proc sortintvec (intvec w)
-"USAGE:      sortintvec(v); v intvec
-RETURN:      intvec, the entries of v are ordered in an ascending way
-NOTE:        called from ellipticNF"
-{
-  int j,k,stop;
-  intvec v=w[1];
-  for (j=2;j<=size(w);j++)
-  {
-    k=1;
-    stop=0;
-    while ((k<=size(v)) and (stop==0))
-    {
-      if (v[k]<w[j])
-      {
-        k++;
-      }
-      else
-      {
-        stop=1;
-      }
-    }
-    if (k==size(v)+1)
-    {
-      v=v,w[j];
-    }
-    else
-    {
-      if (k==1)
-      {
-        v=w[j],v;
-      }
-      else
-      {
-        v=v[1..k-1],w[j],v[k..size(v)];
-      }
-    }
-  }
-  return(v);
-}
-
-static proc sortlistbyintvec (list L,intvec w)
-"USAGE:      sortlistbyintvec(L,w); L list, w intvec
-RETURN:      list, the entries of L are ordered such that the corresponding reordering of
-                   w would order w in an ascending way
-NOTE:        called from ellipticNF"
-{
-  int j,k,stop;
-  intvec v=w[1];
-  list LL=L[1];
-  for (j=2;j<=size(w);j++)
-  {
-    k=1;
-    stop=0;
-    while ((k<=size(v)) and (stop==0))
-    {
-      if (v[k]<w[j])
-      {
-        k++;
-      }
-      else
-      {
-        stop=1;
-      }
-    }
-    if (k==size(v)+1)
-    {
-      v=v,w[j];
-      LL=insert(LL,L[j],size(LL));
-    }
-    else
-    {
-      if (k==1)
-      {
-        v=w[j],v;
-        LL=insert(LL,L[j]);
-      }
-      else
-      {
-        v=v[1..k-1],w[j],v[k..size(v)];
-        LL=insert(LL,L[j],k-1);
-      }
-    }
-  }
-  return(LL);
-}
-
-static proc matrixtointmat (matrix MM)
-"USAGE:      matrixtointmat(v); MM matrix
-ASSUME:      MM is a matrix with only integers as entries
-RETURN:      intmat, the matrix MM has been transformed to type intmat
-NOTE:        called from ellipticNF"
-{
-  intmat M[nrows(MM)][ncols(MM)]=M;
-  int i,j;
-  for (i=1;i<=nrows(M);i++)
-  {
-    for (j=1;j<=ncols(M);j++)
-    {
-      execute("M["+string(i)+","+string(j)+"]="+string(MM[i,j])+";");
-    }
-  }
-  return(M);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-static proc polygonToCoordinates (list points)
-"USAGE:      polygonToCoordinates(points);   points list
-ASSUME:      points is a list of integer vectors each of size two describing the
-             marked points of a convex lattice polygon like the output of
-             polygonDB
-RETURN:      list, the first entry is a string representing the coordinates
-                   corresponding to the latticpoints seperated by commata
-                   the second entry is a list where the ith entry is a string
-                   representing the coordinate of corresponding to the ith
-                   lattice point the third entry is the latex format of the
-                   first entry
-NOTE:        the procedure is called by fan"
-{
-  string coord;
-  list coords;
-  string latex;
-  for (int i=1;i<=size(points);i++)
-  {
-    coords[i]="u"+string(points[i][1])+string(points[i][2]);
-    coord=coord+coords[i]+",";
-    latex=latex+"u_{"+string(points[i][1])+string(points[i][2])+"},";
-  }
-  coord=coord[1,size(coord)-1];
-  latex=latex[1,size(latex)-1];
-  return(list(coord,coords,latex));
-}
diff --git a/Singular/bbcone.cc b/Singular/bbcone.cc
deleted file mode 100644
index 4fa0517..0000000
--- a/Singular/bbcone.cc
+++ /dev/null
@@ -1,1271 +0,0 @@
-#include <Singular/mod2.h>
-
-#ifdef HAVE_FANS
-
-#include <Singular/ipid.h>
-#include <Singular/blackbox.h>
-#include <omalloc/omalloc.h>
-#include <kernel/febase.h>
-#include <kernel/longrat.h>
-#include <Singular/subexpr.h>
-#include <gfanlib/gfanlib.h>
-#include <Singular/ipshell.h>
-#include <kernel/intvec.h>
-#include <sstream>
-
-#include <kernel/bbcone.h>
-#include <kernel/bbfan.h>
-#include <kernel/bbpolytope.h>
-
-int coneID;
-
-int integerToInt(gfan::Integer const &V, bool &ok)
-{
-  mpz_t v;
-  mpz_init(v);
-  V.setGmp(v);
-  int ret=0;
-  if(mpz_fits_sint_p(v))
-    ret=mpz_get_si(v);
-  else
-    ok=false;
-  mpz_clear(v);
-  return ret;
-}
-
-intvec* zVector2Intvec(const gfan::ZVector zv)
-{
-  int d=zv.size();
-  intvec* iv = new intvec(1, d, 0);
-  bool ok = true;
-  for(int i=1;i<=d;i++)
-    IMATELEM(*iv, 1, i) = integerToInt(zv[i-1], ok);
-  if (!ok) WerrorS("overflow while converting a gfan::ZVector to an intvec");
-  return iv;
-}
-
-intvec* zMatrix2Intvec(const gfan::ZMatrix zm)
-{
-  int d=zm.getHeight();
-  int n=zm.getWidth();
-  intvec* iv = new intvec(d, n, 0);
-  bool ok = true;
-  for(int i=1;i<=d;i++)
-    for(int j=1;j<=n;j++)
-      IMATELEM(*iv, i, j) = integerToInt(zm[i-1][j-1], ok);
-  if (!ok) WerrorS("overflow while converting a gfan::ZMatrix to an intmat");
-  return iv;
-}
-
-gfan::ZMatrix intmat2ZMatrix(const intvec* iMat)
-{
-  int d=iMat->rows();
-  int n=iMat->cols();
-  gfan::ZMatrix ret(d,n);
-  for(int i=0;i<d;i++)
-    for(int j=0;j<n;j++)
-      ret[i][j]=IMATELEM(*iMat, i+1, j+1);
-  return ret;
-}
-
-/* expects iMat to have just one row */
-gfan::ZVector intvec2ZVector(const intvec* iVec)
-{
-  int n =iVec->rows();
-  gfan::ZVector ret(n);
-  for(int j=0;j<n;j++)
-    ret[j]=IMATELEM(*iVec, j+1, 1);
-  return ret;
-}
-
-std::string toString(gfan::ZMatrix const &m, char *tab)
-{
-  std::stringstream s;
-
-  for(int i=0;i<m.getHeight();i++)
-    {
-      if(tab)s<<tab;
-      for(int j=0;j<m.getWidth();j++)
-	{
-	  s<<m[i][j];
-	  if(i+1!=m.getHeight() || j+1!=m.getWidth())
-	    {
-	      s<<",";
-	    }
-	}
-      s<<std::endl;
-    }
-  return s.str();
-}
-
-std::string toString(gfan::ZCone const &c)
-{
-  std::stringstream s;
-  gfan::ZMatrix i=c.getInequalities();
-  gfan::ZMatrix e=c.getEquations();
-  s<<"AMBIENT_DIM"<<std::endl;
-  s<<c.ambientDimension()<<std::endl;
-  s<<"INEQUALITIES"<<std::endl;
-  s<<toString(i);
-  s<<"EQUATIONS"<<std::endl;
-  s<<toString(e);
-  return s.str();
-}
-
-void *bbcone_Init(blackbox *b)
-{
-  return (void*)(new gfan::ZCone());
-}
-
-BOOLEAN bbcone_Assign(leftv l, leftv r)
-{
-  gfan::ZCone* newZc;
-  if (r==NULL)
-  { 
-    if (l->Data()!=NULL) 
-    {   
-      gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-      delete zd;
-    }
-    newZc = new gfan::ZCone();
-  }
-  else if (r->Typ()==l->Typ())
-  {
-    if (l->Data()!=NULL)
-    {   
-      gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-      delete zd;
-    }
-    gfan::ZCone* zc = (gfan::ZCone*)r->Data();
-    newZc = new gfan::ZCone(*zc);
-  }
-  else if (r->Typ()==INT_CMD)
-  {
-    int ambientDim = (int)(long)r->Data();
-    if (ambientDim < 0)
-    {
-      Werror("expected an int >= 0, but got %d", ambientDim);
-      return TRUE;
-    }
-    if (l->Data()!=NULL)
-    {   
-      gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-      delete zd;
-    }
-    newZc = new gfan::ZCone(ambientDim);
-  }
-  else
-  {
-    Werror("assign Type(%d) = Type(%d) not implemented",l->Typ(),r->Typ());
-    return TRUE;
-  }
- 
-  if (l->rtyp==IDHDL)
-  {
-    IDDATA((idhdl)l->data)=(char *)newZc;
-  }
-  else
-  {
-    l->data=(void *)newZc;
-  }
-  return FALSE;
-}
-
-char * bbcone_String(blackbox *b, void *d)
-{ if (d==NULL) return omStrDup("invalid object");
-   else
-   {
-     std::string s=toString(*((gfan::ZCone*)d));
-     return omStrDup(s.c_str());
-   }
-}
-
-void bbcone_destroy(blackbox *b, void *d)
-{
-  if (d!=NULL)
-  {
-    gfan::ZCone* zc = (gfan::ZCone*) d;
-    delete zc;
-  }
-}
-
-void * bbcone_Copy(blackbox*b, void *d)
-{       
-  gfan::ZCone* zc = (gfan::ZCone*)d;
-  gfan::ZCone* newZc = new gfan::ZCone(*zc);
-  return newZc;
-}
-
-static BOOLEAN jjCONERAYS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (cone = convex hull of the half-lines; note: there may be
-     entire lines in the cone);
-     valid parametrizations: (intmat) */
-  intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN jjCONERAYS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from half-lines,
-     and lines (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines; the second argument may contain or entirely consist
-     of zero rows);
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
-  if (rays->cols() != linSpace->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           rays->cols(), linSpace->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm1, zm2);
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN jjCONERAYS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from half-lines,
-     and lines (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines), and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then the lineality space is known
-     to be the span of the provided lines;
-     if the 2^1-bit of k is set, then the extreme rays are known:
-     each half-line spans a (different) extreme ray */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
-  if (rays->cols() != linSpace->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           rays->cols(), linSpace->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm1, zm2);
-  //k should be passed on to zc; not available yet
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN coneViaRays(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return jjCONERAYS1(res, u);
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-    {
-      if (v->next == NULL) return jjCONERAYS2(res, u, v);
-      leftv w = v->next;
-      if ((w != NULL) && (w->Typ() == INT_CMD))
-      {
-        if (w->next == NULL) return jjCONERAYS3(res, u, v, w);
-      }
-    }
-  }
-  WerrorS("coneViaRays: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN qqCONERAYS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (cone = convex hull of the half-lines; note: there may be
-     entire lines in the cone);
-     valid parametrizations: (intmat) */
-  intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN qqCONERAYS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from half-lines,
-     and lines (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines; the second argument may contain or entirely consist
-     of zero rows);
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
-  if (rays->cols() != linSpace->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           rays->cols(), linSpace->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm1, zm2);
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN qqCONERAYS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from half-lines,
-     and lines (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines), and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then the lineality space is known
-     to be the span of the provided lines;
-     if the 2^1-bit of k is set, then the extreme rays are known:
-     each half-line spans a (different) extreme ray */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* linSpace = (intvec *)v->CopyD(INTVEC_CMD);
-  if (rays->cols() != linSpace->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           rays->cols(), linSpace->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(rays);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(linSpace);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm1, zm2);
-  //k should be passed on to zc; not available yet
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN quickConeViaRays(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return qqCONERAYS1(res, u);
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-    {
-      if (v->next == NULL) return qqCONERAYS2(res, u, v);
-      leftv w = v->next;
-      if ((w != NULL) && (w->Typ() == INT_CMD))
-      {
-        if (w->next == NULL) return qqCONERAYS3(res, u, v, w);
-      }
-    }
-  }
-  WerrorS("quickConeViaRays: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN jjCONENORMALS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from inequalities;
-     valid parametrizations: (intmat) */
-  intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(inequs);
-  gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN jjCONENORMALS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from iequalities,
-     and equations (...)
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN jjCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from inequalities, equations,
-     and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then ... */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
-  zc->canonicalize();
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN coneViaNormals(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return jjCONENORMALS1(res, u);
-  }
-  leftv v = u->next;
-  if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-  {
-    if (v->next == NULL) return jjCONENORMALS2(res, u, v);
-  }
-  leftv w = v->next;
-  if ((w != NULL) && (w->Typ() == INT_CMD))
-  {
-    if (w->next == NULL) return jjCONENORMALS3(res, u, v, w);
-  }
-  WerrorS("coneViaNormals: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN qqCONENORMALS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from inequalities;
-     valid parametrizations: (intmat) */
-  intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(inequs);
-  gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN qqCONENORMALS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from iequalities,
-     and equations (...)
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN qqCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from inequalities, equations,
-     and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then ... */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
-  res->rtyp = coneID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN quickConeViaNormals(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return qqCONENORMALS1(res, u);
-  }
-  leftv v = u->next;
-  if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-  {
-    if (v->next == NULL) return qqCONENORMALS2(res, u, v);
-  }
-  leftv w = v->next;
-  if ((w != NULL) && (w->Typ() == INT_CMD))
-  {
-    if (w->next == NULL) return qqCONENORMALS3(res, u, v, w);
-  }
-  WerrorS("quickConeViaNormals: unexpected parameters");
-  return TRUE;
-}
-
-
-BOOLEAN getInequalities(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    
-    gfan::ZMatrix zmat = zc->getInequalities();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getInequalities: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getEquations(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->getEquations();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getEquations: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getFacetNormals(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->getFacets();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == polytopeID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      res->rtyp = INTMAT_CMD;
-      res->data = (void*)getFacetNormals(zc);
-      return FALSE;
-    }
-  WerrorS("getFacetNormals: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getImpliedEquations(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->getImpliedEquations();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getImpliedEquations: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getGeneratorsOfSpan(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->generatorsOfSpan();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getGeneratorsOfSpan: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getGeneratorsOfLinealitySpace(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->generatorsOfLinealitySpace();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getGeneratorsOfLinealitySpace: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getRays(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->extremeRays();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getRays: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getQuotientLatticeBasis(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->quotientLatticeBasis();
-    res->rtyp = INTMAT_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getQuotientLatticeBasis: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getLinearForms(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix zmat = zc->getLinearForms();
-    res->rtyp = INTVEC_CMD;
-    res->data = (void*)zMatrix2Intvec(zmat);
-    return FALSE;
-  }
-  WerrorS("getLinearForms: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getAmbientDimension(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) zc->ambientDimension();
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) getAmbientDimension(zf);
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == polytopeID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) getAmbientDimension(zc);
-    return FALSE;
-  }
-  WerrorS("getAmbientDimension: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getDimension(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) zc->dimension();
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) getDimension(zf);
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == polytopeID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) getDimension(zc);
-    return FALSE;
-  }
-  WerrorS("getDimension: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getCodimension(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == coneID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) zc->codimension();
-      return FALSE;
-    }
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) getCodimension(zf);
-      return FALSE;
-    }
-  if ((u != NULL) && (u->Typ() == polytopeID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) getCodimension(zc);
-      return FALSE;
-    }
-  WerrorS("getCodimension: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getLinealityDimension(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) zc->dimensionOfLinealitySpace();
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-    res->rtyp = INT_CMD;
-    res->data = (char*) getLinealityDimension(zf);
-    return FALSE;
-  }
-  WerrorS("getLinealityDimension: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getMultiplicity(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    bool ok = true;
-    int i = integerToInt(zc->getMultiplicity(), ok);
-    if (!ok)
-      WerrorS("overflow while converting a gfan::Integer to an int");
-    res->rtyp = INT_CMD;
-    res->data = (void*) i;
-    return FALSE;
-  }
-  WerrorS("getMultiplicity: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN isOrigin(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    int i = zc->isOrigin() ? 1 : 0;
-    res->rtyp = INT_CMD;
-    res->data = (void*) i;
-    return FALSE;
-  }
-  WerrorS("isOrigin: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN isFullSpace(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    int i = zc->isFullSpace() ? 1 : 0;
-    res->rtyp = INT_CMD;
-    res->data = (void*) i;
-    return FALSE;
-  }
-  WerrorS("isFullSpace: unexpected parameters");
-  return TRUE;
-}
-
-int isSimplicial(gfan::ZCone* zc)
-{
-  int i = zc->isSimplicial() ? 1 : 0;
-  return i;
-}
-
-BOOLEAN containsPositiveVector(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    int i = zc->containsPositiveVector() ? 1 : 0;
-    res->rtyp = INT_CMD;
-    res->data = (void*) i;
-    return FALSE;
-  }
-  WerrorS("containsPositiveVector: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getLinealitySpace(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZCone* zd = new gfan::ZCone(zc->linealitySpace());
-    res->rtyp = coneID;
-    res->data = (void*) zd;
-    return FALSE;
-  }
-  WerrorS("getLinealitySpace: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getDualCone(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZCone* zd = new gfan::ZCone(zc->dualCone());
-    res->rtyp = coneID;
-    res->data = (void*) zd;
-    return FALSE;
-  }
-  WerrorS("getDualCone: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getNegated(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZCone* zd = new gfan::ZCone(zc->negated());
-    res->rtyp = coneID;
-    res->data = (void*) zd;
-    return FALSE;
-  }
-  WerrorS("getNegated: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getSemigroupGenerator(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    int d = zc->dimension();
-    int dLS = zc->dimensionOfLinealitySpace();
-    if (d == dLS + 1)
-    {
-      gfan::ZVector zv = zc->semiGroupGeneratorOfRay();
-      res->rtyp = INTVEC_CMD;
-      res->data = (void*) zVector2Intvec(zv);
-      return FALSE;
-    }
-    else
-    {
-      Werror("expected dim of cone one larger than dim of lin space\n"
-             "but got dimensions %d and %d", d, dLS);
-    }
-  }
-  WerrorS("getSemigroupGenerator: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getRelativeInteriorPoint(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZVector zv = zc->getRelativeInteriorPoint();
-    res->rtyp = INTVEC_CMD;
-    res->data = (void*) zVector2Intvec(zv);
-    return FALSE;
-  }
-  WerrorS("getRelativeInteriorPoint: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getUniquePoint(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZVector zv = zc->getUniquePoint();
-    res->rtyp = INTVEC_CMD;
-    res->data = (void*) zVector2Intvec(zv);
-    return FALSE;
-  }
-  WerrorS("getUniquePoint: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN setMultiplicity(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INT_CMD))
-    {
-      int val = (int)(long)v->Data();
-      zc->setMultiplicity(gfan::Integer(val));
-      res->rtyp = NONE;
-      res->data = NULL;
-      return FALSE;
-    }
-  }
-  WerrorS("setMultiplicity: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN setLinearForms(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INTVEC_CMD))
-    {
-      intvec* mat = (intvec*)v->Data();
-      gfan::ZMatrix zm = intmat2ZMatrix(mat);
-      zc->setLinearForms(zm);
-      res->rtyp = NONE;
-      res->data = NULL;
-      return FALSE;
-    }
-  }
-  WerrorS("setLinearForms: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN intersectCones(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
-      gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
-      int d1 = zc1->ambientDimension();
-      int d2 = zc2->ambientDimension();
-      if (d1 != d2)
-        Werror("expected ambient dims of both cones to coincide\n"
-               "but got %d and %d", d1, d2);
-      gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
-      zc3.canonicalize();
-      res->rtyp = coneID;
-      res->data = (void *)new gfan::ZCone(zc3);
-      return FALSE;
-    }
-  }
-  WerrorS("intersectCones: unexpected parameters");
-  return TRUE;
-}
-
-// BOOLEAN takeUnion(leftv res, leftv args)
-// {
-//   leftv u = args;
-//   std::cout << u->Typ() << (u != NULL) << std::endl;
-//   if ((u != NULL) && (u->Typ() == coneID))
-//   {
-//     leftv v = u->next;
-//     std::cout << v->Typ() << (v != NULL) << std::endl;
-//     if ((v != NULL) && (v->Typ() == coneID))
-//     {
-//       gfan::ZCone* zc1 = (gfan::ZCone*)u->Data();
-//       gfan::ZCone* zc2 = (gfan::ZCone*)v->Data();
-//       int d1 = zc1->ambientDimension();
-//       int d2 = zc2->ambientDimension();
-//       if (d1 != d2)
-//         Werror("expected ambient dims of both cones to coincide\n"
-//                "but got %d and %d", d1, d2);
-//       gfan::ZCone zc3 = gfan::intersection(*zc1, *zc2);
-//       zc3.canonicalize();
-//       if (zc1->hasFace(zc3) && zc2->hasFace(zc3))
-//       {
-// 	gfan::ZMatrix zm1 = zc1->extremeRays();
-// 	gfan::ZMatrix zm2 = zc2->extremeRays();
-// 	gfan::ZMatrix zm11 = zc1->generatorsOfLinealitySpace();
-// 	gfan::ZMatrix zm22 = zc2->generatorsOfLinealitySpace();
-// 	gfan::ZMatrix zm = combineOnTop(combineOnTop(combineOnTop(zm1,zm2),zm11),zm22);
-//         gfan::ZCone* zc = new gfan::ZCone();
-//         *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-//         res->rtyp = coneID;
-//         res->data = (char*) zc;
-//         return FALSE;
-//       }
-//       WerrorS("takeUnion: cones do not share common edge");
-//     }
-//   }
-//   WerrorS("takeUnion: unexpected parameters");
-//   return TRUE;
-// }
-
-BOOLEAN coneLink(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INTVEC_CMD))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      intvec* iv = (intvec*)v->Data();
-      gfan::ZVector zv= intvec2ZVector(iv);
-      int d1 = zc->ambientDimension();
-      int d2 = zv.size();
-      if (d1 != d2)
-        Werror("expected ambient dim of cone and size of vector\n"
-               "to be equal but got %d and %d", d1, d2);
-      if(!zc->contains(zv))
-      {
-        WerrorS("the provided intvec does not lie in the cone");
-      }
-      res->rtyp = coneID;
-      res->data = (void *)new gfan::ZCone(zc->link(zv));
-      return FALSE;
-    }
-  }
-  WerrorS("coneLink: unexpected parameters");
-  return TRUE;
-}
-
-bool containsInSupport(gfan::ZCone* zc, gfan::ZCone* zd)
-{
-  int d1 = zc->ambientDimension();
-  int d2 = zd->ambientDimension();
-  if (d1 == d2)
-    return (zc->contains(*zd) ? 1 : 0);
-  Werror("expected cones with same ambient dimensions\n but got"
-         " dimensions %d and %d", d1, d2);
-}
-
-bool containsInSupport(gfan::ZCone* zc, intvec* vec)
-{
-  gfan::ZVector zv = intvec2ZVector(vec);
-  int d1 = zc->ambientDimension();
-  int d2 = zv.size();
-  if (d1 == d2)
-    return (zc->contains(zv) ? 1 : 0);
-  Werror("expected ambient dim of cone and size of vector\n"
-         "to be equal but got %d and %d", d1, d2);
-}
-
-BOOLEAN containsRelatively(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INTVEC_CMD))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      intvec* vec = (intvec*)v->Data();
-      gfan::ZVector zv = intvec2ZVector(vec);
-      int d1 = zc->ambientDimension();
-      int d2 = zv.size();
-      if (d1 == d2)
-      {
-        res->rtyp = INT_CMD;
-        res->data = (void *)(zc->containsRelatively(zv) ? 1 : 0);
-        return FALSE;
-      }
-      Werror("expected ambient dim of cone and size of vector\n"
-             "to be equal but got %d and %d", d1, d2);     
-    }
-  }
-  WerrorS("containsRelatively: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN hasFace(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      gfan::ZCone* zd = (gfan::ZCone*)v->Data();
-      bool b = zc->hasFace(*zd);
-      int bb = (int) b;
-      res->rtyp = INT_CMD;
-      res->data = (char*) bb;
-      return FALSE;
-    }
-  }
-  WerrorS("hasFace: unexpected parameters");
-  return TRUE;  
-}
-
-BOOLEAN canonicalizeCone(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZCone* zd = new gfan::ZCone(*zc);
-    zd->canonicalize();
-    res->rtyp = coneID;
-    res->data = (char*) zd;
-    return FALSE;
-  }
-}
-
-void bbcone_setup()
-{
-  blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
-  // all undefined entries will be set to default in setBlackboxStuff
-  // the default Print is quite usefule,
-  // all other are simply error messages
-  b->blackbox_destroy=bbcone_destroy;
-  b->blackbox_String=bbcone_String;
-  //b->blackbox_Print=blackbox_default_Print;
-  b->blackbox_Init=bbcone_Init;
-  b->blackbox_Copy=bbcone_Copy;
-  b->blackbox_Assign=bbcone_Assign;
-  iiAddCproc("","canonicalizeCone",FALSE,canonicalizeCone);
-  iiAddCproc("","coneViaRays",FALSE,coneViaRays);
-  iiAddCproc("","coneViaNormals",FALSE,coneViaNormals);
-  iiAddCproc("","quickConeViaRays",FALSE,quickConeViaRays);
-  iiAddCproc("","quickConeViaNormals",FALSE,quickConeViaNormals);
-  iiAddCproc("","intersectCones",FALSE,intersectCones);
-  // iiAddCproc("","takeUnion",FALSE,takeUnion);
-  iiAddCproc("","coneLink",FALSE,coneLink);
-  // iiAddCproc("","contains",FALSE,contains);
-  iiAddCproc("","containsRelatively",FALSE,containsRelatively);
-  iiAddCproc("","getRays",FALSE,getRays);
-  iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
-  iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
-  iiAddCproc("","getLinearForms",FALSE,getLinearForms);
-  iiAddCproc("","setLinearForms",FALSE,setLinearForms);
-  iiAddCproc("","getInequalities",FALSE,getInequalities);
-  iiAddCproc("","getEquations",FALSE,getEquations);
-  iiAddCproc("","getGeneratorsOfSpan",FALSE,getGeneratorsOfSpan);
-  iiAddCproc("","getGeneratorsOfLinealitySpace",FALSE,getGeneratorsOfLinealitySpace);
-  iiAddCproc("","getFacetNormals",FALSE,getFacetNormals);
-  iiAddCproc("","getImpliedEquations",FALSE,getImpliedEquations);
-  iiAddCproc("","getRelativeInteriorPoint",FALSE,getRelativeInteriorPoint);
-  iiAddCproc("","getAmbientDimension",FALSE,getAmbientDimension);
-  iiAddCproc("","getCodimension",FALSE,getCodimension);
-  iiAddCproc("","getDimension",FALSE,getDimension);
-  iiAddCproc("","getLinealityDimension",FALSE,getLinealityDimension);
-  iiAddCproc("","isOrigin",FALSE,isOrigin);
-  iiAddCproc("","isFullSpace",FALSE,isFullSpace);
-  iiAddCproc("","containsPositiveVector",FALSE,containsPositiveVector);
-  iiAddCproc("","getLinealitySpace",FALSE,getLinealitySpace);
-  iiAddCproc("","getDualCone",FALSE,getDualCone);
-  iiAddCproc("","getNegated",FALSE,getNegated);
-  iiAddCproc("","getQuotientLatticeBasis",FALSE,getQuotientLatticeBasis);
-  iiAddCproc("","getSemigroupGenerator",FALSE,getSemigroupGenerator);
-  iiAddCproc("","getUniquePoint",FALSE,getUniquePoint);
-  // iiAddCproc("","faceContaining",FALSE,faceContaining);
-  iiAddCproc("","hasFace",FALSE,hasFace);
-  coneID=setBlackboxStuff(b,"cone");
-  //Print("created type %d (cone)\n",coneID); 
-}
-
-#endif
-/* HAVE_FANS */
diff --git a/Singular/bbfan.cc b/Singular/bbfan.cc
deleted file mode 100644
index 866a50d..0000000
--- a/Singular/bbfan.cc
+++ /dev/null
@@ -1,733 +0,0 @@
-#include <Singular/mod2.h>
-#ifdef HAVE_FANS
-
-#include <Singular/ipid.h>
-#include <Singular/blackbox.h>
-#include <omalloc/omalloc.h>
-#include <kernel/febase.h>
-#include <kernel/longrat.h>
-#include <Singular/subexpr.h>
-#include <kernel/bbfan.h>
-#include <kernel/bbcone.h>
-#include <Singular/ipshell.h>
-#include <kernel/intvec.h>
-#include <sstream>
-#include <gfanlib/gfanlib.h>
-
-int fanID;
-
-void *bbfan_Init(blackbox *b)
-{
-  return (void*)(new gfan::ZFan(0));
-}
-
-void bbfan_destroy(blackbox *b, void *d)
-{
-  if (d!=NULL)
-  {
-    gfan::ZFan* zf = (gfan::ZFan*) d;
-    delete zf;
-  }
-}
-
-char * bbfan_String(blackbox *b, void *d)
-{ 
-  if (d==NULL) return omStrDup("invalid object");
-  else
-  {
-    gfan::ZFan* zf = (gfan::ZFan*)d;
-    std::string s = zf->toString();
-    return omStrDup(s.c_str());
-  }
-}
-
-void * bbfan_Copy(blackbox*b, void *d)
-{       
-  gfan::ZFan* zf = (gfan::ZFan*)d;
-  gfan::ZFan* newZf = new gfan::ZFan(*zf);
-  return newZf;
-}
-
-BOOLEAN bbfan_Assign(leftv l, leftv r)
-{
-  gfan::ZFan* newZf;
-  if (r==NULL)
-  { 
-    if (l->Data()!=NULL) 
-    {   
-      gfan::ZFan* zd = (gfan::ZFan*)l->Data();
-      delete zd;
-    }
-    newZf = new gfan::ZFan(0);
-  }
-  else if (r->Typ()==l->Typ())
-  {
-    if (l->Data()!=NULL)
-    {   
-      gfan::ZFan* zd = (gfan::ZFan*)l->Data();
-      delete zd;
-    }
-    gfan::ZFan* zf = (gfan::ZFan*)r->Data();
-    newZf = new gfan::ZFan(*zf);
-  }
-  else if (r->Typ()==INT_CMD)
-  {
-    int ambientDim = (int)(long)r->Data();
-    if (ambientDim < 0)
-    {
-      Werror("expected an int >= 0, but got %d", ambientDim);
-      return TRUE;
-    }
-    if (l->Data()!=NULL)
-    {   
-      gfan::ZFan* zd = (gfan::ZFan*)l->Data();
-      delete zd;
-    }
-    newZf = new gfan::ZFan(ambientDim);
-  }
-  else
-  {
-    Werror("assign Type(%d) = Type(%d) not implemented",l->Typ(),r->Typ());
-    return TRUE;
-  }
- 
-  if (l->rtyp==IDHDL)
-  {
-    IDDATA((idhdl)l->data)=(char *)newZf;
-  }
-  else
-  {
-    l->data=(void *)newZf;
-  }
-  return FALSE;
-}
-
-/* returns 1 iff all rows consist of entries 1..n,
-   where n is the number of columns of the provided
-   intmat; 0 otherwise */
-static gfan::IntMatrix permutationIntMatrix(const intvec* iv)
-{
-        int cc = iv->cols();
-        int rr = iv->rows();
-        intvec* ivCopy = new intvec(rr, cc, 0);
-        for (int r = 1; r <= rr; r++)
-          for (int c = 1; c <= cc; c++)
-            IMATELEM(*ivCopy, r, c) = IMATELEM(*iv, r, c) - 1;
-        gfan::ZMatrix zm = intmat2ZMatrix(ivCopy);
-        gfan::IntMatrix* im = new gfan::IntMatrix(gfan::ZToIntMatrix(zm));
-        return *im;
-}
-static BOOLEAN jjFANEMPTY_I(leftv res, leftv v)
-{
-  int ambientDim = (int)(long)v->Data();
-  if (ambientDim < 0)
-  {
-    Werror("expected non-negative ambient dim but got %d", ambientDim);
-    return TRUE;
-  }
-  res->rtyp = fanID;
-  res->data = (char*)(new gfan::ZFan(ambientDim));
-  return FALSE;
-}
-
-static BOOLEAN jjFANEMPTY_IM(leftv res, leftv v)
-{
-  intvec* permutations = (intvec*)v->Data();
-  int ambientDim = permutations->cols();
-  gfan::IntMatrix im = permutationIntMatrix(permutations);
-  if (!gfan::Permutation::arePermutations(im))
-  {
-    Werror("provided intmat contains invalid permutations of {1, ..., %d}", ambientDim);
-    return TRUE;
-  }
-  gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
-  sg.computeClosure(im);
-  res->rtyp = fanID;
-  res->data = (char*)(new gfan::ZFan(sg));
-  return FALSE;
-}
-
-BOOLEAN emptyFan(leftv res, leftv args)
-{
-  leftv u = args;
-  if (u == NULL)
-  {
-    res->rtyp = fanID;
-    res->data = (void*)(new gfan::ZFan(0));
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == INT_CMD))
-  {
-    if (u->next == NULL) return jjFANEMPTY_I(res, u);
-  }
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return jjFANEMPTY_IM(res, u);
-  }
-  WerrorS("emptyFan: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN jjFANFULL_I(leftv res, leftv v)
-{
-  int ambientDim = (int)(long)v->Data();
-  if (ambientDim < 0)
-  {
-    Werror("expected non-negative ambient dim but got %d", ambientDim);
-    return TRUE;
-  }
-  gfan::ZFan* zf = new gfan::ZFan(gfan::ZFan::fullFan(ambientDim));
-  res->rtyp = fanID;
-  res->data = (char*)zf;
-  return FALSE;
-}
-static BOOLEAN jjFANFULL_IM(leftv res, leftv v)
-{
-  intvec* permutations = (intvec*)v->Data();
-  int ambientDim = permutations->cols();
-  gfan::IntMatrix im = permutationIntMatrix(permutations);
-  if (!gfan::Permutation::arePermutations(im))
-  {
-    Werror("provided intmat contains invalid permutations of {1, ..., %d}", ambientDim);
-    return TRUE;
-  }
-  gfan::SymmetryGroup sg = gfan::SymmetryGroup(ambientDim);
-  sg.computeClosure(im);
-  gfan::ZFan* zf = new gfan::ZFan(gfan::ZFan::fullFan(sg));
-  res->rtyp = fanID;
-  res->data = (char*)zf;
-  return FALSE;
-}
-
-BOOLEAN fullFan(leftv res, leftv args)
-{
-  /*  {
-    gfan::ZFan f(2);
-    std::cout<<f.toString();
-    f.insert(gfan::ZCone::positiveOrthant(2));
-    std::cout<<f.toString();
-    }*/
-
-
-  leftv u = args;
-  if (u == NULL)
-  {
-    res->rtyp = fanID;
-    res->data = (void*)(new gfan::ZFan(0));
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == INT_CMD))
-  {
-    if (u->next == NULL) return jjFANFULL_I(res, u);
-  }
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return jjFANFULL_IM(res, u);
-  }
-  WerrorS("fullFan: unexpected parameters");
-  return TRUE;
-}
-
-int getAmbientDimension(gfan::ZFan* zf)
-{
-  return zf->getAmbientDimension();
-}
-
-int getCodimension(gfan::ZFan* zf)
-{
-  return zf->getCodimension();
-}
-
-int getDimension(gfan::ZFan* zf)
-{
-  return zf->getDimension();
-}
-
-int getLinealityDimension(gfan::ZFan* zf)
-{
-  return zf->getLinealityDimension(); 
-}
-
-BOOLEAN numberOfConesOfDimension(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      leftv v=u->next;
-      if ((v != NULL) && (v->Typ() == INT_CMD))
-        {
-	  leftv w=v->next;
-	  if ((w != NULL) && (w->Typ() == INT_CMD))
-	    {
-	      leftv x=w->next;
-	      if ((x != NULL) && (x->Typ() == INT_CMD))
-		{
-		  gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-		  int d = (int)(long)v->Data(); 
-		  int o = (int)(long)w->Data();
-		  int m = (int)(long)x->Data();
-                  if ((d <= zf->getAmbientDimension()) && ((o == 0) || (o == 1)) && ((m == 0) || (m == 1)))
-		    {
-		      bool oo = (bool) o;
-		      bool mm = (bool) m;
-		      int n = zf->numberOfConesOfDimension(d,oo,mm);
-		      res->rtyp = INT_CMD;
-		      res->data = (char*) n;
-		      return FALSE;
-		    }
-		}
-	    }
-	}
-    }
-  WerrorS("getAmbientDimension: unexpected parameters");
-  return TRUE;  
-}
-
-BOOLEAN ncones(leftv res, leftv args)
-{  
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      int d = zf->getAmbientDimension();
-      int n = 0;
-
-      for (int i=0; i<=d; i++)
-        { n = n + zf->numberOfConesOfDimension(i,0,0); }
-
-      res->rtyp = INT_CMD;
-      res->data = (char*) n;
-      return FALSE;
-    }
-  else
-    {
-      WerrorS("check_compatibility: unexpected parameters");
-      return TRUE;
-    }
-}
-
-BOOLEAN nmaxcones(leftv res, leftv args)
-{  
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-
-      int n = 0;
-      for (int d=0; d<=zf->getAmbientDimension(); d++)
-        { n = n + zf->numberOfConesOfDimension(d,0,1); }
-
-      res->rtyp = INT_CMD;
-      res->data = (char*) n;
-      return FALSE;
-    }
-  else
-    {
-      WerrorS("nmaxcones: unexpected parameters");
-      return TRUE;
-    }
-}
-
-bool iscompatible(gfan::ZFan* zf, gfan::ZCone* zc)
-{
-  bool b = (zf->getAmbientDimension() == zc->ambientDimension());
-  if(b)
-  {
-    for (int d=0; d<=zf->getAmbientDimension(); d++)
-    {
-      for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
-      {
-        gfan::ZCone zd = zf->getCone(d,i,0,1);
-        gfan::ZCone zt = gfan::intersection(*zc,zd);
-        zt.canonicalize();
-        b = b && zd.hasFace(zt);
-      }
-    }
-  }
-  return b;
-}
-
-BOOLEAN isCompatible(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-      bool b = iscompatible(zf,zc);
-      int bb = (int) b;
-      res->rtyp = INT_CMD;
-      res->data = (char*) bb;
-      return FALSE;
-      }
-    }
-  WerrorS("isCompatible: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN quickInsertCone(leftv res, leftv args)  
-{                                           
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-      zc->canonicalize();
-      zf->insert(*zc);
-      res->rtyp = NONE;
-      res->data = NULL;
-      return FALSE;
-    }
-  }
-  WerrorS("quickInsertCone: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN insertCone(leftv res, leftv args)  
-{                                           
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-      zc->canonicalize();
-      if (iscompatible(zf,zc))
-	{ 
-	  zf->insert(*zc); 
-          res->rtyp = NONE;
-          res->data = NULL;
-          return FALSE;
-        }
-      else
-        {
-	  WerrorS("insertCone: cone and fan not compatible");
-	  return TRUE;
-	}
-    }
-  }
-  else
-  {
-    WerrorS("insertCone: unexpected parameters");
-    return TRUE;
-  }
-}
-
-BOOLEAN containsInSupport(leftv res, leftv args)
-{
-  leftv u=args;                             
-  // if ((u != NULL) && (u->Typ() == fanID))          // TODO
-  // {
-  //   leftv v=u->next;
-  //   if ((v != NULL) && (v->Typ() == coneID))
-  //   {
-  //     gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-  //     gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-  //     gfan::ZMatrix zm = zc->extremeRays();
-  //     bool b = 1;
-  //     for(int i=1; i<zm->getHeight(); i++)
-  //     {
-	
-  //     }
-  //     res->rtyp = INT_CMD;
-  //     res->data = (char*) (int) contains(zf,zc);
-  //     return FALSE;
-  //   }
-  // }
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      gfan::ZCone* zd = (gfan::ZCone*)v->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) (int) containsInSupport(zc,zd);
-      return FALSE;
-    }
-    if ((v != NULL) && (v->Typ() == INTVEC_CMD))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      intvec* vec = (intvec*)v->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) (int) containsInSupport(zc,vec);
-      return FALSE;
-    }
-  }
-  WerrorS("containsInSupport: unexpected parameters");
-  return TRUE;
-}
-
-bool containsInCollection(gfan::ZFan* zf, gfan::ZCone* zc)
-{
-  if((zf->getAmbientDimension() == zc->ambientDimension()))
-  {
-    gfan::ZVector zv=zc->getRelativeInteriorPoint();
-    for (int d=0; d<=zf->getAmbientDimension(); d++)
-    {
-      for (int i=0; i<zf->numberOfConesOfDimension(d,0,1); i++)
-      {
-        gfan::ZCone zd = zf->getCone(d,i,0,1);
-	zd.canonicalize();
-        if (zd.containsRelatively(zv))
-	{
-	  gfan::ZCone temp = *zc;
-	  temp.canonicalize();
-	  return (!(zd != temp));
-	}
-      }
-    }
-  }
-}
-
-BOOLEAN containsInCollection(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-      res->rtyp = INT_CMD;
-      res->data = (char*) (int) containsInCollection(zf,zc);
-      return FALSE;
-    }
-  }
-  // if ((u != NULL) && (u->Typ() == coneID))
-  // {
-  //   leftv v=u->next;
-  //   if ((v != NULL) && (v->Typ() == coneID))
-  //   {
-  //     gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-  //     gfan::ZCone* zd = (gfan::ZCone*)v->Data();
-  //     res->rtyp = INT_CMD;
-  //     res->data = (char*) (int) hasFace(zc,zd);
-  //     return FALSE;
-  //   }
-  // }
-  WerrorS("containsInCollection: unexpected parameters");
-  return TRUE;
-}
-
-// BOOLEAN coneContaining(leftv res, leftv args)
-// {
-//   leftv u=args;
-//   if ((u != NULL) && (u->Typ() == fanID))
-//   {
-//     if ((v != NULL) && (v->Typ() == INTVEC_CMD))
-//     {
-//       gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-//       intvec* vec = (intvec*)v->Data();
-//     }
-//   }
-//   WerrorS("coneContaining: unexpected parameters");
-//   return TRUE;
-// }
-
-BOOLEAN removeCone(leftv res, leftv args)  
-{                                           
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == coneID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      gfan::ZCone* zc = (gfan::ZCone*)v->Data();
-      zc->canonicalize();
-      if(containsInCollection(zf,zc))
-      {
-	zf->remove(*zc); 
-	res->rtyp = NONE;
-	res->data = NULL;
-	return FALSE;
-      }
-    }
-  }
-  WerrorS("removeCone: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getCone(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    leftv v=u->next;
-    if ((v != NULL) && (v->Typ() == INT_CMD))
-    {
-      leftv w=v->next;
-      if ((w != NULL) && (w->Typ() == INT_CMD))
-      {
-        leftv x=w->next;
-        if ((x != NULL) && (x->Typ() == INT_CMD))
-	{
-          leftv y=w->next;
-          if ((y != NULL) && (y->Typ() == INT_CMD))
-          {
-	    gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-	    int d = (int)(long)v->Data(); 
-	    int i = (int)(long)w->Data();
-	    int o = (int)(long)x->Data();
-	    int m = (int)(long)y->Data();
-            if (((o == 0) || (o == 1)) && ((m == 0) || (m == 1)))
-	    {
-	      bool oo = (bool) o;
-              bool mm = (bool) m;
-              if (d<=zf->getAmbientDimension())
-	      {
-	        if (i<=zf->numberOfConesOfDimension(d,oo,mm))
-	        {
-		  i=i-1;
-	          gfan::ZCone zc = zf->getCone(d,i,oo,mm);
-                  res->rtyp = coneID;
-                  res->data = (char*)new gfan::ZCone(zc);
-                  return FALSE;
-	        }
-	        else
-	        {
-	          WerrorS("getCone: invalid index");
-	          return TRUE;
-	       }
-	     }
-	     else
-	     {
-	       WerrorS("getCone: invalid dimension");
-	       return TRUE;
-	      }
-            }
-	    else
-	    {
-	      WerrorS("getCone: invalid specifier for orbit or maximal");
-	      return TRUE;
-	    }
-          }
-        }
-      }  
-    }
-  }
-  else
-  {
-    WerrorS("getCone: unexpected parameters");  
-    return TRUE;
-  }
-}
-
-BOOLEAN isSimplicial(leftv res, leftv args)
-{
-  leftv u=args;                             
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-    bool b=zf->isSimplicial();
-    res->rtyp = INT_CMD;
-    res->data = (char*) (int) b;
-    return FALSE;
-  }
-  if ((u != NULL) && (u->Typ() == coneID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*) u->Data();
-      int b = isSimplicial(zc);
-      res->rtyp = INT_CMD;
-      res->data = (char*) b;
-      return FALSE;      
-    }
-  WerrorS("isSimplicial: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN isPure(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-    bool b=zf->isPure();
-    res->rtyp = INT_CMD;
-    res->data = (char*) (int) b;
-    return FALSE;
-  }
-  WerrorS("isPure: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN isComplete(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-      bool b=zf->isComplete();
-      res->rtyp = INT_CMD;
-      res->data = (char*) (int) b;
-      return FALSE;
-    }
-  WerrorS("isComplete: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getFVector(leftv res, leftv args)
-{
-  leftv u=args;
-  if ((u != NULL) && (u->Typ() == fanID))
-    {
-      gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-      gfan::ZVector zv=zf->getFVector();
-      res->rtyp = INTVEC_CMD;
-      res->data = (void*) zVector2Intvec(zv);
-      return FALSE;
-    }
-  WerrorS("getFVector: unexpected parameters");
-  return TRUE;
-}
-
-void bbfan_setup()
-{
-  blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
-  // all undefined entries will be set to default in setBlackboxStuff
-  // the default Print is quite usefule,
-  // all other are simply error messages
-  b->blackbox_destroy=bbfan_destroy;
-  b->blackbox_String=bbfan_String;
-  //b->blackbox_Print=blackbox_default_Print;
-  b->blackbox_Init=bbfan_Init;
-  b->blackbox_Copy=bbfan_Copy;
-  b->blackbox_Assign=bbfan_Assign;
-  iiAddCproc("","emptyFan",FALSE,emptyFan);
-  iiAddCproc("","fullFan",FALSE,fullFan);
-  /* the following functions are implemented in bbcone.cc */
-  // iiAddCproc("","getAmbientDimension",FALSE,getAmbientDimension);
-  // iiAddCproc("","getCodimension",FALSE,getDimension);
-  // iiAddCproc("","getDimension",FALSE,getDimension);
-  // iiAddCproc("","getLinealityDimension",FALSE,getLinealityDimension);
-  /********************************************************/ 
-  iiAddCproc("","isCompatible",FALSE,isCompatible);
-  iiAddCproc("","numberOfConesOfDimension",FALSE,numberOfConesOfDimension);
-  iiAddCproc("","ncones",FALSE,ncones);
-  iiAddCproc("","nmaxcones",FALSE,nmaxcones);
-  iiAddCproc("","quickInsertCone",FALSE,quickInsertCone);
-  iiAddCproc("","insertCone",FALSE,insertCone);
-  iiAddCproc("","removeCone",FALSE,removeCone);
-  iiAddCproc("","getCone",FALSE,getCone);
-  iiAddCproc("","isSimplicial",FALSE,isSimplicial);
-  iiAddCproc("","isPure",FALSE,isPure);
-  iiAddCproc("","isComplete",FALSE,isComplete);
-  iiAddCproc("","getFVector",FALSE,getFVector);
-  iiAddCproc("","containsInCollection",FALSE,containsInCollection);
-  iiAddCproc("","containsInSupport",FALSE,containsInSupport);
-  fanID=setBlackboxStuff(b,"fan");
-  //Print("created type %d (fan)\n",fanID); 
-}
-
-#endif
-/* HAVE_FANS */
diff --git a/Singular/bbpolytope.cc b/Singular/bbpolytope.cc
deleted file mode 100644
index 8d60edc..0000000
--- a/Singular/bbpolytope.cc
+++ /dev/null
@@ -1,481 +0,0 @@
-#include <Singular/mod2.h>
-
-#ifdef HAVE_FANS
-
-#include <Singular/ipid.h>
-#include <Singular/blackbox.h>
-#include <omalloc/omalloc.h>
-#include <kernel/febase.h>
-#include <kernel/longrat.h>
-#include <Singular/subexpr.h>
-#include <gfanlib/gfanlib.h>
-#include <kernel/bbcone.h>
-#include <Singular/ipshell.h>
-#include <kernel/intvec.h>
-#include <sstream>
-
-
-int polytopeID;
-
-std::string bbpolytopeToString(gfan::ZCone const &c)
-{
-  std::stringstream s;
-  gfan::ZMatrix r=c.extremeRays();
-  s<<"VERTICES"<<std::endl;
-  s<<toString(r);
-  return s.str();
-}
-
-void *bbpolytope_Init(blackbox *b)
-{
-  return (void*)(new gfan::ZCone());
-}
-
-BOOLEAN bbpolytope_Assign(leftv l, leftv r)
-{
-  gfan::ZCone* newZc;
-  if (r==NULL)
-  { 
-    if (l->Data()!=NULL) 
-    {   
-      gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-      delete zd;
-    }
-    newZc = new gfan::ZCone();
-  }
-  else if (r->Typ()==l->Typ())
-  {
-    if (l->Data()!=NULL)
-    {   
-      gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-      delete zd;
-    }
-    gfan::ZCone* zc = (gfan::ZCone*)r->Data();
-    newZc = new gfan::ZCone(*zc);
-  }
-  // else if (r->Typ()==INT_CMD)  TODO:r->Typ()==INTMAT_CMD
-  // {
-  //   int ambientDim = (int)(long)r->Data();
-  //   if (ambientDim < 0)
-  //   {
-  //     Werror("expected an int >= 0, but got %d", ambientDim);
-  //     return TRUE;
-  //   }
-  //   if (l->Data()!=NULL)
-  //   {   
-  //     gfan::ZCone* zd = (gfan::ZCone*)l->Data();
-  //     delete zd;
-  //   }
-  //   newZc = new gfan::ZCone(ambientDim);
-  // }
-  else
-  {
-    Werror("assign Type(%d) = Type(%d) not implemented",l->Typ(),r->Typ());
-    return TRUE;
-  }
- 
-  if (l->rtyp==IDHDL)
-  {
-    IDDATA((idhdl)l->data)=(char *)newZc;
-  }
-  else
-  {
-    l->data=(void *)newZc;
-  }
-  return FALSE;
-}
-
-char* bbpolytope_String(blackbox *b, void *d)
-{ if (d==NULL) return omStrDup("invalid object");
-   else
-   {
-     gfan::ZCone* zc = (gfan::ZCone*)d;
-     zc->canonicalize();
-     std::string s=bbpolytopeToString(*zc);
-     return omStrDup(s.c_str());
-   }
-}
-
-void bbpolytope_destroy(blackbox *b, void *d)
-{
-  if (d!=NULL)
-  {
-    gfan::ZCone* zc = (gfan::ZCone*) d;
-    delete zc;
-  }
-}
-
-void * bbpolytope_Copy(blackbox*b, void *d)
-{       
-  gfan::ZCone* zc = (gfan::ZCone*)d;
-  gfan::ZCone* newZc = new gfan::ZCone(*zc);
-  return newZc;
-}
-
-static BOOLEAN ppCONERAYS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (cone = convex hull of the half-lines; note: there may be
-     entire lines in the cone);
-     valid parametrizations: (intmat) */
-  intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-  zc->canonicalize();
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN ppCONERAYS3(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines), and an integer k;
-     valid parametrizations: (intmat, int);
-     Errors will be invoked in the following cases:
-     - k not 0 or 1;
-     if the k=1, then the extreme rays are known:
-     each half-line spans a (different) extreme ray */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  int k = (int)(long)v->Data();
-  if ((k < 0) || (k > 1))
-  {
-    WerrorS("expected int argument in [0..1]");
-    return TRUE;
-  }
-  k=k*2;
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
-  zc->canonicalize();
-  //k should be passed on to zc; not available yet
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN polytopeViaVertices(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return ppCONERAYS1(res, u);
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INT_CMD))
-    {
-      if (v->next == NULL) return ppCONERAYS3(res, u, v);
-    }
-  }
-  WerrorS("polytopeViaVertices: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN pqCONERAYS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (cone = convex hull of the half-lines; note: there may be
-     entire lines in the cone);
-     valid parametrizations: (intmat) */
-  intvec* rays = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN pqCONERAYS3(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from half-lines
-     (any point in the cone being the sum of a point
-     in the convex hull of the half-lines and a point in the span
-     of the lines), and an integer k;
-     valid parametrizations: (intmat, int);
-     Errors will be invoked in the following cases:
-     - k not 0 or 1;
-     if the k=1, then the extreme rays are known:
-     each half-line spans a (different) extreme ray */
-  intvec* rays = (intvec *)u->CopyD(INTVEC_CMD);
-  int k = (int)(long)v->Data();
-  if ((k < 0) || (k > 1))
-  {
-    WerrorS("expected int argument in [0..1]");
-    return TRUE;
-  }
-  k=k*2;
-  gfan::ZMatrix zm = intmat2ZMatrix(rays);
-  gfan::ZCone* zc = new gfan::ZCone();
-  *zc = gfan::ZCone::givenByRays(zm,gfan::ZMatrix(0, zm.getWidth()));
-  //k should be passed on to zc; not available yet
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN quickPolytopeViaVertices(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return pqCONERAYS1(res, u);
-    leftv v = u->next;
-    if ((v != NULL) && (v->Typ() == INT_CMD))
-    {
-      if (v->next == NULL) return pqCONERAYS3(res, u, v);
-    }
-  }
-  WerrorS("quickPolytopeViaVertices: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN ppCONENORMALS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from inequalities;
-     valid parametrizations: (intmat) */
-  intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(inequs);
-  gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN ppCONENORMALS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from iequalities,
-     and equations (...)
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN ppCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from inequalities, equations,
-     and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then ... */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN polytopeViaNormals(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return ppCONENORMALS1(res, u);
-  }
-  leftv v = u->next;
-  if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-  {
-    if (v->next == NULL) return ppCONENORMALS2(res, u, v);
-  }
-  leftv w = v->next;
-  if ((w != NULL) && (w->Typ() == INT_CMD))
-  {
-    if (w->next == NULL) return ppCONENORMALS3(res, u, v, w);
-  }
-  WerrorS("polytopeViaNormals: unexpected parameters");
-  return TRUE;
-}
-
-static BOOLEAN pqCONENORMALS1(leftv res, leftv v)
-{
-  /* method for generating a cone object from inequalities;
-     valid parametrizations: (intmat) */
-  intvec* inequs = (intvec *)v->CopyD(INTVEC_CMD);
-  gfan::ZMatrix zm = intmat2ZMatrix(inequs);
-  gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN pqCONENORMALS2(leftv res, leftv u, leftv v)
-{
-  /* method for generating a cone object from iequalities,
-     and equations (...)
-     valid parametrizations: (intmat, intmat)
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2);
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-static BOOLEAN pqCONENORMALS3(leftv res, leftv u, leftv v, leftv w)
-{
-  /* method for generating a cone object from inequalities, equations,
-     and an integer k;
-     valid parametrizations: (intmat, intmat, int);
-     Errors will be invoked in the following cases:
-     - u and v have different numbers of columns,
-     - k not in [0..3];
-     if the 2^0-bit of k is set, then ... */
-  intvec* inequs = (intvec *)u->CopyD(INTVEC_CMD);
-  intvec* equs = (intvec *)v->CopyD(INTVEC_CMD);
-  if (inequs->cols() != equs->cols())
-  {
-    Werror("expected same number of columns but got %d vs. %d",
-           inequs->cols(), equs->cols());
-    return TRUE;
-  }
-  int k = (int)(long)w->Data();
-  if ((k < 0) || (k > 3))
-  {
-    WerrorS("expected int argument in [0..3]");
-    return TRUE;
-  }
-  gfan::ZMatrix zm1 = intmat2ZMatrix(inequs);
-  gfan::ZMatrix zm2 = intmat2ZMatrix(equs);
-  gfan::ZCone* zc = new gfan::ZCone(zm1, zm2, k);
-  res->rtyp = polytopeID;
-  res->data = (char *)zc;
-  return FALSE;
-}
-
-BOOLEAN quickPolytopeViaNormals(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == INTMAT_CMD))
-  {
-    if (u->next == NULL) return ppCONENORMALS1(res, u);
-  }
-  leftv v = u->next;
-  if ((v != NULL) && (v->Typ() == INTMAT_CMD))
-  {
-    if (v->next == NULL) return ppCONENORMALS2(res, u, v);
-  }
-  leftv w = v->next;
-  if ((w != NULL) && (w->Typ() == INT_CMD))
-  {
-    if (w->next == NULL) return ppCONENORMALS3(res, u, v, w);
-  }
-  WerrorS("quickPolytopeViaNormals: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN getVertices(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == polytopeID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      gfan::ZMatrix zmat = zc->extremeRays();
-      res->rtyp = INTMAT_CMD;
-      res->data = (void*)zMatrix2Intvec(zmat);
-      return FALSE;
-    }
-  WerrorS("getVertices: unexpected parameters");
-  return TRUE;
-}
-
-intvec* getFacetNormals(gfan::ZCone* zc)
-{
-  gfan::ZMatrix zmat = zc->getFacets();
-  return zMatrix2Intvec(zmat);
-}
-
-int getAmbientDimension(gfan::ZCone* zc) // zc is meant to represent a polytope here
-{                                        // hence ambientDimension-1
-  return zc->ambientDimension()-1;
-}
-
-int getCodimension(gfan::ZCone *zc)
-{
-  return zc->codimension();
-}
-
-int getDimension(gfan::ZCone* zc)
-{
-  return zc->dimension()-1;
-}
-
-void bbpolytope_setup()
-{
-  blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox));
-  // all undefined entries will be set to default in setBlackboxStuff
-  // the default Print is quite usefule,
-  // all other are simply error messages
-  b->blackbox_destroy=bbpolytope_destroy;
-  b->blackbox_String=bbpolytope_String;
-  //b->blackbox_Print=blackbox_default_Print;
-  b->blackbox_Init=bbpolytope_Init;
-  b->blackbox_Copy=bbpolytope_Copy;
-  b->blackbox_Assign=bbpolytope_Assign;
-  iiAddCproc("","polytopeViaVertices",FALSE,polytopeViaVertices);
-  iiAddCproc("","polytopeViaNormals",FALSE,polytopeViaNormals);
-  iiAddCproc("","quickPolytopeViaVertices",FALSE,quickPolytopeViaVertices);
-  iiAddCproc("","quickPolytopeViaNormals",FALSE,quickPolytopeViaNormals);
-  iiAddCproc("","getVertices",FALSE,getVertices);
-  /********************************************************/
-  /* the following functions are implemented in bbcone.cc */
-  // iiAddCproc("","getAmbientDimension",FALSE,getAmbientDimension);                                               
-  // iiAddCproc("","getCodimension",FALSE,getAmbientDimension);                                                 
-  // iiAddCproc("","getDimension",FALSE,getDimension);                                                                // iiAddCproc("","getFacetNormals",FALSE,getFacetNormals);  
-  /********************************************************/
-  /* the following functions are identical to those in bbcone.cc */
-  // iiAddCproc("","setLinearForms",FALSE,setLinearForms);
-  // iiAddCproc("","getLinearForms",FALSE,getLinearForms);
-  // iiAddCproc("","setMultiplicity",FALSE,setMultiplicity);
-  // iiAddCproc("","getMultiplicity",FALSE,getMultiplicity);
-  /***************************************************************/
-  // iiAddCproc("","getEquations",FALSE,getEquations);
-  // iiAddCproc("","getInequalities",FALSE,getInequalities);
-  polytopeID=setBlackboxStuff(b,"polytope");
-  //Print("created type %d (polytope)\n",polytopeID); 
-}
-
-#endif
-/* HAVE_FANS */
diff --git a/Singular/install-sh b/Singular/install-sh
deleted file mode 100755
index 18719da..0000000
--- a/Singular/install-sh
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-tranformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-c) instcmd="$cpprog"
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd="$stripprog"
-	    shift
-	    continue;;
-
-	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
-	    shift
-	    continue;;
-
-	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-	    shift
-	    continue;;
-
-	*)  if [ x"$src" = x ]
-	    then
-		src=$1
-	    else
-		# this colon is to work around a 386BSD /bin/sh bug
-		:
-		dst=$1
-	    fi
-	    shift
-	    continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-	echo "install:	no input file specified"
-	exit 1
-else
-	true
-fi
-
-if [ x"$dir_arg" != x ]; then
-	dst=$src
-	src=""
-	
-	if [ -d $dst ]; then
-		instcmd=:
-	else
-		instcmd=mkdir
-	fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-# obachman 6/15/98
-# Here is an ugly fix for a bug in cygwin
-# '[ test -f $src ]' evaluates to true, even if only $src.exe exists
-# However 'cp $src $dst' can  not find $src, if only $src.exe exists
-	if test -f "$src.exe" && test -x "$src.exe"; then
-		src="$src.exe"
-		true
-	elif [ -f $src -o -d $src ]
-	then
-		true
-	else
-		echo "install:  $src does not exist"
-		exit 1
-	fi
-	
-	if [ x"$dst" = x ]
-	then
-		echo "install:	no destination specified"
-		exit 1
-	else
-		true
-	fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-	if [ -d $dst ]
-	then
-		dst="$dst"/`basename $src`
-	else
-		true
-	fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='	
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-	pathcomp="${pathcomp}${1}"
-	shift
-
-	if [ ! -d "${pathcomp}" ] ;
-        then
-		$mkdirprog "${pathcomp}"
-	else
-		true
-	fi
-
-	pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-	$doit $instcmd $dst &&
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-	if [ x"$transformarg" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		echo "basename $dst $transformbasename | sed $transformarg$transformbasename"
-		dstfile=`basename $dst $transformbasename | 
-			sed $transformarg`$transformbasename
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		true
-	fi
-
-# Make a temp file name in the proper directory.
-
-	dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd $src $dsttmp &&
-
-	trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-	$doit $rmcmd -f $dstdir/$dstfile &&
-	$doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/Singular/svnver b/Singular/svnver
deleted file mode 100644
index 1ba0055..0000000
--- a/Singular/svnver
+++ /dev/null
@@ -1 +0,0 @@
-14545
diff --git a/Singular/testgh b/Singular/testgh
old mode 100644
new mode 100755
diff --git a/Tst/Old/lib0.lib b/Tst/Old/lib0.lib
deleted file mode 100644
index 1ce2954..0000000
--- a/Tst/Old/lib0.lib
+++ /dev/null
@@ -1,1068 +0,0 @@
-// $Id: lib0.lib 12231 2009-11-02 10:12:22Z hannes $
-//system("random",787422842);
-//(GMG)
-///////////////////////////////////////////////////////////////////////////////
-
-LIBRARY:  lib0.lib       PROCEDURES OF GENERAL TYPE
-
- A_Z("a",n);             string of n comma seperated letters starting with a
- binomial(n,m[,int/str]);n choose m (type int), [type string/type number]
- changechar(r,"c","R");  makes a copy R of ring r with new char c the basering
- changeord(r,"ord","R"); makes a copy R of ring r with new ord the basering
- changevar(r,"vars","R");same as copyring
- copyring(r,"vars","R"); makes a copy R of ring r with new vars the basering
- copyring1(r,"vars","R");string to make a copy R of ring r with new variables
- defrings(n[,p]);        define ring Sn in n vars, char 32003 [or p], ds
- defringp(n[,p]);        define ring Pn in n vars, char 32003 [or p], dp
- factorial(n[,int/str]); n factorial (=n!) (type int), [type string/number]
- fetchall(R[,str]);      fetch all objects of ring R to basering
- fibonacci(n[,p]);       nth Fibonacci number [char p]
- ishomog(poly/...);      int, =1 resp. =0 if input is homogeneous resp. not
- kmemory();              int = active memory (kilobyte)
- killall();              kill all user-defined variables
- imapall(R [,str]);      imap all objects of ring R to basering
- mapall(R,i[,str]);      map all objects of ring R via ideal i to basering
- maxcoef(poly/...);      maximal length of coefficient occuring in poly/...
- maxdeg(poly/...);       int/intmat = degree/s of terms of maximal order
- mindeg(poly/...);       int/intmat = degree/s of terms of minimal order
- normalize(poly/...);    normalize poly/... such that leading coefficient is 1
- primes(n,m);            intvec of primes p, n<=p<=m
- product(vector/..[,v]); multiply components of vector/ideal/...[indices v]
- ringsum(s,t,..."r");    create a ring r from existing rings s,t,...
- ringweights(r);         intvec of weights of ring variables of ring r
- sort(ideal/module);     sort generators according to monomial ordering
- sum(vector/id/..[,v]);  add components of vector/ideal/...[with indices v]
-           (parameters in square brackets [] are optional)
-
-LIB "inout.lib";
-///////////////////////////////////////////////////////////////////////////////
-
-proc A_Z (string s,int n)
-USAGE:   A_Z("a",n);  a any letter, n integer (-26<= n <=26, !=0)
-RETURN:  string of n small (if a is small) or capital (if a is capital)
-         letters, comma seperated, beginning with a, in alphabetical
-         order (or revers alphabetical order if n<0)
-EXAMPLE: example A_Z; shows an example
-{
-  if ( n>=-26 and n<=26 and n!=0 )
-  {
-    string alpha =
-    "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,"+
-    "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,"+
-    "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,"+
-    "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
-    int ii; int aa;
-    for(ii=1; ii<=51; ii=ii+2)
-    {
-       if( alpha[ii]==s ) { aa=ii; }
-    }
-    if ( aa==0)
-    {
-      for(ii=105; ii<=155; ii=ii+2)
-      {
-        if( alpha[ii]==s ) { aa=ii; }
-      }
-    }
-    if( aa!=0 )
-    {
-      string out;
-      if (n > 0) { out = alpha[aa,2*(n)-1];  return (out); }
-      if (n < 0)
-      {
-        string beta =
-        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
-        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
-        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,"+
-        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A";
-        if ( aa < 52 ) { aa=52-aa; }
-        if ( aa > 104 ) { aa=260-aa; }
-        out = beta[aa,2*(-n)-1]; return (out);
-      }
-    }
-  }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   A_Z("c",5);
-   A_Z("Z",-5);
-   string sR = "ring R = (0,"+A_Z("A",6)+"),("+A_Z("a",10)+"),dp;";
-   sR;
-   execute sR;
-   R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc binomial (int n, int k, list #)
-USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
-RETURN:  binomial(n,k);    binomial coefficient n choose k of type int
-                           (machine integer, limited size! )
-         binomial(n,k,p);  n choose k in char p of type string
-         binomial(n,k,s);  n choose k of type number (s any string), computed
-                           in char of basering if a basering is defined
-EXAMPLE: example binomial; shows an example
-{
-   if ( size(#)==0 ) { int rr=1; }
-   if ( typeof(#[1])=="int") { ring bin = #[1],x,dp; number rr=1; }
-   if ( typeof(#[1])=="string") { number rr=1; }
-   if ( size(#)==0 or typeof(#[1])=="int" or typeof(#[1])=="string" )
-   {
-      def r = rr;
-      if ( k<=0 or k>n ) { return((k==0)*r); }
-      if ( k>=n-k ) { k = n-k; }
-      int l;
-      for (l=1 ; l<=k ; l++ )
-      {
-         r=r*(n+1-l)/l;
-      }
-      if ( typeof(#[1])=="int" ) { return(string(r)); }
-      return(r);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   int b1 = binomial(10,7); b1;
-   binomial(37,17,0);
-   ring t = 31,x,dp;
-   number b2 = binomial(37,17,""); b2;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changechar (r, string c, string newr)
-USAGE:   changechar(r,c,newr);  r=ring/qring, c,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the characteristic. If,
-         say, (c,newr) = ("0,A","R") and the ring r exists, the new basering
-         will have name R characteristic 0 and one parameter A.
-RETURN:  No return value
-NOTE:    //*** Buggy for qrings
-EXAMPLE: example changechar; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+c+"),("+varstr(r)+"),("+ordstr(r)+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   show(r);
-   changechar(r,"2,A","R");
-   show(R);
-   kill R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changeord (r, string o, string newr)
-USAGE:   changeord(r,o,newr);  r=ring/qring, o,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the ordering. If, say,
-         (o,newr) = ("wp(2,3),dp","R") and the ring r exists and has >=3
-         variables, the new basering will have name R and ordering wp(2,3),dp.
-RETURN:  No return value
-EXAMPLE: example changeord; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+charstr(r)+"),("+varstr(r)+"),("+o+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   changeord(r,"wp(2,3),dp","R");
-   show(R);
-   ideal i = x^2,y^2-u^3,v;
-   qring Q = std(i);
-   changeord(Q,"lp","Q'");
-   show(Q');
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changevar (r, string vars, string newr)
-USAGE:   changevar(r,vars,newr);  r=ring/qring, vars,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-NOTE:    This procedure is the same as copyring
-EXAMPLE: example changevar; shows an example
-{
-   copyring(r,vars,newr);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   changevar(r,"A()","R");
-   show(R);
-   ideal i = x^2,y^2-u^3,v;
-   qring Q = std(i);
-   changevar(Q,"a,b,c,d","Q'");
-   show(Q');
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc copyring (r, string vars, string newr)
-USAGE:   copyring(r,vars,newr);  r ring/qring, vars, newr strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the variables. If, say,
-         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
-         the new basering will have name R and variables t(1),...,t(n).
-         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
-RETURN:  No return value
-NOTE:    This procedure is useful in connection with the procedure ringsum,
-         when a conflict between variable names must be avoided. See proc
-         copyring1 for an alternative
-EXAMPLE: example copyring; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+charstr(r)+"),(";
-   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
-   {
-      newring = newring+vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")";
-   }
-   else { newring = newring+vars; }
-   newring = newring+"),("+ordstr(r)+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   copyring(r,"A()","R");
-   type R;
-   ideal i = A(1)^2,A(2)^2-A(3)^3,A(4);
-   qring Q = std(i);
-   copyring(Q,"a,b,c,d","Q'");
-   type Q';
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc copyring1 (r, string vars, string newr)
-USAGE:   copyring1(r,vars,newr);  r ring, vars, newr strings
-RETURN:  a string which can be executed to define a new ring with name equal
-         to `newr` if r is an existing ring name.
-         The new ring differs from the old ring only in the variables. If, say,
-         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
-         the new basering will have name R and variables t(1),...,t(n).
-         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
-NOTE:    This procedure differs from copyring that it returns the string to
-         create newring, but does not execute this string. Contrary to
-         copyring this procedure does not work for a qring
-EXAMPLE: example copyring1; shows an example
-{
-   string newring = "ring "+newr+"=("+charstr(r)+"),(";
-   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
-        { string v = vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")"; }
-   else { string v = vars; }
-   return(newring+v+"),("+ordstr(r)+");");
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   string s=copyring1(r,"A()","R");s;
-   execute(s);
-   type R;
-   execute(copyring1(R,"a,b,c,d,e","r'"));
-   type r';
-   kill R,r';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defring (string s1, string s2, int n, string s3, string s4)
-USAGE:   defring(s1,s2,n,s3,s4);  s1..s4=strings, n=integer
-CREATE:  Defines a ring with name 's1', characteristic 's2', ordering 's4' and
-         n variables with names derived from s3: if s3 is a single letter, say
-         s3="a", and if n<=26 then a and the following n-1 letters from the
-         alphabeth (cyclic order) are taken as variables. If n>26 or if s3 is
-         a single letter followed by (, say s3="T(", the variables are
-         T(1),...,T(n).
-RETURN:  No return value
-EXAMPLE: example defring; shows an example
-{
-   string newring = "ring "+s1+"=("+s2+"),(";
-   if( n>26 or s3[2]=="(" ) { string v = s3[1]+"(1.."+string(n)+")"; }
-   else { string v = A_Z(s3,n); }
-   newring=newring+v+"),("+s4+");";
-   execute(newring);
-   export(basering);
-   keepring(`s1`);
-   if (voice==2) { "// basering is now:",s1; }
-   return();
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defring("r","0",5,"u","ls"); r;
-   defring("R","2,A",10,"x(","dp(3),ws(1,2,3),ds"); R;
-   kill r,R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defrings (int n, list #)
-USAGE:   defrings(n,[p]);  n,p integers
-CREATE:  Defines a ring with name Sn, characteristic p, ordering ds and n
-         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
-         the basering (default: p=32003)
-RETURN:  No return value
-EXAMPLE: example defrings; shows an example
-{
-   int p;
-   if (size(#)==0) { p=32003; }
-   else { p=#[1]; }
-   if (n >26)
-   {
-      string s="ring S"+string(n)+"="+string(p)+",x(1.."+string(n)+"),ds;";
-   }
-   else
-   {
-      string s="ring S"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),ds;";
-   }
-   execute(s);
-   export basering;
-   execute("keepring S"+string(n)+";");
-   if (voice==2) { "// basering is now:",s; }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defrings(5,0); S5;
-   defrings(30); S30;
-   kill S5, S30;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defringp (int n,list #)
-USAGE:   defringp(n,[p]);  n,p=integers
-CREATE:  defines a ring with name Pn, characteristic p, ordering dp and n
-         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
-         the basering (default: p=32003)
-RETURN:  No return value
-EXAMPLE: example defringp; shows an example
-{
-   int p;
-   if (size(#)==0) { p=32003; }
-   else { p=#[1]; }
-   if (n >26)
-   {
-      string s="ring P"+string(n)+"="+string(p)+",x(1.."+string(n)+"),dp;";
-   }
-   else
-   {
-     string s="ring P"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),dp;";
-   }
-   execute(s);
-   export basering;
-   execute("keepring P"+string(n)+";");
-   //the next comment is only shown if defringp is not called by another proc
-   if (voice==2) { "// basering is now:",s; }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defringp(5,0); P5;
-   defringp(30); P30;
-   kill P5, P30;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc factorial (int n, list #)
-USAGE:   factorial(n[,string]);  n integer
-RETURN:  factorial(n); string of n! in char 0
-         factorial(n,s);  n! of type number (s any string), computed in char of
-         basering if a basering is defined
-EXAMPLE: example factorial; shows an example
-{
-   if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; }
-   if ( typeof(#[1])=="string" ) { number r=1; }
-   if ( size(#)==0 or typeof(#[1])=="string" )
-   {
-      int l;
-      for (l=2; l<=n; l++)
-      {
-         r=r*l;
-      }
-      if ( size(#)==0 ) { return(string(r)); }
-      return(r);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   factorial(37);
-   ring r1 = 32003,(x,y,z),ds;
-   number p = factorial(37,""); p;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc fetchall (R, list #)
-USAGE:   fetchall(R[,s]);  R=ring/qring, s=string
-CREATE:  fetch all objects of ring R (of type poly, ideal, vector, module,
-         number, matrix) into the basering.
-         If no 3rd argument is present, the names are the same as in R. If, say,
-         f is a poly in R and the 3rd argument is the string "R", then f is
-         maped to f_R etc.
-RETURN:  no return value
-NOTE:    As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
-         1st, 2nd, ... variable of the basering.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: fetchall does not work inside a procedure
-         //***at the moment it does not work if R contains a map
-EXAMPLE: example fetchall; shows an example
-{
-   list @L@=names(R);
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-         execute("def "+ at L@[@ii@]+ at s@+"=fetch(R,`@L@[@ii@]`);");
-         execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since fetchall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z),dp;";
-"   ideal j=x,y2,z2;";
-"   matrix M[2][3]=1,2,3,x,y,z;";
-"   j; print(M);";
-"   ring S=0,(a,b,c),ds;";
-"   fetchall(R);           // map from R to S: x->a, y->b, z->c";
-"   names(S);";
-"   j; print(M);";
-"   fetchall(S,\"1\");       // identity map of S: copy objects, change names";
-"   names(S);";
-"   kill R,S;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc fibonacci (int n, list #)
-USAGE:   fibonacci(n[,string]);  (n integer)
-RETURN:  fibonacci(n); string of nth Fibonacci number,
-            f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
-         fibonacci(n,s);  nth Fibonacci number of type number (s any string),
-         computed in characteristic of basering if a basering is defined
-EXAMPLE: example fibonacci; shows an example
-{
-   if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; }
-   if ( typeof(#[1])=="string" ) { number f=1; }
-   if ( size(#)==0 or typeof(#[1])=="string" )
-   {
-      number g,h = 1,1; int ii;
-      for (ii=3; ii<=n; ii++)
-      {
-         h = f+g; f = g; g = h;
-      }
-      if ( size(#)==0 ) { return(string(h)); }
-      return(h);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   fibonacci(37);
-   ring r = 17,x,dp;
-   number b = fibonacci(37,""); b;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ishomog (id)
-USAGE:   ishomog(id);  id  poly/ideal/vector/module/matrix
-RETURN:  integer which is 1 if input is homogeneous (resp. weighted homogeneous
-         if the monomial ordering consists of one block of type ws,Ws,wp or Wp,
-         assuming that all weights are positive) and 0 otherwise
-NOTE:    A vector is homogeneous, if the components are homogeneous of same
-         degree, a module/matrix is homogeneous if all column vectors are
-         homogeneous
-         //*** ergaenzen, wenn Matrizen Spalten Gewichte haben
-EXAMPLE: example ishomog; shows an example
-{
-   module M = module(matrix(id));
-   M = simplify(M,2);                        // remove 0-columns
-   intvec v = ringweights(basering);
-   int i,j=1,1;
-   for (i=1; i<=ncols(M); i++)
-   {
-      if( M[i]!=jet(M[i],deg(lead(M[i])),v)-jet(M[i],deg(lead(M[i]))-1,v))
-      { return(0); }
-   }
-   return(1);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),wp(1,2,3);
-   ishomog(x5-yz+y3);
-   ideal i = x6+y3+z2, x9-z3;
-   ishomog(i);
-   ring s = 0,(a,b,c),ds;
-   vector v = [a2,0,ac+bc];
-   vector w = [a3,b3,c4];
-   ishomog(v);
-   ishomog(w);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc kmemory ()
-USAGE:   kmemory();
-RETURN:  memory used by active variables, of type int (in kilobyte)
-EXAMPLE: example kmemory; shows an example
-{
-  if ( voice==2 ) { "// memory used by active variables (kilobyte):"; }
-   return ((memory(0)+1023)/1024);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   kmemory();
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc killall ()
-USAGE:   killall(); (no parameter)
-CREATE:  kill all user-defined variables but not loaded procedures
-RETURN:  no return value
-NOTE:    killall should never be used inside a procedure
-EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES
-{
-   list L=names(); int joni=size(L);
-   for ( ; joni>0; joni-- )
-   {
-      if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { kill `L[joni]`; }
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring rtest; ideal i=x,y,z; number n=37; string str="hi";
-   export rtest,i,n,str;     //this makes the local variables global
-   listvar(all);
-   killall();
-   listvar(all);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc imapall (R, list #)
-USAGE:   imapall(R[,s]);  R=ring/qring, s=string
-CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
-         matrix) into the basering, by applying imap to all objects of R.
-         If no 3rd argument is present, the names are the same as in R. If, say,
-         f is a poly in R and the 3rd argument is the string "R", then f is
-         maped to f_R etc.
-RETURN:  no return value
-NOTE:    As imap, this procedure maps the variables of R to the variables with
-         the same name in the basering, the other variables are maped to 0.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: imapall does not work inside a procedure
-         //***at the moment it does not work if R contains a map
-EXAMPLE: example imapall; shows an example
-{
-   list @L@=names(R);
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-         execute("def "+ at L@[@ii@]+ at s@+"=imap(R,`@L@[@ii@]`);");
-         execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since imapall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z,u),dp;";
-"   ideal j=x,y,z,u2+ux+z;";
-"   matrix M[2][3]=1,2,3,x,y,uz;";
-"   j; print(M);";
-"   ring S=0,(a,b,c,x,z,y),ds;";
-"   imapall(R);           // map from R to S: x->x, y->y, z->z, u->0";
-"   names(S);";
-"   j; print(M);";
-"   imapall(S,\"1\");       // identity map of S: copy objects, change names";
-"   names(S);";
-"   kill R,S;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc mapall (R, ideal i, list #)
-USAGE:   mapall(R,i[,s]);  R=ring/qring, i=ideal of basering, s=string
-CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
-         matrix, map) into the basering, by mapping the jth variable of R to
-         the jth generator of the ideal i. If no 3rd argument is present, the
-         names are the same as in R. If, say, f is a poly in R and the 3rd
-         argument is the string "R", then f is maped to f_R etc.
-RETURN:  no return value
-NOTE:    This procedure has the same effect as defining a map, say psi, by
-         map psi=R,i; and then applying psi to all objects of R. In particular,
-         maps from R to some ring S are composed with psi, creating thus a map
-         from the basering to S.
-         mapall may be combined with copyring to change vars for all objects.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: mapall does not work inside a procedure
-EXAMPLE: example mapall; shows an example
-{
-   list @L@=names(R); map @psi@ = R,i;
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-      execute("def "+ at L@[@ii@]+ at s@+"=@psi@(`@L@[@ii@]`);");
-      execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since mapall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z),dp;";
-"   ideal j=x,y,z;";
-"   matrix M[2][3]=1,2,3,x,y,z;";
-"   map phi=R,x2,y2,z2; ";
-"   ring S=0,(a,b,c),ds;";
-"   ideal i=c,a,b;";
-"   mapall(R,i);             // map from R to S: x->c, y->a, z->b";
-"   names(S);";
-"   j; print(M); phi;        // phi is a map from R to S: x->c2, y->a2, z->b2";
-"   ideal i1=a2,a+b,1;";
-"   mapall(R,i1,\"\");         // map from R to S: x->a2, y->a+b, z->1";
-"   names(S);";
-"   j_; print(M_); phi_;";
-"   copyring(S,\"x()\",\"T\");";
-"   mapall(R,maxideal(1));   // identity map from R to T";
-"   names(T);";
-"   j; print(M); phi;";
-"   kill R,S,T;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc maxcoef (f)
-USAGE:   maxcoef(f);  f  poly/ideal/vector/module/matrix
-RETURN:  maximal length of coefficient of f of type int (by counting the
-         length of the string of each coefficient)
-EXAMPLE: example maxcoef; shows an example
-{
-   int max,s,ii,jj; string t;
-   ideal i = ideal(matrix(f));
-   i = simplify(i,6);         //* delete 0's and keep first of equal elements
-   poly m = var(1); matrix C;
-   for (ii=2;ii<=nvars(basering);ii++) { m = m*var(ii); }
-   for (ii=1; ii<=size(i); ii++)
-   {
-      C = coef(i[ii],m);
-      for (jj=1; jj<=ncols(C); jj++)
-      {
-         t = string(C[2,jj]);  s = size(t);
-         if ( t[1] == "-" ) { s = s - 1; }
-         if ( s > max ) { max = s; }
-      }
-   }
-   return(max);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),ds;
-   poly g = 345x2-1234567890y+7/4z;
-   maxcoef(g);
-   ideal i = g,10/1234567890;
-   maxcoef(i);
-   // since i[2]=1/123456789
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc maxdeg (id)
-USAGE:   maxdeg(id);  id  poly/ideal/vector/module/matrix
-RETURN:  maximal degree/s of monomials of id independent of ring ordering
-         (maxdeg of each variable is 1)
-         of type int if id is of type poly, of type intmat else
-EXAMPLE: example maxdeg; shows an example
-{
-//------------------- find maximal degree of given component ------------------
-   proc findmaxdeg
-   {
-      poly c = #[1];
-      if (c==0) { return(-1); }
-   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
-      int d = (deg(c)>=0)*deg(c)-(deg(c)<0)*deg(c);
-      int i = d;
-      while ( c-jet(c,i) != 0 ) { i = 2*(i+1); }
-      int o = i-1;
-      int u = (d != i)*((i/ 2)-1);
-   //----------------------- "quick search" for maxdeg ------------------------
-      while ( (c-jet(c,i)==0)*(c-jet(c,i-1)!=0) == 0)
-      {
-         i = (o+1+u)/ 2;
-         if (c-jet(c,i)!=0) { u = i+1; }
-         else { o = i-1; }
-      }
-      return(i);
-   }
-//------------------------------ main program ---------------------------------
-   matrix M = matrix(id);
-   int r,c = nrows(M), ncols(M); int i,j;
-   intmat m[r][c];
-   for (i=r; i>0; i--)
-   {
-      for (j=c; j>0; j--) { m[i,j] = findmaxdeg(M[i,j]); }
-   }
-   if( typeof(id)=="poly" ) { return(m[1,1]); }
-   return(m);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),wp(-1,-2,-3);
-   poly f = x+y2+z3;
-   deg(f);               //deg returns weighted degree (in case of 1 block)!
-   maxdeg(f);
-   matrix m[2][2]=f+x10,1,0,f^2;
-   maxdeg(m);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc mindeg (id)
-USAGE:   mindeg(id);  id  poly/ideal/vector/module/matrix
-RETURN:  minimal degree/s of monomials of id independent of ring ordering
-         (mindeg of each variable is 1)
-         of type int if id is of type poly, of type intmat else
-EXAMPLE: example mindeg; shows an example
-{
-//------------------- find minimal degree of given component ------------------
-   proc findmindeg
-   {
-      poly c = #[1];
-      if (c==0) { return(-1); }
-   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
-      int d = (ord(c)>=0)*ord(c)-(ord(c)<0)*ord(c);
-      int i = d;
-      while ( jet(c,i) == 0 ) { i = 2*(i+1); }
-      int o = i-1;
-      int u = (d != i)*((i/ 2)-1);
-//----------------------- "quick search" for mindeg --------------------------
-      while ( (jet(c,u)==0)*(jet(c,o)!=0) )
-      {
-         i = (o+u)/ 2;
-         if (jet(c,i)==0) { u = i+1; }
-         else { o = i-1; }
-      }
-      if (jet(c,u)!=0) { return(u); }
-      else { return(o+1); }
-   }
-//------------------------------ main program ---------------------------------
-   matrix M = matrix(id);
-   int r,c = nrows(M), ncols(M); int i,j;
-   intmat m[r][c];
-   for (i=r; i>0; i--)
-   {
-      for (j=c; j>0; j--) { m[i,j] = findmindeg(M[i,j]); }
-   }
-   if (typeof(id)=="poly") { return(m[1,1]); }
-   return(m);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),ls;
-   poly f = x5+y2+z3;
-   ord(f);                // ord returns weighted order of leading term!
-   mindeg(f);
-   matrix m[2][2]=x10,1,0,f^2;
-   mindeg(m);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc normalize (id)
-USAGE:   normalize(id);  id=poly/vector/ideal/module
-RETURN:  object of same type with leading coefficient equal to 1
-EXAMPLE: example normalize; shows an example
-{
-   return(simplify(id,1));
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),ls;
-   poly f = 2x5+3y2+4z3;
-   normalize(f);
-   module m=[9xy,0,3z3],[4z,6y,2x];
-   show(normalize(m));
-   ring s = 0,(x,y,z),(c,ls);
-   module m=[9xy,0,3z3],[4z,6y,2x];
-   show(normalize(m));
-   normalize(matrix(m));  // by automatic type conversion to module!
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc primes (int n, int m)
-USAGE:   primes(n,m);  n,m integers
-RETURN:  intvec, consisting of all primes p, prime(n)<=p<=m, in increasing
-         order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n
-NOTE:    prime(n); returns the biggest prime number <= n (if n>=2, else 2)
-EXAMPLE: example primes; shows an example
-{  int change;
-   if ( n>m ) { change=n; n=m ; m=change; change=1; }
-   int q,p = prime(m),prime(n); intvec v = q; q = q-1;
-   while ( q>=p ) { q = prime(q); v = q,v; q = q-1; }
-   if ( change==1 ) { v = v[size(v)..1]; }
-   return(v);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   primes(50,100);
-   intvec v = primes(37,1); v;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc product (id, list #)
-USAGE:    product(id[,v]); id=ideal/vector/module/matrix
-          resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer)
-RETURN:   poly resp. int which is the product of all entries of id, with index
-          given by v (default: v=1..number of entries of id)
-NOTE:     id is treated as a list of polys resp. integers. A module m is
-          identified with corresponding matrix M (columns of M generate m)
-EXAMPLE:  example product; shows an example
-{
-   int n,j;
-   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
-       or typeof(id)=="module" or typeof(id)=="matrix" )
-   {
-      ideal i = ideal(matrix(id));
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      n = ncols(i); poly f=1;
-   }
-   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
-   {
-      intmat S = intmat(id);
-      intvec i = S[1..nrows(S),1..ncols(S)];
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      n = size(i); int f=1;
-   }
-   for( j=1; j<=n; j++ ) { f=f*i[j]; }
-   return(f);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),dp;
-   ideal m = maxideal(1);
-   product(m);
-   matrix M[2][3] = 1,x,2,y,3,z;
-   product(M);
-   intvec v=2,4,6;
-   product(M,v);
-   intvec iv = 1,2,3,4,5,6,7,8,9;
-   v=1..5,7,9;
-   product(iv,v);
-   intmat A[2][3] = 1,1,1,2,2,2;
-   product(A,3..5);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ringsum (list #)
-USAGE:   ringsum(r1,r2,...,s); r1,r2,... rings, s string (name of result ring)
-CREATE:  A new base ring with name equal to s if r1,r2,... are existing rings.
-         If, say, s = "R" and the rings r1,r2,... exist, the new ring will
-         have name R, variables from all rings r1,r2,... and as monomial
-         ordering the block (product) ordering of r1,r2,.... Mathematically, R
-         is the tensor product of the rings r1,r2,... with ordering matrix
-         equal to the direct sum of the ordering matrices of r1,r2,...
-RETURN:  no return value
-NOTE:    The characteristic of the new ring will be that of r1. The names of
-         variables in the rings r1,r2,... should differ (if a name, say x,
-         occurs in r1 and r2, then, in the new ring r, x always refers to the
-         variable with name x in r1, there is no access to x in r2).
-         The procedure works also for quotient rings.
-EXAMPLE: example ringsum; shows an example
-{
-   int ii,q;
-   int n = size(#);
-   string vars,order,oi,s;
-   for(ii=1; ii<=n-1; ii++)
-   {
-      if( ordstr(#[ii])[1]=="C" or ordstr(#[ii])[1]=="c" )
-           { oi=ordstr(#[ii])[3,size(ordstr(#[ii]))-2]; }
-      else { oi=ordstr(#[ii])[1,size(ordstr(#[ii]))-2]; }
-      vars = vars+varstr(#[ii])+",";
-      order= order+oi+",";
-      def r(ii)=#[ii];
-      setring r(ii);
-      ideal i(ii)=ideal(r(ii));
-      int q(ii)=size(i(ii));
-      q=q+q(ii);
-   }
-   if( q!=0 ) { s = "newr"; }
-   else {  s = #[size(#)]; }
-   string newring ="=("+charstr(#[1])+"),("+vars[1,size(vars)-1]+"),("
-                  +order[1,size(order)-1]+");";
-   execute("ring "+s+newring);
-   if( q!=0 )
-   {
-      ideal i;
-      for(ii=1; ii<=n-1; ii++)
-      {
-         if( q(ii)!=0 )
-         {
-            map phi = r(ii),maxideal(1);
-            i = i+phi(i(ii));
-            kill phi;
-         }
-      }
-      i=std(i);
-      execute("qring "+#[size(#)]+"=i;");
-   }
-   export(`#[size(#)]`);
-   keepring(`#[size(#)]`);
-   return();
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),dp;
-   ring s=32003,(a,b,c),wp(1,2,3);
-   ring t=37,x(1..5),(c,ls);
-   ringsum(r,s,t,"R");
-   type R;
-   setring s;
-   ideal i = a2+b3+c5; i=std(i);
-   qring qs =i;
-   setring s; qring qt=i;
-   ringsum(r,qs,t,qt,"Q");
-   type Q;
-   kill R,Q;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ringweights (r)
-USAGE:   ringweights(r); r ring
-RETURN:  intvec of weights of ring variables. If, say, x(1),...,x(n) are the
-         variables of the ring r, in this order, the resulting intvec is
-         deg(x(1)),...,deg(x(n)) where deg denotes the weighted degree if
-         the monomial ordering of r has only one block of type ws,Ws,wp or Wp.
-NOTE:    In all other cases, in particular if there is more than one block,
-         the resulting intvec is 1,...,1
-EXAMPLE: example ringweights; shows an example
-{
-   int i; intvec v; setring r;
-   for (i=1; i<=nvars(basering); i++) { v[i] = deg(var(i)); }
-   return(v);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r1=32003,(x,y,z),wp(1,2,3);
-   ring r2=32003,(x,y,z),Ws(1,2,3);
-   ring r=0,(x,y,u,v),lp;
-   intvec vr=ringweights(r1); vr;
-   ringweights(r2);
-   ringweights(r);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc sort
-USAGE:    sort(id); id ideal or module
-RETURN:   ideal with generators of id sorted with respect to monomial ordering
-          of the basering (generators with smaller leading term come first)
-EXAMPLE:  example sort; shows an example
-{
-  intvec v = sortvec(#[1]);
-  int s    = size(v);
-  def m    = #[1];
-  for (int jj=1;jj<=s;jj++) { m[jj] = #[1][v[jj]]; }
-  return(m);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r0 = 0,(x,y,z),lp;
-   ideal i = x3,y3,z3,x2z,x2y,y2z,y2x,z2y,z2x,xyz;
-   sort(i);
-   ring r1  = 0,t,ls;
-   ideal i = t47,t14,t6;
-   ideal j = i;
-   int ii;
-   for (ii=1;ii<=8;ii=ii+1) { j=simplify(jet(j+i^ii,50),6); }
-   print (matrix(j));
-   print (matrix(sort(j)));
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc sum (id, list #)
-USAGE:    sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat,
-                       v=intvec (e.g. v=1..n, n=integer)
-RETURN:   poly resp. int which is the sum of all entries of id, with index
-          given by v (default: v=1..number of entries of id)
-NOTE:     id is treated as a list of polys resp. integers. A module m is
-          identified with corresponding matrix M (columns of M generate m)
-EXAMPLE:  example sum; shows an example
-{
-   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
-       or typeof(id)=="module" or typeof(id)=="matrix" )
-   {
-      ideal i = ideal(matrix(id));
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      matrix Z = matrix(i);
-      intvec v; v[ncols(Z)]=0; v=v+1;
-   }
-   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
-   {
-      intmat S = intmat(id);
-      intvec v = S[1..nrows(S),1..ncols(S)];
-      if( size(#)!=0 ) { v = v[#[1]]; }
-      intvec z; z[size(v)]=0; z=z+1;
-      intmat Z=transpose(z);
-   }
-   return((Z*v)[1,1]);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),dp;
-   vector pv = [xy,xz,yz,x2,y2,z2];
-   sum(pv);
-   sum(pv,2..5);
-   matrix M[2][3] = 1,x,2,y,3,z;
-   sum(M);
-   intvec v=2,4,6;
-   sum(M,v);
-   intvec iv = 1,2,3,4,5,6,7,8,9;
-   v=1..5,7,9;
-   sum(iv,v);
-   intmat m[2][3] = 1,1,1,2,2,2;
-   sum(m,3..4);
-}
-///////////////////////////////////////////////////////////////////////////////
diff --git a/Tst/Old/lib0.test b/Tst/Old/lib0.test
deleted file mode 100644
index 3600185..0000000
--- a/Tst/Old/lib0.test
+++ /dev/null
@@ -1,1072 +0,0 @@
-// $Id: lib0.test 12231 2009-11-02 10:12:22Z hannes $
-//system("random",787422842);
-//(GMG)
-///////////////////////////////////////////////////////////////////////////////
-
-LIBRARY:  lib0.lib       PROCEDURES OF GENERAL TYPE
-
- A_Z("a",n);             string of n comma seperated letters starting with a
- binomial(n,m[,int/str]);n choose m (type int), [type string/type number]
- changechar(r,"c","R");  makes a copy R of ring r with new char c the basering
- changeord(r,"ord","R"); makes a copy R of ring r with new ord the basering
- changevar(r,"vars","R");same as copyring
- copyring(r,"vars","R"); makes a copy R of ring r with new vars the basering
- copyring1(r,"vars","R");string to make a copy R of ring r with new variables
- defrings(n[,p]);        define ring Sn in n vars, char 32003 [or p], ds
- defringp(n[,p]);        define ring Pn in n vars, char 32003 [or p], dp
- factorial(n[,int/str]); n factorial (=n!) (type int), [type string/number]
- fetchall(R[,str]);      fetch all objects of ring R to basering
- fibonacci(n[,p]);       nth Fibonacci number [char p]
- ishomog(poly/...);      int, =1 resp. =0 if input is homogeneous resp. not
- kmemory();              int = active memory (kilobyte)
- killall();              kill all user-defined variables
- imapall(R [,str]);      imap all objects of ring R to basering
- mapall(R,i[,str]);      map all objects of ring R via ideal i to basering
- maxcoef(poly/...);      maximal length of coefficient occuring in poly/...
- maxdeg(poly/...);       int/intmat = degree/s of terms of maximal order
- mindeg(poly/...);       int/intmat = degree/s of terms of minimal order
- normalize(poly/...);    normalize poly/... such that leading coefficient is 1
- primes(n,m);            intvec of primes p, n<=p<=m
- product(vector/..[,v]); multiply components of vector/ideal/...[indices v]
- ringsum(s,t,..."r");    create a ring r from existing rings s,t,...
- ringweights(r);         intvec of weights of ring variables of ring r
- sort(ideal/module);     sort generators according to monomial ordering
- sum(vector/id/..[,v]);  add components of vector/ideal/...[with indices v]
-           (parameters in square brackets [] are optional)
-
-LIB "inout.lib";
-///////////////////////////////////////////////////////////////////////////////
-
-proc A_Z (string s,int n)
-USAGE:   A_Z("a",n);  a any letter, n integer (-26<= n <=26, !=0)
-RETURN:  string of n small (if a is small) or capital (if a is capital)
-         letters, comma seperated, beginning with a, in alphabetical
-         order (or revers alphabetical order if n<0)
-EXAMPLE: example A_Z; shows an example
-{
-  if ( n>=-26 and n<=26 and n!=0 )
-  {
-    string alpha =
-    "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,"+
-    "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,"+
-    "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,"+
-    "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z";
-    int ii; int aa;
-    for(ii=1; ii<=51; ii=ii+2)
-    {
-       if( alpha[ii]==s ) { aa=ii; }
-    }
-    if ( aa==0)
-    {
-      for(ii=105; ii<=155; ii=ii+2)
-      {
-        if( alpha[ii]==s ) { aa=ii; }
-      }
-    }
-    if( aa!=0 )
-    {
-      string out;
-      if (n > 0) { out = alpha[aa,2*(n)-1];  return (out); }
-      if (n < 0)
-      {
-        string beta =
-        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
-        "z,y,x,w,v,u,t,s,r,q,p,o,n,m,l,k,j,i,h,g,f,e,d,c,b,a,"+
-        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A,"+
-        "Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,I,H,G,F,E,D,C,B,A";
-        if ( aa < 52 ) { aa=52-aa; }
-        if ( aa > 104 ) { aa=260-aa; }
-        out = beta[aa,2*(-n)-1]; return (out);
-      }
-    }
-  }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   A_Z("c",5);
-   A_Z("Z",-5);
-   string sR = "ring R = (0,"+A_Z("A",6)+"),("+A_Z("a",10)+"),dp;";
-   sR;
-   execute sR;
-   R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc binomial (int n, int k, list #)
-USAGE:   binomial(n,k[,p/s]); n,k,p integers, s string
-RETURN:  binomial(n,k);    binomial coefficient n choose k of type int
-                           (machine integer, limited size! )
-         binomial(n,k,p);  n choose k in char p of type string
-         binomial(n,k,s);  n choose k of type number (s any string), computed
-                           in char of basering if a basering is defined
-EXAMPLE: example binomial; shows an example
-{
-   if ( size(#)==0 ) { int rr=1; }
-   if ( typeof(#[1])=="int") { ring bin = #[1],x,dp; number rr=1; }
-   if ( typeof(#[1])=="string") { number rr=1; }
-   if ( size(#)==0 or typeof(#[1])=="int" or typeof(#[1])=="string" )
-   {
-      def r = rr;
-      if ( k<=0 or k>n ) { return((k==0)*r); }
-      if ( k>=n-k ) { k = n-k; }
-      int l;
-      for (l=1 ; l<=k ; l++ )
-      {
-         r=r*(n+1-l)/l;
-      }
-      if ( typeof(#[1])=="int" ) { return(string(r)); }
-      return(r);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   int b1 = binomial(10,7); b1;
-   binomial(37,17,0);
-   ring t = 31,x,dp;
-   number b2 = binomial(37,17,""); b2;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changechar (r, string c, string newr)
-USAGE:   changechar(r,c,newr);  r=ring/qring, c,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the characteristic. If,
-         say, (c,newr) = ("0,A","R") and the ring r exists, the new basering
-         will have name R characteristic 0 and one parameter A.
-RETURN:  No return value
-NOTE:    //*** Buggy for qrings
-EXAMPLE: example changechar; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+c+"),("+varstr(r)+"),("+ordstr(r)+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   show(r);
-   changechar(r,"2,A","R");
-   show(R);
-   kill R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changeord (r, string o, string newr)
-USAGE:   changeord(r,o,newr);  r=ring/qring, o,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the ordering. If, say,
-         (o,newr) = ("wp(2,3),dp","R") and the ring r exists and has >=3
-         variables, the new basering will have name R and ordering wp(2,3),dp.
-RETURN:  No return value
-EXAMPLE: example changeord; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+charstr(r)+"),("+varstr(r)+"),("+o+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   changeord(r,"wp(2,3),dp","R");
-   show(R);
-   ideal i = x^2,y^2-u^3,v;
-   qring Q = std(i);
-   changeord(Q,"lp","Q'");
-   show(Q');
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc changevar (r, string vars, string newr)
-USAGE:   changevar(r,vars,newr);  r=ring/qring, vars,newr=strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-NOTE:    This procedure is the same as copyring
-EXAMPLE: example changevar; shows an example
-{
-   copyring(r,vars,newr);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   changevar(r,"A()","R");
-   show(R);
-   ideal i = x^2,y^2-u^3,v;
-   qring Q = std(i);
-   changevar(Q,"a,b,c,d","Q'");
-   show(Q');
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc copyring (r, string vars, string newr)
-USAGE:   copyring(r,vars,newr);  r ring/qring, vars, newr strings
-CREATE:  creates a new ring with name `newr` and makes it the basering if r is
-         an existing ring/qring.
-         The new ring differs from the old ring only in the variables. If, say,
-         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
-         the new basering will have name R and variables t(1),...,t(n).
-         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
-RETURN:  No return value
-NOTE:    This procedure is useful in connection with the procedure ringsum,
-         when a conflict between variable names must be avoided. See proc
-         copyring1 for an alternative
-EXAMPLE: example copyring; shows an example
-{
-   setring r;
-   ideal i = ideal(r); int q = size(i);
-   if( q!=0 )
-      { string s = "newr1"; }
-   else
-      { string s = newr; }
-   string newring = s+"=("+charstr(r)+"),(";
-   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
-   {
-      newring = newring+vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")";
-   }
-   else { newring = newring+vars; }
-   newring = newring+"),("+ordstr(r)+");";
-   execute("ring "+newring);
-   if( q!=0 )
-   {
-      map phi = r,maxideal(1);
-      ideal i = phi(i);
-      attrib(i,"isSB",1);         //*** attrib funktioniert ?
-      execute("qring "+newr+"=i;");
-   }
-   export(`newr`);
-   keepring(`newr`);
-   return();
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   copyring(r,"A()","R");
-   type R;
-   ideal i = A(1)^2,A(2)^2-A(3)^3,A(4);
-   qring Q = std(i);
-   copyring(Q,"a,b,c,d","Q'");
-   type Q';
-   kill R,Q,Q';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc copyring1 (r, string vars, string newr)
-USAGE:   copyring1(r,vars,newr);  r ring, vars, newr strings
-RETURN:  a string which can be executed to define a new ring with name equal
-         to `newr` if r is an existing ring name.
-         The new ring differs from the old ring only in the variables. If, say,
-         (vars,newr) = ("t()","R") and the ring r exists and has n variables,
-         the new basering will have name R and variables t(1),...,t(n).
-         If vars = "a,b,c,d", the new ring will have the variables a,b,c,d.
-NOTE:    This procedure differs from copyring that it returns the string to
-         create newring, but does not execute this string. Contrary to
-         copyring this procedure does not work for a qring
-EXAMPLE: example copyring1; shows an example
-{
-   string newring = "ring "+newr+"=("+charstr(r)+"),(";
-   if( vars[size(vars)-1]=="(" and vars[size(vars)]==")" )
-        { string v = vars[1,size(vars)-2]+"(1.."+string(nvars(r))+")"; }
-   else { string v = vars; }
-   return(newring+v+"),("+ordstr(r)+");");
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),(dp(2),ds);
-   string s=copyring1(r,"A()","R");s;
-   execute(s);
-   type R;
-   execute(copyring1(R,"a,b,c,d,e","r'"));
-   type r';
-   kill R,r';
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defring (string s1, string s2, int n, string s3, string s4)
-USAGE:   defring(s1,s2,n,s3,s4);  s1..s4=strings, n=integer
-CREATE:  Defines a ring with name 's1', characteristic 's2', ordering 's4' and
-         n variables with names derived from s3: if s3 is a single letter, say
-         s3="a", and if n<=26 then a and the following n-1 letters from the
-         alphabeth (cyclic order) are taken as variables. If n>26 or if s3 is
-         a single letter followed by (, say s3="T(", the variables are
-         T(1),...,T(n).
-RETURN:  No return value
-EXAMPLE: example defring; shows an example
-{
-   string newring = "ring "+s1+"=("+s2+"),(";
-   if( n>26 or s3[2]=="(" ) { string v = s3[1]+"(1.."+string(n)+")"; }
-   else { string v = A_Z(s3,n); }
-   newring=newring+v+"),("+s4+");";
-   execute(newring);
-   export(basering);
-   keepring(`s1`);
-   if (voice==2) { "// basering is now:",s1; }
-   return();
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defring("r","0",5,"u","ls"); r;
-   defring("R","2,A",10,"x(","dp(3),ws(1,2,3),ds"); R;
-   kill r,R;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defrings (int n, list #)
-USAGE:   defrings(n,[p]);  n,p integers
-CREATE:  Defines a ring with name Sn, characteristic p, ordering ds and n
-         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
-         the basering (default: p=32003)
-RETURN:  No return value
-EXAMPLE: example defrings; shows an example
-{
-   int p;
-   if (size(#)==0) { p=32003; }
-   else { p=#[1]; }
-   if (n >26)
-   {
-      string s="ring S"+string(n)+"="+string(p)+",x(1.."+string(n)+"),ds;";
-   }
-   else
-   {
-      string s="ring S"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),ds;";
-   }
-   execute(s);
-   export basering;
-   execute("keepring S"+string(n)+";");
-   if (voice==2) { "// basering is now:",s; }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defrings(5,0); S5;
-   defrings(30); S30;
-   kill S5, S30;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc defringp (int n,list #)
-USAGE:   defringp(n,[p]);  n,p=integers
-CREATE:  defines a ring with name Pn, characteristic p, ordering dp and n
-         variables x,y,z,a,b,...if n<=26 (resp. x(1..n) if n>26) and makes it
-         the basering (default: p=32003)
-RETURN:  No return value
-EXAMPLE: example defringp; shows an example
-{
-   int p;
-   if (size(#)==0) { p=32003; }
-   else { p=#[1]; }
-   if (n >26)
-   {
-      string s="ring P"+string(n)+"="+string(p)+",x(1.."+string(n)+"),dp;";
-   }
-   else
-   {
-     string s="ring P"+string(n)+"="+string(p)+",("+A_Z("x",n)+"),dp;";
-   }
-   execute(s);
-   export basering;
-   execute("keepring P"+string(n)+";");
-   //the next comment is only shown if defringp is not called by another proc
-   if (voice==2) { "// basering is now:",s; }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   defringp(5,0); P5;
-   defringp(30); P30;
-   kill P5, P30;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc factorial (int n, list #)
-USAGE:   factorial(n[,string]);  n integer
-RETURN:  factorial(n); string of n! in char 0
-         factorial(n,s);  n! of type number (s any string), computed in char of
-         basering if a basering is defined
-EXAMPLE: example factorial; shows an example
-{
-   if ( size(#)==0 ) { ring R = 0,x,dp; poly r=1; }
-   if ( typeof(#[1])=="string" ) { number r=1; }
-   if ( size(#)==0 or typeof(#[1])=="string" )
-   {
-      int l;
-      for (l=2; l<=n; l++)
-      {
-         r=r*l;
-      }
-      if ( size(#)==0 ) { return(string(r)); }
-      return(r);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   factorial(37);
-   ring r1 = 32003,(x,y,z),ds;
-   number p = factorial(37,""); p;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc fetchall (R, list #)
-USAGE:   fetchall(R[,s]);  R=ring/qring, s=string
-CREATE:  fetch all objects of ring R (of type poly, ideal, vector, module,
-         number, matrix) into the basering.
-         If no 3rd argument is present, the names are the same as in R. If, say,
-         f is a poly in R and the 3rd argument is the string "R", then f is
-         maped to f_R etc.
-RETURN:  no return value
-NOTE:    As fetch, this procedure maps the 1st, 2nd, ... variable of R to the
-         1st, 2nd, ... variable of the basering.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: fetchall does not work inside a procedure
-         //***at the moment it does not work if R contains a map
-EXAMPLE: example fetchall; shows an example
-{
-   list @L@=names(R);
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-         execute("def "+ at L@[@ii@]+ at s@+"=fetch(R,`@L@[@ii@]`);");
-         execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since fetchall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z),dp;";
-"   ideal j=x,y2,z2;";
-"   matrix M[2][3]=1,2,3,x,y,z;";
-"   j; print(M);";
-"   ring S=0,(a,b,c),ds;";
-"   fetchall(R);           // map from R to S: x->a, y->b, z->c";
-"   names(S);";
-"   j; print(M);";
-"   fetchall(S,\"1\");       // identity map of S: copy objects, change names";
-"   names(S);";
-"   kill R,S;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc fibonacci (int n, list #)
-USAGE:   fibonacci(n[,string]);  (n integer)
-RETURN:  fibonacci(n); string of nth Fibonacci number,
-            f(0)=f(1)=1, f(i+1)=f(i-1)+f(i)
-         fibonacci(n,s);  nth Fibonacci number of type number (s any string),
-         computed in characteristic of basering if a basering is defined
-EXAMPLE: example fibonacci; shows an example
-{
-   if ( size(#)==0 ) { ring fibo = 0,x,dp; number f=1; }
-   if ( typeof(#[1])=="string" ) { number f=1; }
-   if ( size(#)==0 or typeof(#[1])=="string" )
-   {
-      number g,h = 1,1; int ii;
-      for (ii=3; ii<=n; ii++)
-      {
-         h = f+g; f = g; g = h;
-      }
-      if ( size(#)==0 ) { return(string(h)); }
-      return(h);
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   fibonacci(37);
-   ring r = 17,x,dp;
-   number b = fibonacci(37,""); b;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ishomog (id)
-USAGE:   ishomog(id);  id  poly/ideal/vector/module/matrix
-RETURN:  integer which is 1 if input is homogeneous (resp. weighted homogeneous
-         if the monomial ordering consists of one block of type ws,Ws,wp or Wp,
-         assuming that all weights are positive) and 0 otherwise
-NOTE:    A vector is homogeneous, if the components are homogeneous of same
-         degree, a module/matrix is homogeneous if all column vectors are
-         homogeneous
-         //*** ergaenzen, wenn Matrizen Spalten Gewichte haben
-EXAMPLE: example ishomog; shows an example
-{
-   module M = module(matrix(id));
-   M = simplify(M,2);                        // remove 0-columns
-   intvec v = ringweights(basering);
-   int i,j=1,1;
-   for (i=1; i<=ncols(M); i++)
-   {
-      if( M[i]!=jet(M[i],deg(lead(M[i])),v)-jet(M[i],deg(lead(M[i]))-1,v))
-      { return(0); }
-   }
-   return(1);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),wp(1,2,3);
-   ishomog(x5-yz+y3);
-   ideal i = x6+y3+z2, x9-z3;
-   ishomog(i);
-   ring s = 0,(a,b,c),ds;
-   vector v = [a2,0,ac+bc];
-   vector w = [a3,b3,c4];
-   ishomog(v);
-   ishomog(w);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc kmemory ()
-USAGE:   kmemory();
-RETURN:  memory used by active variables, of type int (in kilobyte)
-EXAMPLE: example kmemory; shows an example
-{
-  if ( voice==2 ) { "// memory used by active variables (kilobyte):"; }
-   return ((memory(0)+1023)/1024);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   kmemory();
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc killall ()
-USAGE:   killall(); (no parameter)
-CREATE:  kill all user-defined variables but not loaded procedures
-RETURN:  no return value
-NOTE:    killall should never be used inside a procedure
-EXAMPLE: example killall; shows an example AND KILLS ALL YOUR VARIABLES
-{
-   list L=names(); int joni=size(L);
-   for ( ; joni>0; joni-- )
-   {
-      joni,L[joni],typeof(`L[joni]`),
-      L[joni]!="LIB",
-      typeof(`L[joni]`)!="proc",
-      L[joni]!="LIB" and typeof(`L[joni]`)!="proc";
-      if( L[joni]!="LIB" and typeof(`L[joni]`)!="proc" ) { joni;"kill"+L[joni];kill `L[joni]`; }
-   }
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring rtest; ideal i=x,y,z; number n=37; string str="hi";
-   export rtest,i,n,str;     //this makes the local variables global
-   listvar(all);
-   killall();
-   listvar(all);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc imapall (R, list #)
-USAGE:   imapall(R[,s]);  R=ring/qring, s=string
-CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
-         matrix) into the basering, by applying imap to all objects of R.
-         If no 3rd argument is present, the names are the same as in R. If, say,
-         f is a poly in R and the 3rd argument is the string "R", then f is
-         maped to f_R etc.
-RETURN:  no return value
-NOTE:    As imap, this procedure maps the variables of R to the variables with
-         the same name in the basering, the other variables are maped to 0.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: imapall does not work inside a procedure
-         //***at the moment it does not work if R contains a map
-EXAMPLE: example imapall; shows an example
-{
-   list @L@=names(R);
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-         execute("def "+ at L@[@ii@]+ at s@+"=imap(R,`@L@[@ii@]`);");
-         execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since imapall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z,u),dp;";
-"   ideal j=x,y,z,u2+ux+z;";
-"   matrix M[2][3]=1,2,3,x,y,uz;";
-"   j; print(M);";
-"   ring S=0,(a,b,c,x,z,y),ds;";
-"   imapall(R);           // map from R to S: x->x, y->y, z->z, u->0";
-"   names(S);";
-"   j; print(M);";
-"   imapall(S,\"1\");       // identity map of S: copy objects, change names";
-"   names(S);";
-"   kill R,S;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc mapall (R, ideal i, list #)
-USAGE:   mapall(R,i[,s]);  R=ring/qring, i=ideal of basering, s=string
-CREATE:  map all objects of ring R (of type poly, ideal, vector, module, number,
-         matrix, map) into the basering, by mapping the jth variable of R to
-         the jth generator of the ideal i. If no 3rd argument is present, the
-         names are the same as in R. If, say, f is a poly in R and the 3rd
-         argument is the string "R", then f is maped to f_R etc.
-RETURN:  no return value
-NOTE:    This procedure has the same effect as defining a map, say psi, by
-         map psi=R,i; and then applying psi to all objects of R. In particular,
-         maps from R to some ring S are composed with psi, creating thus a map
-         from the basering to S.
-         mapall may be combined with copyring to change vars for all objects.
-         The 3rd argument is useful in order to avoid conflicts of names, the
-         empty string is allowed
-CAUTION: mapall does not work inside a procedure
-EXAMPLE: example mapall; shows an example
-{
-   list @L@=names(R); map @psi@ = R,i;
-   int @ii@; string @s@;
-   if( size(#) > 0 ) { @s@=@s at +"_"+#[1]; }
-   for( @ii@=size(@L@); @ii@>0; @ii@=@ii at -- )
-   {
-      execute("def "+ at L@[@ii@]+ at s@+"=@psi@(`@L@[@ii@]`);");
-      execute("export "+ at L@[@ii@]+ at s@+";");
-   }
-   return();
-}
-example
-{  "EXAMPLE:";
-"// This example is not executed since mapall does not work in a procedure";
-"// (and hence not in the example procedure). Just try the following commands:";
-"   ring R=0,(x,y,z),dp;";
-"   ideal j=x,y,z;";
-"   matrix M[2][3]=1,2,3,x,y,z;";
-"   map phi=R,x2,y2,z2; ";
-"   ring S=0,(a,b,c),ds;";
-"   ideal i=c,a,b;";
-"   mapall(R,i);             // map from R to S: x->c, y->a, z->b";
-"   names(S);";
-"   j; print(M); phi;        // phi is a map from R to S: x->c2, y->a2, z->b2";
-"   ideal i1=a2,a+b,1;";
-"   mapall(R,i1,\"\");         // map from R to S: x->a2, y->a+b, z->1";
-"   names(S);";
-"   j_; print(M_); phi_;";
-"   copyring(S,\"x()\",\"T\");";
-"   mapall(R,maxideal(1));   // identity map from R to T";
-"   names(T);";
-"   j; print(M); phi;";
-"   kill R,S,T;";
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc maxcoef (f)
-USAGE:   maxcoef(f);  f  poly/ideal/vector/module/matrix
-RETURN:  maximal length of coefficient of f of type int (by counting the
-         length of the string of each coefficient)
-EXAMPLE: example maxcoef; shows an example
-{
-   int max,s,ii,jj; string t;
-   ideal i = ideal(matrix(f));
-   i = simplify(i,6);         //* delete 0's and keep first of equal elements
-   poly m = var(1); matrix C;
-   for (ii=2;ii<=nvars(basering);ii++) { m = m*var(ii); }
-   for (ii=1; ii<=size(i); ii++)
-   {
-      C = coef(i[ii],m);
-      for (jj=1; jj<=ncols(C); jj++)
-      {
-         t = string(C[2,jj]);  s = size(t);
-         if ( t[1] == "-" ) { s = s - 1; }
-         if ( s > max ) { max = s; }
-      }
-   }
-   return(max);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),ds;
-   poly g = 345x2-1234567890y+7/4z;
-   maxcoef(g);
-   ideal i = g,10/1234567890;
-   maxcoef(i);
-   // since i[2]=1/123456789
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc maxdeg (id)
-USAGE:   maxdeg(id);  id  poly/ideal/vector/module/matrix
-RETURN:  maximal degree/s of monomials of id independent of ring ordering
-         (maxdeg of each variable is 1)
-         of type int if id is of type poly, of type intmat else
-EXAMPLE: example maxdeg; shows an example
-{
-//------------------- find maximal degree of given component ------------------
-   proc findmaxdeg
-   {
-      poly c = #[1];
-      if (c==0) { return(-1); }
-   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
-      int d = (deg(c)>=0)*deg(c)-(deg(c)<0)*deg(c);
-      int i = d;
-      while ( c-jet(c,i) != 0 ) { i = 2*(i+1); }
-      int o = i-1;
-      int u = (d != i)*((i/ 2)-1);
-   //----------------------- "quick search" for maxdeg ------------------------
-      while ( (c-jet(c,i)==0)*(c-jet(c,i-1)!=0) == 0)
-      {
-         i = (o+1+u)/ 2;
-         if (c-jet(c,i)!=0) { u = i+1; }
-         else { o = i-1; }
-      }
-      return(i);
-   }
-//------------------------------ main program ---------------------------------
-   matrix M = matrix(id);
-   int r,c = nrows(M), ncols(M); int i,j;
-   intmat m[r][c];
-   for (i=r; i>0; i--)
-   {
-      for (j=c; j>0; j--) { m[i,j] = findmaxdeg(M[i,j]); }
-   }
-   if( typeof(id)=="poly" ) { return(m[1,1]); }
-   return(m);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),wp(-1,-2,-3);
-   poly f = x+y2+z3;
-   deg(f);               //deg returns weighted degree (in case of 1 block)!
-   maxdeg(f);
-   matrix m[2][2]=f+x10,1,0,f^2;
-   maxdeg(m);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc mindeg (id)
-USAGE:   mindeg(id);  id  poly/ideal/vector/module/matrix
-RETURN:  minimal degree/s of monomials of id independent of ring ordering
-         (mindeg of each variable is 1)
-         of type int if id is of type poly, of type intmat else
-EXAMPLE: example mindeg; shows an example
-{
-//------------------- find minimal degree of given component ------------------
-   proc findmindeg
-   {
-      poly c = #[1];
-      if (c==0) { return(-1); }
-   //--- guess upper 'o' and lower 'u' bound, in case of negative weights -----
-      int d = (ord(c)>=0)*ord(c)-(ord(c)<0)*ord(c);
-      int i = d;
-      while ( jet(c,i) == 0 ) { i = 2*(i+1); }
-      int o = i-1;
-      int u = (d != i)*((i/ 2)-1);
-//----------------------- "quick search" for mindeg --------------------------
-      while ( (jet(c,u)==0)*(jet(c,o)!=0) )
-      {
-         i = (o+u)/ 2;
-         if (jet(c,i)==0) { u = i+1; }
-         else { o = i-1; }
-      }
-      if (jet(c,u)!=0) { return(u); }
-      else { return(o+1); }
-   }
-//------------------------------ main program ---------------------------------
-   matrix M = matrix(id);
-   int r,c = nrows(M), ncols(M); int i,j;
-   intmat m[r][c];
-   for (i=r; i>0; i--)
-   {
-      for (j=c; j>0; j--) { m[i,j] = findmindeg(M[i,j]); }
-   }
-   if (typeof(id)=="poly") { return(m[1,1]); }
-   return(m);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),ls;
-   poly f = x5+y2+z3;
-   ord(f);                // ord returns weighted order of leading term!
-   mindeg(f);
-   matrix m[2][2]=x10,1,0,f^2;
-   mindeg(m);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc normalize (id)
-USAGE:   normalize(id);  id=poly/vector/ideal/module
-RETURN:  object of same type with leading coefficient equal to 1
-EXAMPLE: example normalize; shows an example
-{
-   return(simplify(id,1));
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r = 0,(x,y,z),ls;
-   poly f = 2x5+3y2+4z3;
-   normalize(f);
-   module m=[9xy,0,3z3],[4z,6y,2x];
-   show(normalize(m));
-   ring s = 0,(x,y,z),(c,ls);
-   module m=[9xy,0,3z3],[4z,6y,2x];
-   show(normalize(m));
-   normalize(matrix(m));  // by automatic type conversion to module!
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc primes (int n, int m)
-USAGE:   primes(n,m);  n,m integers
-RETURN:  intvec, consisting of all primes p, prime(n)<=p<=m, in increasing
-         order if n<=m, resp. prime(m)<=p<=n, in decreasing order if m<n
-NOTE:    prime(n); returns the biggest prime number <= n (if n>=2, else 2)
-EXAMPLE: example primes; shows an example
-{  int change;
-   if ( n>m ) { change=n; n=m ; m=change; change=1; }
-   int q,p = prime(m),prime(n); intvec v = q; q = q-1;
-   while ( q>=p ) { q = prime(q); v = q,v; q = q-1; }
-   if ( change==1 ) { v = v[size(v)..1]; }
-   return(v);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   primes(50,100);
-   intvec v = primes(37,1); v;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc product (id, list #)
-USAGE:    product(id[,v]); id=ideal/vector/module/matrix
-          resp.id=intvec/intmat, v=intvec (e.g. v=1..n, n=integer)
-RETURN:   poly resp. int which is the product of all entries of id, with index
-          given by v (default: v=1..number of entries of id)
-NOTE:     id is treated as a list of polys resp. integers. A module m is
-          identified with corresponding matrix M (columns of M generate m)
-EXAMPLE:  example product; shows an example
-{
-   int n,j;
-   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
-       or typeof(id)=="module" or typeof(id)=="matrix" )
-   {
-      ideal i = ideal(matrix(id));
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      n = ncols(i); poly f=1;
-   }
-   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
-   {
-      intmat S = intmat(id);
-      intvec i = S[1..nrows(S),1..ncols(S)];
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      n = size(i); int f=1;
-   }
-   for( j=1; j<=n; j++ ) { f=f*i[j]; }
-   return(f);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),dp;
-   ideal m = maxideal(1);
-   product(m);
-   matrix M[2][3] = 1,x,2,y,3,z;
-   product(M);
-   intvec v=2,4,6;
-   product(M,v);
-   intvec iv = 1,2,3,4,5,6,7,8,9;
-   v=1..5,7,9;
-   product(iv,v);
-   intmat A[2][3] = 1,1,1,2,2,2;
-   product(A,3..5);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ringsum (list #)
-USAGE:   ringsum(r1,r2,...,s); r1,r2,... rings, s string (name of result ring)
-CREATE:  A new base ring with name equal to s if r1,r2,... are existing rings.
-         If, say, s = "R" and the rings r1,r2,... exist, the new ring will
-         have name R, variables from all rings r1,r2,... and as monomial
-         ordering the block (product) ordering of r1,r2,.... Mathematically, R
-         is the tensor product of the rings r1,r2,... with ordering matrix
-         equal to the direct sum of the ordering matrices of r1,r2,...
-RETURN:  no return value
-NOTE:    The characteristic of the new ring will be that of r1. The names of
-         variables in the rings r1,r2,... should differ (if a name, say x,
-         occurs in r1 and r2, then, in the new ring r, x always refers to the
-         variable with name x in r1, there is no access to x in r2).
-         The procedure works also for quotient rings.
-EXAMPLE: example ringsum; shows an example
-{
-   int ii,q;
-   int n = size(#);
-   string vars,order,oi,s;
-   for(ii=1; ii<=n-1; ii++)
-   {
-      if( ordstr(#[ii])[1]=="C" or ordstr(#[ii])[1]=="c" )
-           { oi=ordstr(#[ii])[3,size(ordstr(#[ii]))-2]; }
-      else { oi=ordstr(#[ii])[1,size(ordstr(#[ii]))-2]; }
-      vars = vars+varstr(#[ii])+",";
-      order= order+oi+",";
-      def r(ii)=#[ii];
-      setring r(ii);
-      ideal i(ii)=ideal(r(ii));
-      int q(ii)=size(i(ii));
-      q=q+q(ii);
-   }
-   if( q!=0 ) { s = "newr"; }
-   else {  s = #[size(#)]; }
-   string newring ="=("+charstr(#[1])+"),("+vars[1,size(vars)-1]+"),("
-                  +order[1,size(order)-1]+");";
-   execute("ring "+s+newring);
-   if( q!=0 )
-   {
-      ideal i;
-      for(ii=1; ii<=n-1; ii++)
-      {
-         if( q(ii)!=0 )
-         {
-            map phi = r(ii),maxideal(1);
-            i = i+phi(i(ii));
-            kill phi;
-         }
-      }
-      i=std(i);
-      execute("qring "+#[size(#)]+"=i;");
-   }
-   export(`#[size(#)]`);
-   keepring(`#[size(#)]`);
-   return();
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r=0,(x,y,u,v),dp;
-   ring s=32003,(a,b,c),wp(1,2,3);
-   ring t=37,x(1..5),(c,ls);
-   ringsum(r,s,t,"R");
-   type R;
-   setring s;
-   ideal i = a2+b3+c5; i=std(i);
-   qring qs =i;
-   setring s; qring qt=i;
-   ringsum(r,qs,t,qt,"Q");
-   type Q;
-   kill R,Q;
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc ringweights (r)
-USAGE:   ringweights(r); r ring
-RETURN:  intvec of weights of ring variables. If, say, x(1),...,x(n) are the
-         variables of the ring r, in this order, the resulting intvec is
-         deg(x(1)),...,deg(x(n)) where deg denotes the weighted degree if
-         the monomial ordering of r has only one block of type ws,Ws,wp or Wp.
-NOTE:    In all other cases, in particular if there is more than one block,
-         the resulting intvec is 1,...,1
-EXAMPLE: example ringweights; shows an example
-{
-   int i; intvec v; setring r;
-   for (i=1; i<=nvars(basering); i++) { v[i] = deg(var(i)); }
-   return(v);
-}
-example
-{ "EXAMPLE:"; echo = 2;
-   ring r1=32003,(x,y,z),wp(1,2,3);
-   ring r2=32003,(x,y,z),Ws(1,2,3);
-   ring r=0,(x,y,u,v),lp;
-   intvec vr=ringweights(r1); vr;
-   ringweights(r2);
-   ringweights(r);
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc sort
-USAGE:    sort(id); id ideal or module
-RETURN:   ideal with generators of id sorted with respect to monomial ordering
-          of the basering (generators with smaller leading term come first)
-EXAMPLE:  example sort; shows an example
-{
-  intvec v = sortvec(#[1]);
-  int s    = size(v);
-  def m    = #[1];
-  for (int jj=1;jj<=s;jj++) { m[jj] = #[1][v[jj]]; }
-  return(m);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r0 = 0,(x,y,z),lp;
-   ideal i = x3,y3,z3,x2z,x2y,y2z,y2x,z2y,z2x,xyz;
-   sort(i);
-   ring r1  = 0,t,ls;
-   ideal i = t47,t14,t6;
-   ideal j = i;
-   int ii;
-   for (ii=1;ii<=8;ii=ii+1) { j=simplify(jet(j+i^ii,50),6); }
-   print (matrix(j));
-   print (matrix(sort(j)));
-}
-///////////////////////////////////////////////////////////////////////////////
-
-proc sum (id, list #)
-USAGE:    sum(id[,v]); id=ideal/vector/module/matrix resp. id=intvec/intmat,
-                       v=intvec (e.g. v=1..n, n=integer)
-RETURN:   poly resp. int which is the sum of all entries of id, with index
-          given by v (default: v=1..number of entries of id)
-NOTE:     id is treated as a list of polys resp. integers. A module m is
-          identified with corresponding matrix M (columns of M generate m)
-EXAMPLE:  example sum; shows an example
-{
-   if( typeof(id)=="poly" or typeof(id)=="ideal" or typeof(id)=="vector"
-       or typeof(id)=="module" or typeof(id)=="matrix" )
-   {
-      ideal i = ideal(matrix(id));
-      if( size(#)!=0 ) { i = i[#[1]]; }
-      matrix Z = matrix(i);
-      intvec v; v[ncols(Z)]=0; v=v+1;
-   }
-   if( typeof(id)=="int" or typeof(id)=="intvec" or typeof(id)=="intmat" )
-   {
-      intmat S = intmat(id);
-      intvec v = S[1..nrows(S),1..ncols(S)];
-      if( size(#)!=0 ) { v = v[#[1]]; }
-      intvec z; z[size(v)]=0; z=z+1;
-      intmat Z=transpose(z);
-   }
-   return((Z*v)[1,1]);
-}
-example
-{  "EXAMPLE:"; echo = 2;
-   ring r= 0,(x,y,z),dp;
-   vector pv = [xy,xz,yz,x2,y2,z2];
-   sum(pv);
-   sum(pv,2..5);
-   matrix M[2][3] = 1,x,2,y,3,z;
-   sum(M);
-   intvec v=2,4,6;
-   sum(M,v);
-   intvec iv = 1,2,3,4,5,6,7,8,9;
-   v=1..5,7,9;
-   sum(iv,v);
-   intmat m[2][3] = 1,1,1,2,2,2;
-   sum(m,3..4);
-}
-///////////////////////////////////////////////////////////////////////////////
diff --git a/callpolymake/Makefile b/callpolymake/Makefile
deleted file mode 100755
index 0360f6e..0000000
--- a/callpolymake/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-PM_INC := $(shell polymake-config --includes)
-PM_CFLAGS := -fPIC -DPOLYMAKE_DEBUG=0
-PM_LIBS := $(shell polymake-config --libs)
-PM_LDFLAGS := $(shell polymake-config --ldflags)
-
-CFLAGS += -march=native
-LDFLAGS += -Wl,-rpath,/home/ren/polymake-2.9.10/build.x86_64/perlx-5.10.1-x86_64-linux-gnu-thread-multi/ -lxml2
-
-all: polymake
-
-polymake: 
-	g++ -o polymake.o -I. ${PM_INC} ${PM_CFLAGS} ${CFLAGS} ${PM_LDFLAGS} ${PM_LIBS} -I/home/ren/Sources/ -c -g polymake.cc
-	g++ -shared -o polymake.so ${PM_INC} ${PM_CFLAGS} ${CFLAGS} ${PM_LDFLAGS} ${PM_LIBS} ${LDFLAGS} -lgmpxx -lgmp -g polymake.o
-
-clean:
-	rm *.so *.o
-
diff --git a/callpolymake/polymake.cc b/callpolymake/polymake.cc
deleted file mode 100755
index cd086f1..0000000
--- a/callpolymake/polymake.cc
+++ /dev/null
@@ -1,451 +0,0 @@
-#include </usr/local/include/polymake/Main.h>
-#include </usr/local/include/polymake/Matrix.h>
-#include </usr/local/include/polymake/Rational.h>
-#include </usr/local/include/polymake/Integer.h>
-#include </usr/local/include/polymake/perl/macros.h>
-#include </usr/local/include/polymake/next/Set.h>
-#include </usr/local/include/polymake/next/IncidenceMatrix.h>
-
-#include </usr/local/include/gfanlib.h>
-#include </usr/local/include/gfanlib_q.h>
-
-#include <gmpxx.h>
-
-#include <kernel/mod2.h>
-#include <kernel/structs.h>
-#include <kernel/febase.h>
-#include <kernel/intvec.h>
-
-#include <kernel/bbcone.h>
-#include <kernel/bbfan.h>
-
-#include <Singular/ipshell.h>
-#include <Singular/subexpr.h>
-
-using namespace polymake;
-
-/* Functions for converting Integers, Rationals and their Matrices 
-   in between C++, gfan, polymake and singular */
-
-gfan::Integer PMInt2GFInt (const polymake::Integer pmint)
-{
-  mpz_class cache(pmint.get_rep());
-  gfan::Integer gfint(cache.get_mpz_t());
-  return gfint;  
-}
-
-polymake::Integer GFInt2PMInt (const gfan::Integer gfint)
-{
-  mpz_t cache; mpz_init(cache);
-  gfint.setGmp(cache);
-  polymake::Integer pmint(cache);
-  return pmint;
-}
-
-gfan::Rational PMRat2GFRat (const polymake::Rational pmrat)
-{
-  mpq_class cache(pmrat.get_rep());
-  gfan::Rational gfrat(cache.get_mpq_t());
-  return gfrat;
-}
-
-polymake::Rational GFRat2PMRat (const gfan::Rational gfrat)
-{
-  mpq_t cache; mpq_init(cache);
-  gfrat.setGmp(cache);
-  polymake::Rational pmrat(cache);
-  return pmrat;
-}
-
-gfan::ZMatrix PMMat2ZMat (const polymake::Matrix<polymake::Integer> pmmat)
-{
-  int rows=pmmat.rows();
-  int cols=pmmat.cols();
-  gfan::ZMatrix zmat(rows,cols);
-  for(int r=1; r<=rows; r++)
-    for(int c=1; c<=cols; c++)
-      zmat[r-1][c-1] = PMInt2GFInt(pmmat(r-1,c-1));
-  return zmat;
-}
-
-gfan::QMatrix PMMat2QMat (const polymake::Matrix<polymake::Integer> pmmat)
-{
-  int rows=pmmat.rows();
-  int cols=pmmat.cols();
-  gfan::QMatrix qmat(rows,cols);
-  for(int r=1; r<=rows; r++)
-    for(int c=1; c<=cols; c++)
-      qmat[r-1][c-1] = PMRat2GFRat(pmmat(r-1,c-1));
-  return qmat;
-}
-
-polymake::Matrix<polymake::Integer> ZMat2PMMat (const gfan::ZMatrix zmat)
-{
-  int rows=zmat.getHeight();
-  int cols=zmat.getWidth();
-  polymake::Matrix<polymake::Integer> pmmat(rows,cols);
-  for(int r=1; r<=rows; r++)
-    for(int c=1; c<=cols; c++)
-      pmmat(r-1,c-1) = GFInt2PMInt(zmat[r-1][c-1]);
-  return pmmat;
-}
-
-polymake::Matrix<polymake::Rational> QMat2PMMat (const gfan::QMatrix qmat)
-{
-  int rows=qmat.getHeight();
-  int cols=qmat.getWidth();
-  polymake::Matrix<polymake::Rational> pmmat(rows,cols);
-  for(int r=1; r<=rows; r++)
-    for(int c=1; c<=cols; c++)
-      pmmat(r-1,c-1) = GFRat2PMRat(qmat[r-1][c-1]);
-  return pmmat;
-}
-
-intvec* PMMat2intvec (polymake::Matrix<polymake::Integer> pmmat)
-{
-  int rows = pmmat.rows();
-  int cols = pmmat.cols();
-  intvec* simat = new intvec(rows,cols,0);
-  const polymake::Integer* elem = concat_rows(pmmat).begin();
-  for (int r = 1; r <= rows; r++) 
-    for (int c = 1; c <= cols; c++) 
-       IMATELEM(*simat,r,c) = *elem++;
-  return simat;  
-}
-
-/* Functions for converting cones and fans in between gfan and polymake,
-   Singular shares the same cones and fans with gfan */
-
-gfan::ZCone PMCone2ZCone (polymake::perl::Object pc)
-{
-  if (pc.isa("Cone"))
-  {
-    polymake::Matrix<polymake::Integer> rays = pc.give("RAYS");
-    gfan::ZMatrix zm = PMMat2ZMat(rays);
-
-    gfan::ZCone zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-    return zc;
-  }
-  WerrorS("PMCone2ZCone: unexpected parameters");
-}
-
-gfan::ZFan PMFan2ZFan (polymake::perl::Object pf)
-{
-  if (pf.isa("PolyhedralFan"))
-  {
-    int d = (int) pf.give("FAN_AMBIENT_DIM");
-    gfan::ZFan zf = gfan::ZFan(d);
-
-    int n = pf.give("N_MAXIMAL_CONES");
-    for (int i=0; i<n; i++)
-      {
-        polymake::perl::Object pmcone=pf.CallPolymakeMethod("cone",i);
-	gfan::ZCone zc=PMCone2ZCone(pmcone);
-        zf.insert(zc);
-      }
-    return zf;
-  }
-  WerrorS("PMFan2ZFan: unexpected parameters");
-}
-
-polymake::perl::Object ZCone2PMCone (gfan::ZCone zc)
-{
-  gfan::ZMatrix zm = zc.extremeRays();
-  polymake::Matrix<polymake::Integer> pm = ZMat2PMMat(zm);
-
-  polymake::perl::Object gc("Cone");
-  gc.take("INPUT_RAYS") << pm;  
-
-  return gc;
-}
-
-polymake::Matrix<polymake::Integer> PRaysOf(gfan::ZFan* zf)
-{
-  int d = zf->getAmbientDimension();
-  int n = zf->numberOfConesOfDimension(1,0,0);
-  gfan::ZMatrix zm(n,d);
-
-  for (int i=0; i<n; i++)
-    {
-      gfan::ZCone zc = zf->getCone(1,i,0,0);
-      gfan::ZMatrix ray = zc.extremeRays();
-      for (int j=0; j<d; j++)
-        {
-  	  zm[i][j]=ray[0][j];
-        }
-    }
-
-  return ZMat2PMMat(zm);
-}
-
-int numberOfRaysOf(gfan::ZFan* zf)
-{
-  int n = zf->numberOfConesOfDimension(1,0,0);
-  return n;
-}
-
-int numberOfMaximalConesOf(gfan::ZFan* zf)
-{
-  int d = zf->getAmbientDimension();
-  int n = 0;
-
-  for (int i=0; i<=n; i++)
-    {
-      int n = n + zf->numberOfConesOfDimension(i,0,1);
-    }
-
-  return n;
-}
-
-polymake::Array<polymake::Set<int> > PConesOf(gfan::ZFan* zf)
-{
-  int c = numberOfRaysOf(zf);
-  int r = numberOfMaximalConesOf(zf);
-
-  polymake::Matrix<polymake::Integer> pm=PRaysOf(zf);
-  polymake::Array<polymake::Set<int> > L(r);
-
-  int d = 1;  // runs through all dimensions
-  int ii = 0; // runs through all cones of a given dimension
-  for (int i=0; i<r; i++)
-    {
-      if (ii>zf->numberOfConesOfDimension(d,0,1))  // if all cones of a dimension are through,
-  	{
-  	  d = d+1;                                 // increase dimension
-          ii = 0;                                  // set counter to 0
-  	}
-      gfan::IntVector v = zf->getConeIndices(d,ii,0,1);
-      polymake::Set<int> s;
-      for (int j=0; j<v.size(); j++)
-  	{
-  	  s = s+v[j];
-  	}
-      
-      L[i] = s;
-      ii = ii+1;
-    }
-  return L;
-}
-
-polymake::perl::Object ZFan2PMFan (gfan::ZFan* zf)
-{
-  polymake::perl::Object pf("PolyhedralFan");
-
-  polymake::Matrix<polymake::Integer> zm = PRaysOf(zf);
-  pf.take("INPUT_RAYS") << zm;
-
-  polymake::Array<polymake::Set<int> > ar = PConesOf(zf);
-  pf.take("INPUT_CONES") << ar;
-
-  return pf;
-}
-
-/* Functions for using Polymake in Singular */
-
-BOOLEAN cube(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u !=NULL) && (u->Typ() == INT_CMD))
-    {
-      int ambientDim = (int)(long)u->Data();
-      if (ambientDim < 0)
-	{
-          Werror("expected non-negative ambient dim but got %d", ambientDim);
-	  return TRUE;
-	}
-      gfan::ZMatrix zm(ambientDim*2,ambientDim+1);
-      int j=1;
-      for (int i=0; i<ambientDim*2; i=i+2)
-        {
-          zm[i][0] = 1;
-          zm[i][j] = 1;
-          zm[i+1][0] = 1;
-          zm[i+1][j] = -1;
-          j = j+1;
-        }
-      gfan::ZCone* zc = new gfan::ZCone(zm, gfan::ZMatrix(0, zm.getWidth()));
-      res->rtyp = coneID;
-      res->data = (char *)zc;
-      return FALSE;
-    }
-  WerrorS("cube: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN cross(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u !=NULL) && (u->Typ() == INT_CMD))
-    {
-      int ambientDim = (int)(long)u->Data();
-      if (ambientDim < 0)
-	{
-          Werror("expected non-negative ambient dim but got %d", ambientDim);
-	  return TRUE;
-	}
-      gfan::ZMatrix zm(ambientDim*2,ambientDim+1);
-      int j=1;
-      for (int i=0; i<ambientDim*2; i=i+2)
-        {
-          zm[i][0] = 1;
-          zm[i][j] = 1;
-          zm[i+1][0] = 1;
-          zm[i+1][j] = -1;
-          j = j+1;
-        }
-      gfan::ZCone* zc = new gfan::ZCone();
-      *zc = gfan::ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-      res->rtyp = coneID;
-      res->data = (char *)zc;
-      return FALSE;
-    }
-  WerrorS("cross: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN visual(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {  
-    try
-    {
-      gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-      gfan::ZMatrix rays = zc->extremeRays();
-      polymake::perl::Object p("Polytope<Rational>");
-      p.take("VERTICES") << ZMat2PMMat(rays);
-      CallPolymakeFunction("jreality",p.CallPolymakeMethod("VISUAL"));
-      res->rtyp = NONE;
-      res->data = NULL;
-      return FALSE;
-    }
-    catch (const std::exception& ex)
-    {
-      std::cerr << "Error: " << ex.what() << std::endl; 
-      return TRUE;
-    }
-  }
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    try
-    {
-      gfan::ZFan* zf = (gfan::ZFan*)u->Data();
-      polymake::perl::Object pf=ZFan2PMFan(zf);
-      CallPolymakeFunction("jreality",pf.CallPolymakeMethod("VISUAL"));
-      res->rtyp = NONE;
-      res->data = NULL;
-      return FALSE;
-    }    
-    catch (const std::exception& ex)
-    {
-      std::cerr << "Error: " << ex.what() << std::endl; 
-      return TRUE;
-    }
-  }
-  WerrorS("visual: unexpected parameters");
-  return TRUE;
-}
-
-BOOLEAN normal_fan(leftv res, leftv args)
-{
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-  {
-    gfan::ZCone* zc = (gfan::ZCone*)u->Data();
-    gfan::ZMatrix rays = zc->extremeRays();
-    polymake::perl::Object p("Polytope<Rational>");
-    p.take("VERTICES") << ZMat2PMMat(rays);
-    polymake::perl::Object pf;
-    CallPolymakeFunction("normal_fan", p) >> pf;
-    gfan::ZFan* zf = new gfan::ZFan(PMFan2ZFan(pf));
-    res->rtyp = fanID;
-    res->data = (char*) zf;
-    return FALSE;
-  }
-  WerrorS("normal_fan: unexpected parameters");
-  return TRUE; 
-}
-
-
-BOOLEAN testingfans(leftv res, leftv args)  // for testing purposes    
-{                                           // creating a fan in polymake 
-  leftv u = args;                           // and handing it to Singular
-  if ((u != NULL) && (u->Typ() == fanID))
-  {
-    gfan::ZFan* zf = (gfan::ZFan*) u->Data();
-    perl::Object pf = ZFan2PMFan(zf);
-    // perl::Object pf("PolyhedralFan");         
-    // Matrix<Integer> zm=(unit_matrix<Integer>(3));
-    // pf.take("INPUT_RAYS") << zm;
-    // Set<int> s;
-    // s = s+0;
-    // s = s+1;
-    // s = s+2;
-    // Array<Set<int> > ar(1);
-    // ar[0]=s;
-    // pf.take("INPUT_CONES") << ar;
-    gfan::ZFan* zff = new gfan::ZFan(PMFan2ZFan(pf));
-    res->rtyp = fanID;
-    res->data = (char *)zff;
-    return FALSE;
-  }
-  return TRUE;
-}
-
-BOOLEAN testingcones(leftv res, leftv args)  // for testing purposes       
-{                                            // taking a cone from Singular,
-                                             // handing it over to polymake 
-                                             // and back                    
-  leftv u = args;
-  if ((u != NULL) && (u->Typ() == coneID))
-    {
-      gfan::ZCone* zc = (gfan::ZCone*) u->Data();
-      polymake::perl::Object pc = ZCone2PMCone(*zc);
-      gfan::ZCone* zd = new gfan::ZCone(PMCone2ZCone(pc));
-      res->rtyp = coneID;
-      res->data = (char *) zd;;
-      return FALSE;
-    }
-  return TRUE;
-}
-
-BOOLEAN testingvisuals(leftv res, leftv args)   // for testing purposes
-{                                               // testing visualization of fans
-  try{                                          // exactly same as smalltest
-    perl::Object p("PolyhedralFan");
-    Matrix<Integer> zm=(unit_matrix<Integer>(3));
-    p.take("INPUT_RAYS") << zm;
-    Set<int> s;
-    s = s+0;
-    s = s+1;
-    s = s+2;
-    Array<Set<int> > ar(1);
-    ar[0]=s;
-    p.take("INPUT_CONES") << ar;
-    CallPolymakeFunction("jreality",p.CallPolymakeMethod("VISUAL")); 
-    res->rtyp = NONE;
-    res->data = NULL;
-    return FALSE;
-  } 
-  catch (const std::exception& ex) 
-  {
-    std::cerr << "ERROR: " << ex.what() << endl; 
-    return TRUE;
-  }
-}
-
-
-extern "C" int mod_init(void* polymakesingular)
-{
-
-  polymake::Main init_polymake;
-  init_polymake.set_application("fan");
-  iiAddCproc("","cube",FALSE,cube);
-  iiAddCproc("","cross",FALSE,cross);
-  iiAddCproc("","visual",FALSE,visual);
-  iiAddCproc("","normalFan",FALSE,normal_fan);
-  iiAddCproc("","testingcones",FALSE,testingcones);
-  iiAddCproc("","testingfans",FALSE,testingfans);
-  iiAddCproc("","testingvisuals",FALSE,testingvisuals);
-
-}
diff --git a/doc/types.doc b/doc/types.doc
old mode 100644
new mode 100755
diff --git a/factory/abs_fac.cc b/factory/abs_fac.cc
deleted file mode 100644
index eff2038..0000000
--- a/factory/abs_fac.cc
+++ /dev/null
@@ -1,1074 +0,0 @@
-
-#include "canonicalform.h"
-#ifdef HAVE_BIFAC
-#ifndef NOSTREAMIO
-#include<fstream>
-#endif
-#include<math.h>
-#include <sys/timeb.h>
-
-
-
-static void
-fillVarsRec ( const CanonicalForm & f, int * vars )
-{
-  int n;
-  if ( (n = f.level()) > 0 )
-  {
-    vars[n] = 1;
-    CFIterator i;
-    for ( i = f; i.hasTerms(); ++i )
-      fillVarsRec( i.coeff(), vars );
-  }
-}
-
-int ExtensionLevel();
-void Reduce( bool);
-
-CanonicalForm MYGCD( const CanonicalForm& f, const CanonicalForm& g);
-
-
-CanonicalForm MyContent( const CanonicalForm& F, const Variable& x)
-{
-  CanonicalForm r,t;
-  CanonicalForm g=F;
-  CanonicalForm one=1;
-
-  if( F.isZero() ) return 0;
-  if( F.inBaseDomain() )  return F;
-
-  if( level(F) < 0 )  return 1;
-
-  r = LC( F, x);
-
-  g = g - power(x,degree(g,x))*r;
-
-  while( g.isZero() != 1 && r!= 1 && r!=-1 )
-  {
-    t = LC(g, x);
-    if( t == 1 || t == -1 ) return 1;
-    r = MYGCD( r, t);
-    if( r == 1 ) return 1;
-    g = g - power(x,degree(g,x))*t;
-  }
-  return r;
-}
-
-void CurrentExtension()
-{
-  Variable x('x');
-  int i;
-#ifndef NOSTREAMIO
-  cout << "Current Extension: "<<endl;
-#endif
-  for (i = ExtensionLevel();i>0;i--)
-  {
-    Variable l(-i);
-#ifndef NOSTREAMIO
-    cout << "Variable: "<<l<<" Level: "<<l.level()<<" Minimal Polynom: "<<getMipo(l,x)<<endl;
-#endif
-  }
-}
-
-/*Liefert den ggt aller numerischen Koeffizienten einer Canonischen Form */
-
-CanonicalForm MyNum(const CanonicalForm & a)
-{
-  bool bruch = isOn(SW_RATIONAL);
-  Off (SW_RATIONAL);
-
-  CanonicalForm dummy =0;
-  CanonicalForm dummy2;
-
-  CFIterator F =a;
-
-  for ( ; F.hasTerms(); F++)
-  {
-    if (F.coeff().inBaseDomain())
-    {
-      dummy2 = F.coeff().num();
-      if (dummy == 0)
-      {
-        dummy = dummy2;
-      }
-      else
-      {
-        dummy = gcd(dummy, dummy2);
-      }
-    }
-    else
-    {
-      dummy2 = MyNum(F.coeff());
-      if (dummy == 0)
-      {
-        dummy = dummy2;
-      }
-      else
-      {
-        dummy = gcd(dummy, dummy2);
-      }
-    }
-  }
-  if (bruch)
-    On (SW_RATIONAL);
-  else
-    Off(SW_RATIONAL);
-  return dummy;
-}
-
-/* Liefert den kgV aller Nenner der Koeffizenten einer Canonischen Form */
-
-CanonicalForm MyDen(const CanonicalForm & a)
-{
-  bool bruch = isOn(SW_RATIONAL);
-  Off (SW_RATIONAL);
-
-  CanonicalForm dummy(1);
-  CanonicalForm dummy2;
-
-  CFIterator F =a;
-
-  for ( ; F.hasTerms(); F++)
-  {
-    if (F.coeff().inBaseDomain())
-    {
-      dummy2 = gcd(dummy,F.coeff().den());
-      dummy = dummy * F.coeff().den()/dummy2;
-    }
-    else
-    {
-      dummy2 = MyDen(F.coeff());
-      dummy = dummy*dummy2/gcd(dummy,dummy2);
-    }
-  }
-  if (bruch)
-    On (SW_RATIONAL);
-  else
-    Off(SW_RATIONAL);
-  return dummy;
-}
-
-/* Liefert die normierte Canonische Form a zur�ck, wenn LC(a) kein Nullteiler in Characteristic p ist */
-/* sonst -1*/
-CanonicalForm MyMonic(const CanonicalForm & a, const CanonicalForm & r, const int & l)
-{
-  bool bruch = isOn(SW_RATIONAL);
-  int zaehler;
-  int Level = l;
-  CanonicalForm dummy, dummy1, dummy2;
-  CanonicalForm g = a;
-  CanonicalForm p = r;
-
-  On (SW_RATIONAL);
-
-  if (Level == g.level())
-  {
-    dummy = 1/g.LC();
-  }
-  else
-  {
-    dummy = 1/g;
-  }
-  dummy1 = MyDen(dummy);
-  dummy2 =dummy1;
-  zaehler =1;
-
-  Off (SW_RATIONAL);
-
-  while ((mod(dummy2,p) != 1) && (mod(dummy2,p) !=0))
-  {
-    dummy2 = dummy2*dummy1;
-    dummy2 =mod(dummy2,p);
-    zaehler++;
-  }
-  if (mod(dummy2,p).isZero())
-  {
-    if (bruch)
-      On (SW_RATIONAL);
-    else
-      Off(SW_RATIONAL);
-    return -1;
-  }
-  else
-  {
-    zaehler--;
-    dummy2 = power(dummy1,zaehler);
-    dummy2 = mod(dummy2,p);
-    dummy*= dummy1;
-    dummy*= dummy2;
-    g =mod(g*dummy,p);
-    if (bruch)
-      On (SW_RATIONAL);
-    else
-      Off(SW_RATIONAL);
-    return g;
-  }
-}
-
-
-
-/*Berechnet den ggT der Formen a und b in Characteristic p*/
-
-CanonicalForm MyGCDlocal (const CanonicalForm & a, const CanonicalForm & b, const CanonicalForm & r, const int & l)
-{
-  bool bruch = isOn(SW_RATIONAL);
-  Off(SW_RATIONAL);
-  CanonicalForm Rest, Result;
-
-  CanonicalForm f=a;
-  CanonicalForm g=b;
-  CanonicalForm p=r;
-  int Level =l;
-  f = mod(f,p);
-  g = mod(g,p);
-
-  Rest=g;
-
-  while (!Rest.isZero())
-  {
-    g = MyMonic(g,p,Level);
-
-    if (g == -1)
-    {
-      if (bruch)
-        On(SW_RATIONAL);
-      else
-        Off(SW_RATIONAL);
-      return -1;
-    }
-    else
-    {
-      Result =g;
-      Rest = f%g;
-      f = g;
-      g = Rest;
-      f =mod(f,p);
-      g =mod(g,p);
-      Rest =mod(Rest,p);
-    }
-  }
-  if (bruch)
-    On(SW_RATIONAL);
-   else
-    Off(SW_RATIONAL);
-  return Result;
-}
-
-/* Chinese Remaindering f�r a mod m und b mod l */
-
-CanonicalForm MyChiRem(const CanonicalForm & a,const CanonicalForm & m,const CanonicalForm & b,const CanonicalForm & l)
-{
- bool bruch = isOn(SW_RATIONAL);
-
- CanonicalForm u,v,Runner;
- CanonicalForm Result(0);
- CanonicalForm LeadTerm;
- CanonicalForm x1=a;
- CanonicalForm m1 = m;
- CanonicalForm x2=b;
- CanonicalForm m2 = l;
-
- while (!x1.isZero() || !x2.isZero())
- {
-  if (x1.degree() > x2.degree())
-  {
-    LeadTerm = power(x1.mvar(),x1.degree());
-    u = x1.LC()*LeadTerm;
-    v = 0;
-    x1 = x1-u;
-  }
-  else
-  {
-    if (x1.degree() < x2.degree())
-    {
-     u = 0;
-     LeadTerm = power(x2.mvar(),x2.degree());
-     v = x2.LC()*LeadTerm;
-     x2 = x2-v;
-    }
-    else
-    {
-     if (x1.degree() == x2.degree())
-     {
-      LeadTerm = power(x2.mvar(),x2.degree());
-      u = x1.LC()*LeadTerm;
-      v = x2.LC()*LeadTerm;
-      x1 = x1-u;
-      x2 = x2-v;
-     }
-    }
-  }
-
-  if (u.LC().inBaseDomain() && v.LC().inBaseDomain())
-  {
-    Runner = u.LC();
-    Off(SW_RATIONAL);
-    while(mod(Runner,m2) !=v.LC())
-    {
-      Runner = Runner+m1;
-    }
-
-    Result = Result+Runner*LeadTerm;
-
-  }
-  else
-  {
-   Result = Result + MyChiRem(u.LC(),m1, v.LC(), m2)*LeadTerm;
-  }
- }
-if (bruch)
-       On(SW_RATIONAL);
-      else
-       Off(SW_RATIONAL);
-return Result;
-}
-
-/*Rational Rekonstruction f�r a mod b*/
-
-CanonicalForm MyRatRed(const CanonicalForm & a,const CanonicalForm & b)
-{
- bool bruch = isOn(SW_RATIONAL);
-
- CanonicalForm f,dummy,dummy1,dummy2, Wurzel;
- CanonicalForm  q,u0,u1,v0,v1;
- CanonicalForm Result(0);
-
- CFIterator F =a;
-
- for ( ; F.hasTerms(); F++)
-   {
-    if (F.coeff().inBaseDomain())
-    {
-     Wurzel = sqrt(b);
-     u0 =b;
-     u1= F.coeff();
-     v1 = 1;
-     v0 = 0;
-
-     int i=0;
-
-     while(!(u1<Wurzel))
-      {
-       Off(SW_RATIONAL);
-       q=u0/u1;
-       dummy = u0-q*u1;
-       u0=u1;
-       u1=dummy;
-       dummy = v0+q*v1;
-       v0=v1;
-       v1=dummy;
-       i++;
-      }
-      f = -1;
-
-      On(SW_RATIONAL);
-      dummy2 = u1/v1;
-
-      f = power(f,i)*dummy2;
-
-      if (f.isZero())
-      {
-       Off(SW_RATIONAL);
-
-       if (!mod(F.coeff(),b).isZero())
-       {
-        if (bruch)
-         On(SW_RATIONAL);
-        else
-         Off(SW_RATIONAL);
-        return -1;
-       }
-
-      }
-      Result = Result+f*power(a.mvar(),F.exp());
-
-    }
-    else
-    {
-     dummy1 = MyRatRed(F.coeff(),b);
-     if (dummy1 == -1)
-     {
-      if (bruch)
-       On(SW_RATIONAL);
-      else
-       Off(SW_RATIONAL);
-      return -1;
-     }
-     else
-     Result = Result + dummy1*power(a.mvar(),F.exp());
-    }
-  }
-if (bruch)
-       On(SW_RATIONAL);
-      else
-       Off(SW_RATIONAL);
-return Result;
-}
-
-/*Berechnet lokale ggT's der Formen a und b und liftet sie wieder hoch*/
-
-CanonicalForm MyGCDmod( const CanonicalForm & a,const CanonicalForm & b)
-{
- bool bruch = isOn(SW_RATIONAL);
- // cout << "enter MyGCD mit a= "<<a<<endl;
- // cout << "und b= "<<b<<endl;
-CanonicalForm LeadA, LeadB;
-CanonicalForm Kandidat,Kandidat1;
-CanonicalForm f,g, Result;
-CanonicalForm NennerA =1;
-CanonicalForm NennerB=1;
-CanonicalForm ZahlerA=1;
-CanonicalForm ZahlerB=1;
-int treffer = 0;
-int Level;
-CanonicalForm Modulo;
-int i = 0;
-bool TryAgain = 1;
-int Primes[1228];
-
-
-
-for (int i = 0;i <1228;i++)
-{
- Primes[i]=cf_getPrime(i+1);
-
-}
-Level=a.level();
-
-if (a.degree() > b.degree())
- {
- f = a;
-        g = b;
- }
- else
- {
- g = a;
-        f = b;
- }
-
- if (g.isZero())
- {
-  if (f.isZero()) return CanonicalForm(1);
-  return f/f.LC();
- }
-
- NennerA = MyDen(f);
- NennerB = MyDen(g);
-
- f = f*NennerA;
- g = g*NennerB;
-
- ZahlerA = MyNum(f);
- ZahlerB = MyNum(g);
-
- f=f/ZahlerA;
- g=g/ZahlerB;
-
- LeadA = f.LC();
- while (!LeadA.inBaseDomain())
- {
-    LeadA =LeadA.LC();
- }
- LeadB = g.LC();
- while (!LeadB.inBaseDomain())
- {
-    LeadB =LeadB.LC();
- }
-
- Off (SW_RATIONAL);
-
-
- while (TryAgain && i < 1228)
- {
-
-  CanonicalForm p(Primes[i]);
-  // cout << "p: "<<p<<endl;
-  i++;
-  if ( (mod(LeadA,p) != 0) && (mod(LeadB,p) != 0))
-  {
-    Result = MyGCDlocal(f,g,p,Level);
-
-    if (Result !=-1)
-    {
-
-      if (Result == 1)
-      {
-        if (bruch)
-         On(SW_RATIONAL);
-        else
-         Off(SW_RATIONAL);
-        return Result;
-      }
-      else
-      {
-        if (treffer == 0 || Kandidat.degree() > Result.degree())
-        {
-         treffer = 1;
-         Kandidat = Result;
-         Modulo = p;
-        }
-        else
-        {
-         if (Kandidat.degree() == Result.degree())
-         {
-          Kandidat = MyChiRem(Kandidat,Modulo,Result,p);
-          Modulo = Modulo*p;
-          treffer++;
-         }
-      }
-      if (mod(treffer,4) ==1)
-      {
-        Kandidat1=MyRatRed(Kandidat, Modulo);
-
-
-        if (Kandidat1 !=-1)
-        {
-            Off(SW_RATIONAL);
-            if (mod(f,Kandidat1) == 0 && mod(g,Kandidat1) == 0)
-            {
-             break;
-            }
-
-        }
-      }
-
-
-     }
-   }
-  }
-  else
-  {
-
-  }
-
- }
-
- if (bruch)
-       On(SW_RATIONAL);
-      else
-       Off(SW_RATIONAL);
- return Kandidat1;
-}
-
-/* Berechnet die Norm eines Form h �ber zwei K�rpererweiterungen und faktorisiert sie*/
-
-CFFList FactorizeNorm (const CanonicalForm & h, const int & i )
-{
- bool bruch = isOn(SW_RATIONAL);
- if (i ==0)
- { return factorize(h);
- }
-
-
- CanonicalForm g =h;
-
-  Variable x =g.mvar();
-
- int AnzExt = i;  // �ber welcher Erweiterung arbeite ich gerade ...
- Variable l(-AnzExt);           //... und welche algebr. Variable geh�rt dazu ?
- Variable y('_');
-
-
- CanonicalForm MiPo, Norm, NormAbl, Factor_Norm,dummy1, dummy2, Nenner,LeaC;
-
- CFFList Result;
- CFFList dummy;
-
- bool is = true;
-
- int k = 0;
- g = g(y,l);                    //die algeb. Variable wird durch eine Polynomvariable ersetzt
- MiPo = getMipo(l,y);
-
- Norm = resultant(MiPo,g,y);   //norm von g als Funk. in x und y (l->y)  bzgl y
- NormAbl = Norm.deriv();
- // Off(SW_RATIONAL);
- is = !MyGCDmod(Norm,NormAbl).inBaseDomain(); //ist die Norm quadratfrei ?
- while (is)
-  {
-    k++;
-    CanonicalForm t = g;
-                  t = t(x-k*y,x);        //wenn nicht, wird g gest�rt und die neue Norm berechnet
-
-    On(SW_RATIONAL);
-    Norm = resultant(MiPo,t,y);  //Problem tritt hier auf, bei AnzExt = 1
-    Off(SW_RATIONAL);
-    NormAbl = Norm.deriv();
-    is = ! MyGCDmod(Norm,NormAbl).inBaseDomain();
-    //cout << "ggt der Norm: "<< MyGCDmod(Norm,NormAbl)<<endl;
-  }
-  AnzExt--;
-  if (bruch)
-   On(SW_RATIONAL);
-  else
-   Off(SW_RATIONAL);
-  if (AnzExt == 0)  //sind alle Erweiterungen abgearbeitet...
-   {
-    Result = factorize(Norm);        //... wird die Norm Faktorisiert
-   }
-  else
-   {
-    Result = FactorizeNorm(Norm, AnzExt);  //wenn nicht, kommt die n�chste erweiterung dran
-   }
-   CFFListIterator J=Result;
-   for ( ; J.hasItem(); J++)
-    {
-     Factor_Norm = J.getItem().factor();
-     Factor_Norm = Factor_Norm(x+k*l,x);   // die St�rungen werden r�ckg�nig gemacht
-     dummy.append(CFFactor(Factor_Norm));
-    }
- return dummy;
-}
-
-
-/* Bereitet die Form h vor, ruft FactorizeNorm(h) auf und rekonstruiert daraus die
-Faktoren von h */
-
-CFFList MyFactorize(const CanonicalForm & h)
-{
- bool bruch = isOn(SW_RATIONAL);
-
- CanonicalForm g = h;
- CFFList FacNorm, Result;  // Faktorisierung der Norm und das Ergebniss
- CanonicalForm Abl_g, LeaCoeff_g, normiert_g, g_quadrat ; //Ableitung, f�hrender Koeff. und Normierung von g
- CanonicalForm Norm,NormAbl;
- CanonicalForm Factor_Norm, Fac;
- CanonicalForm dummy, g_origin;
- CanonicalForm Nenner,warte;
-
- Variable x = g.mvar();
-
- int exp =0;
- int DegAlt, DegNeu;
- On(SW_RATIONAL);
-
- /* Initzialisierung, faktorisiert wird CF g */
- g_origin = g;
- LeaCoeff_g = g.LC();
- //g /=LeaCoeff_g;
- Nenner = MyDen(g);
- g *= power(Nenner, g.degree());
- g *= power(LeaCoeff_g,g.degree()-1);
- g = g(x/(Nenner*LeaCoeff_g),x);
- Abl_g = g.deriv();
- DegAlt = g.degree();
- g_quadrat=g;
- g /= MyGCDmod(g,Abl_g);        // g wird quadratfrei gemacht
- DegNeu = g.degree();
-
- //g = g/LeaCoeff_g;          // und normiert
- //CurrentExtension();
- FacNorm = FactorizeNorm(g,ExtensionLevel());
- CFFListIterator J=FacNorm;
- J.lastItem();
- // g = g*MyDen(g);
- //
-  g = h ;
-
- for ( ; J.hasItem(); J--)   // Iteration �ber die Faktoren der Norm
-  {
-          Factor_Norm = J.getItem().factor();
-
-   Fac =  MyGCDmod(g,Factor_Norm);       //Ergebniss wird hochgeliftet
-
-          Fac = Fac/Fac.LC();                        // und normiert
-
-/* Ermittlung der Exponenten der einzelnen Faktoren */
-
-   exp = 1;              // f�r den FaKtor mit Grad 0
-   dummy = g_quadrat;
-
-          if (!Fac.inBaseDomain())      // echter Faktor ?
-         {
-  exp = 0;
-         while ( 0==dummy%Fac && !dummy.inBaseDomain()) // Wie oft Teilt der Faktor das Polynom ?
-           {
-      dummy =dummy/Fac;
-             exp++;
-           }
-  Fac = Fac(x*(Nenner*LeaCoeff_g),x);
-
-    Fac /= Fac.LC();
-   }
-
-         else
-            {
-             Fac *= LeaCoeff_g;
-             g *= LeaCoeff_g;
-            }
-
-          g /=power(Fac,exp);
-
-          Result.append(CFFactor( Fac, exp ));    // Faktor wird an Result geh�ngt
-  }
-  if (bruch)
-       On(SW_RATIONAL);
-      else
-       Off(SW_RATIONAL);
-  return Result;    // und zur�ckgegeben
-}
-
-CFFList AbsFactorize(const CanonicalForm  & a)
-{
-CanonicalForm f = a;
-CanonicalForm Factor, NewFactor,dummy3, Nenner,LeadC;
-CanonicalForm Coeff=f.LC();
-
-Variable x =a.mvar();
-CFFList dummy, dummy2;
-CFFList result, empty;
-empty.append(CFFactor(1,1));
-bool NewRoot = false;
-bool fertig;
-
-LeadC = f.LC();
-f *= power(LeadC, f.degree()-1);
-Nenner = MyDen(f);
-f *= power(Nenner, f.degree());
-f = f(x/(Nenner*LeadC), x);
-result = MyFactorize(f);
-
-CFFListIterator L = result;
-  fertig = true;
-  for(; L.hasItem();L++)
-     {
-      if (L.getItem().factor().degree() >1)
-       {
-        fertig = false;
-       }
-     }
-
-while(!fertig)
-{
- dummy = result;
- CFFListIterator J = dummy;
- result = empty;
-for ( ; J.hasItem(); J++)   // Iteration �ber die Faktoren der Norm
-  {
-          Factor = J.getItem().factor();
-
-          if (Factor.degree() != 0 && Factor.degree() != 1 && !NewRoot)
-           {
-            Reduce(false);
-            Variable u = rootOf(Factor);
-            Reduce(true);
-            NewRoot = true;
-            result.append(CFFactor((x-u),1));
-            Factor /= (x-u);
-           }
-
-
-           if (Factor.degree() != 0 && Factor.degree() != 1 && NewRoot)
-           {
-            dummy2 = MyFactorize(Factor);
-
-            CFFListIterator H = dummy2;
-            for ( ; H.hasItem(); H++)   // Iteration �ber die Faktoren der Norm
-              {
-               NewFactor = H.getItem().factor();
-               if (!NewFactor.inBaseDomain())
-                 {
-                  result.append(CFFactor(NewFactor, H.getItem().exp()*J.getItem().exp()));
-                 }
-        else
-          {
-    Coeff *=H.getItem().factor();
-   }
-              }
-           }
-          if ( Factor.degree() == 0)
-           {
-            Coeff *=Factor;
-           }
-          if( Factor.degree() == 1)
-           {
-            result.append(CFFactor(Factor,J.getItem().exp()));
-           }
-  }
-  NewRoot = false;
-  CFFListIterator K = result;
-  fertig = true;
-
-  for(; K.hasItem();K++)
-     {
-
-      if (K.getItem().factor().degree() >1)
-       {
-        fertig = false;
-       }
-     }
- }
-CFFList result2;
-//result2.append(CFFactor(Coeff));
-CFFListIterator K = result;
-for(; K.hasItem();K++)
-     {
-      dummy3 = K.getItem().factor();
-      if (dummy3.degree() == 0)
- { dummy3 *= Coeff;
-  }
-      else
-       {
-      dummy3 = dummy3(x*Nenner*LeadC,x);
- dummy3 /= dummy3.LC();
- }
-
-      result2.append(CFFactor(dummy3,K.getItem().exp()));
-     }
-return result2;
-}
-
-
-//
-//
-CanonicalForm Bigcd( const CanonicalForm& f, const CanonicalForm& g)
-{
-
-
- if( f.level() < 0 ) return 1;
- if( g.level() < 0 ) return 1;
-
-    CFArray A;
-
-    int i=0;
-    int r;
-
-    Variable x = f.mvar();
-    Variable y = g.mvar();
-
-    // Wahl als Hauptvariable ?
-    //
-    if( x.level() >= y.level() ) x = y;
-
-    CanonicalForm Cf, Cg, gamma, c,T;
-    CanonicalForm F=f;
-    CanonicalForm G=g;
-
-    Cf = MyContent(f,x); //changed
-    Cg = MyContent(g,x); //changed
-    F = F/Cf;
-    G = G/Cg;
-    gamma = MyGCDmod( LC(F,x), LC(G,x) );
-
-    A = subResChain(F,G,x);
-
-    c = MyGCDmod( Cf, Cg );
-
-    r = A.size();
-
-    while( A[i].isZero() ) i++;
-
-    F = A[i];
-
-    if( degree(F,x) == 0 )
-  if( c.level() < 0 ) return 1; else return c;
-
-    F = gamma*F/LC(F, x);
-    F = F/content(F,x);
-
-    F = c*F;
-
-    c = F.LC();
-
-   while( c.level()>0 ) c = c.LC();
-
-    F=F/c;
-
- if( F.level() < 0 ) return 1;
-
-    return F;
-}
-
-
-
-
-CanonicalForm MYGCD( const CanonicalForm& f, const CanonicalForm& g)
-{
-
- // FIX ME: CONSTANT FIELD
- //
- //
- //
- //
- //
- if( f.level() < 0 && g.level() < 0) return 1;
- if( (f.level() < 0 && g.level() > 0) ||
-     (f.level() > 0 && g.level() <0 )     ) return 1;
-
- int i;
-
- CFList L;
- for (i=1; i<= level(f); i++)
-  if( f != f(0,i) )
-  L.append(i);
-
- int nvf = L.length();
-
- for (i=1; i<= level(g); i++)
-  if( g != g(0,i) )
-     L.append(i);
-
- int nvg = L.length();
-
-
-
- if( f.level() < 0 && g.level() < 0 )  { ;
-  return 1; }
-
- CFArray A;
-
- i=0;
-    int r;
-
-    Variable x = f.mvar();
-    Variable y = g.mvar();
-
-    // Wahl als Hauptvariable ?
-    //
-    if( x.level() >= y.level() ) x = y;
-
-    CanonicalForm Cf, Cg, gamma, c,T;
-    CanonicalForm F=f;
-    CanonicalForm G=g;
-
-
-    Cf = MyContent(f,x);
-    Cg = MyContent(g,x);
-    F = F/Cf;
-    G = G/Cg;
-
- if( nvf <= 1 && nvg <=1 )
- {
-  gamma = MyGCDmod( LC(F,x), LC(G,x) );
-  c = MyGCDmod( Cf, Cg );
- }
- else
- {
-   gamma = MYGCD( LC(F,x), LC(G,x) );
-  c = MYGCD( Cf, Cg );
- }
-    A = subResChain(F,G,x);
-
-    r = A.size();
-
-    while( A[i].isZero() ) i++;
-
-    F = A[i];
-
-    if( degree(F,x) == 0 )
-  if( c.level() < 0 ) return 1; else return c;
-
-    F = gamma*F/LC(F, x);
-    F = F/MyContent(F,x);
-
-    F = c*F;
-
-    c = F.LC();
-
-   while( c.level()>0 ) c = c.LC();
-
-    F=F/c;
-
- //if( F.level() < 0 ) return 1;
-
-    return F;
-}
-
-
-
-CFFList Mysqrfree_local( const CanonicalForm& F, const Variable& v)
-{
- int i=1;
- CanonicalForm f=F;
- CanonicalForm g, qi, fp, wp, temp1, temp2, temp3, temp4,  pA;
- CFFList L;
-
-
- g = MyContent(f,v);
-
- if( g != 1 )
- L.append( CFFactor(g,1) );
-
- pA = f/g;
-
- fp = deriv( pA, v);
-
- temp1 = MYGCD( pA, fp );
-
- if( temp1 == 1 ){ L.append( CFFactor(pA,1) ); return L; }
- else
- {
-  temp2 = pA/temp1;
-  temp3 = fp/temp1;
-  wp = deriv(temp2,v);
-  temp4 = temp3 - wp;
-
-  while( !temp4.isZero() )
-  {
-   CanonicalForm qi = MYGCD( temp2, temp4);
-   if( qi != 1 ) L.append( CFFactor( qi, i ) );
-   i++;
-   temp2 = temp2/qi;
-   temp3 = temp4/qi;
-   temp4 = temp3-deriv(temp2, v);
-  }
-
- if( temp2 != 1 ) L.append( CFFactor( temp2, i ) );
-
- }
-
- return L;
-}
-
-CFFList Mysqrfree( const CanonicalForm& F )
-{
- CFFList L, M, V;
- CFFList N;
- CanonicalForm vars=getVars(F);
- Variable v;
- CanonicalForm s;
- bool b;
-
- L.append( CFFactor(F,1) );
-
- int n = F.level();
- int *vrs = new int[n+1];
- for ( int i = 0; i <= n; i++ ) vars[i] = 0;
- for ( CFIterator I = F; I.hasTerms(); ++I ) fillVarsRec( I.coeff(), vrs );
-
- N.append( CFFactor(F,1) );
-
- int i = n+1;
-
- while( i >= 0 )
- {
-  b = 0;
-
-  if( i == 0 ){  v = mvar(F); b=1 ;}
-  else
-  if( vrs[i] != 0 ){ b=1; v= Variable(i);}
-  if( vrs[i] == 0 )  i--;
-
-  if( b )
-  {
-   for( CFFListIterator J = L; J.hasItem(); J++ )
-   {
-    M = Mysqrfree_local(  J.getItem().factor() , v );
-
-    for( CFFListIterator K = M; K.hasItem(); K++ )
-    {
-     if( K.getItem().factor().level() > 0 )
-      {
-    N.append( CFFactor( K.getItem().factor(), K.getItem().exp()+J.getItem().exp()-1  )); }
-    }
-    N.removeFirst();
-   }
-   if( N.length() == L.length() ) i -= 1;
-   L=N;
-  }
- }
-
-  return L;
-
-}
-#endif
diff --git a/factory/bifac.cc b/factory/bifac.cc
deleted file mode 100644
index 0ea6d66..0000000
--- a/factory/bifac.cc
+++ /dev/null
@@ -1,1294 +0,0 @@
-#include "canonicalform.h"
-#ifdef HAVE_BIFAC
-#include "lgs.h"
-#include "bifacConfig.h"
-
-#define BIFAC_BASIS_OF_G_CHECK        1
-void Reduce( bool );
-CanonicalForm Bigcd( const CanonicalForm& f, const CanonicalForm& g);
-
-CanonicalForm MyContent( const CanonicalForm& F, const Variable& x);
-CFFList Mysqrfree( const CanonicalForm& F );
-
-
-CanonicalForm MyGCDmod( const CanonicalForm & a,const CanonicalForm & b);
-CFFList RelFactorize(const CanonicalForm & h);
-
-//====== global definitions ===================
-Variable x( 'x' );
-Variable y( 'y' );
-Variable z( 'z' );
-Variable e( 'e' );
-
-
-///////////////////////////////////////////////////////
-// Class for storing polynomials as vectors.
-// Enables fast access to a certain degree.
-///////////////////////////////////////////////////////
-
-//==================================================
-class PolyVector
-//==================================================
-{
-public:
-  PolyVector ( void ){
-    m = -1;
-  }
-  virtual ~PolyVector( void ){
-    if( m!= -1) delete[] value;
-  }
-  void init (CanonicalForm f){
-    if( f.level()<0 )
-    {
-      m = 0;
-      n = 0;
-      value = new CanonicalForm[1];
-      value[0] = f;
-    }
-    else
-    {
-      m = degree(f,x);
-      n = degree(f,y);
-      ASSERT( m>0 || n>0, "Input is not a polynomial");
-      int correction = 1;  // univariate polynomials
-      if( n==0) correction = n+1;
-
-      value = new CanonicalForm[m*(n+1)+n+1];
-      for(int i=0; i<=m*(n+1)+n; i++) value[i]=0;
-
-
-      for ( CFIterator i = f; i.hasTerms(); i++ ) {
-        for ( CFIterator j = i.coeff(); j.hasTerms(); j++ ){
-                if( i.coeff().mvar().level()< 0 ){
-                        value[ 0*(n+1) + i.exp()*correction ] = j.coeff();}
-            else{
-                        value[ j.exp()*(n+1) + i.exp()*correction ] = j.coeff();}}}
-    }
-  }
-
-  void  push(int mm, int nn, CanonicalForm v){
-    ASSERT( 0<=mm<=m && 0<=nn<=n, "Wrong Index in PolyVector");
-    value[mm*(n+1)+nn] = v;
-  }
-  CanonicalForm get(int mm, int nn){
-
-    if( 0<=mm && mm<=m && 0<=nn && nn<=n )
-      return value[mm*(n+1)+nn];
-    else
-      return 0;
-  }
-#ifndef NOSTREAMIO
-  friend OSTREAM & operator<< ( OSTREAM & s, const PolyVector& V ){
-    for (int i=0;i<=V.m;i++)
-    {
-      s << "[";
-      for (int j=0;j<=V.n;j++)
-        s << V.value[i*(V.n+1)+j] << ", ";
-      s << "]\n";
-    }
-    return s;
-  }
-#endif /* NOSTREAMIO */
-
-
-private:
-  int            m;       // Degree in x
-  int            n;       // Degree in y
-  CanonicalForm* value;   // Value: index = m*(n+1)+n
-};
-////////// END of PolyVector ///////////////////////////
-
-
-
-
-/////////////////////////////////////////////////////////
-//
-//  Default class declarations
-//
-/////////////////////////////////////////////////////////
-
-
-
-//--<>---------------------------------
-BIFAC::BIFAC( void )// KONSTRUKTOR
-//--<>---------------------------------
-{
-}
-
-//--<>---------------------------------
-BIFAC::~BIFAC( void )// DESTRUKTOR
-//--<>---------------------------------
-{
-}
-
-
-/////////////////////////////////////////////////////////
-//
-//  Auxiliary functions
-//
-/////////////////////////////////////////////////////////
-
-//  //--<>---------------------------------
-//  void BIFAC::matrix_drucken( CFMatrix M )
-//  //--<>---------------------------------
-//  {
-//    int i,j;
-//    char* name="matrix.ppm";
-
-//    // === Datei l�schen ===
-
-//    ofstream* aus = new ofstream(name, ios::out);
-//    delete aus;
-
-
-//    // === Jetzt immer nur anh�ngen ===
-
-//    aus  = new ofstream(name, ios::app);
-//    *aus << "// Zeilen Spalten\n"
-//         << "// x-Koord. y-Koord.  Wert\n";
-
-//    *aus  << M.rows()  << " " << M.columns() << endl;
-
-
-//    // === Noch nicht bearbeitet Teile ===
-
-//    for( i=0; i<M.rows(); i++)
-//      for( j=0; j<M.columns(); j++)
-//        *aus << i << " " << j << " " << M(i+1,j+1) << endl;;
-//    delete aus;
-//  }
-
-//=======================================================
-void  BIFAC::passedTime()
-//=======================================================
-{
-        ;
-}
-
-
-//=======================================================
-long int  BIFAC::anz_terme(  CanonicalForm & f )
-//=======================================================
-{
-  long int z=0;
-
-  for ( CFIterator i = f; i.hasTerms(); i++ )
-    for ( CFIterator j = i.coeff(); j.hasTerms(); j++ )
-      z++;
-  return( z );
-}
-
-//=======================================================
-void BIFAC::biGanzMachen(  CanonicalForm & f )
-//=======================================================
-{
-  CanonicalForm ggT;
-  bool init = false;
-  Off( SW_RATIONAL );
-
-  for ( CFIterator i = f; i.hasTerms(); i++ )
-    for ( CFIterator j = i.coeff(); j.hasTerms(); j++ )
-    {
-      if( !init )
-      {
-        ggT = j.coeff();
-        init = true;
-      }
-      else
-        ggT = gcd(j.coeff(), ggT);
-    }
-  f /= ggT;
-  On( SW_RATIONAL );
-}
-
-//=======================================================
-void  BIFAC::biNormieren( CanonicalForm & f )
-//=======================================================
-{
-  if ( getCharacteristic() == 0 )
-  {
-    for ( CFIterator i = f; i.hasTerms(); i++ )
-      for ( CFIterator j = i.coeff(); j.hasTerms(); j++ )
-        if( j.coeff().den() != 1 )
-        {
-          f  *= j.coeff().den();
-          biNormieren( f );
-        }
-    biGanzMachen( f );
-  }
-  else
-  {
-    f /= LC(f);
-  }
-}
-
-
-//=======================================================
-//   * Convert the basis vectors of G into polynomials
-//   * Validate the solutions
-//=======================================================
-CFList BIFAC::matrix2basis(CFMatrix A, int dim, int m, int n, CanonicalForm f)
-//=======================================================
-{
-  Variable x('x'), y('y');
-  int i,j,k;
-  CanonicalForm g,h,ff;
-  CFList Lg, Lh;
-
-  // === Construction of the 'g's ====
-  for(k=1; k<=dim; k++)
-  {
-    g=0;
-    for(i=0; i<=m-1; i++)
-      for(j=0; j<=n; j++)
-        g += A(k, i*(n+1)+j+1)* power(x,i) * power(y,j);
-    Lg.append(g);
-  }
-
-  ///////////  START VALIDATION ////////////////////////////////////
-  if (BIFAC_BASIS_OF_G_CHECK)
-  {
-
-    // === Construction of the 'h's ====
-    for(k=1; k<=dim; k++)
-    {
-      h=0;
-      for(i=0; i<=m; i++)
-        for(j=0; j<n; j++)
-          h += A(k, i*n+j+1 +m*(n+1))* power(x,i) * power(y,j);
-      Lh.append(h);
-    }
-
-    // === Is the solution correct? ===
-    CFListIterator itg=Lg;
-    CFListIterator ith=Lh;
-    for( ; itg.hasItem(); itg++, ith++)
-    {
-      g = itg.getItem();
-      h = ith.getItem();
-      ff = f*(deriv(g,y)-deriv(h,x)) +h*deriv(f,x) -g*deriv(f,y);
-      if( !ff.isZero()) {
-      #ifndef NOSTREAMIO
-        AUSGABE_ERR("* Falsche Polynome!");
-        exit (1);
-      #else
-        printf("wrong polys\n");
-        break;
-      #endif
-      }
-    }
-  }
-  ///////////  END VALIDATION ////////////////////////////////////
-
-  return (Lg);
-}
-
-/////////////////////////////////////////////////////////
-//
-//  Main functions
-//
-/////////////////////////////////////////////////////////
-
-//=======================================================
-//   * Create the matrix belonging to G
-//   * Compute a basis of the kernel
-//=======================================================
-CFList BIFAC::basisOfG(CanonicalForm f)
-//=======================================================
-{
-
-
-  int m = degree(f,x);
-  int n = degree(f,y);
-  int r,s, ii,jj;
-
-
-  // ======= Creation of the system of linear equations for G =============
-  int rows    = 4*m*n;
-  int columns = m*(n+1) + (m+1)*n;
-
-  CFMatrix M(rows, columns); // Remember: The first index is (1,1) -- not (0,0)!
-
-  for ( CFIterator i = f; i.hasTerms(); i++ )  // All coeffizients of y
-  {
-    for ( CFIterator j = i.coeff(); j.hasTerms(); j++ )  // All coeffizients of x
-    {
-      r = j.exp();  // x^r
-      s = i.exp();  // y^s
-
-      // Now we regard g_{ii,jj)
-      for( ii=0; ii<m; ii++)
-        for( jj=0; jj<=n; jj++)
-        {
-          if(  s>= 1) M( (r+ii)*2*n +(jj+s-1)+1, ii*(n+1)+jj +1) += -j.coeff() * s;
-          if( jj>= 1) M( (r+ii)*2*n +(jj+s-1)+1, ii*(n+1)+jj +1) +=  j.coeff() * jj;
-        }
-
-      // Now we regard h_{ii,jj}
-      for( ii=0; ii<=m; ii++)
-        for( jj=0; jj<n; jj++)
-        {
-          if(  r>= 1) M( (r+ii-1)*2*n +(jj+s)+1, (ii*n)+jj +m*(n+1) +1) += j.coeff() * r;
-          if( ii>= 1) M( (r+ii-1)*2*n +(jj+s)+1, (ii*n) +jj +m*(n+1) +1) +=  -j.coeff() * ii;
-        }
-    }
-  }
-  // ========= Solving the  system of linear equations for G =============
-
-//  matrix_drucken(M); // **********************************
-
-  LGS L(rows,columns);
-
-  CFMatrix Z(1,columns);
-  for( ii=1; ii<=rows; ii++)
-  {
-    for( jj=1; jj<=columns; jj++)
-      Z(1,jj) = M(ii,jj);  // Copy the ii-th row
-    L.new_row(Z);
-  }
-
-  if( L.corank() == 1 )
-  {
-    CFList Lg;
-    Lg.append(f);
-    return(Lg);
-  }
-//  L.print();
-  CFMatrix basis = L.GetKernelBasis();
-
-  // ============= TEST AUF KORREKTHEIT /start) ====
-  CanonicalForm tmp;
-  for(int k=1; k<= L.corank(); k++)
-    for(int i=1; i<=rows; i++)
-    {
-      tmp =0;
-      for(int j=1; j<=columns; j++)
-        tmp += M(i,j) * basis(k,j);
-      if( tmp!= 0) {
-        exit(17);
-      }
-    }
-  // ============= TEST AUF KORREKTHEIT (ende) ====
-  return (  matrix2basis( basis, L.corank(), m,n,f ) );
-}
-
-//=======================================================
-//   Compute a   r x r - matrix A=(a_ij) for
-//     gg_i = SUM a_ij * g_j * f_x (mod f)
-//  Return a list consisting of
-//    r x (r+1) Matrix A
-//    the last columns contains only the indices of the
-//    first r linear independent lines
-// REMARK: this is used by BIFAC::createEg but NOT by createEgUni!!
-//=======================================================
-CFMatrix BIFAC::createA (CFList G, CanonicalForm f)
-//=======================================================
-{
-  // === Declarations ===
-  int m,n;
-  int i,j,e;
-  int r = G.length();  // number of factors
-
-  LGS       L(r,r,true);
-//  LGS       L(r,r);
-  CFMatrix  Z(1,r);
-  CFMatrix  A(r,r+2);  // the last two column contain the bi-degree
-
-  CanonicalForm fx   = deriv(f,x);
-  PolyVector*   gifx = new  PolyVector[r];
-
-  // === Convert polynomials into vectors ===
-  i=0;
-  CanonicalForm q;
-
-  for( CFListIterator it=G; it.hasItem(); it++, i++){
-
-    gifx[i].init( (it.getItem()*fx)%f );
-  }
-
-  // === Search linear independent lines ===
-
-  e=1; // row number of A
-  n=0; //
-  m=0; //
-  while (L.rank() != r )
-  {
-    for(j=0;j<r;j++)
-      Z(1,j+1) = gifx[j].get(m,n);
-    if( L.new_row(Z,0) )  // linear independent row?
-    {
-      ASSERT( e<=r, "Wrong index in matrix");
-      A(e,r+1) = m;      // Degree in x
-      A(e,r+2) = n;      // Degree in y
-      e++;
-    }
-    if (m>n) n++;
-    else     { m++; n=0; }
-  }
-  L.print();
-
-  L.inverse(A);
-
-  // === Clean up ==
-  delete[] gifx;
-
-  return A;
-}
-
-//=======================================================
-CanonicalForm BIFAC::create_g (CFList G)
-//=======================================================
-{
-  CanonicalForm g = 0;
-  int i = 0;
-
-  int r    = G.length();  // number of factors
-  float SS =  10*( r*(r-1) / ( 2*( (100- (float) EgSeparable)/100)) );
-  int S    = (int) SS +1;
-
-  IntRandom RANDOM(S);
-
-  int*        rand_coeff1 = new int[r];
-
-
-  //  static for debugging
-  // rand_coeff1[0] = 12; rand_coeff1[1] = 91; rand_coeff1[2] = 42;
-
-  for( CFListIterator it=G; it.hasItem(); it++, i++)
-    {
-      rand_coeff1[i] =  RANDOM.generate().intval();
-
-      g += rand_coeff1[i]  * it.getItem();
-    }
-
-  delete[] rand_coeff1;
-
-  return g;
-}
-
-/////////////////////////////////////////////////////////////
-// This subroutine creates the polynomials Eg(x) and g
-// by using the 'bivariate' methode'.
-// REMARK: There is a 'univariate methode' as well
-//         which ought to be faster!
-////////////////////////////////////////////////////////////
-//=======================================================
-CFList BIFAC::createEg (CFList G, CanonicalForm f)
-//=======================================================
-{
-
-
-  CFMatrix NEU = createA(G,f);
-//  passedTime();
-
-  bool suitable1 = false; // Is Eg by chance unsuitable?
-  bool suitable2 = false;  // Is on of g*g_i or g_i*f_x zero?
-
-  // === (0) Preparation ===
-  CanonicalForm g;
-  CanonicalForm Eg;
-  CanonicalForm fx = deriv(f,x);
-
-  int i,j,e;
-  int r = G.length();  // number of factors
-//    float SS =  ( r*(r-1) / ( 2*( (100- (float) EgSeparable)/100)) );
-//    int S = (int) SS +1;
-
-//    IntRandom RANDOM(S);
-//    int*        rand_coeff = new int[r];
-  CFMatrix  A(r,r);
-  CanonicalForm*     gi  = new CanonicalForm[r];
-  CanonicalForm*    ggi  = new CanonicalForm[r];
-  PolyVector*     v_ggi  = new PolyVector   [r];
-
-
-
-  i=0;
-  for( CFListIterator it=G; it.hasItem(); it++, i++)
-    gi[i] =  it.getItem();
-
-  while ( !suitable1 )
-  {
-
-     suitable2 = false;
-    // === (1) Creating g ===
-    while ( !suitable2 )
-    {
-//        i=0;
-//        g=0;
-//        for( CFListIterator it=G; it.hasItem(); it++, i++)
-//        {
-//          gi[i] =  it.getItem();
-//          rand_coeff[i] =  RANDOM.generate().intval();
-//          g += rand_coeff[i] * it.getItem();
-//        }
-      g = create_g( G );
-
-      // === (2) Computing g_i * g ===
-          //
-      for(i=0; i<r; i++){
-
-          ggi[i]  = (g*gi[i])%f;   // seite 10
-      }
-
-      // ===  Check if all polynomials are <> 0  ===
-      suitable2 = true;    // It should be fine, but ...
-      if( g.isZero() )
-        suitable2 = false;
-//        else
-//          for(i=0; i<r; i++)
-//            if(  ggi[i].isZero() )
-//              suitable2 = false;
-
-    } // end of  �while ( !suitable2 )�
-
-    // === (3) Computing Eg(x) ===
-
-    for(i=0;i<r;i++)  // Get Polynomials as vectors
-      v_ggi[i].init(ggi[i]);
-
-    // Matrix A
-    for(i=1; i<=r; i++)
-      for( j=1; j<=r; j++)
-      {
-        A(i,j) = 0;
-        for( e=1; e<=r; e++)
-        {
-
-
-   A(i,j) += ( NEU(j,e ) * v_ggi[i-1].get(NEU(e,r+1).intval(),(NEU(e,r+2).intval() )));
-
-
-//
-
-        }
-      }
-
-    for(j=1; j<=r; j++)
-      A(j,j) -= x;
-    Eg = determinant(A,r);
-//    exit(1);
-    // === (4) Is Eg(x) suitable? ===
-    if( MyGCDmod(Eg, deriv(Eg,x)) == 1 )
-      suitable1 = true;
-    else
-    {
-    }
-  } // end of  �while ( !suitable1 )�
-
-  // Delete trash
-
-
-
-  delete[] v_ggi;
-  delete[] gi;
-  delete[] ggi;
-  //  delete[] rand_coeff;
-
-  CFList LL;
-  LL.append(Eg);
-  LL.append(g);
-  return (LL);
-}
-//  /////////////////////////////////////////////////////////////
-//  // It is possible to take univariate polynomials
-//  // with y:=c for a suitable c.
-//  // c is suitable iff gcd( f(x,c), f_x(x,c)) = 1.
-//  ////////////////////////////////////////////////////////////
-//
-//=======================================================
-CFList BIFAC::createEgUni (CFList G, CanonicalForm f)
-//=======================================================
-{
-
-  int i,ii,k;
-  CanonicalForm ff, ffx,g, gg, Eg;
-
-
-  bool suitable1 = false;  // Is Eg unsuitable?
-  bool suitable2 = false;  // Is on of g*g_i or g_i*f_x zero?
-  bool suitable3 = false;  // Is 'konst' unsuitable?
-
-  // ========================
-  // =   (0) Preparation    =
-  // ========================
-  int konst = 0;
-  CanonicalForm fx = deriv(f,x);
-  int m = degree(f,x);
-  int r = G.length();            // number of factors
-  int S =  (int) ((float) ( r*(r-1) / ( 2*( (100- (float) EgSeparable)/100)) )+1);
-
-
-  int*  rand_coeff      = new int[r];
-  CanonicalForm*     gi  = new CanonicalForm[r];
-  CanonicalForm*    ggi  = new CanonicalForm[r];
-
-  CFMatrix  A(r,r);     // We have to find the matrix A,
-  CFMatrix  Z(1,r);     // `Vector` for data transportation
-  CFMatrix  AA(m,r);    // but first we generate AA.
-  CFMatrix  AI(r,r+1);  //
-  LGS       L(r,r,true);
-  IntRandom RANDOM(S);
-
-
-  // ==========================================================
-  // =  (1) Find a suitable constant to make bivariate        =
-  // =      polynomials univariate. Try the following numbers =
-  // =      0, 1, -1, 2, -2, 3,...                            =
-  // ==========================================================
-
-  while ( !suitable3 )
-  {
-    ff  = f(konst,'y');
-    ffx = fx(konst,'y');
-
-    if( gcd(ff, ffx) == 1)
-      suitable3 = true;
-    else
-    {
-      konst *= -1;
-      if( konst >= 0 )
-        konst++;
-    }
-  }
-
-
-  // ===============================================
-  // =    (2) Make g_i univariate                  =
-  // ===============================================
-  i=0;
-  for( CFListIterator it=G; it.hasItem(); it++, i++)
-  {
-    gi[i] =  it.getItem()(konst,'y');
-  }
-
-  // ===============================================
-  // =   (3) Compute the matrices 'AA' and 'AI'    =
-  // ===============================================
-
-
-  for( i=0; i<r; i++) // First store all coeffizients in AA.
-  {
-    ggi[i] = (gi[i]*ffx)%ff;   // now we have degree < m.
-    //biNormieren(ggi[i]);
-    for ( CFIterator j = ggi[i]; j.hasTerms(); j++ )
-      AA( j.exp()+1, i+1) = j.coeff();
-  }
-
-
-  // Now find the lin. indep. rows.
-  i  = 1;
-  ii = 1; // row number of A
-  while (L.rank() != r )
-  {
-    ASSERT( i<=m, "Too few linear independent rows!");
-
-    for (k=1; k<=r; k++)
-      Z(1,k) =  AA(i,k);
-    if( L.new_row(Z,0) )  // linear independent row?
-    {
-      ASSERT( ii<=r, "Wrong index in matrix");
-      AI(ii,r+1) = i;      // Degree in x
-      ii++;
-    }
-    i++;
-    L.print();
-  }
-  L.inverse(AI);
-
-
-  // ==============================================
-  // =   (4) Big loop to find a suitable 'Eg(x)   =
-  // ==============================================
-
-  while ( !suitable1 )    // Is Eg(x) suitable? -> Check at the end of this procedure!
-  {
-    suitable2 = false;   // In case we need a second loop
-
-    // ================================================
-    // =    (4a) Find a suitable 'g'                  =
-    // ================================================
-//    rand_coeff[0] = 0;
-//    rand_coeff[1] = 4;
-
-
-    while ( !suitable2 )
-    {
-      // === (i) Creating g ===
-      i=0;
-      g=0;
-      for( CFListIterator it=G; it.hasItem(); it++, i++)
-      {
-         rand_coeff[i] =  RANDOM.generate().intval();
-        g += rand_coeff[i] * it.getItem();
-      }
-      gg = g(konst,'y');   // univariate!
-      for(i=0; i<r; i++)  ggi[i] = (gi[i]*gg)%ff; // !! Redefinition of ggi !!
-
-      // ===  (ii) Check if all polynomials are <> 0  ===
-      suitable2 = true;    // It should be fine, but ...
-      if( gg.isZero() )
-        suitable2 = false;
-//        else
-//          for(i=0; i<r; i++)
-//            if(  ggi[i].isZero() )
-//              suitable2 = false;
-    } // end of  �while ( !suitable2 )�
-
-//    createRg(g,f);
-
-    // ===============================================
-    // =    (b) Compute matrix 'A'                   =
-    // ===============================================
-    for(i=1; i<=r; i++)
-    {
-      for( ii=1; ii<=m; ii++)
-        AA (ii,1) = 0;  // !! Redefinition of AA !!
-      for ( CFIterator j = ggi[i-1]; j.hasTerms(); j++ )
-        AA( j.exp()+1, 1) = j.coeff();
-
-      for( ii=1; ii<=r; ii++)
-      {
-        A(i,ii) = 0;
-        for( k=1; k<=r; k++)
-          A(i,ii) += ( AI(ii,k ) *  AA( AI(k, r+1 ).intval(),1) );
-      }
-    }
-    for(i=1; i<=r; i++)
-      A(i,i) -= x;
-
-    // ===============================================
-    // =    (c) Compute Eg(x) and check it           =
-    // ===============================================
-
-    Eg = determinant(A,r);
-    if( gcd(Eg, deriv(Eg,x)) == 1 )
-    {
-      suitable1 = true;
-    }
-  } // end of  �while ( !suitable1 )�
-
-
-  // ==============================================
-  // =   (5) Prepare for leaving                  =
-  // ==============================================
-
-  delete[] gi;
-  delete[] ggi;
-  delete[] rand_coeff;
-
-  CFList LL;
-  LL.append(Eg);
-  LL.append(g);
-
-  return (LL);
-}
-/////////////////////////////////////////////////////////////
-// This subroutine creates the polynomials Rg(x)
-// which can be used instead of Eg(x).
-// No basis of G is neccessary, only one element
-////////////////////////////////////////////////////////////
-//=======================================================
-CFList BIFAC::createRg (CFList G, CanonicalForm f)
-//=======================================================
-{
-
-//  cerr << "* Was ist wenn g versagt???? -> Ausbauen\n";
-
-  CanonicalForm fx = deriv(f,x);
-  CanonicalForm Rg;
-  CanonicalForm g = create_g(G);
-
-
-  // ===============================================
-  // =   (1) Find a suitable constant              =
-  // ===============================================
-
-  CanonicalForm alpha=1;
-
-  while(  resultant( f, fx, x)(alpha) == 0 )
-  {
-        //while( resultant( f, fx, x)(alpha).inCoeffDomain() != true )
-    //alpha +=1;
-  }
-
-
-  // ===============================================
-  // =   (2) Find a suitable constant              =
-  // ===============================================
-
-  Rg = resultant( f(alpha,y), g(alpha,y)-z*fx(alpha,y), x);
-
-
-  CFList LL;
-  LL.append(Rg(x,z));
-  LL.append(g);
-  return (LL);
-}
-/////////////////////////////////////////////////////////
-// Compute the absolute and rational factorization of
-// the univariate polynomial 'ff^grad'.
-//=======================================================
-void BIFAC::unifac (CanonicalForm ff, int grad)
-//=======================================================
-{
-
-  CFFList factorsUni;
-  CFFList factorsAbs;
-  CanonicalForm tmp;
-
-  factorsUni = AbsFactorize(ff);
-
-  for( CFFListIterator l=factorsUni; l.hasItem(); l++)
-    if( ! l.getItem().factor().inBaseDomain() )
-    {
-      gl_RL.append( CFFactor( l.getItem().factor(),l.getItem().exp()*grad) );
-    }
-
-
-}
-
-
-///////////////////////////////////////////////////////
-// Compute the rational factor of f belonging to phi
-//=======================================================
-CanonicalForm BIFAC::RationalFactor (CanonicalForm phi, CanonicalForm ff, \
-                                     CanonicalForm fx, CanonicalForm g)
-//=======================================================
-{
-
-  CanonicalForm h,hh;
-//  CanonicalForm fx = deriv(f,x);
-
-  for ( CFIterator it = phi; it.hasTerms(); it++ )
-    h += it.coeff() * power(fx,phi.degree()-it.exp())*power(g,it.exp());
-
-
-  hh = Bigcd(ff,  h);
-
-  return(hh);
-}
-//=======================================================
-void BIFAC::RationalFactorizationOnly (CFFList Phis, CanonicalForm f0, CanonicalForm g)
-//=======================================================
-{
-  CanonicalForm h,ff;
-  CanonicalForm fx = deriv(f0,x);
-
-  for( CFFListIterator i=Phis; i.hasItem(); i++)
-  {
-    ASSERT( i.getItem().exp() == 1 , "Wrong factor of Eg"); // degree must be 1
-    CanonicalForm phi = i.getItem().factor();
-
-    if( ! phi.inBaseDomain())
-    {
-      h = RationalFactor(phi,f0,fx,g);
-      gl_RL.append( CFFactor(h,exponent ));
-      ff = f0;
-      f0 /= h;
-      ASSERT( f0*h==ff, "Wrong factor found");
-    }
-  }
-}
-
-//=======================================================
-CFList BIFAC::getAbsoluteFactors (CanonicalForm f1, CanonicalForm phi)
-//=======================================================
-{
-  CanonicalForm fac;
-  CanonicalForm root;
-  CFList AbsFac;
-
-  CFFList Fac = factorize(phi,e);
-  for( CFFListIterator i=Fac; i.hasItem(); i++)
-  {
-    fac = i.getItem().factor();
-    if( taildegree(fac) > 0 )  // case: phi = a * x
-      root = 0;
-    else
-      root = -tailcoeff(fac)/lc(fac);
-
-
-    AbsFac.append( f1(root,e) );
-    AbsFac.append( i.getItem().exp() * exponent);
-    AbsFac.append( phi ); // Polynomial of the field extension
-  }
-  return AbsFac;
-}
-//=======================================================
-void BIFAC::AbsoluteFactorization (CFFList Phis, CanonicalForm ff, CanonicalForm g)
-//=======================================================
-{
-
-  int ii;
-  if( getCharacteristic() == 0 )
-  {
-    //cerr << "* Charcteristic 0 is not yet implemented! => Aborting!\n";
-    exit(1);
-  }
-
-
-  CFList  AbsFac;
-  CanonicalForm phi;
-  CanonicalForm h, h_abs, h_res, h_rat;
-  CanonicalForm fx = deriv(ff,x);
-
-
-  for( CFFListIterator i=Phis; i.hasItem(); i++)
-  {
-    ASSERT( i.getItem().exp() == 1 , "Wrong factor of Eg"); // degree must be 1
-    phi = i.getItem().factor();
-
-    if( ! phi.inBaseDomain())
-    {
-
-      // === Case 1:  phi has degree 1 ===
-      if( phi.degree() == 1 )
-      {
-        if( taildegree(phi) > 0 )  // case: phi = a * x
-          h = gcd( ff,g );
-        else                       // case: phi = a * x + c
-        {
-          h =  gcd( ff, g+tailcoeff(phi)/lc(phi)*fx);
-        }
-
-        //biNormieren( h );
-        gl_AL.append(h); // Factor of degree 1
-         gl_AL.append(exponent); // Multiplicity (exponent)
-        gl_AL.append(0); // No field extension
-      } else
-      {
-        // === Case 2:  phi has degree > 1 ===
-        e=rootOf(phi, 'e');
-        h =  gcd( ff, g-e*fx);
-        //biNormieren( h );
-
-        AbsFac = getAbsoluteFactors(h, phi);
-        for( CFListIterator l=AbsFac; l.hasItem(); l++)
-          gl_AL.append( l.getItem() );
-
-
-        // ===  (1) Get the rational factor by multi-  ===
-        // ===      plication of the absolute factor.  ===
-        h_abs=1;
-        ii = 0;
-
-        for( CFListIterator l=AbsFac; l.hasItem(); l++)
-        {
-          ii++;
-          if (ii%3 == 1 )
-            h_abs *= l.getItem();
-        }
-        //biNormieren( h_abs );
-
-
-        // === (2) Compute the rational factor  ===
-        // ===     by using the resultant.      ===
-        h_res =  resultant(phi(z,x), h(z,e), z);
-        //biNormieren( h_res );
-
-
-        // === (3) Compute the rational factor by ignoring  ===
-        // ===     all knowledge of absolute factors.       ===
-        h_rat = RationalFactor(phi, ff,fx, g);
-        //biNormieren( h_rat );
-
-        ASSERT(  (h_abs == h_res) && (h_res == h_rat), "Wrong rational factor ?!?");
-        h = h_abs;
-      }
-      // End of absolute factorization.
-      gl_RL.append(CFFactor( h,exponent )); // Save the rational factor
-      ff/=h;
-    }
-  }
-}
-
-
-//======================================================
-//  Factorization of a squarefree bivariate polynomial
-//  in which every factor appears only once.
-//  Do we need a complete factorization ('absolute' is true)
-//  or only a rational factorization ('absolute' false)?
-//======================================================
-void BIFAC::bifacSqrFree(CanonicalForm ff)
-//=======================================================
-{
-
-  int anz=0;                  // number of factors without field elements
-
-  CFList G   = basisOfG(ff);
-
-  CFList LL;
-  CanonicalForm Eg,g;
-
-
-
-  // Case 1: There is only one rational & absolute factor ===
-  if( G.length() == 1 ){                        // There is only one
-    gl_RL.append( CFFactor(ff, exponent));      // rational factor
-    gl_AL.append( ff );
-    gl_AL.append( exponent );
-    gl_AL.append( 0 );
-  }
-  else // Case 2: There is more than  one absolute factor ===
-  {
-//    LL  = createEg(G,ff);
-//   LL = createEgUni(G,ff); // Hier ist noch ein FEHLER !!!!
-
-   LL = createRg( G, ff);  // viel langsamer als EgUni
-
-
-    Eg  =  LL.getFirst();
-        Eg  =  Eg/LC(Eg);
-
-   g   =  LL.getLast();
-
-//      g = G.getFirst();
-
-
-    CFFList PHI = AbsFactorize( Eg );
-
-        CFFListIterator J=PHI;
-        CanonicalForm Eg2=1;
-         for ( ; J.hasItem(); J++)
-        { Eg2 = Eg2 * J.getItem().factor(); }
-
-    // === Is Eg(x) irreducible ? ===
-    anz=0;
-
-        // PHI =  AbsFactorize( Eg) ;
-        //
-
-    for( CFFListIterator i=PHI; i.hasItem(); i++) {
-      if( !i.getItem().factor().inBaseDomain())
-        anz++;
-         }
-
-    /* if( absolute ) // Only for a absolute factorization
-      AbsoluteFactorization( PHI,ff, g);
-    else         // only for a rational factorization
-    { */
-      if( anz==1 ){ ;
-        gl_RL.append( CFFactor(ff,exponent));}
-      else
-        RationalFactorizationOnly( PHI,ff, g);
-   /* } */
-  }
-}
-
-/////////////////////////////////////////////
-// Main procedure for the factorization
-// of the bivariate polynomial 'f'.
-// REMARK: 'f' might be univariate, too.
-//--<>---------------------------------
-void BIFAC::bifacMain(CanonicalForm  f)
-//--<>---------------------------------
-{
-
-
-  CanonicalForm ff, ggT;
-
-  // ===============================================
-  // =    (1) Trivial case: Input is a constant    =
-  // ===============================================
-
-  if( f.inBaseDomain() )
-  {
-    gl_AL.append(f); // store polynomial
-    gl_AL.append(1); // store exponent
-    gl_AL.append(0); // store �polynomial� for field extension
-
-    gl_RL.append( CFFactor(f,1) ); // store polynomial
-    return;
-  }
-
-  // ===============================================
-  // =       STEP: Squarefree decomposition        =
-  // ===============================================
-
-
-        CFFList Q =Mysqrfree(f);
-//
-//        cout << Q << endl;
-//
-
-
-
-  // =========================================================
-  // =  STEP: Factorization of the squarefree decomposition  =
-  // =========================================================
-
-
-  for( CFFListIterator i=Q; i.hasItem(); i++)
-  {
-
-        if( i.getItem().factor().level() < 0 ) ;
-        else
-        {
-    if( ( degree(i.getItem().factor(),x) == 0 || degree( i.getItem().factor(),y) == 0) ) {
-      // case: univariate
-      unifac( i.getItem().factor(), i.getItem().exp()  ); }
-    else // case: bivariate
-    {
-      exponent =  i.getItem().exp();       // global variable
-          CanonicalForm dumm = i.getItem().factor();
-          dumm = dumm.LC();
-          if( dumm.level() > 0 ){ dumm =  1;  }
-      bifacSqrFree(i.getItem().factor()/dumm );
-    }
-  }}
-
-
-}
-
-
-///////////////////////////////////////////////////////
-// Find the least prime so that the factorization
-// works.
-///////////////////////////////////////////////////////
-
-//=======================================================
-int BIFAC::findCharacteristic(CanonicalForm f)
-//=======================================================
-{
-  int min = (2*degree(f,'x')-1)*degree(f,'y');
-  int nr=0;
-
-  if( min >= 32003 ) return ( 32003 ); // this is the maximum
-
-  // Find the smallest poosible prime
-  while ( cf_getPrime(nr) < min)  { nr++;  }
-  return ( cf_getPrime(nr) );
-}
-
-/////////////////////////////////////////////////////////
-//
-//  PUBLIC functions
-//
-/////////////////////////////////////////////////////////
-
-// convert the result of the factorization from
-// the intern storage type into the public one.
-// Also, check the correctness of the solution
-// and, if neccessary, change the characteristic.
-//--<>---------------------------------
-void BIFAC::convertResult(CanonicalForm & f, int ch, int sw)
-//--<>---------------------------------
-{
-
-  CanonicalForm ff = 1;
-  CanonicalForm c;
-
-  CFFList aL;
-
-  //cout << gl_RL<<endl;
-
-        if( sw )
-        {
-                Variable W('W');
-                for( CFFListIterator i=gl_RL; i.hasItem(); i++)
-            {
-                        c = i.getItem().factor();
-                        c = c(W,y);
-                        c = c(y,x);
-                        c = c(x,W);
-                        aL.append( CFFactor( c, i.getItem().exp() ));
-                }
-
-                f = f(W,y); f=f(y,x); f=f(x,W);
-        }
-        else aL = gl_RL;
-
-        gl_RL = aL;
-
-        //cout << aL;
-
-
-
-  // ==========  OUTPUT  =====================
-/*  for( CFFListIterator i=aL; i.hasItem(); i++)
-  {
-    cout << "(" << i.getItem().factor() << ")";
-    if( i.getItem().exp() != 1 )
-      cout << "^" << i.getItem().exp();
-    cout << " * ";
-  } */
-
-
-//  cout << "\n* Test auf Korrektheit ...";
-
-
-  for( CFFListIterator i=aL; i.hasItem(); i++)
-    {
-      ff *= power(i.getItem().factor(),  i.getItem().exp() );
-      //      cout << " ff = " << ff
-      //           << "\n a^b = " << i.getItem().factor() << "  ^ " <<   i.getItem().exp() << endl;
-    }
-  c = f.LC()/ff.LC();
-
-  ff *= c;
-
-
-//   cout << "\n\nOriginal f = " << f << "\n\nff = " << ff
-//           << "\n\nDiff = " << f-ff << endl << "Quot "<< f/ff <<endl;
-//  cout << "degree 0: " << c << endl;
-
-
-#ifndef NOSTREAMIO
-  if( f != ff ) cout << "\n\nOriginal f = " << f << "\n\nff = " << ff
-                     << "\n\nDiff = " << f-ff << endl << "Quot "<< f/ff <<endl;
-#endif
-  ASSERT( f==ff, "Wrong rational factorization. Abborting!");
-//  cout << "  [OK]\n";
-
-}
-//--<>---------------------------------
-void BIFAC::bifac(CanonicalForm f, bool abs)
-//--<>---------------------------------
-{
-  absolute = 1;      // global variables
-  CFList  factors;
-  int ch =  getCharacteristic();
-  int ch2;
-
-
-  ASSERT( ch==0 && !isOn(SW_RATIONAL), "Integer numbers not allowed" );
-
-
-  // === Check the characteristic ===
-  if( ch != 0 )
-  {
-    ch2 = findCharacteristic(f);
-    if( ch <  ch2 )
-    {
-//      setCharacteristic( ch2 );
-      f = mapinto(f);
-
-      // PROVISORISCH
-      //cerr << "\n Characteristic is too small!"
-         //  << "\n The result might be wrong!\n\n";
-      exit(1);
-
-    } else ;
-  }
-
-         Variable W('W');
-          CanonicalForm l;
-        int sw = 0;
-
-        if( degree(f,x) < degree(f,y) ) {
-                f = f(W,x);   f = f(x,y); f=f(y,W);
-                sw = 1;
-        }
-                l = f.LC();
-
-                if( l.level()<0 ) { f = f/f.LC(); gl_RL.append( CFFactor(l,1) ); }
-
-
-  bifacMain(f);                   // start the computation
-
-  convertResult(f,ch, sw) ; // and convert the result
-}
-
-// ==============  end of 'bifac.cc'  ==================
-#endif
diff --git a/factory/bifac.h b/factory/bifac.h
deleted file mode 100644
index c55dea5..0000000
--- a/factory/bifac.h
+++ /dev/null
@@ -1,100 +0,0 @@
-/* ======================================================================
-    Dateiname:          bifac.h
-    Autor:              Holger L. Cr�ni
-    Bearbeitung:        29. August 2002
-
-
-    Beschreibung: Klasse zur Faktorisierung bivariater Polynome
-   =================================================================== */
-
-#ifndef bifac__H
-#define bifac__H
-
-
-#include <time.h>
-#include <factoryconf.h>
-#ifdef HAVE_BIFAC
-
-#include "lgs.h"
-#include "bifacConfig.h"
-
-// === IO-Streams ===
-#ifndef NOSTREAMIO
-#ifdef HAVE_CSTDIO
-#include <cstdio>
-#else
-#include <stdio.h>
-#endif
-#ifdef HAVE_IOSTREAM
-#include <fstream>
-#include <iostream>
-#elif defined(HAVE_IOSTREAM_H)
-#include <fstream.h>
-#include <iostream.h>
-#endif
-#include <iomanip.h>
-#endif
-
-/*BEGINPUBLIC*/
-
-CFFList AbsFactorize( const CanonicalForm  & a );
-
-class BIFAC
-{
-////////////////////////////////////////////////////////////////
-  public:
-////////////////////////////////////////////////////////////////
-
-  // === KONST-/ DESTRUKTOREN ====
-  BIFAC         ( void );  // Konstruktor
-  virtual ~BIFAC( void );  // DESTRUKTOR
-
-  // === Funktionen =======
-  void     bifac(CanonicalForm f, bool absolute=true);
-  CFFList  getFactors( void ){ return  gl_RL; };
-
-
-////////////////////////////////////////////////////////////////
- private:
-////////////////////////////////////////////////////////////////
-
-  // === Funktionen =======
-  void   passedTime();
-  void   biGanzMachen(  CanonicalForm & f );
-  void   biNormieren( CanonicalForm & f ) ;
-  void   convertResult(  CanonicalForm & f, int ch, int sw);
-  int    findCharacteristic(CanonicalForm f);
-//  void   matrix_drucken( CFMatrix M );
-  long int  anz_terme(  CanonicalForm & f );
-
-  CFList matrix2basis(CFMatrix A, int dim, int m, int n, CanonicalForm f);
-  CFList basisOfG(CanonicalForm f);
-  CFMatrix createA (CFList G, CanonicalForm f);
-  CanonicalForm  create_g    (CFList G);
-  CFList         createRg    (CFList G, CanonicalForm f);
-  CFList         createEg    (CFList G, CanonicalForm f);
-  CFList         createEgUni (CFList G, CanonicalForm f);
-
-  void     unifac(CanonicalForm f, int grad);
-  CanonicalForm RationalFactor (CanonicalForm phi, CanonicalForm f, \
-                                CanonicalForm fx, CanonicalForm g);
-  void   RationalFactorizationOnly (CFFList Phis, CanonicalForm f, CanonicalForm g);
-  CFList getAbsoluteFactors (CanonicalForm f1, CanonicalForm phi);
-  void   AbsoluteFactorization (CFFList Phis, CanonicalForm f, CanonicalForm g);
-  void   bifacSqrFree( CanonicalForm f );
-  void   bifacMain(CanonicalForm f);
-
-
-  // === Variable =======
-  CFFList gl_RL;    // where to store the rational factorization
-  CFList  gl_AL;    // where to store the absolute factorization
-  bool   absolute;  // Compute an absolute factorization as well?
-  int    exponent;  //
-};
-
-/*ENDPUBLIC*/
-
-#endif
-// =============== Ende der Datei 'bifac.h' ============================
-
-#endif
diff --git a/factory/bifacConfig.h b/factory/bifacConfig.h
deleted file mode 100644
index 7361295..0000000
--- a/factory/bifacConfig.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*  ===================================================================
-    GLOBAL COMPILE OPTIONS FOR BIFAC
-    =================================================================== */
-
-
-#ifndef bifac_global__H
-#define bifac_global__H
-
-#ifdef HAVE_BIFAC
-
-// Also compute the polynomial 'h' and check if the defining
-// diffential equation is zero
-const bool BIFAC_BASIS_OF_G_CHECK = true;
-
-// Check if the result of the absolute and rational
-// factorization of a univariate polynomial are identical.
-const bool  BIFAC_CHECK_UNI_ABS = true;
-
-
-// Probability (in percent) that Eg(x) is separable
-const int EgSeparable  =  90;
-
-// #define AUSGABE_LGS(text) ;
-// #define AUSGABE_HQ(text) ;
-// #define AUSGABE_ERR(text) ;
-// #define AUSGABE_LOG(text) ;
-
-// Should there be debugging output?
-#ifdef NOSTREAMIO
-#define AUSGABE_LGS(text)
-#define AUSGABE_HQ(text)
-#define AUSGABE_ERR(text)
-#define AUSGABE_LOG(text)
-#else
-#define AUSGABE_LGS(text) (cout << text << endl);
-#define AUSGABE_HQ(text) (cout << text << endl);
-#define AUSGABE_ERR(text) (cerr << text << endl);
-#define AUSGABE_LOG(text) (cout << text << endl);
-#endif
-
-
-/*  ===================================================================
-    GLOBAL COMPILE OPTIONS FOR MULTIFAC
-    =================================================================== */
-const int PROB_p = 90;  // Probability in percent for acurate factorization
-const bool HC_NOASSERT = false;
-
-#endif
-#endif
diff --git a/factory/fex/ChangeLog b/factory/fex/ChangeLog
deleted file mode 100644
index d091949..0000000
--- a/factory/fex/ChangeLog
+++ /dev/null
@@ -1,29 +0,0 @@
-Wed Apr  1 09:52:59 MET DST 1998  Jens Schmidt
-
-	* ChangeLog, insert.fex:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-Tue Mar 31 13:01:59 MET DST 1998  Jens Schmidt
-
-	* gcd.fex:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-	* stdUnivPGcd.in, runfex, gcdUnivPAlpha.fex, gcdUnivP.fex:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-Tue Mar 31 13:17:04 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-	* insert.fex: cosmetical changes
-
-Fri Mar 27 12:26:17 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* stdUnivPGcd.in: cosmetical changes
-
-	* stdUnivPGcd.in (symmetric 4(1/p/1), inhomog cyclic 5(1/p/2),
-	  inhomog cyclic 5(1/p/2)): new examples
-
-	* stdUnivPGcd.in: major rewrite of format
-
-    **************** >>> changes in branch `factory-gcd' ****************
diff --git a/factory/fex/gcdUnivP.fex b/factory/fex/gcdUnivP.fex
deleted file mode 100644
index 0abeca5..0000000
--- a/factory/fex/gcdUnivP.fex
+++ /dev/null
@@ -1,407 +0,0 @@
-# emacs edit mode for this file is -*- sh -*-
-# $Id: gcdUnivP.fex 12231 2009-11-02 10:12:22Z hannes $
-
-#{{{ docu
-#
-# gcdUnivP.fex - factory example collection for testing
-#   univariate gcd in characteristic p.
-#
-# Allmost all of the examples have been generated with the
-# following standard bases calculations:
-#
-# "anborg 7/p";
-# ring r2=(32003,u),(x,y,z),dp;
-# ideal i=
-# u3x2+yz+xy2z+xyz2+xyz+xy+xz+yz, 
-# ux2y2z+xy2z2+x2yz+xyz+yz+x+z, 
-# u2x2y2z2+x2y2z+xy2z+xyz+xz+z+1;
-# option(redSB);
-# ideal j=std(i);
-# ring sr2=(32003,u),(x,y,z),lp;
-# ideal k=fglm(r2, j);
-#
-# "inhomog cyclic 6/p";
-# ring r4=(32003,u),(a,b,c,d,e,f),dp;
-# ideal i=
-# a+b+c+d+e+f,
-# ab+bc+cd+de+ef+fa,
-# abc+bcd+cde+d*e*f + efa + fab,
-# uabcd+bcde+c*d*e*f+d*e*f*a + efab + fabc,
-# abcde+b*c*d*e*f+c*d*e*f*a+d*e*f*a*b+efabc+fabcd,
-# a*b*c*d*e*f;
-# ideal j=std(i);
-#
-#}}}
-
-collection gcdUnivP \
-    -n"Factory example collection for testing univariate gcd in characteristic p" \
-    -ohntc \
-    /32003/x
-
-#{{{ stdA*
-#{{{ docu
-#
-# stdA* - examples from Singulars std calculations.
-#
-# `stdA*' is a series of examples generated by content
-# extractions during std computations involving a simple
-# transcendental extension.
-#
-# They are ordered by increasing input data degree.  gcd degrees
-# vary in a wide range, but do not equal zero.  In fact, they
-# have a tendency to be relatively large.
-#
-# The examples are almost completely dense.
-#
-# The degree patterns:
-# 1:	4	3	2
-# 2:	6	8	5
-# 3:	9	13	1
-# 4:	13	14	12
-# 5:	17	20	5
-# 6:	22	20	5
-# 7:	36	34	24
-# 8:	46	45	44
-# 9:	56	61	21
-# 10:	93	94	79
-# 11:	180	180	162
-# 12:	734	734	678
-#
-#}}}
-example stdA1 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
--9554*x^4-12895*x^3-10023*x^2-6213*x;
--9554*x^3-3341*x^2+6213*x;
-19108*x^2+19577*x;
-EOF
-
-example stdA2 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
--11265*x^6+12161*x^5+10369*x^4-12161*x^3+896*x^2;
-10669*x^8-10673*x^7+5*x^6+8*x^5-10681*x^4+10665*x^3+7*x^2;
-4*x^5+31997*x^4+31999*x^3+6*x^2;
-EOF
-
-example stdA3 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
--7918*x^9-14406*x^8-7256*x^7+2092*x^6-2198*x^5-12539*x^4-14631*x^3-7150*x^2;
--14833*x^13-7011*x^12+15121*x^11-10864*x^10+12943*x^9-9871*x^8+10354*x^7-1437*x^6+6604*x^5-10394*x^4-3231*x^3-9348*x^2-2092*x;
-8238*x;
-EOF
-
-example stdA4 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-106*x^13-583*x^12-1060*x^11+8056*x^10+1696*x^9-327*x^8+12508*x^7+8277*x^6+5609*x^5-12879*x^4+13144*x^3-2544*x^2;
-11118*x^14-5404*x^13-908*x^12-13908*x^11+3188*x^10-8818*x^9+10439*x^8-14811*x^7+15530*x^6-4891*x^5+6322*x^4+15829*x^3-13686*x^2;
-16832*x^12+18604*x^11+5094*x^10+26021*x^9+19270*x^8+31456*x^7+2537*x^6+25026*x^5+8202*x^4+26905*x^3+12071*x^2;
-EOF
-
-example stdA5 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
--14613*x^17+2235*x^16-298*x^15+4540*x^14+7214*x^13+5494*x^12-3122*x^11-4720*x^10+8300*x^9-6582*x^8-9908*x^7-15983*x^6-5802*x^5-8634*x^4+7899*x^3+10556*x^2+6931*x+11063;
--10168*x^20+6674*x^19+3004*x^18+13113*x^17+9449*x^16+9097*x^15-6420*x^14+50*x^13+434*x^12-15226*x^11+3727*x^10-14065*x^9-9751*x^8-15792*x^7+6004*x^6-5059*x^5+2479*x^4-12504*x^3-11328*x^2-11338*x-8280;
-3435*x^5+13128*x^4+18838*x^3+7869*x^2+14710*x+31384;
-EOF
-
-example stdA6 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
-3812*x^22-6874*x^21+12586*x^20+3003*x^19-9568*x^18+11117*x^17+7524*x^16+11138*x^15-9743*x^14+1892*x^13+12485*x^12-569*x^11-8265*x^10-5991*x^9+13701*x^8+2644*x^7-3936*x^6-15875*x^5+1289*x^4+3956*x^3-10099*x^2-6616*x+5401;
-
-10652*x^20-4144*x^19-11810*x^18+8237*x^17-8675*x^16+6545*x^15-3601*x^14+14559*x^13+8090*x^12-8378*x^11+14255*x^10+8767*x^9-13932*x^8+11602*x^7-10751*x^6-4899*x^5+8637*x^4+14084*x^3-11583*x^2+5882*x+885;
-
-16159*x^5+8428*x^4+724*x^3+9235*x^2+3749*x+880;
-EOF
-
-example stdA7 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
--7448*x^36+7714*x^35-13927*x^34+3932*x^33+3682*x^32-10010*x^31+5268*x^30+13873*x^29+13357*x^28-833*x^27-184*x^26+15676*x^25+13250*x^24-1501*x^23+4047*x^22-12971*x^21+1837*x^20-95*x^19+13420*x^18+6133*x^17+1202*x^16-10228*x^15+15007*x^14-5205*x^13+5458*x^12+11076*x^11-488*x^10-9898*x^9+7409*x^8+13329*x^7-11898*x^6-7619*x^5-8536*x^4+12785*x^3+11896*x^2-12853*x+2549;
-
-5104*x^34-12263*x^33-1609*x^32-6796*x^31-2994*x^30+7028*x^29-3014*x^28-1266*x^27-12321*x^26+14482*x^25+3663*x^24-3726*x^23+6983*x^22+1260*x^21-4850*x^20-2975*x^19+11044*x^18-14330*x^17-6739*x^16-11849*x^15+1213*x^14+3785*x^13+4837*x^12-11046*x^11+13804*x^10+8188*x^9+8122*x^8+10487*x^7+6814*x^6+9533*x^5-11550*x^4-10878*x^3-699*x^2-14751*x+3845;
-
-31962*x^24+23624*x^23+8361*x^22+5741*x^21+28375*x^20+30600*x^19+23141*x^18+21460*x^17+7597*x^16+14737*x^15+8586*x^14+27345*x^13+25015*x^12+15767*x^11+28878*x^10+15575*x^9+25802*x^8+320*x^7+5331*x^6+31806*x^5+22043*x^4+30040*x^3+20941*x^2+17959*x+9379;
-EOF
-
-example stdA8 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
--11183*x^46+8215*x^45-14295*x^44+8289*x^43-7550*x^42+12650*x^41+10826*x^40-2442*x^39+6380*x^38-1209*x^37+1942*x^36+2715*x^35+15876*x^34+15415*x^33+6777*x^32-12712*x^31+12435*x^30-3063*x^29+10219*x^28-11110*x^27+7832*x^26-5236*x^25-12353*x^24+5050*x^23-1811*x^22+6642*x^21-3090*x^20-7071*x^19-12500*x^18+12953*x^17-10539*x^16+12938*x^15+8080*x^14+8451*x^13-9123*x^12-4021*x^11+4501*x^10-4506*x^9-407*x^8+12356*x^7-2074*x^6+690*x^5-14676*x^4-15971*x^3-1813*x^2+7707*x+1079;
-
-183*x^45+5561*x^44-1043*x^43+12612*x^42+1596*x^41-9268*x^40+4858*x^39-13517*x^38+14465*x^37-12452*x^36-15117*x^35-5775*x^34-8520*x^33-13105*x^32-12192*x^31-4843*x^30-5194*x^29-2000*x^28+13734*x^27-4211*x^26+6154*x^25+3930*x^24+11156*x^23+5575*x^22+12497*x^21+3708*x^20-13561*x^19+6457*x^18+7867*x^17+11794*x^16-13102*x^15+3546*x^14+11013*x^13+6443*x^12+9411*x^11-5881*x^10-11560*x^9+13919*x^8-2613*x^7+10716*x^6+10107*x^5-7507*x^4-14638*x^3-9884*x^2-4890*x-2671;
-
-28289*x^44+11555*x^43+13374*x^42+23635*x^41+11000*x^40+31192*x^39+20885*x^38+3863*x^37+19661*x^36+27448*x^35+25114*x^34+21097*x^33+21622*x^32+15737*x^31+2014*x^30+18783*x^29+16863*x^28+5083*x^27+18062*x^26+30553*x^25+25096*x^24+31745*x^23+9865*x^22+30437*x^21+9682*x^20+22605*x^19+14337*x^18+8907*x^17+27538*x^16+6418*x^15+15444*x^14+19743*x^13+13977*x^12+17825*x^11+683*x^10+12192*x^9+10274*x^8+27620*x^7+12902*x^6+4730*x^5+14555*x^4+26794*x^3+3464*x^2+14119*x+8400;
-EOF
-
-example stdA9 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
-2229*x^56+11515*x^55+5449*x^54-2102*x^53+10553*x^52+4459*x^51 -10713*x^50-10483*x^49+12815*x^48+1371*x^47+13136*x^46+13474*x^45 +15930*x^44-3951*x^43+3632*x^42+5483*x^41+15429*x^40+11158*x^39 +11618*x^38-11397*x^37+373*x^36+12655*x^35-14103*x^34-9976*x^33 -4906*x^32+10959*x^31-6889*x^30-4713*x^29-9677*x^28-12594*x^27 +6918*x^26-12226*x^25+3225*x^24+9437*x^23-9869*x^22-10191*x^21 -2477*x^20+11187*x^19+5746*x^18-15428*x^17+4405*x^16-1631*x^15 -13687*x^14-6654*x^13+8104*x^12+12147*x^11-4629 [...]
-
-2877*x^61-351*x^60-12672*x^59-7991*x^58-2499*x^57-9709*x^56 +1219*x^55+5355*x^54-13710*x^53+3347*x^52-12542*x^51+12524*x^50 +8280*x^49+15488*x^48+13565*x^47+14659*x^46+9784*x^45+3738*x^44 +13042*x^43-2627*x^42-15378*x^41+7650*x^40-827*x^39-7590*x^38 +2687*x^37+15016*x^36+12855*x^35-8645*x^34+3930*x^33+1837*x^32 +335*x^31-11981*x^30-4414*x^29-7074*x^28+2715*x^27+3314*x^26-44*x^25 +8932*x^24+15583*x^23-2036*x^22-9074*x^21+9396*x^20+13732*x^19 -6178*x^18+2091*x^17+14186*x^16-7830*x^15+12864 [...]
-
-20545*x^21+13767*x^20+14438*x^19+5157*x^18+6247*x^17 +9252*x^16+6991*x^15+8965*x^14+21909*x^13+5606*x^12 +25423*x^11+8852*x^10+22192*x^9+15394*x^8+22226*x^7 +12407*x^6+3862*x^5+19893*x^4+13670*x^3+26335*x^2+3988*x +8566;
-EOF
-
-#{{{ example stdA10
-example stdA10 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
-12909*x^93-1050*x^92+9079*x^91+13353*x^90+5362*x^89+2122*x^88+5552*x^87-860*x^86-7038*x^85+8454*x^84+1007*x^83+8389*x^82-11334*x^81-665*x^80+6624*x^79-12187*x^78+12852*x^77-11781*x^76-14093*x^75+8262*x^74+7715*x^73+9732*x^72+11087*x^71+12104*x^70-3417*x^69-15320*x^68+1755*x^67-3430*x^66-15539*x^65-9386*x^64+13828*x^63+11829*x^62-4486*x^61-1512*x^60+7176*x^59+3601*x^58+14441*x^57-12871*x^56-10638*x^55-11581*x^54-7926*x^53+9673*x^52-5632*x^51+2444*x^50+1985*x^49+15200*x^48+14766*x^47+5334* [...]
-
--1861*x^94-14011*x^93+10894*x^92+12157*x^91-5731*x^90-3615*x^89-2283*x^88-11269*x^87-2618*x^86+14170*x^85+6324*x^84+12200*x^83-10783*x^82-13291*x^81-1268*x^80+3704*x^79-3599*x^78-12575*x^77-5955*x^76+1506*x^75-4485*x^74-8736*x^73-15630*x^72+9190*x^71+4808*x^70-11208*x^69-7288*x^68-1359*x^67+9895*x^66+10662*x^65+3490*x^64-10443*x^63+9600*x^62+14793*x^61-9336*x^60-2414*x^59-10087*x^58+6224*x^57-12489*x^56+6942*x^55+4866*x^54+15052*x^53-5209*x^52+193*x^51-6029*x^50+5192*x^49+294*x^48-14381* [...]
-
-31188*x^79+26875*x^78+27090*x^77+1534*x^76+11483*x^75+13487*x^74+22087*x^73+27276*x^72+31652*x^71+9268*x^70+2948*x^69+19010*x^68+20339*x^67+8023*x^66+25574*x^65+14637*x^64+8811*x^63+30955*x^62+27272*x^61+3165*x^60+11771*x^59+18062*x^58+26871*x^57+5769*x^56+5249*x^55+22428*x^54+18102*x^53+16968*x^52+13092*x^51+24546*x^50+11020*x^49+31864*x^48+27889*x^47+18236*x^46+11964*x^45+5621*x^44+12326*x^43+2337*x^42+24256*x^41+17501*x^40+28122*x^39+15616*x^38+22501*x^37+12472*x^36+3131*x^35+16386*x^ [...]
-EOF
-#}}}
-
-#{{{ example stdA11
-example stdA11 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
-1367*x^180+10863*x^179-3528*x^178+5664*x^177-4128*x^176+3133*x^175-8229*x^174+14908*x^173-3523*x^172-14491*x^171+1677*x^170+12245*x^169+11041*x^168+1056*x^167+14826*x^166-11163*x^165-6039*x^164+11584*x^163-15741*x^162-2437*x^161+13388*x^160-8705*x^159-13250*x^158+5034*x^157+5747*x^156-12567*x^155+727*x^154+13685*x^153-14742*x^152+12465*x^151-11822*x^150+10720*x^149-2599*x^148+10322*x^147-6403*x^146-7094*x^145-8810*x^144+5157*x^143-6138*x^142-9641*x^141-6605*x^140+10604*x^139-13262*x^138- [...]
-
-2182*x^180+15616*x^179+1801*x^178+11312*x^177+15739*x^176-6201*x^175-12543*x^174+3593*x^173-3570*x^172-4868*x^171-7221*x^170-9138*x^169-15750*x^168-9016*x^167-12465*x^166-9653*x^165+14232*x^164+15516*x^163-15116*x^162-2651*x^161+14059*x^160-13333*x^159-1461*x^158-6261*x^157-4552*x^156+3007*x^155+5703*x^154-4304*x^153+8372*x^152+13109*x^151+2290*x^150+14095*x^149-9268*x^148+5474*x^147-3345*x^146+15520*x^145+2329*x^144+11611*x^143-12128*x^142+9714*x^141-8996*x^140+8336*x^139-6299*x^138+124 [...]
-
-4873*x^162+348*x^161+10617*x^160+31353*x^159+17164*x^158+3952*x^157+26906*x^156+26507*x^155+14706*x^154+21914*x^153+25105*x^152+12527*x^151+27564*x^150+6134*x^149+22325*x^148+13897*x^147+30611*x^146+16046*x^145+16822*x^144+24784*x^143+22767*x^142+14616*x^141+16778*x^140+23943*x^139+12829*x^138+12355*x^137+23994*x^136+13696*x^135+11499*x^134+26224*x^133+21156*x^132+16851*x^131+1145*x^130+12044*x^129+20572*x^128+25299*x^127+26570*x^126+24944*x^125+24141*x^124+25712*x^123+18180*x^122+5983*x [...]
-EOF
-#}}}
-
-#{{{ example stdA12
-example stdA12 \
-    -n"Example from Singulars std calculations" \
-    gcd - - - << EOF
-
--14348*x^734+684*x^733-843*x^732-8088*x^731-10210*x^730-3862*x^729+10354*x^728+6084*x^727+7173*x^726-8509*x^725+12851*x^724-5525*x^723-10261*x^722-3867*x^721-15038*x^720-12268*x^719-15652*x^718+5284*x^717+10087*x^716-1812*x^715-10989*x^714+7027*x^713+11755*x^712+13957*x^711-10230*x^710-13425*x^709-15236*x^708-14761*x^707-4722*x^706-14056*x^705+10719*x^704+8468*x^703+3140*x^702-10177*x^701-2900*x^700+7840*x^699+13083*x^698+565*x^697-12629*x^696+6920*x^695-4222*x^694-11082*x^693+9873*x^692 [...]
-
--3932*x^734+7516*x^733+8421*x^732-6660*x^731-3003*x^730-10656*x^729-10441*x^728-10897*x^727+11521*x^726+13529*x^725-5321*x^724-15343*x^723+15544*x^722-3747*x^721-12281*x^720+7718*x^719+15443*x^718+11028*x^717-15948*x^716+8768*x^715-4170*x^714+11575*x^713-10070*x^712+14687*x^711+15365*x^710-12240*x^709-11684*x^708-8529*x^707-5135*x^706-12791*x^705+5239*x^704+2120*x^703+8565*x^702+12132*x^701+11140*x^700+7540*x^699-6133*x^698-6335*x^697+10365*x^696-13152*x^695-13730*x^694-13515*x^693-11621 [...]
-
-18102*x^678+28704*x^677+15354*x^676+5770*x^675+x^674+24694*x^673+29419*x^672+24194*x^671+7983*x^670+12834*x^669+29453*x^668+7167*x^667+20129*x^666+24301*x^665+25949*x^664+29295*x^663+25713*x^662+12680*x^661+12242*x^660+8803*x^659+14148*x^658+8658*x^657+16788*x^656+12471*x^655+26836*x^654+3417*x^653+5105*x^652+4696*x^651+8061*x^650+20400*x^649+30621*x^648+1020*x^647+18059*x^646+31094*x^645+17627*x^644+27515*x^643+3320*x^642+4871*x^641+23031*x^640+9762*x^639+24081*x^638+26557*x^637+31115*x [...]
-EOF
-#}}}
-#}}}
-
-#{{{ stdB*
-#{{{ docu
-#
-# stdB* - examples from Singulars std/fglm computations with
-#   low degree gcd.
-#
-# In contrast to the previous examples, the examples in
-# `stdB*' have constant or allmost constant gcd.  They are
-# sorted by increasing input degree.
-#
-# Most of the examples result from simplifications of quotients
-# of polynomials.
-#
-#}}}
-example stdB1 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - x^2 << EOF
--4*x^8;
-4*x^10-4*x^9-12*x^8-4*x^7+4*x^6-8*x^5+8*x^4+20*x^3+8*x^2;
-EOF
-
-example stdB2 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - x << EOF
-x^2;
-4*x^8-8*x^7-4*x^5+8*x^4+4*x^2+4*x;
-EOF
-
-example stdB3 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-x;
-8*x^7-8*x^6-8*x^5+8*x^3-8*x^2+8*x+8;
-EOF
-
-example stdB4 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-12524*x^11-6955*x^10+6955*x^9-5569*x^8-5569*x^7+12524*x^6-11138*x^5+8341*x^4-8341*x^3+11138*x^2+1411*x;
--13910*x^12-6955*x^11+2772*x^10-2797*x^9-12524*x^8+5569*x^7+6930*x^6-9727*x^5-12474*x^4+1411*x^3+9777*x^2+15296*x-1411;
-EOF
-
-example stdB5 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - x^3 << EOF
-4377*x^15+682*x^14-9436*x^13+8754*x^12+5059*x^11-4377*x^10;
--2918*x^14+13131*x^13-2918*x^12+10800*x^11+777*x^10-7977*x^9-2236*x^8+1459*x^7+95*x^6-13813*x^5+682*x^4-4377*x^3;
-EOF
-
-example stdB6 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - '3278*x^2+25447*x' << EOF
--7487*x^8-9542*x^7-14974*x^6+2055*x^5-13652*x^4-12919*x^3+9542*x^2+12919*x;
-15659*x^18-6117*x^17-3425*x^16-14974*x^15-1322*x^14-6898*x^13+4843*x^12-2055*x^11-11597*x^10-12919*x^9;
-EOF
-
-example stdB7 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-2648*x^19-2648*x^16+13240*x^15+1324*x^14-3972*x^13-13656*x^12+5523*x^11-11462*x^10+5939*x^9+7074*x^8+8171*x^7-10592*x^6-908*x^5;
-2648*x^15+3745*x^13+7944*x^12+8171*x^11-5750*x^10-9306*x^9-4653*x^8+7944*x^7-13202*x^6+11197*x^5+11159*x^4-13202*x^3-11802*x^2+5296*x-1816;
-EOF
-
-example stdB8 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
--6663*x^21-5351*x^20+6007*x^19+10702*x^18-4798*x^17+14432*x^16-3730*x^15+9493*x^14+11190*x^13-3448*x^12-8837*x^11+477*x^10-9699*x^9+13749*x^8+7845*x^7-13196*x^6+13971*x^5-9699*x^4+320*x^3-12079*x^2-6148*x+10805;
--6663*x^16-9943*x^14+12014*x^13-4039*x^12+13429*x^11-11705*x^10+10149*x^9+12014*x^8-11667*x^7+15153*x^6-3871*x^5-11667*x^4+7048*x^3-13326*x^2+412*x;
-EOF
-
-example stdB9 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-4255*x^23-3964*x^22+7346*x^21-2218*x^19-7055*x^18-6001*x^17+291*x^16+7236*x^15+11129*x^14+10893*x^13-10602*x^12-1746*x^11-2108*x^10-12898*x^9-87*x^8-14692*x^7+5538*x^6+3249*x^5+8519*x^4-14096*x^3-5728*x^2+13166*x+2328;
-7928*x^16+11019*x^14-8219*x^13-7346*x^12+14401*x^11+2981*x^10-14511*x^9-8219*x^8-6363*x^7-220*x^6-1494*x^5-6363*x^4+149*x^3+15856*x^2-6984*x;
-EOF
-
-example stdB10 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-
--6625*x^48-10445*x^47-14158*x^46-6385*x^45+668*x^44-1688*x^43+9305*x^42+10559*x^41+12374*x^40+15861*x^39+7426*x^38+6671*x^37-4242*x^36+2969*x^35+4589*x^34-9804*x^33+6641*x^32-10293*x^31-316*x^30-9574*x^29+5963*x^28-9318*x^27+415*x^26+1615*x^25+15895*x^24-10926*x^23+8525*x^22+6629*x^21+12133*x^20-9129*x^19-4678*x^18-1467*x^17+10281*x^16-10714*x^15-13904*x^14-9435*x^13-5239*x^12+14124*x^11+15842*x^10+5165*x^9+5528*x^8+13200*x^7+12933*x^6-14013*x^5+9209*x^4-7531*x^3+277*x^2-2250*x-159;
-
--12689*x^30+9430*x^28-12128*x^27-11974*x^26+14025*x^25+2030*x^24-14878*x^23+15980*x^22+15536*x^21-8175*x^20+12624*x^19-1688*x^18-8800*x^17+14981*x^16-6930*x^15-10225*x^14+7597*x^13+13122*x^12+9308*x^11-15816*x^10+1728*x^9+12400*x^8+4144*x^7-982*x^6+3348*x^5-13893*x^4-2604*x^3-13517*x^2-8120*x-2862;
-EOF
-
-example stdB11 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-
-12689*x^51+1122*x^50+12235*x^49-15721*x^48+9156*x^47+9931*x^46+4329*x^45+1824*x^44-9438*x^43-12509*x^42-15062*x^41-14290*x^40+944*x^39-4743*x^38+12234*x^37+10223*x^36+1648*x^35+15858*x^34+12907*x^33-5089*x^32+13492*x^31-2274*x^30-4877*x^29+866*x^28-10632*x^27-2244*x^26+13109*x^25-4936*x^24+9839*x^23-2388*x^22-2157*x^21-15677*x^20-15990*x^19+12588*x^18-3788*x^17-4720*x^16-1503*x^15-7490*x^14-3067*x^13+6149*x^12-9069*x^11-122*x^10+1602*x^9-11251*x^8+55*x^7+13843*x^6-2698*x^5+1527*x^4-7069* [...]
-
--12689*x^33+9430*x^31-12128*x^30-11974*x^29+14025*x^28+2030*x^27-14878*x^26+15980*x^25+15536*x^24-8175*x^23+12624*x^22-1688*x^21-8800*x^20+14981*x^19-6930*x^18-10225*x^17+7597*x^16+13122*x^15+9308*x^14-15816*x^13+1728*x^12+12400*x^11+4144*x^10-982*x^9+3348*x^8-13893*x^7-2604*x^6-13517*x^5-8120*x^4-2862*x^3;
-EOF
-
-example stdB12 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-
-5707*x^56-6212*x^55-14231*x^54+2890*x^53-4338*x^52+14436*x^51+12926*x^50-14197*x^49-14664*x^48+8697*x^47-2119*x^46+3477*x^45-10146*x^44-2274*x^43-13469*x^42-11188*x^41+8981*x^40+4459*x^39-9108*x^38-4534*x^37+2399*x^36+1236*x^35-7039*x^34-2094*x^33-5936*x^32+9920*x^31+8850*x^30+9739*x^29+15859*x^28+1150*x^27+15728*x^26-4589*x^25+11464*x^24-1494*x^23+8400*x^22-10285*x^21-11533*x^20-13508*x^19+8215*x^18+14556*x^17+879*x^16+9650*x^15+15486*x^14+15811*x^13-10170*x^12+4244*x^11+2588*x^10+215*x [...]
-
-6285*x^34+9680*x^32+5707*x^31-15787*x^30-14450*x^29+4697*x^28-12795*x^27-3857*x^26-15037*x^25+2604*x^24+7359*x^23-2140*x^22-1601*x^21+2991*x^20+7140*x^19+14414*x^18-8797*x^17+15574*x^16-14439*x^15-9889*x^14+1129*x^13+6620*x^12-2330*x^11+13619*x^10+8188*x^9+14314*x^8+11411*x^7-1590*x^6+13215*x^5-2870*x^4;
-EOF
-
-example stdB13 \
-    -n"Example from Singulars std/fglm calculations with low degree gcd" \
-    gcd - - 1 << EOF
-
-14984*x^62+8140*x^61-6844*x^60+10863*x^59+10999*x^58+13631*x^57-4567*x^56-196*x^55+6468*x^54+2628*x^53-683*x^52+7124*x^51-15805*x^50+6848*x^49+15655*x^48+2828*x^47-3048*x^46+13797*x^45+10345*x^44+14631*x^43+8752*x^42+13057*x^41+7537*x^40+15864*x^39-11113*x^38-11424*x^37+10964*x^36-5486*x^35-12369*x^34-7914*x^33-6512*x^32-5581*x^31+3641*x^30+2436*x^29-215*x^28+3179*x^27+236*x^26-645*x^25+3964*x^24+559*x^23-12895*x^22+14407*x^21+6594*x^20-6153*x^19-15525*x^18+2534*x^17+979*x^16+11836*x^15- [...]
-
--13165*x^31-3422*x^29-14984*x^28+5852*x^27-13472*x^26+15723*x^25+15268*x^24-14962*x^23-10613*x^22+11960*x^21-6020*x^20+6443*x^19+7198*x^18+2824*x^17-9533*x^16+181*x^15-388*x^14-1816*x^13-4966*x^12+1823*x^11-14331*x^10-13052*x^9+2080*x^8+8033*x^7-13765*x^6+13044*x^5+14262*x^4+15704*x^3+1114*x^2-5267*x;
-EOF
-#}}}
-
-#{{{ sparseA*
-#{{{ docu
-#
-# sparseA* - sparsified examples from std/fglm calculations.
-#
-# I.e., examples with a lot of terms removed.  All of them have
-# constant gcd, input degrees vary between 50 and 120.
-#
-#}}}
-example sparseA1 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
--3041*x^101+2954*x^100-5637*x^96-10702*x^94+9414*x^92-2489*x^90+6760*x^88-11040*x^86+4672*x^84+5852*x^82+1529*x^77-851*x^75-14043*x^73+3445*x^72+4099*x^70+5159*x^68+2143*x^65-3372*x^62+6808*x^57+1519*x^55+3638*x^53+619*x^52-11456*x^50+14971*x^47-15963*x^45-5575*x^43-11051*x^42+11735*x^40+15874*x^38+12108*x^37+5751*x^35+544*x^33-2290*x^30+1016*x^27+14340*x^25-1234*x^23-13240*x^22+7705*x^20-8698*x^18+13544*x^17-2477*x^15+7888*x^13+11774*x^10+7395*x^8-10127*x^7-719*x^5-10331*x^3-14993*x^2-7 [...]
-
--11049*x^70+4576*x^67+5532*x^65+13718*x^63-518*x^60-11626*x^57+9943*x^55+550*x^53-4648*x^52-8158*x^50-7658*x^47+6622*x^45+6166*x^43+9362*x^42-963*x^40+6188*x^38+1503*x^37+11934*x^35+15731*x^33+6371*x^30-13080*x^27+10462*x^25+6585*x^23+9192*x^22+4147*x^20-7051*x^18+7066*x^17-5031*x^15-10393*x^13+3359*x^10;
-EOF
-
-example sparseA2 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
--3796*x^75-12725*x^73+10327*x^72+8148*x^70+1737*x^68+8836*x^67-4033*x^65+10605*x^63-9645*x^60-13566*x^57-1028*x^55+6222*x^53-2426*x^52-3952*x^50+13522*x^47-9952*x^45-3598*x^43+725*x^42+12560*x^40-14034*x^38-8053*x^37+2536*x^35+13116*x^33+12880*x^30-3064*x^27-483*x^25+12642*x^23+8968*x^22+13260*x^20-1918*x^18+4862*x^17+8286*x^15+4075*x^13+959*x^10-8957*x^8-7001*x^7+3591*x^5-13103*x^3+8035*x^2+11762*x-8215;
-
-5797*x^38-2779*x^35+11444*x^33+4223*x^30+12180*x^27-4043*x^25-6017*x^23-5576*x^22-5907*x^20+14918*x^18-6729*x^17-11421*x^15-12965*x^13-4980*x^10-12145*x^8;
-EOF
-
-example sparseA3 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
-4034*x^82-6832*x^77+481*x^75-9941*x^73+10417*x^72+4455*x^70-10091*x^68+4031*x^67+7051*x^65-6618*x^63+15832*x^60-9296*x^57+12835*x^55+14792*x^53-12987*x^52-10295*x^50+6652*x^47+11710*x^45-2213*x^43+87*x^42+638*x^40+2014*x^38-1863*x^37+10834*x^35-7109*x^33+8752*x^30-7360*x^27-15033*x^25-3068*x^23-3080*x^22-12369*x^20+6362*x^18-11998*x^17-14720*x^15-7326*x^13-4019*x^10-1978*x^8+15799*x^7-2907*x^5-14756*x^3+4545*x^2+4225*x+12114;
-
--3240*x^42+8529*x^40+11881*x^38+11039*x^37-11026*x^35+13940*x^33-10812*x^30-1313*x^27-2931*x^25+13790*x^23+15180*x^22+52*x^20+223*x^18-10255*x^17+11532*x^15-3957*x^13;
-EOF
-
-example sparseA4 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
-3126*x^121-3473*x^118+14202*x^117-14278*x^115-6156*x^113-7425*x^110+7291*x^108-12144*x^107-4812*x^105-10938*x^103+15049*x^100+8131*x^97-8431*x^95-7281*x^93-1029*x^92-3498*x^90+10102*x^88-2075*x^87+594*x^85-15900*x^83-4816*x^80-2047*x^77-13865*x^75+13287*x^73-9524*x^72+13044*x^70-2313*x^68+11881*x^67-10980*x^65+3729*x^63+9696*x^60-12381*x^57+1817*x^55-12176*x^53+10923*x^52+15832*x^50-908*x^47+8185*x^45-5471*x^43-3355*x^42+12936*x^40+6369*x^38-1402*x^37-6231*x^35+1342*x^33-10772*x^30-2627* [...]
-
-11318*x^75+3115*x^73+7804*x^72-77*x^70-943*x^68-14782*x^67-13472*x^65-3231*x^63+5907*x^60-8858*x^57+5054*x^55+968*x^53-6690*x^52-1631*x^50-15015*x^47+6834*x^45-2539*x^43+3787*x^42-6533*x^40+10742*x^38-6548*x^37+11117*x^35-3161*x^33-5813*x^30+14984*x^27+3072*x^25+3101*x^23+8371*x^22+11853*x^20+13780*x^18+126*x^17-4078*x^15;
-EOF
-
-example sparseA5 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
-+12555*x^120+5844*x^118-4981*x^117-2457*x^115+13745*x^113+1863*x^110-254*x^108+1244*x^107-15675*x^105+13357*x^103+3688*x^100+15526*x^97-9942*x^95-11735*x^93-4228*x^92+1500*x^90+5390*x^88-5401*x^87-5864*x^85-7666*x^83-8503*x^80+9299*x^77-15761*x^75-11531*x^73-8075*x^72-3786*x^70+13917*x^68-10845*x^67-9368*x^65-6180*x^63-10943*x^60-7032*x^57+6590*x^55+7402*x^53+4462*x^52-15361*x^50+5509*x^47+15453*x^45+7119*x^43+5358*x^42+8299*x^40+10619*x^38+14258*x^37+11258*x^35-12961*x^33-12662*x^30+116 [...]
-
-13532*x^75-5341*x^73+2369*x^72+9361*x^70+14061*x^68-329*x^67-14801*x^65-14098*x^63-4231*x^60-11637*x^57+6365*x^55+5759*x^53-8666*x^52-6265*x^50-1224*x^47+3313*x^45-15932*x^43+12349*x^42+1277*x^40-2941*x^38+13169*x^37+6332*x^35+9395*x^33+6515*x^30+6599*x^27-3147*x^25-7043*x^23+7294*x^22+5423*x^20-11761*x^18+15318*x^17+7136*x^15;
-EOF
-
-example sparseA6 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
--11761*x^118+6676*x^117+8068*x^115-1230*x^113+6683*x^110+13852*x^108-9460*x^107-4707*x^105+15643*x^103+530*x^100+2865*x^97-11630*x^95+3147*x^93-12442*x^92-15817*x^90+7376*x^88-2297*x^87-15653*x^85+11140*x^83-12574*x^80-2354*x^77+8595*x^75+9212*x^73-10453*x^72+4955*x^70-4966*x^68-2458*x^67-8223*x^65-3081*x^63+11495*x^60-6358*x^57+6852*x^55+2918*x^53-5461*x^52-8685*x^50-10890*x^47-15251*x^45-12665*x^43+6037*x^42+13977*x^40-915*x^38+8317*x^37-8672*x^35-15957*x^33-787*x^30-9696*x^27+14509*x^ [...]
-
-11318*x^74+3115*x^72+337*x^70-13853*x^68-943*x^67-7832*x^65-2278*x^63-13431*x^60-4601*x^57-6648*x^55+3437*x^53-968*x^52-15975*x^50+7886*x^47-15408*x^45+5788*x^43-2539*x^42+3501*x^40+3045*x^38-10742*x^37-7578*x^35+3061*x^33+11866*x^30+11737*x^27+8624*x^25+13387*x^23+3101*x^22+7554*x^20+15322*x^18+13780*x^17+4994*x^15;
-EOF
-
-example sparseA7 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
-6252*x^121-10328*x^118+715*x^117+7462*x^115-12952*x^113+5545*x^110+14884*x^108-7275*x^107-4096*x^105-1205*x^103-10910*x^100-2414*x^97+15050*x^95+13845*x^93+5926*x^92-6872*x^90-4610*x^88-5612*x^87+14232*x^85+14866*x^83-5907*x^80-9508*x^77-14607*x^75+13891*x^73-3086*x^72-11480*x^70-3354*x^68+5470*x^67+13608*x^65+8165*x^63+11661*x^60-3865*x^57-10685*x^55+13483*x^53+4414*x^52+10277*x^50-10478*x^47+6256*x^45-1820*x^43-3304*x^42-6824*x^40+11108*x^38+13019*x^37-9819*x^35+1797*x^33+7152*x^30-140 [...]
-
-11318*x^74+3115*x^72+337*x^70-13853*x^68-943*x^67-7832*x^65-2278*x^63-13431*x^60-4601*x^57-6648*x^55+3437*x^53-968*x^52-15975*x^50+7886*x^47-15408*x^45+5788*x^43-2539*x^42+3501*x^40+3045*x^38-10742*x^37-7578*x^35+3061*x^33+11866*x^30+11737*x^27+8624*x^25+13387*x^23+3101*x^22+7554*x^20+15322*x^18+13780*x^17+4994*x^15;
-EOF
-
-example sparseA8 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
-11604*x^123+5561*x^120-4389*x^118-5780*x^117-4717*x^115-12915*x^113-15919*x^110+7002*x^108-12688*x^107+4694*x^105-4373*x^103-3646*x^100+11316*x^97+9895*x^95+9348*x^93+9025*x^92+2382*x^90-9054*x^88-327*x^87+12090*x^85+13679*x^83+6126*x^80-4869*x^77+10582*x^75-5210*x^73+13590*x^72+3892*x^70+10126*x^68+70*x^67+9065*x^65+6998*x^63-8556*x^60+11578*x^57+2202*x^55-3574*x^53-11249*x^52-12080*x^50-5296*x^47-7793*x^45+11089*x^43-9949*x^42-11329*x^40+12303*x^38+15040*x^37-12532*x^35-13803*x^33+1255 [...]
-
-14130*x^76-9545*x^73-2926*x^72+6214*x^70+1947*x^68-7414*x^67+15643*x^65-2815*x^63-12811*x^60-3056*x^57+13557*x^55+9749*x^53-12875*x^52-4224*x^50-15979*x^47-2962*x^45+7810*x^43+13856*x^42+15726*x^40+4589*x^38+1600*x^37+7800*x^35-11114*x^33+9676*x^30+15715*x^27-5037*x^25+6396*x^23-10289*x^22-2576*x^20-6412*x^18-1671*x^17;
-EOF
-
-example sparseA9 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
--5412*x^123+12846*x^120-1653*x^118-8236*x^117+4687*x^115+9937*x^113-13397*x^110+10990*x^108+11845*x^107-10893*x^105-8223*x^103+13299*x^100-10891*x^97-9965*x^95+15940*x^93-14208*x^92+3273*x^90+9698*x^88-2169*x^87-10244*x^85-4911*x^83-12027*x^80+14094*x^77-894*x^75-5927*x^73-15134*x^72+2364*x^70-10023*x^68+13367*x^67+1007*x^65+11336*x^63-6740*x^60-9971*x^57+8728*x^55-10440*x^53-7211*x^52-4289*x^50-15709*x^47-13888*x^45+13884*x^43+14466*x^42+4204*x^40+8246*x^38+3569*x^37-12291*x^35-2536*x^3 [...]
-
--6280*x^74-12828*x^73+5639*x^72-14143*x^70+7918*x^68-6646*x^67+15801*x^65+9986*x^63+13012*x^60+15252*x^57-6210*x^55-12460*x^53+10430*x^52+11028*x^50-4741*x^47-6824*x^45+6389*x^43+13284*x^42+10402*x^40-9708*x^38-9996*x^37+726*x^35+8469*x^33-12196*x^30+13431*x^27-13787*x^25-13486*x^23+5315*x^22+548*x^20+8376*x^18+15000*x^17;
-EOF
-
-example sparseA10 \
-    -n"Sparsified example from std/fglm calculations" \
-    gcd - - 1 << EOF
-
--10222*x^118-15747*x^117+10401*x^115+13492*x^113+12249*x^110-191*x^108-14140*x^107-13119*x^105+5637*x^103-8905*x^100+3374*x^97+13255*x^95-2359*x^93+4017*x^92+13469*x^90+1434*x^88+4732*x^87-6059*x^85+4021*x^83-3331*x^80+6706*x^77+2402*x^75+13742*x^73+3981*x^72+5252*x^70-7610*x^68-5939*x^67-9582*x^65-2690*x^63+1036*x^60-8863*x^57+8169*x^55+4865*x^53+2181*x^52+8476*x^50+5001*x^47-5066*x^45-2802*x^43-13*x^42-15046*x^40+4542*x^38+4561*x^37+14525*x^35+2267*x^33+12011*x^30-9572*x^27-10196*x^25+ [...]
-
--6240*x^74-9281*x^73-5812*x^72-6535*x^70-6033*x^68+11742*x^67-5916*x^65-10054*x^63+8678*x^60+886*x^57-6060*x^55-13196*x^53+8529*x^52-9834*x^50-14699*x^47+7896*x^45-11182*x^43-15746*x^42+3609*x^40-13184*x^38+3725*x^37-14159*x^35-6873*x^33-12526*x^30+10084*x^27-14227*x^25-3111*x^23-12453*x^22+13998*x^20-4927*x^18-11391*x^17;
-EOF
-#}}}
diff --git a/factory/fex/gcdUnivPAlpha.fex b/factory/fex/gcdUnivPAlpha.fex
deleted file mode 100644
index 83ae3ed..0000000
--- a/factory/fex/gcdUnivPAlpha.fex
+++ /dev/null
@@ -1,304 +0,0 @@
-# emacs edit mode for this file is -*- sh -*-
-# $Id: gcdUnivPAlpha.fex 12231 2009-11-02 10:12:22Z hannes $
-
-#{{{ docu
-#
-# gcdUnivPAlpha.fex - factory example collection for testing
-#   univariate gcd in characteristic p[alpha].
-#
-# Some possible minimal polynomials (derived from factorization of x^100+1):
-#
-# mod 103:
-# --------
-# x^2+65*x+1
-# x^2+38*x+1
-# x^4+77*x^3+102*x^2+91*x+1
-# x^4+12*x^3+102*x^2+26*x+1
-# x^4+91*x^3+102*x^2+77*x+1
-# x^4+26*x^3+102*x^2+12*x+1
-# x^20+91*x^15+102*x^10+77*x^5+1
-# x^20+12*x^15+102*x^10+26*x^5+1
-# x^20+77*x^15+102*x^10+91*x^5+1
-# x^20+26*x^15+102*x^10+12*x^5+1
-#
-# mod 32003:
-# ----------
-# x^2+3083*x+32002
-# x^2+28920*x+32002
-# x^4+20186*x^3+x^2+23269*x+1
-# x^4+11817*x^3+x^2+8734*x+1
-# x^4+23269*x^3+x^2+20186*x+1
-# x^4+8734*x^3+x^2+11817*x+1
-# x^20+11817*x^15+x^10+8734*x^5+1
-# x^20+23269*x^15+x^10+20186*x^5+1
-# x^20+8734*x^15+x^10+11817*x^5+1
-# x^20+20186*x^15+x^10+23269*x^5+1
-#
-# mod 103^2:
-# ----------
-# x^2+Z^10557*x+Z^7956
-# x^2+Z^2703*x+Z^7956
-# x^2+Z^2601*x+Z^2652
-# x^2+Z^7905*x+Z^2652
-# x^2+Z^5355*x+Z^2652
-# x^2+Z^5253*x+Z^7956
-# x^2+Z^51*x+Z^2652
-# x^2+Z^8007*x+Z^7956
-# x^10+Z^2703*x^5+Z^7956
-# x^10+Z^5253*x^5+Z^7956
-# x^10+Z^2601*x^5+Z^2652
-# x^10+Z^10557*x^5+Z^7956
-# x^10+Z^5355*x^5+Z^2652
-# x^10+Z^51*x^5+Z^2652
-# x^10+Z^8007*x^5+Z^7956
-# x^10+Z^7905*x^5+Z^2652
-# 
-# The `std*' results are correct in
-# `/32003/xa=x^4+8734*x^3+x^2+11817*x+1', while all other
-# examples are correct in `/32003/xa=x^4+20186*x^3+x^2+23269*x+1'.
-#
-#}}}
-
-collection gcdUnivPAlpha \
-    -n"Factory example collection for testing univariate gcd in characteristic p[alpha]" \
-    -ohntc \
-    /32003/xa=x^4+20186*x^3+x^2+23269*x+1
-#    /101^2/xa=x^2+Z^8007*x+Z^7956
-#    /32003/xa=x^20+23269*x^15+x^10+20186*x^5+1
-
-#{{{ CFSA*
-typeset -i i=0
-f='((6182*a+7698)*x^19+(7698*a+77)*x^16+102*x^113+91*x^3+a)'
-g='(x^21+91*x^13+(127*a+102)*x^10+77*x^6+1)'
-d='(a*x^3+(3757*a+20186)*x^2+23268)'
-while [ $i -le 9 ]; do
-    example CFSA$((i+1)) \
-	-n"Series with constant gcd degree (3) and increasing cofactor degree ($((i*19)),$((i*21)))" \
-	gcd $d*$f^$i $d*$g^$i $d
-    i=i+1
-done
-#}}}
-
-#{{{ GCDSA*
-typeset -i i=0
-f='(a*x^3+(3757*a+20186)*x^2+23268)'
-g='(x^4+(8734*a+536)*x^3+x^2+11817*x+(4124*a+5341))'
-d='((4692*a+616)*x^17+(3412*a+52824)*x^14+24608*x^13+x^10+23269*x^9+(52824*a+87)*x^7+20186*x^3+1)'
-while [ $i -le 9 ]; do
-    example GCDSA$((i+1)) \
-	-n"Series with constant cofactor degree (3,4) and increasing gcd degree ($((i*17)))" \
-	gcd $d^$i*$f $d^$i*$g $d^$i
-    i=i+1
-done
-#}}}
-
-#{{{ CFGCDSA*
-typeset -i i=0
-f='(a*x^3+(3757*a+20186)*x^2+23268)'
-g='(x^3+91*x^2+(127*a+102)*x+78)'
-d='((4692*a+616)*x^3+(3412*a+52824)*x^2+1)'
-while [ $i -le 9 ]; do
-    example CFGCDSA$((i+1)) \
-	-n"Series with constant total degree (30) and increasing gcd degree ($((i))*3)" \
-	gcd $d^$i*$f^$((9-i)) $d^$i*$g^$((9-i)) $d^$i
-    i=i+1
-done
-#}}}
-
-#{{{ stdA*
-#{{{ docu
-#
-# stdA* - reduced examples from Singulars std calculations.
-#
-# `stdA*' is a series of examples generated by content
-# extractions during std computations involving two
-# transcendental extensions.  The results have been reduced
-# modulo `a=x^4+8734*x^3+x^2+11817*x+1' in one variable.
-#
-# They are ordered by increasing input data degree.  gcd degrees
-# vary in a wide range, but do not equal zero.  In fact, they
-# have a tendency to be relatively large.  Some of them are even
-# trivial in the sense that the gcd is already one of the input
-# polynomials.
-#
-# The examples are almost completely dense.
-#
-# The degree patterns:
-# 1:	6	6	5
-# 2:	5	6	5
-# 3:	11	10	7
-# 4:	22	21	14
-# 5:	11	22	11
-# 6:	30	31	25
-# 7:	23	31	23
-# 8:	58	59	56
-#
-#}}}
-collection stdA \
-    -n"Reduced examples from Singulars std calculations" \
-    -ohntc \
-    /32003/xa=x^4+8734*x^3+x^2+11817*x+1
-
-example stdA1 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-(25836*a^3*x^6+30467*a^2*x^6+26792*a*x^6+30467*x^6+27083*a^3*x^5+30808*a^2*x^5+28163*a*x^5+292*x^5+12440*a^3*x^4+19396*a^2*x^4+19616*a*x^4+23236*x^4+25156*a^3*x^3+31764*a^2*x^3+31235*a*x^3+6459*x^3);
-(14670*a^3*x^6+19715*a^2*x^6+22318*a*x^6+19715*x^6+19743*a^3*x^5+28179*a^2*x^5+19715*a*x^5+7335*x^5+6379*a^3*x^4+11397*a^2*x^4+23599*a*x^4+9861*x^4+16005*a^3*x^3+31525*a^2*x^3+30467*a*x^3+12918*x^3);
-(10238*a^3*x^5+3778*a^2*x^5+8932*a*x^5+23767*x^5+23400*a^3*x^4+15610*a^2*x^4+8823*a*x^4+5940*x^4+18561*a^3*x^3+16946*a^2*x^3+2233*a*x^3+29944*x^3);
-EOF
-
-example stdA2 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-(21147*a^3*x^5+10147*a^3*x^4+8142*a^2*x^4+27671*a*x^4+29289*x^4+29289*a^3*x^3);
-(6167*a^3*x^6+1536*a^2*x^6+5211*a*x^6+1536*x^6+17534*a^3*x^5+478*a^2*x^5+1536*a*x^5+19085*x^5+3203*a^3*x^4+26578*a^2*x^4+17052*a*x^4+26770*x^4+26002*a^3*x^3+24062*a^2*x^3+192*a*x^3+6386*x^3);
-(21147*a^3*x^5+10147*a^3*x^4+8142*a^2*x^4+27671*a*x^4+29289*x^4+29289*a^3*x^3);
-EOF
-
-example stdA3 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-(2295*a^2*x^11+5897*a^3*x^10+765*a^2*x^10+27718*a^3*x^9+1283*a^2*x^9+23792*a*x^9+518*x^9+22026*a^3*x^8+11468*a^2*x^8+16834*a*x^8+24778*x^8+28460*a^3*x^7+8140*a^2*x^7+28036*a*x^7+1613*x^7+18196*a^3*x^6+13274*a^2*x^6+4638*a*x^6+31194*x^6+12206*a^3*x^5+10349*a^2*x^5+30979*a*x^5+8612*x^5);
-(8192*a^3*x^10+8957*a^2*x^10+9659*a^3*x^9+28672*a^2*x^9+4553*a*x^9+12288*x^9+5819*a^3*x^8+320*a^2*x^8+14380*a*x^8+12104*x^8+12047*a^3*x^7+19823*a^2*x^7+6824*a*x^7+4335*x^7+29376*a^3*x^6+22190*a^2*x^6+31239*a*x^6+22647*x^6);
-(4992*a^3*x^7+20007*a^2*x^7+24868*a*x^7+16896*x^7+12019*a^3*x^6+22065*a^2*x^6+12021*a*x^6+2496*x^6+17757*a^3*x^5+24002*a^2*x^5+19591*a*x^5+29505*x^5);
-EOF
-
-example stdA4 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(4338*a^3*x^22+30273*a^2*x^22+23626*a*x^22+28673*x^22+2688*a^3*x^21+18069*a^2*x^21+615*a*x^21+11551*x^21+23638*a^3*x^20+20268*a^2*x^20+20021*a*x^20+6060*x^20+15921*a^3*x^19+10779*a^2*x^19+5367*a*x^19+13257*x^19+23678*a^3*x^18+21957*a^2*x^18+22070*a*x^18+13372*x^18+22158*a^3*x^17+22426*a^2*x^17+27501*a*x^17+8746*x^17+13959*a^3*x^16+6774*a^2*x^16+2671*a*x^16+7421*x^16+14110*a^3*x^15+28074*a^2*x^15+31056*a*x^15+9720*x^15+25856*a^3*x^14+27097*a^2*x^14+11589*a*x^14+9779*x^14+28980*a^3*x^13+31 [...]
-
-(21796*a^3*x^21+23013*a^2*x^21+19320*a*x^21+16794*x^21+15777*a^3*x^20+10745*a^2*x^20+18575*a*x^20+14270*x^20+21816*a^3*x^19+8096*a^2*x^19+22632*a*x^19+2859*x^19+11970*a^3*x^18+13157*a^2*x^18+21826*a*x^18+17544*x^18+22237*a^3*x^17+23414*a^2*x^17+28069*a*x^17+21121*x^17+20441*a^3*x^16+23414*a^2*x^16+17132*a*x^16+19928*x^16+4814*a^3*x^15+31789*a^2*x^15+26593*a*x^15+20904*x^15+2605*a^3*x^14+24991*a^2*x^14+19457*a*x^14+27354*x^14+7054*a^3*x^13+13551*a^2*x^13+8720*a*x^13+11331*x^13+20837*a^3*x [...]
-
-(11638*a^3*x^14+12906*a^2*x^14+5771*a*x^14+21038*x^14+29863*a^3*x^13+2861*a^2*x^13+14741*a*x^13+19399*x^13+14919*a^3*x^12+2917*a^2*x^12+26162*a*x^12+12577*x^12+14558*a^3*x^11+5922*a^2*x^11+31508*a*x^11+18956*x^11+30058*a^3*x^10+31012*a^2*x^10+3953*a*x^10+19810*x^10+18813*a^3*x^9+17586*a^2*x^9+12986*a*x^9+12196*x^9+1235*a^3*x^8+22546*a^2*x^8+18363*a*x^8+22602*x^8+29104*a^3*x^7+2954*a^2*x^7+12789*a*x^7+26203*x^7+12967*a^3*x^6+25872*a^2*x^6+9884*a*x^6+1105*x^6);
-EOF
-
-example stdA5 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(30402*a^2*x^11+18403*a^3*x^10+1601*a*x^10+7960*a^3*x^9+5100*a^2*x^9+12917*a*x^9+23503*x^9+19710*a^3*x^8+19683*a^2*x^8+5001*a*x^8+13321*x^8+8701*a^3*x^7+4852*a^2*x^7+7827*a*x^7+19791*x^7+31927*a^3*x^6+5410*a^2*x^6+5467*a*x^6+16037*x^6+17185*a^3*x^5+8307*a^2*x^5+19811*a*x^5+10473*x^5+19945*a^3*x^4+21657*a^2*x^4+10273*a*x^4+23983*x^4);
-
-(21403*a^3*x^22+7448*a^2*x^22+10810*a*x^22+21081*x^22+704*a^3*x^21+5272*a^2*x^21+17829*a*x^21+16706*x^21+10892*a^3*x^20+1510*a^2*x^20+15586*a*x^20+2137*x^20+11244*a^3*x^19+10003*a^2*x^19+3058*a*x^19+19748*x^19+12837*a^3*x^18+8949*a^2*x^18+2293*a*x^18+23488*x^18+29674*a^3*x^17+3512*a^2*x^17+18761*a*x^17+23333*x^17+22922*a^3*x^16+25227*a^2*x^16+12018*a*x^16+16378*x^16+8276*a^3*x^15+11474*a^2*x^15+976*a*x^15+5711*x^15+28827*a^3*x^14+562*a^2*x^14+14734*a*x^14+1896*x^14+21302*a^3*x^13+5155*a^ [...]
-
-(30402*a^2*x^11+18403*a^3*x^10+1601*a*x^10+7960*a^3*x^9+5100*a^2*x^9+12917*a*x^9+23503*x^9+19710*a^3*x^8+19683*a^2*x^8+5001*a*x^8+13321*x^8+8701*a^3*x^7+4852*a^2*x^7+7827*a*x^7+19791*x^7+31927*a^3*x^6+5410*a^2*x^6+5467*a*x^6+16037*x^6+17185*a^3*x^5+8307*a^2*x^5+19811*a*x^5+10473*x^5+19945*a^3*x^4+21657*a^2*x^4+10273*a*x^4+23983*x^4);
-EOF
-
-example stdA6 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(6932*a^3*x^30+8805*a^2*x^30+5025*a*x^30+10521*x^30+13279*a^3*x^29+23946*a^2*x^29+27819*a*x^29+10032*x^29+2815*a^3*x^28+8075*a^2*x^28+10956*a*x^28+6853*x^28+14883*a^3*x^27+24295*a^2*x^27+2927*a*x^27+4389*x^27+23314*a^3*x^26+16933*a^2*x^26+10692*a*x^26+26362*x^26+9650*a^3*x^25+25794*a^2*x^25+31656*a*x^25+5294*x^25+4194*a^3*x^24+22900*a^2*x^24+219*a*x^24+7145*x^24+30606*a^3*x^23+1584*a^2*x^23+20182*a*x^23+19601*x^23+2310*a^3*x^22+16413*a^2*x^22+22745*a*x^22+23328*x^22+6311*a^3*x^21+16014*a [...]
-
-(10159*a^3*x^31+16131*a^2*x^31+13528*a*x^31+23305*x^31+16104*a^3*x^30+31322*a^2*x^30+15822*a*x^30+15332*x^30+6117*a^3*x^29+22754*a^2*x^29+22263*a*x^29+15247*x^29+21262*a^3*x^28+21290*a^2*x^28+22581*a*x^28+19917*x^28+11941*a^3*x^27+14500*a^2*x^27+752*a*x^27+22628*x^27+20010*a^3*x^26+2870*a^2*x^26+4997*a*x^26+31196*x^26+435*a^3*x^25+10675*a^2*x^25+19556*a*x^25+8954*x^25+6160*a^3*x^24+8179*a^2*x^24+13464*a*x^24+5133*x^24+10300*a^3*x^23+16922*a^2*x^23+10977*a*x^23+8282*x^23+26357*a^3*x^22+29 [...]
-
-(18501*a^3*x^25+2215*a^2*x^25+9546*a*x^25+23781*x^25+66*a^3*x^24+17875*a^2*x^24+10791*a*x^24+24958*x^24+12351*a^3*x^23+6945*a^2*x^23+20839*a*x^23+13947*x^23+4102*a^3*x^22+25930*a^2*x^22+24511*a*x^22+5317*x^22+27994*a^3*x^21+1621*a^2*x^21+17149*a*x^21+7899*x^21+29799*a^3*x^20+16892*a^2*x^20+13651*a*x^20+24546*x^20+15513*a^3*x^19+21217*a^2*x^19+17562*a*x^19+16836*x^19+27362*a^3*x^18+17668*a^2*x^18+5087*a*x^18+24099*x^18+27011*a^3*x^17+3798*a^2*x^17+17773*a*x^17+16267*x^17+26438*a^3*x^16+18 [...]
-EOF
-
-example stdA7 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(3942*a^3*x^23+29103*a^2*x^23+12041*a*x^23+25126*x^23+20894*a^3*x^22+28895*a^2*x^22+11505*a*x^22+17368*x^22+13062*a^3*x^21+2762*a^2*x^21+21062*a*x^21+4750*x^21+23462*a^3*x^20+20870*a^2*x^20+2409*a*x^20+29192*x^20+11569*a^3*x^19+16322*a^2*x^19+11901*a*x^19+8892*x^19+9555*a^3*x^18+15798*a^2*x^18+2183*a*x^18+28858*x^18+10484*a^3*x^17+29114*a^2*x^17+7236*a*x^17+23244*x^17+14649*a^3*x^16+23659*a^2*x^16+18881*a*x^16+7039*x^16+5085*a^3*x^15+1172*a^2*x^15+24012*a*x^15+6392*x^15+29778*a^3*x^14+20 [...]
-
-(7790*a^3*x^31+10495*a^2*x^31+3298*a*x^31+22265*x^31+17500*a^3*x^30+10225*a^2*x^30+31566*a*x^30+912*x^30+5002*a^3*x^29+3880*a^2*x^29+5880*a*x^29+27490*x^29+10868*a^3*x^28+31164*a^2*x^28+29132*a*x^28+719*x^28+629*a^3*x^27+21530*a^2*x^27+28414*a*x^27+5748*x^27+18413*a^3*x^26+22024*a^2*x^26+2681*a*x^26+26497*x^26+29395*a^3*x^25+14381*a^2*x^25+23428*a*x^25+6567*x^25+15793*a^3*x^24+9976*a^2*x^24+31655*a*x^24+24728*x^24+22812*a^3*x^23+26206*a^2*x^23+6912*a*x^23+7265*x^23+17258*a^3*x^22+30267*a [...]
-
-(3942*a^3*x^23+29103*a^2*x^23+12041*a*x^23+25126*x^23+20894*a^3*x^22+28895*a^2*x^22+11505*a*x^22+17368*x^22+13062*a^3*x^21+2762*a^2*x^21+21062*a*x^21+4750*x^21+23462*a^3*x^20+20870*a^2*x^20+2409*a*x^20+29192*x^20+11569*a^3*x^19+16322*a^2*x^19+11901*a*x^19+8892*x^19+9555*a^3*x^18+15798*a^2*x^18+2183*a*x^18+28858*x^18+10484*a^3*x^17+29114*a^2*x^17+7236*a*x^17+23244*x^17+14649*a^3*x^16+23659*a^2*x^16+18881*a*x^16+7039*x^16+5085*a^3*x^15+1172*a^2*x^15+24012*a*x^15+6392*x^15+29778*a^3*x^14+20 [...]
-EOF
-
-example stdA8 \
-    -n "Reduced example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(30992*a^3*x^58+22948*a^2*x^58+10015*a*x^58+1073*x^58+18314*a^3*x^57+20073*a^2*x^57+22488*a*x^57+9402*x^57+17300*a^3*x^56+14831*a^2*x^56+26887*a*x^56+4935*x^56+26115*a^3*x^55+12934*a^2*x^55+20509*a*x^55+918*x^55+2507*a^3*x^54+5388*a^2*x^54+1772*a*x^54+28695*x^54+10945*a^3*x^53+4883*a^2*x^53+10536*a*x^53+24376*x^53+27275*a^3*x^52+14030*a^2*x^52+22660*a*x^52+21483*x^52+26646*a^3*x^51+10827*a^2*x^51+5408*a*x^51+17539*x^51+28027*a^3*x^50+2173*a^2*x^50+2283*a*x^50+11199*x^50+21879*a^3*x^49+29 [...]
-
-(9770*a^3*x^59+23847*a^2*x^59+6476*a*x^59+6123*x^59+8421*a^3*x^58+1072*a^2*x^58+22097*a*x^58+29093*x^58+117*a^3*x^57+16911*a^2*x^57+18234*a*x^57+927*x^57+23772*a^3*x^56+22082*a^2*x^56+31256*a*x^56+20032*x^56+31604*a^3*x^55+2212*a^2*x^55+26550*a*x^55+21031*x^55+27901*a^3*x^54+9601*a^2*x^54+27259*a*x^54+26967*x^54+10891*a^3*x^53+9321*a^2*x^53+16017*a*x^53+11268*x^53+19635*a^3*x^52+22384*a^2*x^52+26394*a*x^52+9188*x^52+30422*a^3*x^51+7923*a^2*x^51+4253*a*x^51+27959*x^51+29878*a^3*x^50+31200 [...]
-
-(21642*a^3*x^56+764*a^2*x^56+9713*a*x^56+15382*x^56+11807*a^3*x^55+8386*a^2*x^55+2232*a*x^55+18367*x^55+6452*a^3*x^54+22313*a^2*x^54+8725*a*x^54+13589*x^54+10295*a^3*x^53+22531*a^2*x^53+20264*a*x^53+25539*x^53+8027*a^3*x^52+30200*a^2*x^52+13992*a*x^52+8958*x^52+19484*a^3*x^51+27658*a^2*x^51+24125*a*x^51+30102*x^51+19089*a^3*x^50+7294*a^2*x^50+3278*a*x^50+18744*x^50+29479*a^3*x^49+5168*a^2*x^49+31448*a*x^49+17570*x^49+20053*a^3*x^48+11670*a^2*x^48+1961*a*x^48+3747*x^48+2587*a^3*x^47+16315 [...]
-EOF
-#}}}
-
-#{{{ stdB*
-#{{{ docu
-#
-# stdB* - reduced low degree examples from Singulars std calculations.
-#
-# `stdB*' is a series of low degree examples generated by content
-# extractions during std computations involving two
-# transcendental extensions.  The results have been reduced
-# modulo `a=x^4+8734*x^3+x^2+11817*x+1' in one variable.
-#
-# They are ordered by increasing input data degree.
-#
-# The `stdB*' examples have been produced by:
-#
-# ring r5=(32003,u,v),(a,b,c,d),dp;
-# ideal i=
-# (1+u+u^2)*a4-b4,
-# b4-c4,
-# vc4-d4,
-# ua3b+b3c+c3d+d3a;
-# ideal j=std(i);
-#
-#}}}
-collection stdB \
-    -n"Reduced low gcd degree examples from Singulars std calculations" \
-    -ohntc \
-    /32003/xa=x^4+8734*x^3+x^2+11817*x+1
-
-example stdB1 \
-    -n"Reduced low gcd degree examples from Singulars std calculations" \
-    gcd - - - << EOF
-
-(a^3*x^7+12400*a^3*x^6+3083*a^2*x^6+32001*a*x^6+23269*x^6+5194*a^3*x^5+9249*a^2*x^5+31997*a*x^5+5801*x^5+10383*a^3*x^4+18498*a^2*x^4+31991*a*x^4+11602*x^4+22779*a^3*x^3+21581*a^2*x^3+31989*a*x^3+2868*x^3+10379*a^3*x^2+18498*a^2*x^2+31991*a*x^2+11602*x^2+5189*a^3*x+9249*a^2*x+31997*a*x+5801*x+12397*a^3+3083*a^2+32001*a+23269);
-
-(8734*a^3*x^7+a^2*x^7+11817*a*x^7+1*x^7+26201*a^3*x^6+3*a^2*x^6+3448*a*x^6+3*x^6+20400*a^3*x^5+6*a^2*x^5+6896*a*x^5+6*x^5+29134*a^3*x^4+7*a^2*x^4+18713*a*x^4+7*x^4+20401*a^3*x^3+6*a^2*x^3+6896*a*x^3+6*x^3+26202*a^3*x^2+3*a^2*x^2+3448*a*x^2+3*x^2+8734*a^3*x+a^2*x+11817*a*x+1*x);
-
-(9431*a^3*x^2+10068*a^2*x^2+6138*a*x^2+16731*x^2+9431*a^3*x+10068*a^2*x+6138*a*x+16731*x+9431*a^3+10068*a^2+6138*a+16731);
-EOF
-
-example stdB2 \
-    -n"Reduced low gcd degree example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(5475*a*x^4+10950*a*x^3+16425*a*x^2+10950*a*x+5475*a);
-
-(5180*a*x^7+16463*a^3*x^6+20720*a^2*x^6+15540*a*x^6+5180*x^6+17386*a^3*x^5+4257*a^2*x^5+9437*a*x^5+5180*x^5+2769*a^3*x^4+24977*a^2*x^4+4257*a*x^4+5180*x^4+19232*a^3*x^3+4257*a^2*x^3+31080*a*x^3+2769*a^3*x^2+20720*a^2*x^2+15540*a*x^2+17386*a^3*x+5180*a*x+16463*a^3);
-
-(8574*a^3+2657*a^2+11190*a+16278);
-EOF
-
-example stdB3 \
-    -n"Reduced low gcd degree example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(10733*x^8+21270*a^2*x^7+196*a*x^7+196*x^7+10733*a^3*x^6+31807*a^2*x^6+392*a*x^6+392*x^6+21466*a^3*x^5+31611*a^2*x^5+588*a*x^5+11125*x^5+196*a^3*x^4+20878*a^2*x^4+392*a*x^4+392*x^4+21466*a^3*x^3+31611*a^2*x^3+196*a*x^3+196*x^3+10733*a^3*x^2+31807*a^2*x^2+10733*x^2+21270*a^2*x);
-
-(10733*a*x^7+21270*a^3*x^6+196*a*x^6+21270*x^6+31807*a^3*x^5+31807*a^2*x^5+392*a*x^5+21270*x^5+31611*a^3*x^4+31807*a^2*x^4+11125*a*x^4+21270*x^4+20878*a^3*x^3+31807*a^2*x^3+392*a*x^3+31611*a^3*x^2+196*a*x^2+31807*a^3*x+10733*a*x+21270*a^3);
-
-(12878*a^3*x^2+21317*a^2*x^2+10380*a*x^2+20372*x^2+12878*a^3*x+21317*a^2*x+10380*a*x+20372*x+12878*a^3+21317*a^2+10380*a+20372);
-EOF
-
-example stdB4 \
-    -n"Reduced low gcd degree example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(6414*a^2*x^15+4276*a*x^15+22048*x^15+6596*a^3*x^14+6548*a^2*x^14+7588*a*x^14+9955*x^14+8308*a^3*x^13+14233*a^2*x^13+25484*a*x^13+31268*x^13+11643*a^3*x^12+10987*a^2*x^12+9806*a*x^12+29220*x^12+21978*a^3*x^11+5244*a^2*x^11+22634*a*x^11+26363*x^11+21704*a^3*x^10+12521*a^2*x^10+27067*a*x^10+12911*x^10+18562*a^3*x^9+22681*a^2*x^9+31522*a*x^9+3670*x^9+24053*a^3*x^8+13084*a^2*x^8+10775*a*x^8+22905*x^8+5687*a^3*x^7+17604*a^2*x^7+5832*a*x^7+14577*x^7+18518*a^3*x^6+27507*a^2*x^6+5946*a*x^6+496*x [...]
-
-(29865*a^3*x^15+14231*a^2*x^15+9955*a*x^15+9955*x^15+22795*a^3*x^14+14082*a^2*x^14+17921*a*x^14+6268*x^14+14994*a^3*x^13+2919*a^2*x^13+5319*a*x^13+14722*x^13+1982*a^3*x^12+8086*a^2*x^12+10493*a*x^12+6617*x^12+13655*a^3*x^11+27421*a^2*x^11+30756*a*x^11+25114*x^11+13161*a^3*x^10+9906*a^2*x^10+5442*a*x^10+13173*x^10+7295*a^3*x^9+22*a^2*x^9+12750*a*x^9+14976*x^9+1043*a^3*x^8+11091*a^2*x^8+18962*a*x^8+12693*x^8+19132*a^3*x^7+371*a^2*x^7+28689*a*x^7+17831*x^7+1451*a^3*x^6+26451*a^2*x^6+3540*a* [...]
-
-(12793*a^3+2207*a^2+14150*a+22809);
-EOF
-
-example stdB5 \
-    -n"Reduced low gcd degree example from Singulars std calculations" \
-    gcd - - - << EOF
-
-(18587*a^2*x^21+21305*a^3*x^20+12439*a^2*x^20+7426*a*x^20+13416*x^20+22380*a^3*x^19+12068*a^2*x^19+29458*a*x^19+26754*x^19+6563*a^3*x^18+3808*a^2*x^18+23694*a*x^18+18463*x^18+20710*a^3*x^17+14584*a^2*x^17+12704*a*x^17+23173*x^17+22475*a^3*x^16+1079*a^2*x^16+2760*a*x^16+9545*x^16+10030*a^3*x^15+8915*a^2*x^15+11894*a*x^15+2925*x^15+23184*a^3*x^14+6911*a^2*x^14+23913*a*x^14+24585*x^14+19887*a^3*x^13+16974*a^2*x^13+30830*a*x^13+13078*x^13+19195*a^3*x^12+22249*a^2*x^12+28059*a*x^12+22523*x^12 [...]
-
-(18587*a^3*x^21+18587*a^2*x^21+18027*a^3*x^20+30810*a^2*x^20+10615*a*x^20+29958*x^20+21797*a^3*x^19+27609*a^2*x^19+16906*a*x^19+13750*x^19+18309*a^3*x^18+30555*a^2*x^18+23986*a*x^18+10177*x^18+31775*a^3*x^17+14996*a^2*x^17+13693*a*x^17+5045*x^17+30630*a^3*x^16+11197*a^2*x^16+20956*a*x^16+4530*x^16+1961*a^3*x^15+6992*a^2*x^15+20118*a*x^15+5466*x^15+10734*a^3*x^14+11307*a^2*x^14+5581*a*x^14+21994*x^14+3221*a^3*x^13+8677*a^2*x^13+30761*a*x^13+22755*x^13+22230*a^3*x^12+14389*a^2*x^12+20332*a [...]
-
-(30324*a^3*x^2+26223*a^2*x^2+5461*a*x^2+1916*x^2+30324*a^3*x+26223*a^2*x+5461*a*x+1916*x+30324*a^3+26223*a^2+5461*a+1916);
-EOF
-#}}}
diff --git a/factory/fex/insert.fex b/factory/fex/insert.fex
deleted file mode 100644
index a59d3b6..0000000
--- a/factory/fex/insert.fex
+++ /dev/null
@@ -1,100 +0,0 @@
-# emacs edit mode for this file is -*- sh -*-
-# $Id: insert.fex 12231 2009-11-02 10:12:22Z hannes $
-
-#{{{ docu
-#
-# insert.fex - factory example collection for testing
-#   insertion/evaluation.
-#
-#}}}
-
-collection insert \
-    -n"Factory example collection for testing insertion/evaluation"
-
-#{{{ univ0RanA*
-collection univ0RanA \
-    -n"Univariate, characterstic 0, random polynomials up to degree 35" \
-    -ontc \
-    /0/x
-
-example univ0RanA0 insert 6296064*x^14 3891222
-example univ0RanA1 insert 889085*x^20+233379*x^19+1692743*x^13-3553874*x^3 905476
-example univ0RanA2 insert 6873449*x^19+2738525*x^17+4523129*x^10+2308513*x^9-3167402*x^7-506914*x^6+439504*x^2+4582391 4501067
-example univ0RanA3 insert 9776770*x^18+6006174*x^17+296089*x^13 3566001
-example univ0RanA4 insert 7823243*x^19+8099516*x^17+845246*x^11-7246189*x^9-5658185*x^3+4365206 4660980
-example univ0RanA5 insert 9199916 1440589
-example univ0RanA6 insert 6010029*x^21-599414*x^10-7261890*x^2 4896740
-example univ0RanA7 insert 7162033*x^15+2774467*x^5-7173164*x^2-3034750*x 3098101
-example univ0RanA8 insert 6476491*x^19+8167624*x^16+4151632*x^15-770092*x^14+6231747*x+1 1857263
-example univ0RanA9 insert 4819988*x^18+155177*x^16-7336827*x^13+6482878*x^6+451106*x^4+1 2511519
-example univ0RanA10 insert 1762907*x^10+6771579 4465152
-example univ0RanA11 insert 808115*x^22+6929384*x^21+6617310*x^19+9039218*x^15+238172*x^14+8064345*x^13-7110306*x^2+1703025 4808285
-example univ0RanA12 insert 5784511*x^15-7204848*x^5 3718602
-example univ0RanA13 insert 4477146*x^22+4561695*x^16+8306238*x^5-3658871 2456189
-example univ0RanA14 insert 6273400*x^21+9992059*x^20+1667522*x^19-7398744*x^15+8015824*x^9+9490857*x^4+1261428*x+1 840490
-example univ0RanA15 insert 6329523*x^20+4105767*x^14+6398963 1537565
-example univ0RanA16 insert 9529537*x^16-7886591*x^15-7328453*x^7 935639
-example univ0RanA17 insert 3453052*x^21+2249906*x^14-7932404*x^13-7149616*x^10+9732092*x^5 3577179
-example univ0RanA18 insert 2762344*x^23+44854*x^18+4987902*x^17-754315*x^10+2240423*x^9+2485199*x^5+6629963*x+1 3121365
-example univ0RanA19 insert 1231429*x^23+8748649*x^17+123431*x^15+1870514*x^11-5047809*x^10+9632739*x^6+6180203*x^2-3962456 3181632
-example univ0RanA20 insert 4317373*x^19-7026098*x^15+9443671 531026
-example univ0RanA21 insert 4935749*x^23+4951444*x^17-7962443 3757814
-example univ0RanA22 insert 1951038*x^24-7946714*x^22+831080*x^21+8615278*x^16+2546331*x^14-3193361*x^13-7221358*x^10+2373034*x^8-3774039*x^7+6968215*x^3+1 974249
-example univ0RanA23 insert 5909983*x^14-3983029*x^7+4448500*x^5+8043494*x^4 4174727
-example univ0RanA24 insert 2891977*x^21+4429093*x^20+670772*x^18+2557310*x^17+4388785*x^13+8028955*x^11+1734121*x^9-7573698*x^3+1 3625502
-example univ0RanA25 insert 2557551*x^3+4576612*x^2 4876521
-example univ0RanA26 insert 9305252*x^18+6025717*x^8-7140171*x+8262291 4417989
-example univ0RanA27 insert 5613386*x^22+82701*x^6 4108981
-example univ0RanA28 insert 7626435*x^20+8810080*x^16+4070391*x^13+2941246*x^12+2252981*x^6+8885824*x 1758129
-example univ0RanA29 insert 7939314*x^22+6891195*x^20+4221620*x^17+153099*x^14+6658210*x^12-3995201*x^10-5560741*x^8+4352153*x^6+6221549*x+4168185 4344535
-example univ0RanA30 insert 5223937*x^15+4732366*x^14+1245133*x^12+1 1782047
-example univ0RanA31 insert 3025830*x^15-5383953*x^6-3360594 1382909
-example univ0RanA32 insert 304681*x^17-7261761*x^16+6572773*x^15+9607622*x^5+8203209 3313836
-example univ0RanA33 insert 3315218*x^25-3246807*x^24+8088676*x^20+1805462*x^16+8104302*x^9+8416387*x^8+9429557*x^2 235223
-example univ0RanA34 insert 5000461*x^23+6494100*x^18+1111709*x^17+6648240*x^15+2549635*x^14+6593976*x^10+4469993*x^5+9964421*x^4+1768673*x^2 30179
-example univ0RanA35 insert 1593888*x 2821480
-example univ0RanA36 insert 2210928*x^27+8381667*x^15-3049207*x^9+1439946*x^7-5639120*x^6 3222948
-example univ0RanA37 insert 1327721*x^26+8163899*x^20+9108678*x^15+4326129*x^8-5059051*x^5+652927*x+107465 4647151
-example univ0RanA38 insert 9116463*x^26+811021*x^24-5850053*x^22+4295022*x^19+8128470*x^18+1172571*x^15-3044680*x^13+8785912*x^5+9858601*x^3-7053502*x+9298502 3705417
-example univ0RanA39 insert 8242617*x^21+8620803*x^18+4319047*x^12+8059506*x^10-3851429*x^9+6373780*x^8+4106649*x^7+8515889*x^4+4934810*x^2+2981115*x+9269009 913423
-example univ0RanA40 insert 4117755*x^19+1474597*x^18+6305133*x^17-5138368 511281
-example univ0RanA41 insert 0 1174229
-example univ0RanA42 insert 42714*x^28+4937524*x^27-7044118*x^16+929539*x^15-739754*x^5 2244739
-example univ0RanA43 insert 3757752*x^24+4842269*x^21+8562480*x^11-5223237*x^8+1975451*x^7-5930603*x^4+8457696 2189021
-example univ0RanA44 insert 8218836*x^28+9973131*x^25+6127112*x^22+294553*x^21-5194929*x^19-586167*x^17+8583272*x^14+8800406*x^10+4185125*x^7+9167886*x^6+6729788 1945105
-example univ0RanA45 insert 2406254*x^13-7323802*x^12+4138233 1676526
-example univ0RanA46 insert 6537678*x^22+6816253*x^17+1811993*x^16 686468
-example univ0RanA47 insert 2574923*x^26-7015746*x^23+2115924*x^19-3625551*x^9+2718045*x^8+1269676*x^6-3359622*x^5+6619470 1925300
-example univ0RanA48 insert 8127062*x^26+9365479*x^25+2747563*x^23-7796721*x^21+1983807*x^18+836962*x^17+81923*x^16-3067905*x^14+4376438*x^7-3018644*x^3+930418*x^2 1152679
-example univ0RanA49 insert 7650546*x^26+9878650*x^17+9979816*x^15-3986310*x^14+1148546*x^13+461670*x^9 3347230
-example univ0RanA50 insert 7328828*x^14+6877708 904409
-example univ0RanA51 insert 3730887*x^20+4989560*x^13+9222315*x^11+6542950*x^4 1616052
-example univ0RanA52 insert 1868416*x^29-587176*x^27-3596150*x^20+8553974*x^16-5004931*x^10-5107403*x^9+8084867*x^8-571830 4507154
-example univ0RanA53 insert 6628556*x^26-3892749*x^14-7539681*x^6+9312746*x^3 1332965
-example univ0RanA54 insert 2943239*x^30+1982962*x^28+8318149*x^26-343640*x^25+1705364*x^22+8065565*x^14-5909717*x^12-5810779*x^10+9987671*x^8+9984425*x^7-7293237*x^4+1 3703410
-example univ0RanA55 insert 9863697*x^12 2765640
-example univ0RanA56 insert 8081998*x^29-3511385*x^24-7090008*x^22+8936602*x^13+2545435*x^10-3357648*x^6-579327*x^3+6456921 1857668
-example univ0RanA57 insert 4284015*x^29+4157007*x^27+2420874*x^5+1631327 328640
-example univ0RanA58 insert 3650630*x^26+6237951*x^23+6820656*x^14+839628*x^12+9573747*x^7-7190104*x^3+4465142*x^2 598349
-example univ0RanA59 insert 3872000*x^31+2563571*x^28+8688161*x^24+9113116*x^20+282936*x^8+1293295*x^5-7575015*x^4-7553208*x+1 179809
-example univ0RanA60 insert 5747263*x^19+2286706*x^6-7148242*x^5 1993245
-example univ0RanA61 insert 7900889*x^27+2606244*x^17-7425197*x^12 2979913
-example univ0RanA62 insert 1983961*x^16+1448261*x^14-7069521*x^9-7329425*x^7+8889203*x^5-7821483*x^3+1835312*x^2 2844093
-example univ0RanA63 insert 5539210*x^31+2335462*x^15+6811692*x^13+894361*x^10-3816497*x^5+1 3723706
-example univ0RanA64 insert 4403167*x^30+2465430*x^27+8733654*x^22-7163432*x^16-5999249*x^15+8836918*x^10+9518043*x^6+9165207*x^5 1402122
-example univ0RanA65 insert 626523*x^29+8053951*x^18+1 2441939
-example univ0RanA66 insert 955618*x^30+2740763*x^26-535650*x^25+8957147*x^22-5323562*x^18+1804605*x^14-7786193*x^12+8115*x^5+8253831*x^3+2630810 1181953
-example univ0RanA67 insert 9196279*x^32+6131425*x^30-3798402*x^27-393908*x^22-5253508*x^21+1079403*x^17+9171950*x^5-5479922*x^3-5125385 1463096
-example univ0RanA68 insert 6686718*x^31+866888*x^29+436209*x^24-7395121*x^21-7015419*x^19+9299195*x^13+8075631*x^12-7438419*x^10+618124*x^4+9289490*x^3+8933851 929664
-example univ0RanA69 insert 4410413*x^32+988196*x^29+9225375*x^28+2995227*x^26-3051991*x^23-7686236*x^21+6935289*x^20+9830945*x^17+9904619*x^12+8466120*x^9+9302821*x^7-7492305*x^6+8717370*x-7272106 2403982
-example univ0RanA70 insert 9441073*x^32+1436207*x^31-5790729*x^25+8297341*x^10-7617867 3995441
-example univ0RanA71 insert 5357308*x^27+6855718*x^25-7857508*x^19-3436417*x^17-7168953*x^12+2711984*x^10-7069440*x^5 1934220
-example univ0RanA72 insert 3515962*x^28-5812173*x^21-5786302*x^19+2925137*x^13-3679954*x^11-7684998*x^10+9243285*x^5+9788035*x^4 2800077
-example univ0RanA73 insert 9129185*x^32-3785378*x^27+9786809*x^22-728278*x^21-3149030*x^14-5293775*x^7+2578337*x^6-5171406*x^4-3940135 485070
-example univ0RanA74 insert 7170307*x^29-3018264*x^23+1354167*x^22-5015733*x^18+1904698*x^14+4634075*x^11+6201616*x^9+1551116*x^5+8971683*x^4+4562068*x 4859844
-example univ0RanA75 insert 2778927*x^28+1670291*x^23+8345355*x^10 2368107
-example univ0RanA76 insert 1725817*x^34+1045073*x^20+154705*x^18+4875255*x^12+1772684*x^10 2646740
-example univ0RanA77 insert 9231040*x^33+6448872*x^29+1799400*x^22+8339245*x^20+2424897*x^18+212804*x^16-3949053*x^11+1633316 3224566
-example univ0RanA78 insert 9945043*x^34-5476696*x^31+8156976*x^28-5857681*x^19+9122836*x^18-7568363*x^9+8018153*x^7 2777182
-example univ0RanA79 insert 1825714*x^34+1063566*x^33+2608976*x^32+2170467*x^29+2695263*x^28+9332388*x^27-3141795*x^24+4195960*x^15+2106564*x^11-5291890*x^8+28342*x^7+802236*x^6+6475941*x^2 2506489
-#}}}
diff --git a/factory/fex/runfex b/factory/fex/runfex
deleted file mode 100755
index 6c3983a..0000000
--- a/factory/fex/runfex
+++ /dev/null
@@ -1,533 +0,0 @@
-#! /bin/bash
-# $Id: runfex 12231 2009-11-02 10:12:22Z hannes $
-
-#{{{ docu
-#
-# runfex - run factory example collection.
-#
-#}}}
-
-set -o nounset
-set -o noglob
-
-trap signalHandlerInterrupt SIGINT
-trap signalHandlerQuit SIGQUIT
-
-#
-# - functions.
-#
-
-#{{{ signalHandlerInterrupt (), signalHandlerQuit ()
-#{{{ docu
-#
-# signalHandler*() - catch signals.
-#
-#}}}
-signalHandlerInterrupt()
-{
-    warn "received signal SIGINT"
-    exit
-}
-
-signalHandlerQuit()
-{
-    warn "received signal SIGQUIT"
-    exit
-}
-#}}}
-
-#{{{ warn ()
-#{{{ docu
-#
-# warn() - print arguments to stderr prefixed by ExecName.
-#
-# ExecName (global constant): name of the shell script
-#   being executed
-#
-#}}}
-readonly ExecName="$0"
-
-warn()
-{
-    echo "$ExecName:" "${@-}" >&2
-}
-#}}}
-
-#{{{ usage ()
-usage()
-{
-echo "
-Usage: runfex [<options>] [<factoryOpts>] [<factoryEnvSpec>] <fexFile> [<examplePatterns>]
-
-Runs all examples in <fexFile> matching <examplePattern>.
-<examplePatterns> should be regular shell patterns, which may be
-preceded by a \`^' to exclude all examples matching <examplePattern>.
-
-When run in foreground, SIGQUIT immediately interrupts \`runfex',
-while SIGINT only interrupts the example currently being
-calculated.  In background, SIGTERM interrupts \`runfex' after the
-current example has been finished.
-
-<options>:  -d:         debug mode.  In debug mode, examples are
-                        echoed to stdout instead of being executed.
-            -C <runConfiguration>: specifies which object/executable
-                        configuration to use.  Defaults to \`opt'.
-            -t:         do not run checks
-
-Besides from regular shell commands, the commands \`collection'
-and \`example' may be used in a Factory example file.
-\`collection' specifies options and environment common to a
-collection of examples, \`example' defines an example.
-
-collection <collectionName> [<collectionOptions>] [<factoryOpts>] [<factoryEnvSpec>]
-example <exampleName> [<exampleOptions>] [<factoryOpts>] [<factoryEnvSpec>] <example>
-
-<collectionOptions>/<exampleOptions>:
-            -n <note>: specifies comment on the collection/example
-
-<factoryOpts>:
-            -a <time>:  sets alarm option
-            -c <times>: sets times option
-            -O <options>: specifies optional arguments
-            -o <outputOptions>: specifies which results to print
-
-<outputOptions>:
-            <number>: column width              x: do not print anything
-            h: header                           p: characteristic
-            s: switches                         v: variables
-            n: number fo runs                   g: random generator seed
-            f: Factories version                t: time
-            c: check                            r: result" \
-    >& 2
-}
-#}}}
-
-#{{{ defineSkip ()
-#{{{ docu
-#
-# defineSkip() - define function skipExample().
-#
-# rest: the patterns
-#
-# One function at least that does not use neither global
-# variables nor constants.
-#
-#}}}
-defineSkip()
-{
-    typeset regExp=""
-    typeset notRegExp=""
-    typeset rawArg arg
-
-    for rawArg; do
-	# check for leading ^
-	arg="${rawArg#^}"
-	if [ "$rawArg" = "$arg" ]; then
-	    regExp="$regExp|$arg"
-	else
-	    notRegExp="$notRegExp|$arg"
-	fi
-	shift
-    done
-    regExp="${regExp#|}"
-    notRegExp="${notRegExp#|}"
-
-    if [ -z "$regExp" -a -z "$notRegExp" ]; then
-	eval "
-skipExample()
-{
-    return 1
-}
-"
-    elif [ -n "$regExp" -a -z "$notRegExp" ]; then
-	eval "
-skipExample()
-{
-    case \"\$1\" in
-	($regExp) return 1 ;;
-	(*) return 0 ;;
-    esac
-}
-"
-    elif [ -z "$regExp" -a -n "$notRegExp" ]; then
-	eval "
-skipExample()
-{
-    case \"\$1\" in
-	($notRegExp) return 0 ;;
-	(*) return 1 ;;
-    esac
-}
-"
-    else
-	eval "
-skipExample()
-{
-    case \"\$1\" in
-	($notRegExp) return 0 ;;
-	($regExp) return 1 ;;
-	(*) return 0 ;;
-    esac
-}
-"
-    fi
-}
-#}}}
-
-#{{{ runAlgorithm ()
-#{{{ docu
-#
-# runAlgorithm() - run algorithm with the correct options.
-#
-# To a pity, there is a lot of global variables necessary to
-# determine the "correct options".  The run* variables are set
-# in main program, the collection* variables in collection()
-# and the example* variables in example().
-# All of these variables are exclusively used here.
-#
-# $1: debugMode
-# $2: algorithm to run
-# rest: its arguments
-#
-# runConfiguration (global variable): which configurations'
-#   executables to use
-# run* (global variables): options, optional arguments, and
-#   environment specified at run level
-# collection* (global variables): options, optional arguments,
-#   and environment specified at collection level
-# example* (global variables): options, optional arguments,
-#   and environment specified at example level
-#
-#}}}
-runConfiguration="opt"
-
-runOptions=""
-runOptArguments=""
-runEnvironment=""
-
-collectionOptions=""
-collectionOptArguments=""
-collectionEnvironment=""
-
-exampleOptions=""
-exampleOptArguments=""
-exampleEnvironment=""
-
-runAlgorithm()
-{
-    typeset debugMode="$1" \
-	    name="$2"
-    shift 2
-
-    # now its time to paste the options together
-    $debugMode "$name.$runConfiguration" \
-	$collectionOptions $exampleOptions $runOptions -oa -- \
-	$collectionEnvironment $exampleEnvironment $runEnvironment \
-	${runOptArguments:-${exampleOptArguments:-${collectionOptArguments}}} \
-	"$@"
-}
-#}}}
-
-#{{{ printData ()
-#{{{ docu
-#
-# printData() - print example data.
-#
-# Yet another bunch of global variables.  The *OutputOptions are
-# set by the main program, collection(), and example(), resp.,
-# and determine which information to print.  All the variables
-# are used exclusively here.
-#
-# $1: name
-# $2: note
-#
-# defColWidth (global constant): default width to print results
-# *OutputOptions (global variables): which information to print
-#
-#}}}
-typeset	-ir defColWidth=80
-
-runOutputOptions=""
-collectionOutputOptions=""
-exampleOutputOptions=""
-
-printData()
-{
-    typeset -i colWidth
-
-    typeset name="$1" \
-	    note="$2" \
-	    options="${runOutputOptions:-${exampleOutputOptions:-${collectionOutputOptions}}}" \
-	    line=""
-
-    # get column width (we use line as a dummy here)
-    line="$( echo "$options" | sed s/[^0-9]//g )"
-    colWidth=${line:-$defColWidth}
-
-    case "$options" in
-	(*x*) return ;;
-    esac
-
-    case "$options" in
-	(*h*)
-	    # do some pretty printing
-	    if [ ${#name} -lt 7 ]; then
-		echo "$name:		$note."
-	    elif  [ ${#name} -lt 15 ]; then
-		echo "$name:	$note."
-	    else
-		echo "$name: $note."
-	    fi ;;
-    esac
-    if read line; then case "$options" in
-	(*p*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*s*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*v*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*n*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*g*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*f*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*t*) echo "$line" ;;
-    esac; fi
-    if read line; then case "$options" in
-	(*c*) echo "$line" ;;
-    esac; fi
-
-    # format the result
-    case "$options" in
-	(*r*)
-	    if [ $colWidth = 0 ]; then
-		cat -u
-	    else
-		fold -s -w "$colWidth"
-	    fi ;;
-    esac
-}
-#}}}
-
-#{{{ example ()
-#{{{ docu
-#
-# example() - run an example.
-#
-# Sets the example* variables from the commandline.  Runs the
-# example in dependency on debugMode and on the result of
-# skipExample().  Collects data from the example in the alg*
-# variables for printData().
-#
-# debugMode (global variable): set by main program.  Whether to
-#   run examples or to print them.
-#
-#}}}
-debugMode=""
-
-example()
-{
-    typeset name="" \
-	    note="" \
-	    \
-	    options="" \
-	    optArguments="" \
-	    environment="" \
-	    \
-	    outputOptions=""
-
-    # read example name and skip if necessary
-    if [ "$#" = "0" ]; then
-	warn "no example name specified"
-	exit 1
-    fi
-    name="$1"
-    shift
-
-    if skipExample "$name"; then
-	if [ -n "$debugMode" ]; then
-	    echo "skipping $name"
-	fi
-	return
-    else
-	warn "running $name"
-    fi
-    
-    # read options
-    typeset opt
-    while getopts "n:a:c:O:o:" opt; do
-	case "$opt" in
-	    (n)	note="$OPTARG" ;;
-	    (a)	options="$options -a$OPTARG" ;;
-	    (c)	options="$options -c$OPTARG" ;;
-	    (O) optArguments="$optArguments $OPTARG" ;;
-	    (o)	outputOptions="$OPTARG" ;;
-	    (?)	warn "bad example option"; exit 1 ;;
-	esac
-    done
-    # shift options and reset OPTIND
-    typeset -i optind
-    optind=OPTIND-1
-    shift $optind
-    OPTIND=1
-
-    # read environment
-    while [ "${1-}" != "${1+${1#/}}" ]; do
-	environment="$environment $1"
-	shift
-    done
-
-    # set global variables
-    exampleOptions="$options"
-    exampleOptArguments="$optArguments"
-    exampleEnvironment="$environment"
-    exampleOutputOptions="$outputOptions"
-
-    # run algorithm and print data
-    if [ -n "$debugMode" ]; then
-	runAlgorithm "echo" "$@"
-    else
-	runAlgorithm "" "$@" | printData "$name" "$note"
-    fi
-}
-#}}}
-
-#{{{ collection ()
-#{{{ docu
-#
-# collection() - set up collection data.
-#
-# Sets the collection* variables from commandline.
-#
-#}}}
-collection()
-{
-    typeset options="" \
-	    optArguments="" \
-	    environment="" \
-	    \
-	    outputOptions="" \
-    
-    # read collection name (and ignore it)
-    if [ "$#" = "0" ]; then
-	warn "no collection name specified"
-	exit 1
-    fi
-    shift
-
-    # read options
-    typeset opt
-    while getopts "n:a:c:O:o:" opt; do
-	case "$opt" in
-	    (n)	: ;;
-	    (a)	options="$options -a$OPTARG" ;;
-	    (c)	options="$options -c$OPTARG" ;;
-	    (O) optArguments="$optArguments $OPTARG" ;;
-	    (o)	outputOptions="$OPTARG" ;;
-	    (?)	warn "bad collection option"; exit 1 ;;
-	esac
-    done
-    # shift options and reset OPTIND
-    typeset -i optind
-    optind=OPTIND-1
-    shift $optind
-    OPTIND=1
-
-    # read environment
-    while [ "${1-}" != "${1+${1#/}}" ]; do
-	environment="$environment $1"
-	shift
-    done
-
-    # set global variables
-    collectionOptions="$options"
-    collectionOptArguments="$optArguments"
-    collectionEnvironment="$environment"
-    collectionOutputOptions="$outputOptions"
-}
-#}}}
-
-#{{{ main program
-#{{{ docu
-#
-# - main program.
-#
-# Sets the run* variables for runAlgorithm() and printData()
-# from commandline.  Sets debugMode for example().  Reads the
-# collection.
-#
-#}}}
-typeset configuration="opt" \
-	\
-	options="" \
-	optArguments="" \
-	environment="" \
-	\
-	outputOptions="" \
-	\
-	fexFile=""
-
-# read options
-typeset opt
-while getopts "dC:ta:c:O:o:" opt; do
-    case "$opt" in
-	(d)  debugMode="1" ;;
-	(C)  configuration="$OPTARG" ;;
-	(t)  options="$options -t" ;;
-	(a)  options="$options -a$OPTARG" ;;
-	(c)  options="$options -c$OPTARG" ;;
-	(O)  optArguments="$optArguments $OPTARG" ;;
-	(o)  outputOptions="$OPTARG" ;;
-	(?)  warn "bad run option"; usage; exit 1 ;;
-    esac
-done
-# shift options and reset OPTIND
-typeset -i optind
-optind=OPTIND-1
-shift $optind
-OPTIND=1
-
-# read environment
-while [ "${1-}" != "${1+${1#/}}" ]; do
-    environment="$environment $1"
-    shift
-done
-
-# process rest of arguments
-if [ "$#" = "0" ]; then
-    warn "no fexFile specified"
-    usage
-    exit 1
-fi
-fexFile="${1%.fex}"
-shift
-
-defineSkip "$@"
-
-# before going on, check for existence of collection
-if [ ! -f "$fexFile.fex" ]; then
-    warn "collection $fexFile.fex not found"
-    exit 1
-fi
-
-# reset factory environemnt to exclude external influences
-FTEST_ENV=""
-FTEST_CIRCLE=""
-FTEST_ALARM=""
-
-# set global variables and execute collection
-runConfiguration="$configuration"
-runOptions="$options"
-runOptArguments="$optArguments"
-runEnvironment="$environment"
-runOutputOptions="$outputOptions"
-
-. "$fexFile.fex"
-#}}}
diff --git a/factory/fex/stdUnivPGcd.in b/factory/fex/stdUnivPGcd.in
deleted file mode 100644
index 2fba93b..0000000
--- a/factory/fex/stdUnivPGcd.in
+++ /dev/null
@@ -1,268 +0,0 @@
-// $Id: stdUnivPGcd.in 12231 2009-11-02 10:12:22Z hannes $
-
-//
-// stdUnivPGcd.in - some standard bases with parameters in char p.
-//
-// first time: lisi, second time: schlupp/ratchwum
-// timings made with Singular Version 1.1.5/6
-//
-short=0;
-
-///////////////////////////
-//  example from singularTests/Beispiel (but with order dp instead of lp)
-//
-// codimension = 2
-// dimension   = 1
-// degree      = 45
-//
-// w/o parameter:		0 sec		0 sec
-// std:				150 sec		122 sec
-//
-// time used for content:
-// gcd:				5.03 sec	4.59 sec
-// euclideanGcd:		4.67 sec	4.15 sec
-// subResGcd:			5.13 sec	4.52 sec
-//
-"untitled1(1/p/1)";
-ring r=(32003,u),(t,x,y),dp;
-ideal i=x-t15,y-t21-ut25+2t29-4t33+3t37+96/5t41-87t45;
-option(prot);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-kill r;
-
-///////////////////////////
-//  Anborg 7
-//
-// codimension = 3
-// dimension   = 0
-// degree      = 22
-//
-// degrees up to 120
-//
-// w/o parameter:		0 sec		0 sec
-// std:				80 sec
-// fglm:			
-//
-// time used for content:
-// gcd:				4.52 sec
-// euclideanGcd:		
-// subResGcd:			
-//
-"anborg 7(1/p/1)";
-ring r=(32003,u),(x,y,z),dp;
-ideal i=
-u3x2+yz+xy2z+xyz2+xyz+xy+xz+yz, 
-ux2y2z+xy2z2+x2yz+xyz+yz+x+z, 
-u2x2y2z2+x2y2z+xy2z+xyz+xz+z+1;
-option(prot);
-option(redSB);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-ring s=(32003,u),(x,y,z),lp;
-ideal k=fglm(r,j);
-system("gcdtime");
-
-kill s;
-kill r;
-
-///////////////////////////
-//  coprasse
-//
-// codimension = 4
-// dimension   = 0
-// degree      = 56
-//
-// w/o parameter:		0 sec		0 sec
-// std:						21 sec
-// fglm:			
-//
-// time used for content:
-// gcd:						1.08 sec
-// euclideanGcd:		
-// subResGcd:			
-//
-"coprasse(1/p/1)";
-ring r=(32003,u),(x,y,z,t),dp; 
-ideal i=
-y2z+2xyt-2x-z,
--x3z+4xy2z+4x2yt+2y3t+4x2-10y2+4xz-10yt+2,
-2uyzt+xt2-x-2z,
--xz3+4yz2t+4xzt2+2yt3+4xz+4z2-10yt-10t2+2;
-option(prot);
-option(redSB);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-ring s=(32003,u),(x,y,z,t),lp;
-ideal k=fglm(r,j);
-system("gcdtime");
-
-kill s;
-kill r;
-
-///////////////////////////
-//  inhomog cyclic 6
-//
-// codimension = 4
-// dimension   = 2
-// degree      = 10
-//
-// w/o parameter:				1 sec
-// std:						5050 sec
-//
-// time used for content:
-// gcd:						28.47 sec
-// euclideanGcd:				25.78 sec
-// subResGcd:					28.52 sec
-//
-"inhomog cyclic 6(1/p/1)";
-ring r=(32003,u),(a,b,c,d,e,f),dp;
-ideal i=
-a+b+c+d+e+f,
-ab+bc+cd+de+ef+fa,
-abc+bcd+cde+d*e*f + efa + fab,
-uabcd+bcde+c*d*e*f+d*e*f*a + efab + fabc,
-abcde+b*c*d*e*f+c*d*e*f*a+d*e*f*a*b+efabc+fabcd,
-a*b*c*d*e*f;
-option(prot);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-kill r;
-
-///////////////////////////
-//  inhomog cyclic 5
-//
-// codimension = 5
-// dimension   = 0
-// degree      = 70
-//
-// relatively low degrees
-//
-// w/o parameter:				0 sec
-// std:						6.31 sec
-// fglm:			
-//
-// time used for content:
-// gcd:						0.20 sec
-// euclideanGcd:		
-// subResGcd:			
-//
-"inhomog cyclic 5(1/p/1)";
-ring r=(32003,u),(a,b,c,d,e),dp;
-ideal i=
-a+b+c+d+e,
-ab+bc+cd+de+ea,
-abc+bcd+cde+dea+eab,
-uabcd+bcde+cdea+deab+eabc,
-uabcde+1;
-option(prot);
-option(redSB);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-ring s=(32003,u),(a,b,c,d,e),lp;
-ideal k=fglm(r,j);
-system("gcdtime");
-
-kill s;
-kill r;
-
-///////////////////////////
-//  inhomog cyclic 5(2)
-//
-// codimension = 5
-// dimension   = 0
-// degree      = 70
-//
-// degrees up to 130
-//
-// w/o parameter:				0 sec
-// std:				
-// fglm:			
-//
-// time used for content:
-// gcd:				
-// euclideanGcd:		
-// subResGcd:			
-//
-"inhomog cyclic 5(1/p/2)";
-ring r=(32003,u),(a,b,c,d,e),dp;
-ideal i=
-ua+b+c+d+e,
-ab+bc+cd+de+ea,
-abc+bcd+cde+dea+eab,
-(u+1)*abcd+bcde+cdea+deab+eabc,
-uabcde+1;
-option(prot);
-option(redSB);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-ring s=(32003,u),(a,b,c,d,e),lp;
-ideal k=fglm(r,j);
-system("gcdtime");
-
-kill s;
-kill r;
-
-///////////////////////////
-//  symmetric 4
-//
-// codimension = 4
-// dimension   = 0
-// degree      = 256
-//
-// relatively low degrees
-//
-// w/o parameter:				0 sec
-// std:				
-// fglm:
-//
-// time used for content:
-// gcd:				
-// euclideanGcd:				
-// subResGcd:					
-//
-"symmetric 4(1/p/1)";
-ring r=(32003,u),(a,b,c,d),dp;
-ideal i=
-(1+u+u^2)*a4-b4,
-b4-c4,
-uc4-d4,
-ua3b+b3c+c3d+d3a;
-option(prot);
-option(redSB);
-timer=1;
-ideal j=std(i);
-size(j);
-degree(j);
-system("gcdtime");
-
-ring s=(32003,u),(a,b,c,d),lp;
-ideal k=fglm(r,j);
-system("gcdtime");
-
-kill s;
-kill r;
diff --git a/factory/fieldGCD.cc b/factory/fieldGCD.cc
deleted file mode 100644
index 23d176f..0000000
--- a/factory/fieldGCD.cc
+++ /dev/null
@@ -1,248 +0,0 @@
-#include <stdio.h>
-#include <config.h>
-#ifndef NOSTREAMIO
-#ifdef HAVE_IOSTREAM
-#include <iostream>
-#define OSTREAM std::ostream
-#elif defined(HAVE_IOSTREAM_H)
-#include <iostream.h>
-#define OSTREAM ostream
-#endif
-#endif /* NOSTREAMIO */
-
-#include "cf_defs.h"
-#include "canonicalform.h"
-#include "cf_iter.h"
-#include "cf_primes.h"
-#include "cf_algorithm.h"
-#include "algext.h"
-#include "fieldGCD.h"
-#include "cf_map.h"
-#include "cf_generator.h"
-
-void out_cf(const char *s1,const CanonicalForm &f,const char *s2);
-
-
-CanonicalForm fieldGCD( const CanonicalForm & F, const CanonicalForm & G );
-void CRA(const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew);
-
-
-CanonicalForm fieldGCD( const CanonicalForm & F, const CanonicalForm & G )
-{// this is the modular method by Brown
- // assume F,G are multivariate polys over Z/p for big prime p
-  if(F.isZero())
-  {
-    if(G.isZero())
-      return G; // G is zero
-    if(G.inCoeffDomain())
-      return CanonicalForm(1);
-    return G/lc(G); // return monic G
-  }
-  if(G.isZero()) // F is non-zero
-  {
-    if(F.inCoeffDomain())
-      return CanonicalForm(1);
-    return F/lc(F); // return monic F
-  }
-  if(F.inCoeffDomain() || G.inCoeffDomain())
-    return CanonicalForm(1);
-  //out_cf("F=",F,"\n");
-  //out_cf("G=",G,"\n");
-  CFMap MM,NN;
-  CFArray ps(1,2);
-  ps[1] = F;
-  ps[2] = G;
-  compress(ps,MM,NN); // maps MM, NN are created
-  CanonicalForm f=MM(F);
-  CanonicalForm g=MM(G);
-  // here: f, g are compressed
-  // compute largest variable in f or g (least one is Variable(1))
-  int mv = f.level();
-  if(g.level() > mv)
-    mv = g.level();
-  // here: mv is level of the largest variable in f, g
-  if(mv == 1) // f,g univariate
-    return NN(gcd( f, g )); // do not forget to map back
-  // here: mv > 1
-  CanonicalForm cf = vcontent(f, Variable(2)); // cf is univariate poly in var(1)
-  CanonicalForm cg = vcontent(g, Variable(2));
-  CanonicalForm c = gcd( cf, cg );
-  f/=cf;
-  g/=cg;
-  if(f.inCoeffDomain() || g.inCoeffDomain())
-  {
-    //printf("=============== inCoeffDomain\n");
-    return NN(c);
-  }
-  int *L = new int[mv+1]; // L is addressed by i from 2 to mv
-  int *M = new int[mv+1];
-  for(int i=2; i<=mv; i++)
-    L[i] = M[i] = 0;
-  L = leadDeg(f, L);
-  M = leadDeg(g, M);
-  CanonicalForm gamma = gcd( firstLC(f), firstLC(g) );
-  for(int i=2; i<=mv; i++) // entry at i=1 is not visited
-    if(M[i] < L[i])
-      L[i] = M[i];
-  // L is now upper bound for leading degrees of gcd
-  int *dg_im = new int[mv+1]; // for the degree vector of the image we don't need any entry at i=1
-  for(int i=2; i<=mv; i++)
-    dg_im[i] = 0; // initialize
-  CanonicalForm gamma_image, m=1;
-  CanonicalForm gm=0;
-  CanonicalForm g_image, alpha, gnew, mnew;
-  FFGenerator gen = FFGenerator();
-  for(FFGenerator gen = FFGenerator(); gen.hasItems(); gen.next())
-  {
-    alpha = gen.item();
-    gamma_image = gamma(alpha, Variable(1)); // plug in alpha for var(1)
-    if(gamma_image.isZero()) // skip lc-bad points var(1)-alpha
-      continue;
-    g_image = gcd( f(alpha, Variable(1)), g(alpha, Variable(1)) ); // recursive call with one var less
-    if(g_image.inCoeffDomain()) // early termination
-    {
-      //printf("================== inCoeffDomain\n");
-      return NN(c);
-    }
-    for(int i=2; i<=mv; i++)
-      dg_im[i] = 0; // reset (this is necessary, because some entries may not be updated by call to leadDeg)
-    dg_im = leadDeg(g_image, dg_im); // dg_im cannot be NIL-pointer
-    if(isEqual(dg_im, L, 2, mv))
-    {
-      g_image /= lc(g_image); // make g_image monic
-      g_image *= gamma_image; // multiply by multiple of image lc(gcd)
-      CRA( g_image, Variable(1)-alpha, gm, m, gnew, mnew );
-      // gnew = gm mod m
-      // gnew = g_image mod var(1)-alpha
-      // mnew = m * (var(1)-alpha)
-      m = mnew;
-      if(gnew == gm) // gnew did not change
-      {
-        g_image = gm / vcontent(gm, Variable(2));
-        //out_cf("=========== try ",g_image,"\n");
-        if(fdivides(g_image,f) && fdivides(g_image,g)) // trial division
-        {
-          //printf("=========== okay\n");
-          return NN(c*g_image);
-        }
-      }
-      gm = gnew;
-      continue;
-    }
-    if(isLess(L, dg_im, 2, mv)) // dg_im > L --> current point unlucky
-      continue;
-
-    // here: dg_im < L --> all previous points were unlucky
-    //printf("=========== reset\n");
-    m = CanonicalForm(1); // reset
-    gm = 0; // reset
-    for(int i=2; i<=mv; i++) // tighten bound
-      L[i] = dg_im[i];
-  }
-  // hopefully, we never reach this point
-  Off( SW_USE_fieldGCD );
-  g_image = gcd(f,g);
-  On( SW_USE_fieldGCD );
-  return g_image;
-}
-
-
-void CRA(const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew)
-{ // this is polynomial Chinese Remaindering. q1, q2 are assumed to be coprime.
-  // polynomials of level <= 1 are considered coefficients
-  // xnew = x1 mod q1 (coefficientwise in the above sense)
-  // xnew = x2 mod q2
-  // qnew = q1*q2
-  if(x1.level() <= 1 && x2.level() <= 1) // base case
-  {
-    (void) extgcd(q1,q2,xnew,qnew);
-    xnew = x1 + (x2-x1) * xnew * q1;
-    qnew = q1*q2;
-    xnew = mod(xnew,qnew);
-    return;
-  }
-  CanonicalForm tmp,tmp2;
-  xnew = 0;
-  qnew = q1 * q2;
-  // here: x1.level() > 1 || x2.level() > 1
-  if(x1.level() > x2.level())
-  {
-    for(CFIterator i=x1; i.hasTerms(); i++)
-    {
-      if(i.exp() == 0) // const. term
-      {
-        CRA(i.coeff(),q1,x2,q2,tmp,tmp2);
-        xnew += tmp;
-      }
-      else
-      {
-        CRA(i.coeff(),q1,0,q2,tmp,tmp2);
-        xnew += tmp * power(x1.mvar(),i.exp());
-      }
-    }
-    return;
-  }
-  // here: x1.level() <= x2.level() && ( x1.level() > 1 || x2.level() > 1 )
-  if(x2.level() > x1.level())
-  {
-    for(CFIterator j=x2; j.hasTerms(); j++)
-    {
-      if(j.exp() == 0) // const. term
-      {
-        CRA(x1,q1,j.coeff(),q2,tmp,tmp2);
-        xnew += tmp;
-      }
-      else
-      {
-        CRA(0,q1,j.coeff(),q2,tmp,tmp2);
-        xnew += tmp * power(x2.mvar(),j.exp());
-      }
-    }
-    return;
-  }
-  // here: x1.level() == x2.level() && x1.level() > 1 && x2.level() > 1
-  CFIterator i = x1;
-  CFIterator j = x2;
-  while(i.hasTerms() || j.hasTerms())
-  {
-    if(i.hasTerms())
-    {
-      if(j.hasTerms())
-      {
-        if(i.exp() == j.exp())
-        {
-          CRA(i.coeff(),q1,j.coeff(),q2,tmp,tmp2);
-          xnew += tmp * power(x1.mvar(),i.exp());
-          i++; j++;
-        }
-        else
-        {
-          if(i.exp() < j.exp())
-          {
-            CRA(i.coeff(),q1,0,q2,tmp,tmp2);
-            xnew += tmp * power(x1.mvar(),i.exp());
-            i++;
-          }
-          else // i.exp() > j.exp()
-          {
-            CRA(0,q1,j.coeff(),q2,tmp,tmp2);
-            xnew += tmp * power(x1.mvar(),j.exp());
-            j++;
-          }
-        }
-      }
-      else // j is out of terms
-      {
-        CRA(i.coeff(),q1,0,q2,tmp,tmp2);
-        xnew += tmp * power(x1.mvar(),i.exp());
-        i++;
-      }
-    }
-    else // i is out of terms
-    {
-      CRA(0,q1,j.coeff(),q2,tmp,tmp2);
-      xnew += tmp * power(x1.mvar(),j.exp());
-      j++;
-    }
-  }
-}
diff --git a/factory/fieldGCD.h b/factory/fieldGCD.h
deleted file mode 100644
index 26a783d..0000000
--- a/factory/fieldGCD.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef FIELD_GCD_H
-#define FIELD_GCD_H
-
-CanonicalForm fieldGCD( const CanonicalForm & F, const CanonicalForm & G );
-void CRA(const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew);
-
-#endif
-
diff --git a/factory/ftest/ChangeLog b/factory/ftest/ChangeLog
deleted file mode 100644
index d3e69ed..0000000
--- a/factory/ftest/ChangeLog
+++ /dev/null
@@ -1,566 +0,0 @@
-Tue Feb 16 17:13:47 1999  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* GNUmakefile.in, ChangeLog, gcd.ntl.m4, ntl_util.cc, ntl_util.h:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-	* revert.m4: new file
-
-	* feval.m4 (main): long usage added
-
-Tue Jul  7 18:19:42 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* gcd.m4 (normalizeGcd): new function
-	  (gcdCheck): uses `normalizeGcd()' to check result and real
-	  result
-
-	* gcd.m4 (ftestSetNameOfGame): doc fixes
-
-	* extgcd.m4: new file
-
-Fri Jul  3 11:26:56 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* feval.m4: doc fixes
-
-	* ChangeLog, divrem.m4, feval.m4:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-	* divrem.m4 (ftestSetNameOfGame): doc fix
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-Wed Jul  8 15:50:04 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* GNUmakefile.in (%.o): `ftest_util.h' and `ftest_io.h' added as
-	  dependencies
-
-	* GNUmakefile.in (ntl_util.o, %.ntl, %.ntl.o): new targets
-	  (NTLPATH): new variable
-
-	* gcd.ntl.m4: new file
-
-	* ntl_util.cc, ntl_util.h: new files
-
-Fri Jul  3 11:51:00 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* fbinops.m4 (binOpCFSpecArray): new entry for `psr()'
-	  (ftestPsrTest): new test function
-
-	* fbinops.m4 (ftestDivideTest, ftestModuloTest): bug fix. `%'
-	  replaced by `%%' in args to `ftestError()'.
-
-	* fbinops.m4 (ftestSetNameOfGame): doc fix
-
-Wed Jul  1 12:14:55 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* divrem.m4 (divremCheck): bug fix.  `%' in messages replaced by
-	  `%%'.
-
-    **************** >>> changes in branch `factory-gcd' ****************
-
-Tue Jun 30 16:37:33 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* divides.m4: new file
-
-Mon Jun  8 17:06:29 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-	* gcd.m4 (normalizeGcd): division by leading coefficient in char 0
-	  is done in rational case only
-
-Fri Jun  5 11:53:20 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* feval.m4 (main): accepts optional argument `expand'
-
-	* feval.m4 (main): call to `ftestGetCanonicalForm()' replaced by
-	  call to `ftestReadString()'
-
-    **************** >>> changes in branch `factory-gcd' ****************
-
-Thu May  7 17:24:39 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* factorize.m4 (main): accepts optional variable now
-
-Mon Apr  6 13:36:37 MET DST 1998  Jens Schmidt
-
-	* ChangeLog, ftest_io.h, ftest_util.m4, ftest_util.cc:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-Mon Apr  6 12:49:32 MET DST 1998  Jens Schmidt
-
-	* ChangeLog, ftest_io.cc, ftest_io.h, ftest_util.cc, ftest_util.m4, 
-	* insert.m4, norm.m4, size.m4, totaldegree.m4, divrem.m4,
-	* degree.m4, deriv.m4, fbinops.m4:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-	* ftest_util.cc, ftest_util.m4, ftest_io.h: bug fix.  References
-	  to `ftestRead()' relplaced by `ftestReadString()'
-
-	* ftest_io.cc, ftest_io.h, ftest_util.m4, ftest_util.cc
-	  (ftestGetCanonicalForm, ftestGetbool, ftestGetint,
- 	  ftestGetVariable): functions renamed to `ftestReadString'.  All
- 	  of them store result in reference variable.  Declarations
- 	  adapted.  All callers changed.
-
-	* ftest_io.cc (ftestReadString): does not read environment variables
-
-	* ftest_io.cc (ftestReadString): cosmetical changes
-
-	* ftest_io.cc, ftest_io.h (ftestPrintResult( ..., bool )): new
-	  function.  Declarations added.
-
-	* fbinops.m4 (ftestDivideTest, ftestModuloTest): new tests added
-
-	* divrem.m4: new file
-
-Thu Apr  2 14:54:40 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* degree.m4, deriv.m4, insert.m4, norm.m4, size.m4,
-	  totaldegree.m4 (main): order of `if ( ftestArgGiven )' and
-	  `ftestRun()' interchanged
-
-    **************** >>> changes in branch `factory-gcd' ****************
-
-Tue Mar 31 12:33:25 MET DST 1998  Jens Schmidt
-
-	* ChangeLog, ftest_io.cc, fbinops.m4:
-	  ***** merge from branch `factory-gcd' to main trunk
-
-Thu Mar 26 09:29:36 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-    **************** !!!!! Repository changed !!!!! ****************
-
-	* gcdUniv0.fex, gcdUnivP.fex, gcdUnivPAlpha.fex, insert.fex,
-	  runfex, stdUniv0Gcd.in, stdUnivPGcd.in: files moved in
-	  repository from `factory/ftest' to `factory/fex'
-
-    **************** !!!!! Repository changed !!!!! ****************
-
-	* stdUniv0Gcd.in, stdUnivPGcd.in: new files
-
-	* gcd.m4 (main): reads optional argument `algorithm' and calls it
-	  using `CFPrimitiveGcdUtil::gcd()'
-	  (gcdCheck): compares old and new gcd's
-
-	* gcd.m4 (normalizeGcd): new function.  Calls added to
-	  `gcdCheck()'
-
-	* gcd.m4 (gcdCheck): declared static
-
-	* runfex (printData): new output option `x'.  Column width is
-	  adjustable (to zero, too) ar runtime.
-
-	* gcdUnivPAlpha.fex: new file
-
-	* gcdUnivP.fex: prefix `univP' removed from all identifiers
-
-	* gcdUnivP.fex: new file
-
-	* ftest_io.cc (ftestGetCanonicalForm): ignores trailing blanks
-	  when reading `-'
-
-	* ftest_io.cc (ftestGetCanonicalForm): `<-' as "read from stdin"
-	  specifier replaced by `-'
-
-Wed Mar 25 08:35:01 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* runfex: option `-t' added
-
-Tue Mar 24 11:28:50 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* runfex (usage): new function.  Calls added to main program.
-
-	* runfex (printData): uses stdin instead of `alg*' variables to
-	  read data from algorithm.  `example()' adapted.
-
-	* runfex (runAlgorithm): bug fix
-
-	* runfex (signalHandlerInterrupt, signalHandleQuit): new functions
-	  (trap): handles signals better
-
-	* insert.fex: adapted to new `runfex' format
-
-	* gcd.fex: file splitted up in several smaller files
-	* gcdUniv0.fex: new file
-
-	* runfex: major rewrite.  Hopefully the last one.
-
-Mon Mar 23 17:46:57 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* randomgcd.m4, ranMulGCD.fex: files removed
-
-	* gcd.fex (collection gcd): `-c 50' removed
-
-	* fbinops.m4 (ftestDivideTest, ftestDivTest, ftestModuloTest): new
-	  functions
-	  (binOpCFSpecArray): new entries added for `div()' and `mod()'.
-	  Extra tests for `operator /()' and `operator %()' added.
-
-    **************** >>> changes in branch `factory-gcd' ****************
-
-Mon Mar 23 16:38:41 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* randomgcd.m4, ranMulGCD.fex: files removed
-
-Wed Mar 11 20:33:40 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* commonden.m4, norm.m4: new files
-
-Wed Feb 25 17:26:18 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-    **************** <<< changes in branch `factory-gcd' ****************
-
-	* runfex (printData): arguments `$name' and `$note' re-added
-	  which are printed on occurence of `h' in `$options'.  All
-	  callers changed.
-
-	* runfex (main): variable `$runNote' and corresponding commandline
-	  option removed.
-
-	* gcd.fex (collection gcd): cosmetic changes
-
-	* gcd.fex (univ0RanA, univ0RanB, univ0CofactorSerialA,
-	  univ0GCDSerialA): real results added
-
-	* gcd.fex (univ0CofactorSerialA): slightly modified
-
-	* ftest_util.m4 (ftestGetInVar): recognizes tagged arguments
-
-	* ftest_util.m4 (ftestGetEnv, _ftestOutput): cosmetic changes
-
-	* ftest_util.m4 (ftestRun): checks for end of commandline before
-	  running algorithm
-
-	* ftest_util.m4 (ftestDefaultInitializer): new macro.
-	* ftest_util.m4 (ftestOutVar, ftestInVar): call
-	  `ftestDefaultInitializer()' to write default initializer
-
-	* ftest_io.cc (ftestGetbool): new function.  Declaration adapted.
-
-	* ftest_util.cc (ftestSearchTaggedArg, ftestCutBlancs): new
-	  functions.  Declarations adapted.
-
-	* ftest_util.cc (ftestSubStr): made external.  Declaration
-	  adapted.
-
-	* ftest_util.cc (ftestError, ftestGetOpts, ftestGetEnv,
-	  ftestPrintTimer, ftestPrintEnv): superfluous `const' removed
-	  from signature.  Declarations adapted.
-
-Fri Feb 20 18:29:40 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (ftestError): returns on `errno' == `noError'
-
-	* ftest_util.h (ftestErrorT): `Ok' renamed to `noError'
-
-    **************** >>> changes in branch `factory-gcd' ****************
-
-Thu Feb 19 16:07:09 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.m4: `#line' preprocessor directives added to most of
-	  the macros (that's cool, man!)
-
-	* ftest_util.m4 (ftestSetEnv): macro removed
-
-Mon Feb  2 11:59:36 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* runfex (runConfiguration): new global variable.  `runfex'
-	  supports different configurations.
-
-Fri Jan 30 15:11:23 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* gcd.fex (univ0CofactorSerialA, univ0GCDSerialA): new examples
-
-	* gcd.fex (univ0RanC, univ0RanD): examples removed
-
-	* runfex: (example): does not print `skipping example ...'
-
-	* runfex: cosmetic changes
-
-	* runfex: totally rewritten.  Does not print html-code any longer,
-	  only ASCII-information.
-
-Thu Jan 22 10:46:03 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* bgcd.m4, bgcdext.m4: new files
-
-Tue Jan  6 12:10:04 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* feval.m4 (main): bug fix.  Off-by-one error fixed.
-
-Tue Jan  6 11:00:17 1998  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* .cvsignore: new file
-
-Wed Dec 17 13:14:30 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.m4 (ftestOutVar): `bool's are initialized to `false'
-	  on definition 
-
-	* fbinops.m4 (main): initializations for `operatorName' and
-	  `operatorTag' added
-
-Fri Nov 21 11:34:36 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (CFSwitchesMax): const replaced by `#include
-	  <cd_switches.h>'
-
-	* ftest_util.cc (ftestParseRandom, ftestWriteSeed): uses stream io
-	  to read/write seed file
-
-	* ftest_io.cc (ftestPrintResult): adapted to new output format
-	* ftest_util.cc (ftestPrint): function removed.  All references
-	  adapted to new ouptut format.  Declaration removed, too.
-	  (ftestPrintEnv):  adapted to new output format
-	  (ftestPrintShortFlag): variable removed.  All references, too.
-
-	* ftest_util.cc (ftestCheckFlag): new external variable.
-	  Declaration added.
-	  (ftestGetOpts): sets `ftestCheckFlag'
-	* ftest_util.m4 (ftestCheck): check on `ftestCheckFlag' added
-
-	* fbinops.m4 (ftestCheckRelation): function renamed to
-	  `ftestCheckImplementation()'.  All caller changed.
-
-	* fbinops.m4: new file
-
-	* feval.m4 (main): prints long usage (well, not really)
-
-	* ftest_util.m4 (ftestRun): resets alarm timer after running
-	  algorithm
-
-	* ftest_util.m4 (ftestMainInit): calls `ftestUsagePrint()' if
-	  there are not any arguments
-	* ftest_util.cc (ftestError): call to `ftestUsagePrint()' added
-	  (ftestUsagePrint): new function.  Declaration added.
-
-	* ftest_util.h (ftestErrorT): new enumerator `CheckError'
-	* ftest_util.cc (ftestError): handling for `CheckError' added
-	* fbinops.m4 (ftestRelOpTest): error messages for checks added
-	* gcd.m4 (gcdCheck): error messages for checks added
-
-Thu Nov 13 09:20:42 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* insert.fex, ranMulGCD.fex: new files
-
-	* ftest_util.cc (ftestGetOpts): uses `getopt()' instead of `GetOpt'
-
-	* ftest_util.cc (ftestSignalHandler, ftestAlarmHandler): block new
-	  signals, flush cout before printing error message
-
-	* ftest_util.m4: cosmetic changes
-
-	* GNUmakefile.in (ftest_util.cc): rule slightly changed
-
-Wed Nov  5 15:59:13 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* GNUmakefile.in: new file
-
-	* insert.m4, factorize.m4: new files
-
-	* deriv.m4: cosmetic changes
-
-	* size.m4, degree.m4, deriv.m4, totaldegree.m4, resultant.m4,
-	  feval.m4, gcd.m4: doc fix
-
-Wed Oct 29 10:05:36 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (ftestSignalCatch): parameter `block' added.
-	  Declaration adapted.
-
-	* ftest_io.cc (ftestPrintResult): adapted to new output format
-
-	* ftest_util.cc (ftestSignalCatch): catches `SIGTERM'
-
-Tue Oct 28 18:16:54 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* gcd.fex (univ0RanD, univ0RanC): new monster examples
-
-	* ftest_io.cc (ftestGetCanonicalForm): reads canonical forms from
-	 stdin when given `<-' as input specifier
-
-	* runfex (collection): (almost) reads `collectionName'
-
-	* runfex: case labels fixed
-
-	* runfex: table format slightly changed
-
-Wed Oct 22 16:03:02 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (ftestWriteSeed): calls `factoryrandom( 0 )'
-	  instead of `factoryrandom()'
-
-Wed Oct 15 10:50:07 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.m4 (ftestOutVar): `int's are initialized to 0 on
-	  definition 
-
-	* ftest_io.cc (ftestPrintResult(CFFList)): new function.
-	  Declaration added.
-
-	* ftest_util.m4 (ftestPreprocInit): call to `changecom()' macro
-	  moved from root level to `ftestPreprocInit()'
-
-	* ftest_util.m4 (ftestInVar): `int's are initialized to 0 on
-	  definition
-
-	* ftest_util.m4 (ftestRun): calls to `TIMING_START()' and
-	  `TIMING_END()' macros moved outside while loop
-
-	* degree.m4, randomgcd.m4: new files
-
-	* gcd.m4, deriv.m4, feval.m4, resultant.m4, size.m4,
-	  totaldegree.m4: doc fix
-
-Fri Oct 10 14:33:59 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* runfex: runfxc renamed to runfex
-
-	* feval.m4: eval.m4 renamed to feval.m4
-	* runfxc (EvalAlg): is 'feval' now instead of './eval'
-
-	* runfxc (main): variable 'rawCollectionName' added
-
-Wed Oct  8 11:16:07 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* runfxc (example): reports examples being called
-	  (defineSkip): new function.  Call in main() added.
-
-	* eval.m4 (main): does not output timer/check status when there
-	  are not any arguments
-
-Tue Oct  7 09:57:59 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_io.cc (ftestPrintResult): adds end mark at end of output
-	  now
-
-	* ftest_util.cc (ftestPrintEnv): cosmetic changes
-	(ftestPrintEnv): more cosmetic changes
-
-Thu Oct  2 09:14:15 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.m4 (ftestRun): call to ftestWriteSeed() added
-	* ftest_util.cc (ftestWriteSeed): new function.  Declaration
-	  added.
-	* ftest_util.cc(ftestSeedFile): new static variable
-	  (ftestParseRandom): reads seed from file
-	* ftest_util.h (ftestErrorT): new enumerator FileError
-	* ftest_util.cc (ftestError): handles error `FileError' now
-
-	* ftest_util.cc (ftestParseSwitches): bug fix.  Explicitly
-	  switches off switch if specifies with `-'
-	  (ftestParseEnv): cosmetic changes
-	  (ftestParseVars): check on error removed
-	  (ftestEnv): declared static
-
-	* ftest_util.cc (struct ftestEnvT): new member `seedSet'
-	  (ftestParseRandom): sets `seedSet' if a definite seed has
-	  been set
-	  (ftestGetEnv): initialization for `seedSet' added
-	  (ftestPrintEnv, ftestSetRandom): handles `seedSet' more neatly
-
-	* ftest_util.cc (ftestSetSeed, ftestSetRandom): function
-	  ftestSetSeed() renamed to ftestSetRandom().  All callers
-	  changed.
-	  (ftestParseSeed, ftestParseRandom): function ftestParseSeed()
-	  renamed to ftestParseRandom().  All callers changed.
-
-	* ftest_util.m4 (ftestRun): cosmetic changes
-
-	* ftest_util.cc (ftestMainExit): function removed.  Declaration,
-	  too.
-	* ftest_util.m4 (ftestMainExit): call to function ftestMainExit()
-	  removed
-
-	* ftest_util.cc (ftestMainExit): new function.  Declaration added.
-	* ftest_util.m4 (ftestMainExit): call to function ftestMainExit()
-	  added
-
-Wed Oct  1 12:27:33 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_io.cc (ftestGetCanonicalForm, ftestGetVariable): cosmetic
-	  changes
-
-	* ftest_io.cc (ftestGetCanonicalForm, ftestGetint): cosmetic changes
-
-	* ftest_util.cc (ftestParseVars): cosmetic changes
-
-	* ftest_util.m4 (_ftestOutput): bug fix
-
-	* ftest_util.m4 (ftestGetInVar): checks for non existing arguments
-	  now
-
-	* ftest_util.m4: changes comment character to `//' when finished
-	  reading library
-
-	* ftest_io.cc (ftestGetVariable): parses variables in a more
-	  beautiful and safe way
-
-	* ftest_io.cc (ftestGetint): new function.  Declaration added.
-
-Tue Sep 30 12:16:59 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_io.cc (ftestGetCanonicalForm): argument renamed from
-	  `stringF' to `canFormSpec'.  Declaration adapted.
-	  (ftestGetCanonicalForm): reads canonical forms from environment
-	  variables now
-
-	* ftest_util.h (ftestErrorT): new enumerator CanFormSpecError
-	* ftest_util.cc (ftestError): check for CanFormSpecError added
-
-	* ftest_util.cc (ftestSkipBlancs): made external.  Declaration
-	  added.
-
-	* ftest_io.cc (ftestGetVariable): cosmetic changes
-
-Mon Sep 29 14:58:09 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* eval.m4: new file
-
-	* ftest_util.cc (ftestError): does not print any result output in
-	  error case any more
-
-	* ftest_util.cc (ftestPrintFlag): new external variable.
-	  Declarations adapted.
-	* ftest_io.cc (ftestPrintResult( .., CF ), ftestPrintResult( ..,
-	  int )): use new output format now
-
-	* ftest_io.cc (ftestPrintResult( .., CF ), ftestPrintResult( ..,
-	  int )): functions ftestPrintCanonicalForm() and ftestPrintInt()
-	  renamed to ftestPrintResult.  All callers changed.  Decarations
-	  adapted.
-
-	* ftest_util.m4 (ftestArgGiven): new macro
-	  (ftestInVar, ftestGetInVar): support added for macro
-	  ftestArgGiven()
-
-	* ftest_util.m4 (ftestOutput): supports multiple (or no) output
-	  variables now
-
-	* resultant.m4: doc fix
-
-	* totaldegree.m4: new file
-
-	* gcd.m4 (main): call to ftestOutput() rewritten to new format
-
-Fri Sep 26 11:50:21 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (ftestError): does not print result in case of an
-	  error any longer
-
-Thu Sep 25 09:56:29 1997  Jens Schmidt  <schmidt at mathematik.uni-kl.de>
-
-	* ftest_util.cc (ftestParseOutputType): option `-a' includes `-e'
-	  now
-
-	* ftest_util.cc (ftestGetOpts): lookups for environment variable
-	  `FTEST_ALARM' and `FTEST_CIRCLE' added
-
-	* ftest_util.cc (ftestConcatEnv): lookups for environment variables
-	  `FTEST_SWITCHES', `FTEST_CHAR', `FTEST_VARS', `FTEST_SEED'
-	  removed
-	  (ftestStrLen, ftestStrCat): are superfluous now
diff --git a/factory/ftest/GNUmakefile.in b/factory/ftest/GNUmakefile.in
deleted file mode 100644
index 7323889..0000000
--- a/factory/ftest/GNUmakefile.in
+++ /dev/null
@@ -1,156 +0,0 @@
-# @configure_input@
-# $Id: GNUmakefile.in 12231 2009-11-02 10:12:22Z hannes $
-
-#
-# GNUmakefile.in - used by `configure' to create `GNUmakefile', the
-#   makefile for the Factory Test Environment.
-#
-# In general, you should let `configure' guess the correct values
-# for the variables below.  But if something seriously goes wrong
-# in configuring, please inform the authors and feel free to
-# edit the marked section.
-#
-# See the `INSTALL' file for information on how to build the
-# Factory Test Environment.
-#
-# Note:	Use GNU `make' (`gmake') to make with this makefile.
-#
-# Note: Allthough you may use this `GNUmakefile' directly you
-# better use the top level `GNUmakefile' to make the test
-# programs.  Furthermore, you first have to `make' Factory before
-# you can `make' the Factory Test Environment.
-#
-
-############### START OF CONFIGURABLE SECTION ###############
-
-SHELL =		/bin/sh
-
-#
-# - paths.
-#
-srcdir =	@srcdir@
-VPATH =		@srcdir@
-NTLPATH =	$(srcdir)/../../ntl-2.0
-
-#
-# - programs.
-#
-CXX =		@CXX@
-M4 =		@M4@
-
-#
-# - flags.
-#
-CPPFLAGS =	@CPPFLAGS@
-CXXFLAGS =	@CXXFLAGS@
-DEFS =		@DEFS@
-LDFLAGS =	@LDFLAGS@
-LIBS =		@LIBS@
-
-M4FLAGS =	@M4FLAGS@
-
-############### END OF CONFIGURABLE SECTION ###############
-
-#
-# - compiler flags.
-#
-WARNFLAGS =	-w
-
-# flags to translate library c++ files
-LIBCXXFLAGS =	$(WARNFLAGS) -fno-implicit-templates \
-		-I$(srcdir) -I.. -I$(srcdir)/.. \
-		$(DEFS) $(CPPFLAGS) $(CXXFLAGS)
-
-# flags to translate test programs
-FTESTCXXFLAGS =	$(LIBCXXFLAGS)
-
-# flags to link test programs
-FTESTLDFLAGS =	$(LIBS) $(LDFLAGS)
-
-#
-# - source files.
-#
-
-# use value from environment if set, otherwise supply reasonable
-# default value
-ifndef ftestm4src
-ftestm4src :=	feval.m4
-endif
-ftestccsrc :=	$(ftestm4src:.m4=.cc)
-ftestobj :=	$(ftestm4src:.m4=.o)
-ftestexec :=	$(ftestm4src:.m4=)
-
-#
-# - phony and precious targets.
-#
-.PHONY:		all clean distclean
-.PRECIOUS:	%.cc %.o
-
-#
-# - pattern rules.
-#
-
-# cancel some builtin rules which may cause confusion
-%: %.o
-%: %.cc
-
-# how to link the ntl test files
-%.ntl: %.ntl.o ftest_util.o ftest_io.o ntl_util.o ../libcf.a ../libcfmem.a ../ftmpl_inst.o
-		$(CXX) $^ $(FTESTLDFLAGS) $(NTLPATH)/ntl.a -o $@
-
-# how to create the ntl test file objects
-%.ntl.o: %.ntl.cc ../factory.h ftest_util.h ftest_io.h ntl_util.h
-		$(CXX) -c $< -I$(NTLPATH) $(FTESTCXXFLAGS) -o $@
-
-# how to link the test files
-%: %.o ftest_util.o ftest_io.o ../libcf.a ../libcfmem.a ../ftmpl_inst.o
-		$(CXX) $^ $(FTESTLDFLAGS) -o $@
-
-# how to create the test file objects
-%.o: %.cc ../factory.h ftest_util.h ftest_io.h
-		$(CXX) -c $< $(FTESTCXXFLAGS) -o $@
-
-# how to create the test programs
-%.cc: %.m4 ftest_util.m4
-		$(M4) $(M4FLAGS) $(srcdir)/ftest_util.m4 $< > $@
-
-#
-# - create `feval'.
-#
-# This is a dummy target only just in case the user types `make'
-# in the FTE directory.
-#
-all:		feval
-
-#
-# - explicit targets.
-#
-
-# do not create ftest_util.cc from ftest_util.m4!
-ftest_util.cc:
-		touch $@
-
-ftest_util.o:	ftest_util.cc ftest_util.h ftest_io.h ../factory.h
-		$(CXX) -c $< $(LIBCXXFLAGS) -o $@
-
-ftest_io.o:	ftest_io.cc ftest_io.h ftest_util.h ../factory.h
-		$(CXX) -c $< $(LIBCXXFLAGS) -o $@
-
-ntl_util.o:	ntl_util.cc ntl_util.h ../factory.h
-		$(CXX) -c $< -I$(NTLPATH) $(LIBCXXFLAGS) -o $@
-
-#
-# - cleaning up.
-#
-clean:		
-		-rm -f $(ftestexec) $(ftestccsrc) *.o
-
-distclean:	clean
-		-rm -f GNUmakefile
-
-
-#
-# - configure stuff.
-#
-GNUmakefile:	GNUmakefile.in ../config.status
-		cd .. && CONFIG_FILES=ftest/GNUmakefile CONFIG_HEADERS= ./config.status
diff --git a/factory/ftest/bextgcd.m4 b/factory/ftest/bextgcd.m4
deleted file mode 100644
index 11a28f8..0000000
--- a/factory/ftest/bextgcd.m4
+++ /dev/null
@@ -1,125 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: bextgcd.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( bextgcd, `"
-Usage: bextgcd [<options>] [<envSpec>] <f> <g> [<realResult>]
-  calculates the positive greatest common divider c of canonical
-  forms f and g and CanonicalForms a and b such that f*a + b*c = c.
-  f and g should be from a base domain.
-  The results ar printed in the order a - b - c.
-
-  If the gcd of f and g is already known, the optional canonical
-  form realResult may be used to check the result of the gcd
-  computation.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ ftestStatusT bextgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & a, const CanonicalForm & b, const CanonicalForm & result, const CanonicalForm & realResult )
-//{{{ docu
-//
-// bextgcdCheck() - check result of bextgcd().
-//
-//}}}
-ftestStatusT
-bextgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & a, const CanonicalForm & b, const CanonicalForm & result, const CanonicalForm & realResult )
-{
-    // use old gcd to compare results
-    if ( result != gcd( f, g ) ) {
-	ftestError( CheckError, "new and old gcd differ\n" );
-	return Failed;
-    }
-
-    // if realResult is given, use it to compare with result
-    if ( ! realResult.isZero() )
-	if ( realResult == result )
-	    return Passed;
-	else if ( -realResult == result )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result and real result differ\n" );
-	    return Failed;
-	}
-
-    if ( result.isZero() )
-	if ( f.isZero() && g.isZero() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is zero but f and g are not\n" );
-	    return Failed;
-	}
-
-    if ( f*a + g*b != result ) {
-	ftestError( CheckError, "f*a + g*b != c\n" );
-	return Failed;
-    }
-
-    if ( divides( result, f ) && divides( result, g ) )
-	if ( bgcd( f/result, g/result ).isOne() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is not greatest common divisor\n" );
-	    return Failed;
-	}
-    else {
-	ftestError( CheckError, "result is not a common divisor\n" );
-	return Failed;
-    }
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, a );
-    ftestOutVar( CanonicalForm, b );
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( CanonicalForm, realResult );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( realResult, 0 );
-
-    // do the test!
-    ftestRun(
-	result = bextgcd( f, g, a, b ); );
-
-    // do the check
-    ftestCheck(
-	bextgcdCheck( f, g, a, b, result, realResult ) );
-
-    // print results
-    ftestOutput( "a", a, "b", b, "bextgcd(f, g, a, b)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/bgcd.m4 b/factory/ftest/bgcd.m4
deleted file mode 100644
index 801b833..0000000
--- a/factory/ftest/bgcd.m4
+++ /dev/null
@@ -1,116 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: bgcd.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( bgcd, `"
-Usage: bgcd [<options>] [<envSpec>] <f> <g> [<realResult>]
-  calculates the positive greatest common divider of canonical
-  forms f and g.  f and g should be from a base domain.
-
-  If the gcd of f and g is already known, the optional canonical
-  form realResult may be used to check the result of the gcd
-  computation.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ ftestStatusT bgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-//{{{ docu
-//
-// bgcdCheck() - check result of bgcd().
-//
-//}}}
-ftestStatusT
-bgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-{
-    // use old gcd to compare results
-    if ( result != gcd( f, g ) ) {
-	ftestError( CheckError, "new and old gcd differ\n" );
-	return Failed;
-    }
-
-    // if realResult is given, use it to compare with result
-    if ( ! realResult.isZero() )
-	if ( realResult == result )
-	    return Passed;
-	else if ( -realResult == result )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result and real result differ\n" );
-	    return Failed;
-	}
-
-    if ( result.isZero() )
-	if ( f.isZero() && g.isZero() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is zero but f and g are not\n" );
-	    return Failed;
-	}
-
-    if ( divides( result, f ) && divides( result, g ) )
-	if ( bgcd( f/result, g/result ).isOne() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is not greatest common divisor\n" );
-	    return Failed;
-	}
-    else {
-	ftestError( CheckError, "result is not a common divisor\n" );
-	return Failed;
-    }
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( CanonicalForm, realResult );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( realResult, 0 );
-
-    // do the test!
-    ftestRun(
-	result = bgcd( f, g ); );
-
-    // do the check
-    ftestCheck(
-	bgcdCheck( f, g, result, realResult ) );
-
-    // print results
-    ftestOutput( "bgcd(f, g)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/commonden.m4 b/factory/ftest/commonden.m4
deleted file mode 100644
index 59d1ba2..0000000
--- a/factory/ftest/commonden.m4
+++ /dev/null
@@ -1,51 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: commonden.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( commonden, `"
-Usage: commonden [<options>] [<envSpec>] <f>
-  returns common denominator of canonical form <f>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-
-    // do the test!
-    ftestRun(
-	result = bCommonDen( f ); );
-
-    // print results
-    ftestOutput( "bCommonDen(f)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/degree.m4 b/factory/ftest/degree.m4
deleted file mode 100644
index bca0372..0000000
--- a/factory/ftest/degree.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: degree.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( degree, `"
-Usage: degree [<options>] [<envSpec>] <f> [<x>]
-  returns degree of canonical form <f> with respect to its main
-  variable.  If variable <x> is specified, returns degree of <f>
-  with respect to <x>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( int, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( Variable, x );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( x, Variable() );
-
-    // do the test!
-    if ( ftestArgGiven( x ) ) {
-	ftestRun( result = degree( f, x ); );
-    } else {
-	ftestRun( result = degree( f ); );
-    }
-
-    // print results
-    if ( ftestArgGiven( x ) ) {
-	ftestOutput( "degree(f, x)", result );
-    } else {
-	ftestOutput( "degree(f)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/deriv.m4 b/factory/ftest/deriv.m4
deleted file mode 100644
index 2e36176..0000000
--- a/factory/ftest/deriv.m4
+++ /dev/null
@@ -1,61 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: deriv.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( deriv, `"
-Usage: deriv [<options>] [<envSpec>] <f> [<x>]
-  calculates df/dx or derivation of canonical form <f> with
-  respect to main variable if variable <x> is not specified.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( Variable, x );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( x, Variable() );
-
-    // do the test!
-    if ( ftestArgGiven( x ) ) {
-	ftestRun( result = f.deriv( x ); );
-    } else {
-	ftestRun( result = f.deriv(); );
-    }
-
-    // print results
-    if ( ftestArgGiven( x ) ) {
-	ftestOutput( "df/dx", result );
-    } else {
-	ftestOutput( "df", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/divides.m4 b/factory/ftest/divides.m4
deleted file mode 100644
index 474b1f1..0000000
--- a/factory/ftest/divides.m4
+++ /dev/null
@@ -1,120 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: divides.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( divides, `"
-Usage: divides [<options>] [<envSpec>] <f> <g>
-  returns true iff canonical form <f> divides canonical form <g>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ static ftestStatusT dividesCheck ( const CanonicalForm & f, const CanonicalForm & g, bool result )
-//{{{ docu
-//
-// dividesCheck() - check result of divides().
-//
-//}}}
-static ftestStatusT
-dividesCheck ( const CanonicalForm & f, const CanonicalForm & g, bool result )
-{
-    // check for f == 0
-    if ( f.isZero() )
-	if ( (! g.isZero() || result) && (! result || g.isZero()) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result differs from result of check" );
-	    return Failed;
-	}
-
-    // we check the result without any heuristics
-    CanonicalForm q, r;
-    bool checkResult = divremt( g, f, q, r );
-
-    // by the way, check divremt(), too
-    if ( checkResult ) {
-	if ( q != g / f ) {
-	    ftestError( CheckError, "q != g/f\n" );
-	    return Failed;
-	} else if ( r != g % f ) {
-	    ftestError( CheckError, "r != g%f\n" );
-	    return Failed;
-	} else if ( g.inBaseDomain() && f.inBaseDomain() && getCharacteristic() == 0
-		    && (r < 0 || r > abs( f )) ) {
-	    // check euclidean division in Z
-	    ftestError( CheckError, "!(0 <= g%f < abs(f))\n" );
-	    return Failed;
-	} else if ( g != f*q+r ) {
-	    ftestError( CheckError, "g != f*q+r\n" );
-	    return Failed;
-	} else if ( g.inPolyDomain() || f.inPolyDomain() ) {
-	    // check euclidean division in R[x]
-	    Variable x = (mvar( g ) >= mvar( f )) ? mvar( g ) : mvar( f );
-	    if ( r.isZero() || degree( r, x ) < degree( f, x ) )
-		return Passed;
-	    else {
-		ftestError( CheckError, "degree(r) >= degree(f)\n" );
-		return Failed;
-	    }
-	}
-    }
-
-    // check result now
-    checkResult = checkResult && r.isZero();
-    if ( (! checkResult || result) && (! result || checkResult) )
-	return Passed;
-    else {
-	ftestError( CheckError, "result differs from result of check" );
-	return Failed;
-    }
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( bool, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-
-    // do the test!
-    ftestRun( result = divides( f, g ); );
-
-    // do the check
-    ftestCheck( dividesCheck( f, g, result ); );
-
-    // print results
-    ftestOutput( "divides(f, g)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/divrem.m4 b/factory/ftest/divrem.m4
deleted file mode 100644
index 92a8aa7..0000000
--- a/factory/ftest/divrem.m4
+++ /dev/null
@@ -1,119 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: divrem.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( divrem, `"
-Usage: divrem [<options>] [<envSpec>] <f> <g> [<divisionCheck>]
-  calculates quotient q and remainder r of division from
-  canonical form <f> by canonical form <g> such that f=g*q+r.
-  <g> should not equal zero.  The result is not defined if such q
-  and r do not exist.
-  If the optional integer <divisionCheck> is specified and non-
-  zero additional checks are done whether q and r exist.  The
-  result of the check is printed as a boolean.
-  The results are printed in the order q - r [ - checkResult ].
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ static ftestStatusT divremCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & q, const CanonicalForm & r, bool checkResult )
-//{{{ docu
-//
-// divremCheck() - check result of divrem().
-//
-//}}}
-static ftestStatusT
-divremCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & q, const CanonicalForm & r, bool checkResult )
-{
-    if ( checkResult )
-	if ( q != f / g ) {
-	    ftestError( CheckError, "q != f/g\n" );
-	    return Failed;
-	} else if ( r != f % g ) {
-	    ftestError( CheckError, "r != f%%g\n" );
-	    return Failed;
-	} else if ( f.inBaseDomain() && g.inBaseDomain() && getCharacteristic() == 0
-		    && (r < 0 || r > abs( g )) ) {
-	    // check euclidean division in Z
-	    ftestError( CheckError, "!(0 <= f%%g < abs(g))\n" );
-	    return Failed;
-	} else if ( f != g*q+r ) {
-	    ftestError( CheckError, "f != g*q+r\n" );
-	    return Failed;
-	} else if ( f.inPolyDomain() || g.inPolyDomain() ) {
-	    // check euclidean division in R[x]
-	    Variable x = (mvar( f ) >= mvar( g )) ? mvar( f ) : mvar( g );
-	    if ( r.isZero() || degree( r, x ) < degree( g, x ) )
-		return Passed;
-	    else {
-		ftestError( CheckError, "degree(r) >= degree(g)\n" );
-		return Failed;
-	    }
-	} else
-	    return Passed;
-    else
-	return UndefinedResult;
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, q );
-    ftestOutVar( CanonicalForm, r );
-    ftestOutVar( bool, checkResult );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( int, divisionCheck );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( divisionCheck, 0 );
-
-    // do the test!
-    if ( divisionCheck ) {
-	ftestRun( checkResult = divremt( f, g, q, r ); );
-    } else {
-	checkResult = true;
-	ftestRun( divrem( f, g, q, r ); );
-    }
-
-    // do the check
-    ftestCheck( divremCheck( f, g, q, r, checkResult ); );
-
-    // print results
-    if ( divisionCheck ) {
-	ftestOutput( "q", q, "r", r, "divremt(f, g, q, r)", checkResult );
-    } else {
-	ftestOutput( "q", q, "r", r );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/extgcd.m4 b/factory/ftest/extgcd.m4
deleted file mode 100644
index d70097f..0000000
--- a/factory/ftest/extgcd.m4
+++ /dev/null
@@ -1,132 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: extgcd.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( extgcd, `"
-Usage: extgcd [<options>] [<envSpec>] <f> <g> [<realResult>]
-  calculates greatest common divisor d of canonical forms <f> and
-  <g> and canonical forms a and b such that d = a*<f>+b*<g>.  If
-  the gcd of <f> and <g> is already known, the optional canonical
-  form <realResult> may be used to check the result of the gcd
-  computation.
-  The extended gcd may be calculated in Euclidean domains only.
-  The results are printed in the order a - b - d.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ static CanonicalForm normalizeGcd ( const CanonicalForm & f )
-//{{{ docu
-//
-// normalizeGcd() - normalize result of gcd computation for
-//   testing.
-//
-// Unit normalization is done in case of a field, sign
-// normalization otherwise.
-//
-//}}}
-static CanonicalForm
-normalizeGcd ( const CanonicalForm & f )
-{
-    if ( getCharacteristic() > 0 || isOn( SW_RATIONAL ) )
-	return f/Lc( f );
-    else
-	return abs( f );
-}
-//}}}
-
-//{{{ static ftestStatusT extgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & a, const CanonicalForm & b, const CanonicalForm & result, const CanonicalForm & realResult )
-//{{{ docu
-//
-// extgcdCheck() - check result of extgcd().
-//
-//}}}
-static ftestStatusT
-extgcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & a, const CanonicalForm & b, const CanonicalForm & result, const CanonicalForm & realResult )
-{
-    // check whether result == a*f+b*g
-    if ( result != a*f+b*g ) {
-	ftestError( CheckError, "gcd != a*f+b*g\n" );
-	return Failed;
-    }
-
-    // if realResult is given, use it to compare with result
-    if ( ! realResult.isZero() )
-	if ( normalizeGcd( realResult ) == normalizeGcd( result ) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result and real result differ\n" );
-	    return Failed;
-	}
-
-    if ( result.isZero() )
-	if ( f.isZero() && g.isZero() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is zero but f and g are not\n" );
-	    return Failed;
-	}
-
-    if ( ! divides( result, f ) || ! divides( result, g ) ) {
-	ftestError( CheckError, "result is not a common divisor\n" );
-	return Failed;
-    } else if ( ! gcd( f/result, g/result ).isOne() ) {
-	ftestError( CheckError, "result is not greatest common divisor\n" );
-	return Failed;
-    } else
-	return Passed;
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, a );
-    ftestOutVar( CanonicalForm, b );
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( CanonicalForm, realResult );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( realResult, 0 );
-
-    // do the test!
-    ftestRun( result = extgcd( f, g, a, b ); );
-
-    // do the check
-    ftestCheck( extgcdCheck( f, g, a, b, result, realResult ); );
-
-    // print results
-    ftestOutput( "a", a, "b", b, "extgcd(f, g, a, b)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/factorize.m4 b/factory/ftest/factorize.m4
deleted file mode 100644
index d34153f..0000000
--- a/factory/ftest/factorize.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: factorize.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( factorize, `"
-Usage: factorize [<options>] [<envSpec>] <f> [<v>]
-  factorizes canonical form <f>.
-  If algebraic variable <v> is specified, factorizes in
-  algebraic extension by <v>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CFFList, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( Variable, v );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( v, Variable() );
-
-    // do the test!
-    if ( ftestArgGiven( v ) ) {
-	ftestRun( result = factorize( f, v ); );
-    } else {
-	ftestRun( result = factorize( f ); );
-    }
-
-    // print results
-    if ( ftestArgGiven( v ) ) {
-	ftestOutput( "factorize(f, v)", result );
-    } else {
-	ftestOutput( "factorize(f)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/fbinops.m4 b/factory/ftest/fbinops.m4
deleted file mode 100644
index 0796c96..0000000
--- a/factory/ftest/fbinops.m4
+++ /dev/null
@@ -1,345 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: fbinops.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( fbinops, `"
-Usage: fbinops [<options>] [<envSpec>] <f> <operator> <g>
-  executes operator an canonical forms f, g.
-
-  The following operators (with aliases) are recognized:
-  `+', `-', `*' (= `mul'), `/', `div', `%', `mod': return a canonicalform;
-  `==', `!=', `<' (= `lt'), `>' (= `gt'): return an integer (i.e. boolean)
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//{{{ typedef binOpCFT, binOpBoolT, binOpCFTestT
-//{{{ docu
-//
-// typedef binOpCFT, binOpBoolT, binOpCFTestT -
-//   pointer to functions types.
-//
-// binOpCFT, binOpBoolT: pointers to binary operators getting two
-//   CanonicalForms and returning a CanonicalForm or a bool, resp.
-// binOpCFTestT: pointers to test functions getting three
-//   CanonicalForms and returning a ftestStatusT.
-//
-//}}}
-typedef CanonicalForm (* binOpCFT)( const CanonicalForm &, const CanonicalForm & );
-typedef bool (* binOpBoolT)( const CanonicalForm &, const CanonicalForm & );
-typedef ftestStatusT (* binOpCFTestT)( const CanonicalForm &, const CanonicalForm &, const CanonicalForm & );
-//}}}
-
-//{{{ struct binOpCFSpecT, binOpBoolSpecT
-//{{{ docu
-//
-// struct binOpCFSpecT, struct binOpBoolSpecT - types describing a binary
-//   operator.
-//
-// binOpCFSpecT describes binary operators returning a CanonicalForm.
-// binOpBoolSpecT describes binary operators returning a bool.
-//
-// op: pointer to operator
-// test: test function
-// operatorName: symbolic name, used as a key
-// operatorTag: tag to print result
-//
-//}}}
-struct binOpCFSpecT
-{
-    binOpCFT op;
-    binOpCFTestT test;
-    const char * operatorName;
-    const char * operatorTag;
-};
-
-struct binOpBoolSpecT
-{
-    binOpBoolT op;
-    const char * operatorName;
-    const char * operatorTag;
-};
-//}}}
-
-//{{{ comparison functions, tests
-static inline bool
-ftestBoolEquiv ( bool a, bool b )
-{
-    return ( ( !a || b ) && ( !b || a ) );
-}
-
-static inline bool
-ftestCheckImplementation ( const CanonicalForm & f, const CanonicalForm & g )
-{
-    return ( ftestBoolEquiv( f == g, !(f != g) )
-	     && ftestBoolEquiv( f < g, g > f )
-	     && ftestBoolEquiv( f != g, (f < g) || (f > g) ) );
-}
-
-static inline bool
-ftestCheckTrichotomy ( const CanonicalForm & f, const CanonicalForm & g )
-{
-    if ( f == g ) {
-	if ( f < g ) return false;
-	if ( g < f ) return false;
-	return true;
-    } else if ( f < g ) {
-	if ( f == g ) return false;
-	if ( g < f ) return false;
-	return true;
-    } else if ( g < f ) {
-	if ( f == g ) return false;
-	if ( f < g ) return false;
-	return true;
-    } else
-	return false;
-}
-
-static ftestStatusT
-ftestRelOpTest ( const CanonicalForm & f, const CanonicalForm & g )
-{
-    // check reflexivity
-    if ( ! ( f == f ) ) {
-	ftestError( CheckError, "reflexivity check (f) failed\n" );
-	return Failed;
-    }
-    // check reflexivity
-    if ( ! ( g == g ) ) {
-	ftestError( CheckError, "reflexivity check (g) failed\n" );
-	return Failed;
-    }
-    // check symmetry
-    if ( ! ftestBoolEquiv( f == g, g == f ) ) {
-	ftestError( CheckError, "symmetry check failed\n" );
-	return Failed;
-    }
-    // check implementation of operators
-    if ( ! ftestCheckImplementation( f, g ) ) {
-	ftestError( CheckError, "implementation check (f, g) failed\n" );
-	return Failed;
-    }
-    // check implementation of operators
-    if ( ! ftestCheckImplementation( g, f ) ) {
-	ftestError( CheckError, "implementation check (g, f) failed\n" );
-	return Failed;
-    }
-    // check trichotomy
-    if ( ! ftestCheckTrichotomy( f, g ) ) {
-	ftestError( CheckError, "trichotomy check (f, g) failed\n" );
-	return Failed;
-    }
-    // check trichotomy
-    if ( ! ftestCheckTrichotomy( g, f ) ) {
-	ftestError( CheckError, "trichotomy check (g, f) failed\n" );
-	return Failed;
-    }
-
-    return Passed;
-}
-//}}}
-
-//{{{ arithmetic functions, tests
-static ftestStatusT
-ftestArithTest( const CanonicalForm &, const CanonicalForm &, const CanonicalForm & )
-{
-    return UndefinedResult;
-}
-
-static ftestStatusT
-ftestDivideTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & quot )
-{
-    CanonicalForm rem = f % g;
-    if ( ! ((quot*g)+rem-f).isZero() ) {
-	ftestError( CheckError, "f != (f/g)*g+(f%%g)\n" );
-	return Failed;
-    } else if ( f.inBaseDomain() && g.inBaseDomain() && getCharacteristic() == 0
-		&& (rem < 0 || rem > abs( g )) ) {
-	// check euclidean division in Z
-	ftestError( CheckError, "!(0 <= f%g < abs(g))\n" );
-	return Failed;
-    } else if ( f.inPolyDomain() || g.inPolyDomain() ) {
-	// check euclidean division in R[x]
-	Variable x = (mvar( f ) >= mvar( g )) ? mvar( f ) : mvar( g );
-	if ( rem.isZero() || degree( rem, x ) < degree( g, x ) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "degree(rem) >= degree(g)\n" );
-	    return Failed;
-	}
-    } else
-	return Passed;
-}
-
-static ftestStatusT
-ftestDivTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & quot )
-{
-    if ( ! (f%g).isZero() ) {
-	ftestError( CheckError, "g does not divide f\n" );
-	return Failed;
-    } else if ( f != (quot*g) ) {
-	ftestError( CheckError, "f != (div(f, g)*g)\n" );
-	return Failed;
-    } else
-	return Passed;
-}
-
-static ftestStatusT
-ftestModuloTest( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & rem )
-{
-    if ( ! (((f/g)*g)+(rem)-f).isZero() ) {
-	ftestError( CheckError, "f != (f/g)*g+(f%%g)\n" );
-	return Failed;
-    } else if ( f.inBaseDomain() && g.inBaseDomain() && getCharacteristic() == 0
-		&& (rem < 0 || rem > abs( g )) ) {
-	// check euclidean division in Z
-	ftestError( CheckError, "!(0 <= f%g < abs(g))\n" );
-	return Failed;
-    } else if ( f.inPolyDomain() || g.inPolyDomain() ) {
-	// check euclidean division in R[x]
-	Variable x = (mvar( f ) >= mvar( g )) ? mvar( f ) : mvar( g );
-	if ( rem.isZero() || degree( rem, x ) < degree( g, x ) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "degree(rem) >= degree(g)\n" );
-	    return Failed;
-	}
-    } else
-	return Passed;
-}
-//}}}
-
-//{{{ binOpCFSpecArray, binOpBoolSpecArray
-//{{{ docu
-//
-// binOpCFSpec, binOpBoolSpec - arrays of operator descriptions.
-//
-//}}}
-binOpCFSpecT binOpCFSpecArray[] =
-{
-    { &operator+, ftestArithTest, "+", "f+g" },
-    { &operator-, ftestArithTest, "-", "f-g" },
-    { &operator*, ftestArithTest, "*", "f*g" },
-    { &operator*, ftestArithTest, "mul", "f*g" },
-    { &operator/, ftestDivideTest, "/", "f/g" },
-    { &div, ftestDivTest, "div", "div(f,g)" },
-    { &operator%, ftestModuloTest, "%", "f%g" },
-    { &mod, ftestModuloTest, "mod", "mod(f,g)" },
-    { 0, 0, 0, 0 }
-};
-
-binOpBoolSpecT binOpBoolSpecArray[] =
-{
-    { &operator==, "==", "f==g" },
-    { &operator!=, "!=", "f!=g" },
-    { &operator>, ">", "f>g" },
-    { &operator>, "gt", "f>g" },
-    { &operator<, "<", "f<g" },
-    { &operator<, "lt", "f<g" },
-    { 0, 0, 0 }
-};
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, resultCF );
-    ftestOutVar( bool, resultBool );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-
-    // read first operand
-    ftestGetInVar( f );
-
-    // declarations to search operator
-    const char * operatorName = 0;
-    const char * operatorTag = 0;
-    binOpCFT binOpCF = 0;
-    binOpBoolT binOpBool = 0;
-    binOpCFTestT binOpCFTest = 0;
-
-    // get and search operator
-    if ( argv[ optind ] ) {
-        operatorName = ftestSkipBlancs( argv[ optind++ ] );
-    } else
-	ftestError( CommandlineError,
-                    "expected operator specification at position %d in commandline\n",
-                    optind );
-
-    // search through binOpCFSpecArray
-    int i = 0;
-    while ( binOpCFSpecArray[i].operatorName ) {
-	if ( strcmp( binOpCFSpecArray[i].operatorName, operatorName ) == 0 ) {
-	    binOpCF = binOpCFSpecArray[i].op;
-	    binOpCFTest = binOpCFSpecArray[i].test;
-	    operatorTag = binOpCFSpecArray[i].operatorTag;
-	    break;
-	}
-	i++;
-    }
-
-    // search through binOpBoolSpecArray
-    i = 0;
-    if ( ! binOpCF )
-	while ( binOpBoolSpecArray[i].operatorName ) {
-	    if ( strcmp( binOpBoolSpecArray[i].operatorName, operatorName ) == 0 ) {
-		binOpBool = binOpBoolSpecArray[i].op;
-		operatorTag = binOpBoolSpecArray[i].operatorTag;
-		break;
-	    }
-	    i++;
-	}
-
-    // check whether operator has been found
-    if ( binOpCF == 0 && binOpBool == 0 )
-	ftestError( CommandlineError,
-		    "unknown operator `%s'\n", operatorName );
-
-    // read second operand
-    ftestGetInVar( g );
-
-    // do the test!
-    if ( binOpCF ) {
-	ftestRun(
-	    resultCF = binOpCF( f, g ); );
-	ftestCheck(
-	    binOpCFTest( f, g, resultCF ) );
-    } else {
-	ftestRun(
-	    resultBool = binOpBool( f, g ); );
-	ftestCheck(
-	    ftestRelOpTest( f, g ) );
-    }
-
-    // print results
-    if ( binOpCF ) {
-	ftestOutput( operatorTag, resultCF );
-    } else {
-	ftestOutput( operatorTag, resultBool );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/feval.m4 b/factory/ftest/feval.m4
deleted file mode 100644
index dfb4449..0000000
--- a/factory/ftest/feval.m4
+++ /dev/null
@@ -1,204 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: feval.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( feval, `"
-Usage: feval [<options>] [<envSpec>] [expand=<n>] <f>
-  evaluates canonical form <f>.
-
-  In contrast to the other programs of the Factory Test
-  Environment, <f> may span more than one argument.  More
-  precisely, all arguments are textually pasted together and are
-  then evaluated as one canonical form.  If there are not any
-  arguments (except options), neither time nor status nor result
-  nor data information is printed.
-
-  The `-a' and `-c' options are ignored by `feval'.
-
-  If the optional argument `expand' is given, <f> is printed
-  in a format dependent on <n>:
-  <n> = 0: print <f> in standard format (default)
-  <n> = 1: print <f> in NTL format, i.e., as a dense vector of
-           coefficients (for univariate polynomials only)
-"'`' )
-dnl // the trailing quotes at the end of the second argument
-dnl // are for font-lock only (another font-lock-trick)
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-// necessary to paste the arguments together
-#include <string.h>
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-    check = Passed;
-
-    // print long usage if called with exactly one argument `-?'
-    if ( argc == 2 && strcmp( "-?", argv[1] ) == 0 ) {
-	ftestUsagePrint( "
-
-              Options common to all test programs
-               of the Factory Test Environment:
-               --------------------------------
-
-
-Some examples first:
-
-feval /13/xy <f>
-
-  Evaluates <f> in the finite field with 13 elements and
-  with x < y.  Prints result of evaluation.
-
-feval -oa /x,y,i=x^2+1/+SW_RATIONAL <f>
-
-  Evaluates <f> in the field Q[i], where the algebraic element
-  i has the minimal polynomial x^2+1.  DO NOT FORGET TO SET
-  `SW_RATIONAL' WHEN CALCULATING WITH ALGEBRAIC ELEMENTS OF
-  CHARACTERISTIC 0.  Variable ordering is as above.
-  Prints result and the complete environment.
-
-feval /13^2,Z/x,y,a=x^2+Z^3 <f>
-
-  Evaluate <f> over the field GF(13^2)[a], where GF(13^2) is
-  generated by a primitive element Z and a has the minimal
-  polynomial x^2+Z^3.  DO NOT FORGET TO SPECIFY THE
-  CHARACTERISTIC BEFORE YOU SPECIFY ANY MINIMAL POLYNOMIAL.
-  Variable ordering is as above.
-
-
-Now for the detailed options:
-
-  <options>:
-            -a <time>:  sets maximal running time (in seconds)
-            -c <times>: sets number of runs
-            -o <outputOptions>: specifies what information to
-              print
-
-            An option `--' may be used to terminate parsing
-            of the options.  This is especially useful if the
-            some of the arguments start with a negative number.
-
-  <outputOptions>:
-            a: everything
-            c: check                            r: result
-            e: computing environment            t: time
-
-            Without any output options, prints the result only.
-
-  <envSpec>:
-            /<charSpec><envSpec>
-            /<varSpec><envSpec>
-            /<switchSpec><envSpec>
-            /<randomSpec><envSpec>
-
-            Sets the computing environment, e.g., the variable
-            ordering, the characteristic, etc.
-
-  <charSpec>:
-            <n>
-               where <n> is either zero or a prime number
-            <p>^<d>[,<Z>]
-               where <p> is a prime number and <d> an integer
-               greater or equal 2.  The optional <Z> should be
-               a single character.
-
-            Sets the characteristic to <charSpec>.  With <n> = 0
-            calculations are done in characteristic zero.  With
-            <n> being a prime number, calculations are done over
-            the finite field with <n> elements.  With <p>^<d>
-            calculations are done over the finite Galois field
-            with <p>^<d> elements.  The optional character <Z>
-            specifies the symbol to print for the generator of
-            that field.
-
-  <varSpec>:
-            <varName[=<minPoly>]>[,]<varSpec>
-               where <varName> is a single character and the
-               optional <minPoly> is an irreducible polynomial
-               over the current domain.  The `,' between
-               variables may be omitted if there is no
-               minimal polynomial specified.
-
-            Defines variable ordering and algebraic elements.
-            Variables occurring later in the list get higher
-            level.  If <minPoly> is specified, the corresponding
-            variable is defined to be an algebraic variable with
-            minimal polynomial <minPoly>.
-
-  <switchSpec>:
-            [+|-]<switchName>
-               where <switchName> is one of the switches
-               specified in `cf_defs.h'.
-
-            Turns switch <switchName> on resp off.  The most
-            useful switches are:
-            SW_RATIONAL: to calculate over the rational
-              numbers instead of the rational integers;
-            SW_SYMMETRIC_FF: to use symmetric
-              representation of finite fields;
-            SW_USE_EZGCD: to use EZ-GCD to compute the
-              gcd of multivariate polynomials over the
-              integers.
-
-  <randomSpec>:
-            @<n>
-               where <n> is an integer
-
-            Sets random generator seed to <n>.
-" );
-	exit( 0 );
-    }
-
-    // declare input and output variables
-    ftestInVar( int, expand );
-    ftestOutVar( CanonicalForm, f );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( expand, 0, "expand" );
-
-    if ( argv[optind] ) {
-	int i = optind;
-	int len = 0;
-
-	// get length of arguments
-	while ( argv[i] ) {
-	    len += strlen( argv[i] );
-	    i++;
-	}
-
-	// paste arguments together
-	char * argString = new char[len+1];
-	argString[0] = '\0';
-	while ( optind < i ) {
-	    strcat( argString, argv[optind] );
-	    optind++;
-	}
-	
-	ftestReadString( argString, f );
-	delete [] argString;
-	ftestOutput( "f", f );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/ftest_io.cc b/factory/ftest/ftest_io.cc
deleted file mode 100644
index ffc72e9..0000000
--- a/factory/ftest/ftest_io.cc
+++ /dev/null
@@ -1,221 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ftest_io.cc 12231 2009-11-02 10:12:22Z hannes $ */
-
-//{{{ docu
-//
-// ftest_io.cc - io utilities for the factory test environment.
-//
-//}}}
-
-#include <ctype.h>
-#include <string.h>
-#include <stdlib.h>
-#include <iostream.h>
-#include <strstream.h>
-
-#include <factory.h>
-
-#include "ftest_util.h"
-
-//
-// - external functions.
-//
-
-//{{{ void ftestReadString ( const char * canFormSpec, CanonicalForm & f )
-//{{{ docu
-//
-// ftestReadString() - read canonical form `f' from `canFormSpec'.
-//
-//}}}
-void
-ftestReadString ( const char * canFormSpec, CanonicalForm & f )
-{
-    canFormSpec = ftestSkipBlancs( canFormSpec );
-
-    // check for a single minus and read from stdin
-    if ( *canFormSpec == '-' ) {
-	const char * tokenCursor = ftestSkipBlancs( canFormSpec+1 );
-	if ( ! *tokenCursor ) {
-	    cin >> f;
-	    return;
-	}
-    }
-
-    // create terminated CanonicalForm
-    char * terminatedSpec = new char[ strlen( canFormSpec )+2 ];
-    char * cursor = terminatedSpec;
-    while ( *canFormSpec ) {
-	switch ( *canFormSpec ) {
-	case '.': *cursor = '*'; break;
-	case '{': *cursor = '('; break;
-	case '}': *cursor = ')'; break;
-	default: *cursor = *canFormSpec; break;
-	}
-	canFormSpec++; cursor++;
-    }
-    *cursor++ = ';';
-    *cursor = '\0';
-
-    // read f from string
-    istrstream( terminatedSpec ) >> f;
-    delete [] terminatedSpec;
-}
-//}}}
-
-//{{{ void ftestReadString ( const char * varSpec, Variable & v )
-//{{{ docu
-//
-// ftestReadString() - read variable `v' from `varSpec'.
-//
-//}}}
-void
-ftestReadString ( const char * varSpec, Variable & v )
-{
-    varSpec = ftestSkipBlancs( varSpec );
-
-    if ( isalpha( *varSpec ) )
-	v = Variable( *varSpec );
-    else if ( isdigit( *varSpec ) )
-	v = Variable();
-    else
-	ftestError( CommandlineError,
-		    "variable expected at `%s'\n", varSpec );
-
-    varSpec = ftestSkipBlancs( varSpec+1 );
-    if ( *varSpec )
-	ftestError( CommandlineError,
-		    "extra characters after var spec `%s'\n", varSpec );
-}
-//}}}
-
-//{{{ void ftestReadString ( const char * intSpec, int & i )
-//{{{ docu
-//
-// ftestReadString() - read integer `i' from `intSpec'.
-//
-//}}}
-void
-ftestReadString ( const char * intSpec, int & i )
-{
-    const char * tokenCursor;
-
-    i = (int)strtol( intSpec, (char**)&tokenCursor, 0 );
-
-    // do error checks
-    if ( intSpec == tokenCursor )
-	ftestError( CommandlineError,
-		    "integer expected at `%s'\n", intSpec );
-
-    // check for extra characters after skipping blancs
-    intSpec = ftestSkipBlancs( tokenCursor );
-    if ( *intSpec )
-	ftestError( CommandlineError,
-		    "extra characters after int spec `%s'\n", intSpec );
-}
-//}}}
-
-//{{{ void ftestReadString ( const char * boolSpec, bool & b )
-//{{{ docu
-//
-// ftestReadString() - read boolean `b' from `boolSpec'.
-//
-//}}}
-void
-ftestReadString ( const char * boolSpec, bool & b )
-{
-    // skip blancs
-    boolSpec = ftestSkipBlancs( boolSpec );
-
-    // look for "true" or "false"
-    const char * tokenCursor = ftestSubStr( "true", boolSpec );
-    if ( boolSpec != tokenCursor )
-	b = true;
-    else {
-	tokenCursor = ftestSubStr( "false", boolSpec );
-	b = false;
-    }
-
-    // do error checks
-    if ( boolSpec == tokenCursor )
-	ftestError( CommandlineError,
-		    "bool expected at `%s'\n", boolSpec );
-
-    // check for extra characters after skipping blancs
-    boolSpec = ftestSkipBlancs( tokenCursor );
-    if ( *boolSpec )
-	ftestError( CommandlineError,
-		    "extra characters after bool spec `%s'\n", boolSpec );
-}
-//}}}
-
-//{{{ void ftestPrintResult ( const char * resultName, const CanonicalForm & result )
-//{{{ docu
-//
-// ftestPrintResult() - print a canonical form.
-//
-//}}}
-void
-ftestPrintResult ( const char * resultName, const CanonicalForm & result )
-{
-    if ( ftestPrintResultFlag ) {
-	cout << "Result:\t\t" << resultName << ":" << endl;
-	cout << result << endl;
-    } else if ( ! ftestPrintFlag )
-	cout << "(" << result << ")" << endl;
-}
-//}}}
-
-//{{{ void ftestPrintResult ( const char * resultName, const CFFList & result )
-//{{{ docu
-//
-// ftestPrintResult() - print a list of canonical form factors
-//
-//}}}
-void
-ftestPrintResult ( const char * resultName, const CFFList & result )
-{
-    CFFListIterator I;
-
-    if ( ftestPrintResultFlag ) {
-	cout << "Result:\t\t" << resultName << ":" << endl;
-	for ( I = result; I.hasItem(); I++ )
-	    cout << I.getItem() << endl;
-    } else if ( ! ftestPrintFlag )
-	for ( I = result; I.hasItem(); I++ )
-	    cout << "(" << I.getItem() << ")" << endl;
-}
-//}}}
-
-//{{{ void ftestPrintResult ( const char * resultName, const int result )
-//{{{ docu
-//
-// ftestPrintResult() - print an integer.
-//
-//}}}
-void
-ftestPrintResult ( const char * resultName, const int result )
-{
-    if ( ftestPrintResultFlag )
-	cout << "Result:\t\t" << resultName << ": " << result << endl;
-    else if ( ! ftestPrintFlag )
-	cout << result << endl;
-}
-//}}}
-
-//{{{ void ftestPrintResult ( const char * resultName, const bool result )
-//{{{ docu
-//
-// ftestPrintResult() - print a boolean.
-//
-//}}}
-void
-ftestPrintResult ( const char * resultName, const bool result )
-{
-    const char * stringResult = result ? "true" : "false";
-
-    if ( ftestPrintResultFlag )
-	cout << "Result:\t\t" << resultName << ": " << stringResult << endl;
-    else if ( ! ftestPrintFlag )
-	cout << stringResult << endl;
-}
-//}}}
diff --git a/factory/ftest/ftest_io.h b/factory/ftest/ftest_io.h
deleted file mode 100644
index 693bfd3..0000000
--- a/factory/ftest/ftest_io.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ftest_io.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_FTEST_IO_H
-#define INCL_FTEST_IO_H
-
-//{{{ docu
-//
-// ftest_io.h - header to ftest_io.cc.
-//
-//}}}
-
-#include <factory.h>
-
-// functions to read objects from strings
-void ftestReadString ( const char *, CanonicalForm & );
-void ftestReadString ( const char *, Variable & );
-void ftestReadString ( const char *, int & );
-void ftestReadString ( const char *, bool & );
-
-void ftestPrintResult ( const char * resultName, const CanonicalForm & result );
-void ftestPrintResult ( const char * resultName, const CFFList & result );
-void ftestPrintResult ( const char * resultName, const int result );
-void ftestPrintResult ( const char * resultName, const bool result );
-
-#endif /* ! INCL_FTEST_IO_H */
diff --git a/factory/ftest/ftest_util.cc b/factory/ftest/ftest_util.cc
deleted file mode 100644
index 054727f..0000000
--- a/factory/ftest/ftest_util.cc
+++ /dev/null
@@ -1,1164 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ftest_util.cc 12231 2009-11-02 10:12:22Z hannes $ */
-
-//{{{ docu
-//
-// ftest_util.cc - some utilities for the factory test environment.
-//
-//}}}
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <unistd.h>
-#include <iostream.h>
-#include <fstream.h>
-
-// we include timing.h for calculation of HZ only
-#define TIMING
-#include <timing.h>
-
-#include <factory.h>
-
-// we include `cf_switches.h' for the maximum number of switches
-// and hope that we will not get any conflicts
-#include <cf_switches.h>
-
-#include "ftest_util.h"
-#include "ftest_io.h"
-
-//{{{ struct varSpecT
-struct varSpecT
-{
-    char variable;
-    CanonicalForm mipo;
-    varSpecT * next;
-};
-//}}}
-
-//{{{ struct ftestEnvT
-//{{{ docu
-//
-// struct ftestEnvT - factory environment.
-//
-//}}}
-struct ftestEnvT
-{
-    int seed;
-    bool seedSet;
-    int characteristic;
-    int extDegree;
-    char extGen;
-    varSpecT * varSpec;
-    bool switches[CFSwitchesMax];
-};
-//}}}
-
-//{{{ external variables
-//{{{ docu
-//
-// - external variables.
-//
-// ftestCircle: set by ftestGetOpts() from commandline, read by
-//   main().  Number of test circles.
-// ftestAlarm: set by ftestGetOpts() from commandline, read by
-//   main().
-// ftestCheckFlag: set by ftestGetOpts() from commandline, read by
-//   main().  False iff checks should not be executed.
-// ftestPrintFlag: set by ftestParseOutputType() from
-//   commandline, read by ftestPrintResult().  True iff there was
-//   some output type specifier on commandline.
-// ftestPrintResultFlag: set by ftestParseOutputType() from
-//   commandline, read by output routines.  Whether to print result
-//   or not.
-//
-//}}}
-int ftestCircle = 1;
-int ftestAlarm = 0;
-
-int ftestCheckFlag = 1;
-
-int ftestPrintFlag = 0;
-int ftestPrintResultFlag = 0;
-//}}}
-
-//{{{ static variables
-//{{{ docu
-//
-// - static variables.
-//
-// ftestPrint*Flag: set by ftestParseOutputType() from
-//   commandline, read by output routines.  Things to print/not to
-//   print.  Note that we need `ftestPrintFlag' and
-//   `ftestPrintResultFlag' to be external.
-// ftestExecName, ftestAlgorithmName: set by ftestSetName(), read
-//   by output routines.  Name of executable and algorithm.
-// ftestUsage: set by ftestSetName(), read by ftestUsagePrint().
-//   Algorithm-specific usage information.
-// ftestEnv: factory environment specification.  Set by
-//   ftestGetEnv(), read by ftestPrintEnv() function.  This
-//   variable is quite spurious, but I keep it for future use.
-// ftestSwitchNames: symbolic names of switches
-// ftestSeedFile: file where to read/to which to print the random
-//   generator seed.  Set by ftestParseRandom(), read by
-//   ftestWriteSeed().
-//
-//}}}
-static int ftestPrintTimingFlag = 0;
-static int ftestPrintCheckFlag = 0;
-static int ftestPrintEnvFlag = 0;
-
-const char * ftestExecName = 0;
-const char * ftestAlgorithmName = 0;
-const char * ftestUsage = 0;
-
-static ftestEnvT ftestEnv;
-
-const char * ftestSwitchNames[] =
-{
-    "RATIONAL",
-    "QUOTIENT",
-    "SYMMETRIC_FF",
-    "BERLEKAMP",
-    "FAC_USE_BIG_PRIMES",
-    "FAC_QUADRATICLIFT",
-    "USE_EZGCD",
-    "USE_SPARSEMOD"
-};
-
-static char * ftestSeedFile = 0;
-//}}}
-
-//
-// - static functions.
-//
-
-//{{{ static char * ftestConcatEnv ( char ** argv, int & optind )
-//{{{ docu
-//
-// ftestConcatEnv() - concatenate all environment information
-//   together and return the result.
-//
-// The new index into the commandline is returned in optind.
-//
-//}}}
-static char *
-ftestConcatEnv ( char ** argv, int & optind )
-{
-    // first get length
-    int i = optind;
-    int len = 0;
-    const char * envString = getenv( "FTEST_ENV" );
-    if ( envString )
-	len = strlen( envString );
-
-    while ( (argv[i] != 0) && (*ftestSkipBlancs( argv[i] ) == '/') ) {
-	len += strlen( argv[i] );
-	i++;
-    }
-
-    char * fEnvString = new char[len+1];
-
-    // now build string
-    fEnvString[0] = '\0';
-    if ( envString )
-	strcat( fEnvString, envString );
-
-    while ( optind < i ) {
-	strcat( fEnvString, argv[optind] );
-	optind++;
-    }
-
-    return fEnvString;
-}
-//}}}
-
-//{{{ static const char * ftestParseRandom ( const char * tokenString )
-//{{{ docu
-//
-// ftestParseRandom() - parse random specification and set factory's
-//   random generator seed.
-//
-// The results are also stored in global variable `ftestEnv'.
-// Returns pointer behind last parsed character in tokenString.
-//
-//}}}
-static const char *
-ftestParseRandom ( const char * tokenString )
-{
-    int seed = 0;
-    bool seedSet = false;
-
-    do {
-	const char * tokenCursor;
-
-	// we skip either `@' or `,'
-	tokenString = ftestSkipBlancs( tokenString+1 );
-	if ( isdigit( *tokenString ) ) {
-	    // read seed specification from command line
-	    seed = (int)strtol( tokenString, (char **)&tokenCursor, 0 );
-	    if ( tokenCursor == tokenString )
-		ftestError( EnvSyntaxError,
-			    "bad seed specification `%s'\n",
-			    tokenString );
-	    seedSet = true;
-	} else if ( isalpha( *tokenString ) ) {
-	    // read seed specification from file
-	    tokenCursor = strpbrk( tokenString, ",/" );
-	    if ( ! tokenCursor )
-		tokenCursor = strchr( tokenString, '\0' );
-
-	    // store file name
-	    int nameLen = tokenCursor-tokenString;
-	    ftestSeedFile = new char[nameLen+1];
-	    strncpy( ftestSeedFile, tokenString, nameLen );
-	    ftestSeedFile[nameLen] = '\0';
-
-	    // open file, read seed, close file
-	    ifstream seedStream( ftestSeedFile );
-	    if ( ! seedStream ) {
-		if ( errno != ENOENT )
-		    ftestError( FileError,
-				"failed to open `%s' for reading: %s\n", ftestSeedFile,
-				strerror( errno ) );
-		else if ( ! (ftestEnv.seedSet || seedSet) ) {
-		    // if file does not exist, set seed to some
-		    // default value if it has not been set before
-		    seed = 0;
-		    seedSet = true;
-		}
-	    } else {
-		// if file exists, read seed
-		seedStream >> seed;
-		if ( ! seedStream )
-		    ftestError( FileError,
-				"garbled seed in seed file `%s'\n", ftestSeedFile );
-
-		seedSet = true;
-	    }
-	} else
-	    ftestError( EnvSyntaxError,
-			"bad random specification `%s'\n", tokenString );
-
-	tokenString = ftestSkipBlancs( tokenCursor );
-    } while ( *tokenString == ',' );
-
-    // set seed
-    ftestEnv.seedSet = seedSet;
-    if ( seedSet ) {
-	ftestEnv.seed = seed;
-	factoryseed( seed );
-    }
-
-    return tokenString;
-}
-//}}}
-
-//{{{ static const char * ftestParseChar ( const char * tokenString )
-//{{{ docu
-//
-// ftestParseChar() - parse characteristic specification and set factory's
-//   characteristic.
-//
-// The results are also stored in global variable `ftestEnv'.
-// Returns pointer behind last parsed character in tokenString.
-//
-//}}}
-static const char *
-ftestParseChar ( const char * tokenString )
-{
-    const char * tokenCursor;
-    int characteristic = 0;
-    int extDegree = 0;
-    char extGen = 'Z';
-
-    characteristic = (int)strtol( tokenString, (char **)&tokenCursor, 0 );
-    tokenString = ftestSkipBlancs( tokenCursor );
-
-    // look for exponent
-    if ( *tokenString == '^' ) {
-	tokenString++;
-	extDegree = (int)strtol( tokenString, (char **)&tokenCursor, 0 );
-	if ( tokenCursor == tokenString )
-	    ftestError( EnvSyntaxError,
-			"bad exponent in char specification `%s'\n",
-			tokenString );
-	tokenString = ftestSkipBlancs( tokenCursor );
-	// look for generator
-	if ( *tokenString == ',' ) {
-	    tokenString = ftestSkipBlancs( tokenString+1 );
-	    if ( isalpha( *tokenString ) ) {
-		extGen = *tokenString;
-		tokenString++;
-	    } else
-		ftestError( EnvSyntaxError,
-			    "bad generator in char specification `%s'\n",
-			    tokenString );
-	}
-    }
-
-    // set characteristic
-    ftestEnv.characteristic = characteristic;
-    if ( extDegree ) {
-	ftestEnv.extDegree = extDegree;
-	ftestEnv.extGen = extGen;
-	setCharacteristic( characteristic, extDegree, extGen );
-    } else
-	setCharacteristic( characteristic );
-
-    return tokenString;
-}
-//}}}
-
-//{{{ static const char * ftestParseSwitches ( const char * tokenString )
-//{{{ docu
-//
-// ftestParseSwitches() - parse switch specification and set factory's
-//   switches.
-//
-// The results are also stored in global variable `ftestEnv'.
-// Returns pointer behind last parsed character in tokenString.
-//
-//}}}
-static const char *
-ftestParseSwitches ( const char * tokenString )
-{
-    unsigned int switchNumber;
-    bool switchSetting;
-
-    while ( *tokenString == '+' || *tokenString == '-' ) {
-	const char * tokenCursor;
-	if ( *tokenString == '+' )
-	    switchSetting = true;
-	else
-	    switchSetting = false;
-	tokenString = ftestSkipBlancs( tokenString+1 );
-
-	// skip optional leading "SW_"
-	tokenString = ftestSubStr( "SW_", tokenString );
-
-	// now search name of switch
-	for ( switchNumber = 0;
-	      switchNumber < sizeof( ftestSwitchNames ) / sizeof( char* );
-	      switchNumber++ )
-	    if ( (tokenCursor = ftestSubStr( ftestSwitchNames[switchNumber], tokenString ))
-		 != tokenString )
-		break;
-
-	if ( tokenCursor == tokenString )
-	    ftestError( EnvSyntaxError,
-			"unknown switch `%s'\n", tokenString );
-
-	// set switch
-	ftestEnv.switches[switchNumber] = switchSetting;
-	if ( switchSetting )
-	    On( switchNumber );
-	else
-	    Off( switchNumber );
-
-	tokenString = ftestSkipBlancs( tokenCursor );
-    }
-
-    return tokenString;
-}
-//}}}
-
-//{{{ static const char * ftestParseVars ( const char * tokenString )
-//{{{ docu
-//
-// ftestParseVars() - parse variable specification and set factory's
-//   variable.
-//
-// The results are also stored in global variable `ftestEnv'.
-// Returns pointer behind last parsed character in tokenString.
-//
-//}}}
-static const char *
-ftestParseVars ( const char * tokenString )
-{
-    char variable;
-    CanonicalForm mipo = 0;
-    Variable * dummy;
-
-    // we append at end of list
-    static varSpecT * endOfVarSpec = 0;
-    varSpecT * varSpec;
-
-    while ( isalpha( *tokenString ) ) {
-	variable = *tokenString;
-	mipo = 0;
-
-	tokenString = ftestSkipBlancs( tokenString+1 );
-
-	// look for mipo
-	if ( *tokenString == '=' ) {
-	    const char * tokenCursor;
-	    tokenString = ftestSkipBlancs( tokenString+1 );
-
-	    // search for end of mipo
-	    tokenCursor = strpbrk( tokenString, ",/" );
-	    if ( ! tokenCursor )
-		tokenCursor = strchr( tokenString, '\0' );
-
-	    // copy mipo to new string and read it
-	    int mipoLen = tokenCursor-tokenString;
-	    char * mipoString = new char[mipoLen+1];
-	    strncpy( mipoString, tokenString, mipoLen );
-	    mipoString[mipoLen] = '\0';
-	    ftestReadString( mipoString, mipo );
-	    delete [] mipoString;
-
-	    tokenString = ftestSkipBlancs( tokenCursor );
-	}
-	if ( *tokenString == ',' )
-	    // skip optional separator
-	    tokenString = ftestSkipBlancs( tokenString+1 );
-
-	// store information in ftestEnv
-	varSpec	= new varSpecT;
-	varSpec->variable = variable;
-	varSpec->mipo = mipo;
-	varSpec->next = 0;
-	if ( ftestEnv.varSpec )
-	    endOfVarSpec->next = varSpec;
-	else
-	    ftestEnv.varSpec = varSpec;
-	endOfVarSpec = varSpec;
-
-	// set variable
-	if ( mipo.isZero() )
-	    // polynomial variable
-	    dummy = new Variable( variable );
-	else
-	    dummy = new Variable( rootOf( mipo, variable ) );
-	// we only need the global information
-	delete dummy;
-    }
-
-    return tokenString;
-}
-//}}}
-
-//{{{ static void ftestParseEnv ( const char * tokenString )
-//{{{ docu
-//
-// ftestParseEnv() - parse environment specification and set factory's
-//   environment.
-//
-// The results are also stored in global variable `ftestEnv'.
-//
-// The parser is quite simple.  As long as `tokenString' starts
-// with a `/', he looks up the next character to determine which
-// token follows and parses it.  The functions used to do this
-// should leave `tokenString' behind the last character it
-// succeeded to read.
-//
-//}}}
-static void
-ftestParseEnv ( const char * tokenString )
-{
-    // read list of environment specifications
-    tokenString = ftestSkipBlancs( tokenString );
-    while ( *tokenString == '/' ) {
-	tokenString = ftestSkipBlancs( tokenString+1 );
-
-	if ( *tokenString == '@' ) {
-	    // random specification
-	    tokenString = ftestParseRandom( tokenString );
-	} else if ( isdigit( *tokenString ) ) {
-	    // specification of characteristics
-	    tokenString = ftestParseChar( tokenString );
-	} else if ( *tokenString == '+' || *tokenString == '-' ) {
-	    // specification of switches
-	    tokenString = ftestParseSwitches( tokenString );
-	} else if ( isalpha( *tokenString ) ) {
-	    // specification of variables
-	    tokenString = ftestParseVars( tokenString );
-	}
-	tokenString = ftestSkipBlancs( tokenString );
-    }
-    
-    // check if we reached end
-    if ( *tokenString )
-	ftestError( EnvSyntaxError,
-		    "extra characters in environment specification list `%s'\n",
-		    tokenString );
-}
-//}}}
-
-//{{{ static void ftestParseOutputType ( const char * outputType )
-//{{{ docu
-//
-// ftestParseOutputType() - parse output type and set ftestPrint*Flags.
-//
-//}}}
-static void
-ftestParseOutputType ( const char * outputType )
-{
-    ftestPrintFlag = 1;
-    while ( *outputType ) {
-	switch ( *outputType ) {
-	case 'r': ftestPrintResultFlag = 1; break;
-	case 't': ftestPrintTimingFlag = 1; break;
-	case 'c': ftestPrintCheckFlag = 1; break;
-	case 'e': ftestPrintEnvFlag = 1; break;
-	case 'a':
-	    ftestPrintResultFlag = 1;
-	    ftestPrintCheckFlag = 1;
-	    ftestPrintTimingFlag = 1;
-	    ftestPrintEnvFlag = 1; break;
-	default: ftestError( CommandlineError, "unknown output type specifier `%c'\n", *outputType );
-	}
-	outputType++;
-    }
-}
-//}}}
-
-//{{{ static void ftestSignalHandler ( int signal ), static void ftestAlarmlHandler ( int )
-//{{{ docu
-//
-// ftestSignalHandler(), ftestAlarmHandler() - signal handlers.
-//
-// Blocks new signals, flushes `cout', and calls `ftestError()'.
-//
-//}}}
-static void
-ftestSignalHandler ( int signal )
-{
-    ftestSignalCatch( true );
-    cout.flush();
-    ftestError( (ftestErrorT)((int)SignalError + signal ),
-		"received signal %d\n", signal );
-}
-static void
-ftestAlarmHandler ( int )
-{
-    ftestSignalCatch( true );
-    cout.flush();
-    ftestError( TimeoutError, "timeout after %d secs\n", ftestAlarm );
-}
-//}}}
-
-//
-// - external functions.
-//
-
-//{{{ const char * ftestSkipBlancs ( const char * string )
-//{{{ docu
-//
-// ftestSkipBlancs() - skip all leading blancs in string.
-//
-// Return new position.
-//
-//}}}
-const char *
-ftestSkipBlancs ( const char * string )
-{
-    while ( *string && isspace( *string ) )
-	string++;
-    return string;
-}
-//}}}
-
-//{{{ char * ftestCutBlancs ( char * string )
-//{{{ docu
-//
-// ftestCutBlancs() - cut off all trailing blancs in `string'.
-//
-// Returns `string' unchanged.
-//
-//}}}
-char *
-ftestCutBlancs ( char * string )
-{
-    char * stringCursor = string + strlen( string );
-
-    while ( (string != stringCursor)
-	    && isspace( *(stringCursor-1) ) )
-	stringCursor--;
-
-    *stringCursor = '\0';
-    return string;
-}
-//}}}
-
-//{{{ const char * ftestSubStr ( const char * subString, const char * string )
-//{{{ docu
-//
-// ftestSubStr() - check whether subString is a substring of string.
-//
-// If so, return index behind subString in string, otherwise
-// string.
-//
-//}}}
-const char *
-ftestSubStr ( const char * subString, const char * string )
-{
-    const char * stringStart = string;
-
-    while ( *subString && *subString == *string ) {
-	subString++; string++;
-    }
-
-    if ( *subString )
-	return stringStart;
-    else
-	return string;
-}
-//}}}
-
-//{{{ void ftestError ( ftestErrorT errno, const char * format ... )
-//{{{ docu
-//
-// ftestError() - main error handler.
-//
-// Prints error message consisting of formatString and following
-// arguments, some additional information, and exits with errno.
-// In case of an `CheckError', does not exit but returns to the
-// caller.
-//
-//}}}
-void
-ftestError ( ftestErrorT errno, const char * format ... )
-{
-    // print error message
-    if ( format ) {
-	if ( errno != CheckError )
-	    fprintf( stderr, "%s: ", ftestExecName );
-	else
-	    fprintf( stderr, "%s(CheckError): ", ftestExecName );
-	va_list ap;
-	va_start( ap, format );
-	vfprintf( stderr, format, ap );
-	va_end( ap );
-    }
-
-    switch ( errno ) {
-    case noError:
-	return;
-    case CommandlineError:
-    case EnvSyntaxError: 
-    case CanFormSpecError:
-	ftestUsagePrint();
-	break;
-    case FileError:
-	break;
-    case CheckError:
-	return;
-    case TimeoutError:
-	if ( ftestPrintTimingFlag )
-	    cout << "Time:\t\t> " << (float)ftestAlarm << endl;
-	if ( ftestPrintCheckFlag )
-	    cout << "Check:\t\tTime Out" << endl;
-	break;
-    default:
-	if ( ftestPrintCheckFlag )
-	    cout << "Check:\t\tReceived Signal " << (int)errno-(int)SignalError << endl;
-    }
-    exit( errno );
-}
-//}}}
-
-//{{{ void ftestUsagePrint ( const char * additionalUsage )
-//{{{ docu
-//
-// ftestUsagePrint() - print usage message to stderr.
-//
-// We use the static variable `ftestUsage' to do so.  If
-// `additionalUsage' is non-zero, we print it after
-// `ftestUsage', otherwise some short reference where to find
-// more information.
-//
-//}}}
-void
-ftestUsagePrint ( const char * additionalUsage )
-{
-    cerr << ftestUsage << flush;
-    if ( ! additionalUsage )
-	cerr << "
-For a descriptions of the features common to all programs of the
-Factory Test Environment, call `feval -?' (exactly in this way).
-" << endl;
-    else
-	cerr << additionalUsage << endl;
-}
-//}}}
-
-//{{{ void ftestSignalCatch ( bool block )
-//{{{ docu
-//
-// ftestSignalCatch() - set signal and alarm handlers.
-//
-// If block is true block the signals instead.
-//
-//}}}
-void
-ftestSignalCatch ( bool block )
-{
-    void (*signalHandler)( int );
-    void (*alarmHandler)( int );
-
-    if ( block ) {
-	signalHandler = 0;
-	alarmHandler = 0;
-    } else {
-	signalHandler = ftestSignalHandler;
-	alarmHandler = ftestAlarmHandler;
-    }
-
-#ifdef SIGHUP
-    signal( SIGHUP, signalHandler );
-#endif
-#ifdef SIGINT
-    signal( SIGINT, signalHandler );
-#endif
-#ifdef SIGQUIT
-    signal( SIGQUIT, signalHandler );
-#endif
-#ifdef SIGILL
-    signal( SIGILL, signalHandler );
-#endif
-#ifdef SIGIOT
-    signal( SIGIOT, signalHandler );
-#endif
-#ifdef SIGFPE
-    signal( SIGFPE, signalHandler );
-#endif
-#ifdef SIGBUS
-    signal( SIGBUS, signalHandler );
-#endif
-#ifdef SIGSEGV
-    signal( SIGSEGV, signalHandler );
-#endif
-#ifdef SIGTERM
-    signal( SIGTERM, signalHandler );
-#endif
-
-    // alarm handler
-    signal( SIGALRM, alarmHandler );
-}
-//}}}
-
-//{{{ void ftestSetName ( const char * execName, const char * algorithmName, const char * usage )
-//{{{ docu
-//
-// ftestSetName() - set name of executable and algorithm.
-//
-//}}}
-void
-ftestSetName ( const char * execName, const char * algorithmName, const char * usage )
-{
-    ftestExecName = execName;
-    ftestAlgorithmName = algorithmName;
-    ftestUsage = usage;
-}
-//}}}
-
-//{{{ void ftestGetOpts ( int argc, char ** argv, int & optind )
-//{{{ docu
-//
-// ftestGetOpts() - read options from commandline.
-//
-// Returns new index into commandline in `optind'.
-//
-//}}}
-void
-ftestGetOpts ( int argc, char ** argv, int & optind )
-{
-    // parse command line
-    int optionChar;
-    const char * outputType = 0;
-    const char * envString = 0;
-
-    // read from environment first
-    envString = getenv( "FTEST_ALARM" );
-    if ( envString )
-	ftestAlarm = (int)strtol( envString, 0, 0 );
-    envString = getenv( "FTEST_CIRCLE" );
-    if ( envString )
-	ftestCircle = (int)strtol( envString, 0, 0 );
-
-    // parse options
-    while ( (optionChar = getopt( argc, argv, "a:o:c:t" )) != -1 ) {
-	switch ( optionChar ) {
-	case 'a': ftestAlarm = (int)strtol( optarg, 0, 0 ); break;
-	case 'c': ftestCircle = (int)strtol( optarg, 0, 0 ); break;
-	case 'o': outputType = optarg; break;
-	case 't': ftestCheckFlag = false; break;
-	default: ftestError( CommandlineError, 0 );
-	}
-    }
-    optind = ::optind;
-
-    if ( outputType )
-	ftestParseOutputType( outputType );
-}
-//}}}
-
-//{{{ void ftestGetEnv ( int, char ** argv, int & optind )
-//{{{ docu
-//
-// ftestGetEnv() - read factory environment specs, set environment.
-//
-// The new index into the commandline is returned in optind.
-// The results are stored in global variable `ftestEnv'.
-//
-//}}}
-void
-ftestGetEnv ( int, char ** argv, int & optind )
-{
-    // initialize environment
-    ftestEnv.seed = 0;
-    ftestEnv.seedSet = false;
-    ftestEnv.characteristic = 0;
-    ftestEnv.extDegree = 0;
-    ftestEnv.extGen = 'Z';
-    ftestEnv.varSpec = 0;
-    for ( int i = 0; i < CFSwitchesMax; i++ )
-	ftestEnv.switches[i] = false;
-
-    char * envString = ftestConcatEnv( argv, optind );
-    ftestParseEnv( envString );
-    delete [] envString;
-}
-//}}}
-
-//{{{ bool ftestSearchTaggedArg ( int, char ** argv, int & optind, const char * optionTag )
-//{{{ docu
-//
-// ftestSearchTaggedArg() - search for tagged argument.
-//
-// If the current argument (`argv[ optind ]') is of the form
-// `<tag>=<value>', where `<tag>' is a substring of
-// `<optionTag>', the current argument is modified to point
-// directly after the `=' sign and `true' is returned.
-//
-// Otherwise, `false' is returned.
-//
-// Note: There may be arbitrary white-space between the several
-// tokens of the tagged argument, but the tokens must not span
-// more than one argument.
-//
-//}}}
-bool
-ftestSearchTaggedArg ( int, char ** argv, int & optind, const char * optionTag )
-{
-    const char * tokenCursor;
-    const char * tokenString = argv[ optind ];
-    int tokenLen;
-
-    // check for end of argument list
-    if ( ! tokenString )
-	return false;
-
-    // skip leading blancs
-    tokenString = ftestSkipBlancs( tokenString );
-
-    // check whether it is a tagged argument
-    tokenCursor = strchr( tokenString, '=' );
-    if ( ! tokenCursor )
-	return false;
-    tokenLen = tokenCursor - tokenString;
-
-    // isolate possible keyword
-    char * keyword = new char[ tokenLen+1 ];
-    strncpy( keyword, tokenString, tokenLen );
-    keyword[ tokenLen ] = '\0';
-    ftestCutBlancs( keyword );
-
-    // advance tokenString after `=' sign
-    tokenString = tokenCursor+1;
-
-    // check whether keyword is a substring of `optionTag'
-    tokenCursor = ftestSubStr( keyword, optionTag );
-    if ( tokenCursor == optionTag ) {
-	// optionTag not found
-	delete [] keyword;
-	return false;
-    } else {
-	argv[ optind ] = (char *)tokenString;
-	return true;
-    }
-}
-//}}}
-
-//{{{ void ftestWriteSeed ()
-//{{{ docu
-//
-// ftestWriteSeed() - write current seed to seed file.
-//
-//}}}
-void
-ftestWriteSeed ()
-{
-    if ( ftestSeedFile ) {
-	ofstream seedStream( ftestSeedFile );
-	if ( ! seedStream )
-	    ftestError( FileError,
-			"failed to open `%s' for writing: %s\n", ftestSeedFile,
-			strerror( errno ) );
-	seedStream << factoryrandom( 0 ) << endl;
-    }
-}
-//}}}
-
-//{{{ void ftestPrintTimer ( long timer )
-//{{{ docu
-//
-// ftestPrintTimer() - print value of timer.
-//
-//}}}
-void
-ftestPrintTimer ( long timer )
-{
-    if ( ftestPrintTimingFlag )
-	cout << "Time:\t\t" << (float)timer / HZ << endl;
-}
-//}}}
-
-//{{{ void ftestPrintCheck ( ftestSatusT check )
-//{{{ docu
-//
-// ftestPrintCheck() - print status of checks.
-//
-//}}}
-void
-ftestPrintCheck ( ftestStatusT check )
-{
-    if ( ftestPrintCheckFlag ) {
-	char * checkStr = 0;
-
-	switch (check) {
-	case Passed: checkStr = "Passed"; break;
-	case Failed: checkStr = "Failed"; break;
-	case UndefinedResult: checkStr = "Undefined"; break;
-	default: checkStr = "Error!";
-	}
-
-	cout << "Check:\t\t" << checkStr << endl;
-    }
-}
-//}}}
-
-//{{{ void ftestPrintEnv ()
-//{{{ docu
-//
-// ftestPrintEnv() - print current factory environment.
-//
-// The environment ist read from `ftestEnv'.
-//
-//}}}
-void
-ftestPrintEnv ()
-{
-    if ( ftestPrintEnvFlag ) {
-	// characteristic
-	if ( ftestEnv.extDegree )
-	    cout << "Characteristic:\t" << ftestEnv.characteristic
-		 << '^' << ftestEnv.extDegree
-		 << '(' << ftestEnv.extGen << ')' << endl;
-	else
-	    cout << "Characteristic:\t" << ftestEnv.characteristic << endl;
-
-	// switches
-	bool switchSet = false;
-	cout << "Switches:\t";
-	for ( int i = 0; i < CFSwitchesMax; i++ )
-	    if ( ftestEnv.switches[i] ) {
-		switchSet = true;
-		cout << ftestSwitchNames[i] << ' ';
-	    }
-	if ( ! switchSet )
-	    cout << "(not set)" << endl;
-	else
-	    cout << endl;
-
-	// variables
-	varSpecT * varSpec = ftestEnv.varSpec;
-	cout << "Variables:\t";
-	if ( ! varSpec )
-	    cout << "(not specified)" << endl;
-	else {
-	    while ( varSpec ) {
-		if ( varSpec->mipo.isZero() )
-		    cout << varSpec->variable
-			 << "(" << Variable( varSpec->variable ).level() << ") ";
-		else {
-		    cout << varSpec->variable
-			 << "(" << Variable( varSpec->variable ).level()
-			 << ", " << varSpec->mipo << ") ";
-		}
-		varSpec = varSpec->next;
-	    }
-	    cout << endl;
-	}
-
-	// number of repetitions
-	cout << "Circles:\t" << ftestCircle << endl;
-
-	// random generator seed
-	if ( ftestEnv.seedSet )
-	    cout << "Seed:\t\t" << ftestEnv.seed << endl;
-	else
-	    cout << "Seed:\t\t(not set)" << endl;
-
-	// factory version
-	const char * version;
-	version = strchr( factoryVersion, '=' )+2;
-	cout << "Version:\t" << version << endl;
-    }
-}
-//}}}
-
-//
-// - garbage.
-//
-
-#if 0
-//{{{ static size_t ftestStrLen( const char * string )
-//{{{ docu
-//
-// ftestStrLen() - return length of string, 0 for zero pointer.
-//
-//}}}
-static size_t
-ftestStrLen( const char * string )
-{
-    return string ? strlen( string ) : 0;
-}
-//}}}
-
-//{{{ static char * ftestStrCat (char * to, const char * from)
-//{{{ docu
-//
-// ftestStrCat() - concatenate (maybe empty) from and to.
-//
-//}}}
-static char *
-ftestStrCat (char * to, const char * from)
-{
-    if ( from )
-	strcat( to, from );
-    return to;
-}
-//}}}
-
-//{{{ static void ftestSetRandom ()
-//{{{ docu
-//
-// ftestSetRandom() - set random generator seed from `ftestEnv'.
-//
-// This function is quite spurious, but I keep it for future
-// use.
-//
-//}}}
-static void
-ftestSetRandom ()
-{
-    if ( ftestEnv.seedSet )
-	factoryseed( ftestEnv.seed );
-}
-//}}}
-
-//{{{ static void ftestSetChar ( bool reset = false )
-//{{{ docu
-//
-// ftestSetChar() - set characteristic from `ftestEnv'.
-//
-// If reset is true, reset characteristic to default.
-//
-// This function is quite spurious, but I keep it for future
-// use.
-//
-//}}}
-static void
-ftestSetChar ( bool reset = false )
-{
-    if ( reset )
-	setCharacteristic( 0 );
-    else
-	if ( ftestEnv.extDegree )
-	    setCharacteristic( ftestEnv.characteristic,
-			       ftestEnv.extDegree,
-			       ftestEnv.extGen );
-	else
-	    setCharacteristic( ftestEnv.characteristic );
-}
-//}}}
-
-//{{{ static void ftestSetSwitches ( bool reset = false )
-//{{{ docu
-//
-// ftestSetSwitches() - set switches from `ftestEnv'.
-//
-// If reset is true, reset switches to default.
-//
-// This function is quite spurious, but I keep it for future
-// use.
-//
-//}}}
-static void
-ftestSetSwitches ( bool reset = false )
-{
-    int i;
-
-    if ( reset )
-	for ( i = 0; i < CFSwitchesMax; i ++ )
-	    Off( i );
-    else
-	for ( i = 0; i < CFSwitchesMax; i ++ )
-	    if ( ftestEnv.switches[i] )
-		On( i );
-}
-//}}}
-
-//{{{ static void ftestSetVars ()
-//{{{ docu
-//
-// ftestSetVars() - set variables from `ftestEnv'.
-//
-// This function is quite spurious, but I keep it for future
-// use.
-//
-//}}}
-static void
-ftestSetVars ()
-{
-    varSpecT * varSpec = ftestEnv.varSpec;
-    Variable * dummy;
-
-    while ( varSpec ) {
-	if ( varSpec->mipo.isZero() )
-	    // polynomial variable
-	    dummy = new Variable( varSpec->variable );
-	else
-	    dummy = new Variable( rootOf( varSpec->mipo, varSpec->variable ) );
-
-	varSpec = varSpec->next;
-    }
-}
-//}}}
-
-//{{{ void ftestSetEnv ()
-//{{{ docu
-//
-// ftestSetEnv() - set environment from `ftestEnv'.
-//
-// This function is quite spurious, but I keep it for future
-// use.
-//
-//}}}
-void
-ftestSetEnv ()
-{
-    ftestSetRandom();
-    ftestSetSwitches();
-    ftestSetChar();
-    ftestSetVars();
-}
-//}}}
-#endif
diff --git a/factory/ftest/ftest_util.h b/factory/ftest/ftest_util.h
deleted file mode 100644
index b21e73e..0000000
--- a/factory/ftest/ftest_util.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ftest_util.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_FTEST_UTIL_H
-#define INCL_FTEST_UTIL_H
-
-//{{{ docu
-//
-// ftest_util.h - header to ftest_util.cc.
-//
-//}}}
-
-enum ftestStatusT {
-    Passed = 0, Failed, UndefinedResult
-};
-
-//{{{ enum ftestErrorT
-//{{{ docu
-//
-// enum ftestErrorT - FTE error types.
-//
-// noError: no error (rarely used :-)
-// CommandlineError: commandline syntax error
-// EnvSyntaxError: error in environment specification
-// FileError: error reading some file
-// CanFormSpecError: error in canonical form specification
-// CheckError: error in result checks
-// SignalError: process received a signal
-// TimeoutError: and this signal was due to our own call to `alarm()'
-//
-//}}}
-enum ftestErrorT
-{
-    noError, CommandlineError, EnvSyntaxError, FileError,
-    CanFormSpecError, CheckError,
-    SignalError, TimeoutError = SignalError + 14
-};
-//}}}
-
-extern int ftestCircle;
-extern int ftestAlarm;
-
-extern int ftestCheckFlag;
-extern int ftestPrintFlag;
-extern int ftestPrintResultFlag;
-
-const char * ftestSkipBlancs ( const char * string );
-char * ftestCutBlancs ( char * string );
-const char * ftestSubStr ( const char * subString, const char * string );
-void ftestError ( ftestErrorT errno, const char * format ... );
-void ftestUsagePrint ( const char * additionalUsage = 0 );
-
-void ftestSignalCatch ( bool block = false );
-
-void ftestSetName ( const char * execName, const char * algorithmName, const char * usage );
-
-void ftestGetOpts ( int argc, char ** argv, int & optind );
-void ftestGetEnv ( int, char ** argv, int & optind );
-bool ftestSearchTaggedArg ( int, char ** argv, int & optind, const char * optionTag );
-void ftestWriteSeed ();
-
-void ftestPrintTimer ( long timer );
-void ftestPrintCheck ( ftestStatusT check );
-void ftestPrintEnv ();
-
-#endif /* ! INCL_FTEST_UTIL_H */
diff --git a/factory/ftest/ftest_util.m4 b/factory/ftest/ftest_util.m4
deleted file mode 100644
index 5a26251..0000000
--- a/factory/ftest/ftest_util.m4
+++ /dev/null
@@ -1,292 +0,0 @@
-dnl $Id: ftest_util.m4 12231 2009-11-02 10:12:22Z hannes $
-dnl
-dnl ftest_util.m4 - m4 macros used by the factory test environment.
-dnl
-dnl "External" macro start with prefix `ftest', "internal" macros
-dnl with prefix `_'.
-dnl
-dnl Almost all macros insert `#line'-preprocessor directives into
-dnl code to aid debugging.
-dnl
-dnl Note: Be carefull where to place the ';'!
-dnl
-dnl do not output anything of this library
-divert(-1)
-
-#
-# - internal macros.
-#
-
-#
-# _stripTWS() - strip trailing white space from $1.
-#
-define(`_stripTWS', `dnl
-patsubst(`$1', `[ 	]*$')')
-
-#
-# _qstripTWS() - strip trailing white space from $1, return
-#   quoted result.
-#
-define(`_qstripTWS', `dnl
-ifelse(
-  translit(`$1', ` 	'), `', ,
-  `patsubst(`$1', `\(.*[^ 	]\)[ 	]*$', ``\1'')')')
-
-
-#
-# - external macros.
-#
-
-#
-# ftestSetNameOfGame() - set name of game.
-#
-# $1: name of algorithm
-# $2: usage of algorithm
-#
-# These are stored in the macros `ftestAlgorithm' and
-# `ftestUsage', resp.  Leaves notice on creator of this file.
-#
-define(`ftestSetNameOfGame', `dnl
-define(`ftestAlgorithm',``$1'')dnl
-define(`ftestUsage',``$2'')dnl
-`/* This file was automatically generated by m4 using the ftest_util.m4 library */'')
-
-#
-# ftestPreprocInit() - initial preprocessor directives.
-#
-# In addition, change m4's comment character.  Change it in
-# this place (and not earlier) because we want to replace
-# `ftestAlgorithm' in the file-docu of the generated file.
-#
-define(`ftestPreprocInit', `dnl
-changecom(`//')dnl
-`#line' __line__ "__file__"
-`#include <unistd.h>
-
-#define TIMING
-#include <timing.h>
-
-#include <factory.h>
-
-#include "ftest_util.h"
-#include "ftest_io.h"'
-dnl')
-
-#
-# ftestGlobalInit() - global initialization.
-#
-define(`ftestGlobalInit', `dnl
-`#line' __line__ "__file__"
-`TIMING_DEFINE_PRINT( ftestTimer )'')
-
-#
-# ftestMainInit() - initialization in main().
-#
-# Set the name of the game, check for missing arguments (in
-# this case print the usage and exit), and catche signals.
-#
-define(`ftestMainInit', `dnl
-`#line' __line__ "__file__"
-    `int optind = 0;
-    ftestStatusT check = UndefinedResult;
-
-    ftestSetName( argv[0], "'ftestAlgorithm`", 'ftestUsage`);
-
-    if ( argc == 1 ) {
-        ftestUsagePrint();
-        exit( 0 );
-    }
-
-    ftestSignalCatch();
-    #line' __line__ "__file__"
-dnl')
-
-#
-# ftestMainExit() - clean up in main().
-#
-define(`ftestMainExit', `dnl
-`#line' __line__ "__file__"
-    `return check'')
-
-#
-# ftestDefaultInitializer() - return type dependent default
-#   initializer.
-#
-# $1: type
-#
-define(`ftestDefaultInitializer', `dnl
-ifelse(
-  `$1', `int', `` = 0'',
-  `$1', `bool', `` = false'',
-  `')')
-
-#
-# ftestOutVar() - declare output variable.
-#
-# $1: type of output variable
-# $2: name of output variable
-#
-# Stores type of variable in macro _ftestOutType_<name>.  Does
-# some extra magic for internal data types to avoid warnings on
-# uninitialized variables.
-#
-define(`ftestOutVar', `dnl
-define(`_ftestOutType_'_qstripTWS(`$2'), `$1')dnl
-`$1 '_qstripTWS(`$2')ftestDefaultInitializer(`$1')')
-
-#
-# ftestInVar() - declare input variable.
-#
-# $1: type of input variable
-# $2: name of input variable
-#
-# Stores type of variable in macro _ftestInType_<name>.
-# Furthermore, declares a variable ftestArgGiven<name> for later
-# checks whether this variable has been set from commandline or
-# not.
-# Does some extra magic for internal data types to avoid warnings
-# on uninitialized variables.
-#
-define(`ftestInVar', `dnl
-define(`_ftestInType_'_qstripTWS(`$2'), `$1')dnl
-`$1 '_qstripTWS(`$2')ftestDefaultInitializer(`$1')`;
-    bool ftestArgGiven$2= false'')
-
-#
-# ftestGetOpts() - read options.
-#
-define(`ftestGetOpts', `dnl
-`#line' __line__ "__file__"
-    `ftestGetOpts( argc, argv, optind )'')
-
-#
-# ftestGetEnv() - read environment.
-#
-# And print it directly after reading it.
-#
-define(`ftestGetEnv', `dnl
-`#line' __line__ "__file__"
-    `ftestGetEnv( argc, argv, optind );
-
-    ftestPrintEnv();
-
-'dnl')
-
-#
-# ftestGetInVar() - read variable from command line.
-#
-# $1: name of input variable
-# $2: default for optional command line arguments
-# $3: search for optional argument with this tag
-#
-# Before reading the argument, check whether it really exists.
-# If so, call the appropriate function to convert the string into
-# the type of the variable you are reading.  If there are not any
-# more arguments, and there is no default specified, print an
-# error.  If there is a default value, use it instead.
-#
-# If optional third argument is given, call
-# `ftestSearchTaggedArg()' to check whether there is a tagged
-# optional argument `<tag> = <value>' where `<tag>' is a
-# substring of `$3'.  Use `<value>' as value for the input
-# variable in this case, `$2' otherwise.
-#
-# In any case, save the fact whether the argument was given or
-# not in the variable ftestArgGiven<name>.
-#
-define(`ftestGetInVar', `dnl
-ifelse(
-  `$#', `1',
-  ``if ( argv[ optind ] ) {
-        ftestArgGiven$1= true;
-        ftestReadString( argv[ optind++ ], $1);
-    } else
-	ftestError( CommandlineError,
-                    "expected '_stripTWS(`_ftestInType_$1')` at position %d in commandline\n",
-                    optind );'',
-  `$#', `2',
-  ``if ( argv[ optind ] ) {
-        ftestArgGiven$1= true;
-        ftestReadString( argv[ optind++ ], $1 );
-    } else
-	$1 = '_qstripTWS(`$2')`;'',
-  ``if ( ftestSearchTaggedArg( argc, argv, optind, $3) ) {
-        ftestArgGiven$1 = true;
-        ftestReadString( argv[ optind++ ], $1 );
-    } else
-	$1 = '_qstripTWS(`$2')`;'')
-    `#line' __line__ "__file__"
-
-dnl')
-
-#
-# ftestArgGiven() - check whether an argument was given.
-#
-# $1: name of input variable
-#
-define(`ftestArgGiven', `dnl
-`ftestArgGiven'_qstripTWS(`$1')')
-
-#
-# ftestRun() - run test.
-#
-# $1: code to execute
-#
-# Do not forget to terminate the code to execute with a
-# semicolon!
-#
-define(`ftestRun', `dnl
-`#line' __line__ "__file__"
-    `// check for superfluous command line arguments
-    if ( argv[ optind ] )
-	ftestError( CommandlineError, "superfluous argument `%s' at position %d",
-                    argv[ optind ], optind );
-
-    // save random generator seed now since the algorithm
-    // most likely is going to change it
-    ftestWriteSeed();
-
-    if ( ftestAlarm )
-	alarm( ftestAlarm );		// set alarm
-    TIMING_START(ftestTimer);
-    while ( ftestCircle > 0 ) {
-	$1
-	ftestCircle--;
-    };
-    TIMING_END(ftestTimer);
-    if ( ftestAlarm )			// reset alarm
-	alarm( 0 )'')
-
-#
-# ftestCheck() - run check.
-#
-# $1: check function (with parameters) to call
-#
-define(`ftestCheck', `dnl
-`#line' __line__ "__file__"
-    `if ( ftestCheckFlag )
-	check = '_qstripTWS(`$1')')
-
-#
-# ftestOuput() - print results.
-#
-# Expands to code to print timer and check.  Then, for each
-# argument pair `resultName, result', expands to print this
-# pair.
-#
-
-# internal auxiliary function
-define(`_ftestOutput', `dnl
-ifelse(
-  `$#', `0', ,
-  `$#', `1', ,
-``;
-    ftestPrintResult( $1, '_qstripTWS(`$2')` )'_ftestOutput(shift(shift($@)))')')
-
-define(`ftestOutput', `dnl
-`#line' __line__ "__file__"
-    `ftestPrintTimer( timing_ftestTimer_time );
-    ftestPrintCheck( check )'_ftestOutput($@)')
-
-dnl switch on output again
-divert`'dnl
diff --git a/factory/ftest/gcd.m4 b/factory/ftest/gcd.m4
deleted file mode 100644
index 0962bcd..0000000
--- a/factory/ftest/gcd.m4
+++ /dev/null
@@ -1,121 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: gcd.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( gcd, `"
-Usage: gcd [<options>] [<envSpec>] <f> <g> [<realResult>]
-  calculates greatest common divisor of canonical forms <f> and
-  <g>.  If the gcd of <f> and <g> is already known, the optional
-  canonical form <realResult> may be used to check the result of
-  the gcd computation.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ static CanonicalForm normalizeGcd ( const CanonicalForm & f )
-//{{{ docu
-//
-// normalizeGcd() - normalize result of gcd computation for
-//   testing.
-//
-// Unit normalization is done in case of a field, sign
-// normalization otherwise.
-//
-//}}}
-static CanonicalForm
-normalizeGcd ( const CanonicalForm & f )
-{
-    if ( getCharacteristic() > 0 || isOn( SW_RATIONAL ) )
-	return f/Lc( f );
-    else
-	return abs( f );
-}
-//}}}
-
-//{{{ ftestStatusT gcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-//{{{ docu
-//
-// gcdCheck() - check result of gcd().
-//
-//}}}
-ftestStatusT
-gcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-{
-    // if realResult is given, use it to compare with result
-    if ( ! realResult.isZero() )
-	if ( normalizeGcd( realResult ) == normalizeGcd( result ) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result and real result differ\n" );
-	    return Failed;
-	}
-
-    if ( result.isZero() )
-	if ( f.isZero() && g.isZero() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is zero but f and g are not\n" );
-	    return Failed;
-	}
-
-    if ( ! divides( result, f ) || ! divides( result, g ) ) {
-	ftestError( CheckError, "result is not a common divisor\n" );
-	return Failed;
-    } else if ( ! gcd( f/result, g/result ).isOne() ) {
-	ftestError( CheckError, "result is not greatest common divisor\n" );
-	return Failed;
-    } else
-	return Passed;
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( CanonicalForm, realResult );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( realResult, 0 );
-
-    // do the test!
-    ftestRun( result = gcd( f, g ); );
-
-    // do the check
-    ftestCheck( gcdCheck( f, g, result, realResult ) );
-
-    // print results
-    ftestOutput( "gcd(f, g)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/gcd.ntl.m4 b/factory/ftest/gcd.ntl.m4
deleted file mode 100644
index ca22088..0000000
--- a/factory/ftest/gcd.ntl.m4
+++ /dev/null
@@ -1,159 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: gcd.ntl.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( gcd.ntl, `"
-Usage: gcd.ntl [<options>] [<envSpec>] <f> <g> [<realResult>]
-  calculates greatest common divisor of canonical forms <f> and
-  <g>.  If the gcd of <f> and <g> is already known, the optional
-  canonical form <realResult> may be used to check the result of
-  the gcd computation.
-  The gcd is calculated using the NTL library.  Thus, <f> and <g>
-  have to be univariate polynomials over some finite field or
-  over the integers.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-#include "ntl_util.h"
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - functions.
-//
-
-//{{{ static CanonicalForm normalizeGcd ( const CanonicalForm & f )
-//{{{ docu
-//
-// normalizeGcd() - normalize result of gcd computation for
-//   testing.
-//
-// Unit normalization is done in case of a field, sign
-// normalization otherwise.
-//
-//}}}
-static CanonicalForm
-normalizeGcd ( const CanonicalForm & f )
-{
-    if ( getCharacteristic() > 0 || isOn( SW_RATIONAL ) )
-	return f/Lc( f );
-    else
-	return abs( f );
-}
-//}}}
-
-//{{{ ftestStatusT gcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-//{{{ docu
-//
-// gcdCheck() - check result of gcd().
-//
-//}}}
-ftestStatusT
-gcdCheck ( const CanonicalForm & f, const CanonicalForm & g, const CanonicalForm & result, const CanonicalForm & realResult )
-{
-    // if realResult is given, use it to compare with result
-    if ( ! realResult.isZero() )
-	if ( normalizeGcd( realResult ) == normalizeGcd( result ) )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result and real result differ\n" );
-	    return Failed;
-	}
-
-    if ( result.isZero() )
-	if ( f.isZero() && g.isZero() )
-	    return Passed;
-	else {
-	    ftestError( CheckError, "result is zero but f and g are not\n" );
-	    return Failed;
-	}
-
-    // compare with Factory's gcd
-    CanonicalForm factoryResult = gcd( f, g );
-    if ( normalizeGcd( factoryResult ) == normalizeGcd( result ) )
-	return Passed;
-    else {
-	ftestError( CheckError, "result and Factory's result differ\n" );
-	return Failed;
-    }
-
-    if ( ! divides( result, f ) || ! divides( result, g ) ) {
-	ftestError( CheckError, "result is not a common divisor\n" );
-	return Failed;
-    } else if ( ! gcd( f/result, g/result ).isOne() ) {
-	ftestError( CheckError, "result is not greatest common divisor\n" );
-	return Failed;
-    } else
-	return Passed;
-}
-//}}}
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( CanonicalForm, realResult );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( realResult, 0 );
-
-    // prepare NTL
-    setCharacteristicNTL( getCharacteristic() );
-
-    // run gcd from NTL
-    if ( getCharacteristic() > 0 ) {
-	zz_pX fNTL;
-	zz_pX gNTL;
-	zz_pX resultNTL;
-	fNTL << f;
-	gNTL << g;
-
-	// do the test!
-	ftestRun( GCD( resultNTL, fNTL, gNTL ); );
-
-	result << resultNTL;
-    } else {
-	ZZX fNTL;
-	ZZX gNTL;
-	ZZX resultNTL;
-	fNTL << f;
-	gNTL << g;
-
-	// do the test!
-	ftestRun( GCD( resultNTL, fNTL, gNTL ); );
-
-	result << resultNTL;
-    }
-
-    // do the check
-    ftestCheck( gcdCheck( f, g, result, realResult ) );
-
-    // print results
-    ftestOutput( "gcd(f, g)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/insert.m4 b/factory/ftest/insert.m4
deleted file mode 100644
index a1d293e..0000000
--- a/factory/ftest/insert.m4
+++ /dev/null
@@ -1,64 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: insert.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( insert, `"
-Usage: insert [<options>] [<envSpec>] <f> <g> [<v>]
-  inserts canonical form <g> for variable <v> in canonical form
-  <f>.  <v> defaults to main variable of <f> if not explicitely
-  specified.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( Variable, v );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( v, f.mvar() );
-
-    // do the test!
-    if ( ftestArgGiven( v ) ) {
-	ftestRun( result = f( g, v ); );
-    } else {
-	ftestRun( result = f( g ); );
-    }
-
-    // print results
-    if ( ftestArgGiven( v ) ) {
-	ftestOutput( "f(g, v)", result );
-    } else {
-	ftestOutput( "f(g)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/norm.m4 b/factory/ftest/norm.m4
deleted file mode 100644
index a864749..0000000
--- a/factory/ftest/norm.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: norm.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( norm, `"
-Usage: norm [<options>] [<envSpec>] <f> [<euclideanFlag>]
-  returns maximum norm of canonical form <f>.  If integer
-  <euclideanFlag> is specified and non-zero, the euclidean
-  norm of <f> is returned instead.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( int, euclideanFlag );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( euclideanFlag, 0 );
-
-    // do the test!
-    if ( euclideanFlag ) {
-	ftestRun( result = euclideanNorm( f ); );
-    } else {
-	ftestRun( result = maxNorm( f ); );
-    }
-
-    // print results
-    if ( euclideanFlag ) {
-	ftestOutput( "euclideanNorm(f)", result );
-    } else {
-	ftestOutput( "maxNorm(f)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/ntl_util.cc b/factory/ftest/ntl_util.cc
deleted file mode 100644
index 6aceb7f..0000000
--- a/factory/ftest/ntl_util.cc
+++ /dev/null
@@ -1,242 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ntl_util.cc 12231 2009-11-02 10:12:22Z hannes $ */
-
-//{{{ docu
-//
-// ntl_util.cc - some utilities to connect Factory and NTL.
-//
-// To initialize NTL, its characteristic has to bet set using
-// `setCharacteristicNTL()'.
-//
-// Univariate polynomials and elements from base domains are
-// mapped between Factory and NTL using appropriate `operator
-// <<()'.
-//
-// Conversion routines which map to Factory polynomials return
-// the resulting polynomial in `Variable( 1 )'.
-//
-//}}}
-
-#include <strstream.h>
-
-#include <assert.h>
-
-#include "ntl_util.h"
-
-// size of chunks for API conversion.  For safety's sake we do
-// not use the full size of a long integer.
-const int limbSize = 1 << 31;
-
-//{{{ void operator << ( ... ) // Z
-//{{{ docu
-//
-// operator <<() - convert elements from the integers.
-//
-//}}}
-static void
-internalConvert ( ZZ & nNTL, const CanonicalForm & nCF )
-{
-    if ( nCF.isZero() )
-	nNTL = 0;
-    else {
-	CanonicalForm q, r;
-	divrem( nCF, limbSize, q, r );
-	internalConvert( nNTL, q );
-	nNTL *= limbSize;
-	nNTL += r.intval();
-    }
-}
-
-void
-operator << ( ZZ & nNTL, const CanonicalForm & nCF )
-{
-    ASSERT( nCF.inZ(), "type error: integer expected" );
-
-    internalConvert( nNTL, abs( nCF ) );
-    nNTL *= sign( nCF );
-}
-
-
-static void
-internalConvert ( CanonicalForm & nCF, const ZZ & nNTL )
-{
-    if ( IsZero( nNTL ) )
-	nCF = 0;
-    else {
-	ZZ q, r;
-	DivRem( q, r, nNTL, limbSize );
-	internalConvert( nCF, q );
-	int rInt;
-	rInt << r;
-	nCF *= limbSize;
-	nCF += rInt;
-    }
-}
-
-void
-operator << ( CanonicalForm & nCF, const ZZ & nNTL )
-{
-    ZZ absNNTL;
-    abs( absNNTL, nNTL );
-    internalConvert( nCF, absNNTL );
-    nCF *= sign( nNTL );
-}
-//}}}
-
-//{{{ void operator << ( ... ) // Z[x]
-//{{{ docu
-//
-// operator <<() - convert elements from univariate polynomials
-//   over the integers.
-//
-//}}}
-void
-operator << ( ZZX & fNTL, const CanonicalForm & fCF )
-{
-    ASSERT( fCF.lc().inZ() && (fCF.inBaseDomain() || fCF.isUnivariate()),
-	    "type error: element from FF(p)[x] expected" );
-
-    int i = fCF.degree();
-    if ( i == -1 ) i = 0;			// beware of zero
-						// polynomial !!
-
-    // clean up old polynomial and reallocate sufficient memory to store
-    // new one
-    fNTL.kill();
-    fNTL.SetMaxLength( i+1 );
-
-    // fill polynomial with coefficients from fCF
-    for ( CFIterator I = fCF; I.hasTerms(); I++ )
-    {
-	ZZ coeffNTL( 0 );
-	int exp = I.exp();
-
-	// fill gaps with zeroes
-	while ( i != exp ) {
-	    SetCoeff( fNTL, i, coeffNTL );
-	    i--;
-	}
-
-	// map coefficient
-	coeffNTL << I.coeff();
-	SetCoeff( fNTL, i, coeffNTL );
-	i--;
-    }
-    // fill trailing gaps
-    while ( i >= 0 ) {
-	ZZ coeffNTL( 0 );
-	SetCoeff( fNTL, i, coeffNTL ); i--;
-    }
-
-}
-
-void
-operator << ( CanonicalForm & nCF, const ZZX & fNTL )
-{
-    nCF = 0;
-
-    for ( int i = deg( fNTL ); i >= 0; i-- ) {
-	ZZ coeffNTL;
-	CanonicalForm coeffCF;
-
-	GetCoeff( coeffNTL, fNTL, i );
-	coeffCF << coeffNTL;
-	nCF += coeffCF * power( Variable( 1 ), i );
-    }
-}
-//}}}
-
-//{{{ void operator << ( ... ) // FF(p)
-//{{{ docu
-//
-// operator <<() - convert elements from FF(p).
-//
-//}}}
-void
-operator << ( zz_p & nNTL, const CanonicalForm & nCF )
-{
-    ASSERT( nCF.inFF(), "type error: element from FF(p) expected" );
-    nNTL = zz_p( nCF.intval() );
-}
-
-void
-operator << ( CanonicalForm & nCF, const zz_p & nNTL )
-{
-    nCF = CanonicalForm( rep( nNTL ) );
-}
-//}}}
-
-//{{{ void operator << ( ... ) // FF(p)[x]
-//{{{ docu
-//
-// operator <<() - convert elements from FF(p)[x].
-//
-//}}}
-void
-operator << ( zz_pX & fNTL, const CanonicalForm & fCF )
-{
-    ASSERT( fCF.lc().inFF() && (fCF.inBaseDomain() || fCF.isUnivariate()),
-	    "type error: element from FF(p)[x] expected" );
-
-    int i = fCF.degree();
-    if ( i == -1 ) i = 0;			// beware of zero
-						// polynomial !!
-
-    // clean up old polynomial and reallocate sufficient memory to store
-    // new one
-    fNTL.kill();
-    fNTL.SetMaxLength( i+1 );
-
-    // fill polynomial with coefficients from fCF
-    for ( CFIterator I = fCF; I.hasTerms(); I++ )
-    {
-	zz_p coeffNTL( 0 );
-	int exp = I.exp();
-
-	// fill gaps with zeroes
-	while ( i != exp ) {
-	    SetCoeff( fNTL, i, coeffNTL );
-	    i--;
-	}
-
-	// map coefficient
-	coeffNTL << I.coeff();
-	SetCoeff( fNTL, i, coeffNTL );
-	i--;
-    }
-    // fill trailing gaps
-    while ( i >= 0 ) {
-	zz_p coeffNTL( 0 );
-	SetCoeff( fNTL, i, coeffNTL ); i--;
-    }
-
-}
-
-void
-operator << ( CanonicalForm & nCF, const zz_pX & fNTL )
-{
-    nCF = 0;
-
-    for ( int i = deg( fNTL ); i >= 0; i-- ) {
-	zz_p coeffNTL;
-	CanonicalForm coeffCF;
-
-	GetCoeff( coeffNTL, fNTL, i );
-	coeffCF << coeffNTL;
-	nCF += coeffCF * power( Variable( 1 ), i );
-    }
-}
-//}}}
-
-//{{{ void setCharacteristicNTL ( int p )
-//{{{ docu
-//
-// setCharacteristicNTL() - set NTL's characteristic to `p'.
-//
-//}}}
-void
-setCharacteristicNTL ( int p )
-{
-    if ( p > 0 ) zz_pInit( p );
-}
-//}}}
diff --git a/factory/ftest/ntl_util.h b/factory/ftest/ntl_util.h
deleted file mode 100644
index 835c5be..0000000
--- a/factory/ftest/ntl_util.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: ntl_util.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_NTL_UTIL_H
-#define INCL_NTL_UTIL_H
-
-//{{{ docu
-//
-// ntl_util.h - header to ntl_util.cc.
-//
-//}}}
-
-#include <factory.h>
-
-#include <ZZ.h>
-#include <ZZ_p.h>
-#include <ZZX.h>
-#include <zz_pX.h>
-
-void operator << ( ZZ &, const CanonicalForm & );
-void operator << ( CanonicalForm &, const ZZ & );
-void operator << ( ZZX &, const CanonicalForm & );
-void operator << ( CanonicalForm &, const ZZX & );
-void operator << ( zz_p &, const CanonicalForm & );
-void operator << ( CanonicalForm &, const zz_p & );
-void operator << ( zz_pX &, const CanonicalForm & );
-void operator << ( CanonicalForm &, const zz_pX & );
-
-void setCharacteristicNTL ( int );
-
-#endif /* ! INCL_NTL_UTIL_H */
diff --git a/factory/ftest/resultant.m4 b/factory/ftest/resultant.m4
deleted file mode 100644
index a3dc39a..0000000
--- a/factory/ftest/resultant.m4
+++ /dev/null
@@ -1,56 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: resultant.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( resultant, `"
-Usage: resultant [<options>] [<envSpec>] <f> <g> <x>
-  calculates resultant of canonical forms f and g with respect to
-  variable x.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( CanonicalForm, g );
-    ftestInVar( Variable, x );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( g );
-    ftestGetInVar( x );
-
-    // do the test!
-    ftestRun(
-	result = resultant( f, g, x ); );
-
-    // print results
-    ftestOutput( "resultant(f, g, x)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/revert.m4 b/factory/ftest/revert.m4
deleted file mode 100644
index 412aa39..0000000
--- a/factory/ftest/revert.m4
+++ /dev/null
@@ -1,49 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: revert.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( revert, `"
-Usage: revert [<options>] [<envSpec>] <f>
-  reverts the canonical form <f>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CanonicalForm, result );
-    ftestInVar( CanonicalForm, f );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-
-    // do the test!
-    ftestRun( result = revert( f ); );
-
-    ftestOutput( "revert(f)", result );
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/size.m4 b/factory/ftest/size.m4
deleted file mode 100644
index 4485652..0000000
--- a/factory/ftest/size.m4
+++ /dev/null
@@ -1,62 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: size.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( size, `"
-Usage: size [<options>] [<envSpec>] <f> [<x>]
-  calculates number of monomials of canonical form <f>.  If
-  variable <x> is specified, calculates number of monomials of
-  <f> with level higher or equal than level of <x>.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( int, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( Variable, x );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( x, Variable() );
-
-    // do the test!
-    if ( ftestArgGiven( x ) ) {
-	ftestRun( result = size( f, x ); );
-    } else {
-	ftestRun( result = size( f ); );
-    }
-
-    // print results
-    if ( ftestArgGiven( x ) ) {
-	ftestOutput( "size(f, x)", result );
-    } else {
-	ftestOutput( "size(f)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/sqrfree.m4 b/factory/ftest/sqrfree.m4
deleted file mode 100644
index adfe6b4..0000000
--- a/factory/ftest/sqrfree.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: sqrfree.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( sqrfree, `"
-Usage: sqrfree [<options>] [<envSpec>] [sort=<flag>] <f>
-  computes squarefree decomposition of canonical form <f>.
-  If optional <flag> is set, squarefree factors are returned
-  sorted by multiplicity.
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( CFFList, result );
-    ftestInVar( bool, flag );
-    ftestInVar( CanonicalForm, f );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( flag, false, "sort" );
-    ftestGetInVar( f );
-
-    // do the test!
-    ftestRun( result = sqrFree( f, flag ); );
-
-    // print results
-    if ( ftestArgGiven( flag ) && flag ) {
-	ftestOutput( "sqrfree(f)", result );
-    } else {
-	ftestOutput( "sqrfree(f) (unsorted)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/ftest/totaldegree.m4 b/factory/ftest/totaldegree.m4
deleted file mode 100644
index 9519bc0..0000000
--- a/factory/ftest/totaldegree.m4
+++ /dev/null
@@ -1,65 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: totaldegree.m4 12231 2009-11-02 10:12:22Z hannes $ */
-
-ftestSetNameOfGame( totaldegree, `"
-Usage: totaldegree [<options>] [<envSpec>] <f> [<x> <y>]
-  calculates total degree of canonical form <f>.  If the
-  variables <x> and <y> are specified, calculates total
-  degree of <f> with respect to the polynomial variables
-  between <x> and <y> (inclusively).
-"'`' )
-
-//{{{ docu
-//
-// ftestAlgorithm.m4 - ftestAlgorithm test program.
-//
-// To create ftestAlgorithm.cc, run m4 using the ftest_util.m4 library in
-// the following way:
-//
-// m4 ftest_util.m4 ftestAlgorithm.m4 > ftestAlgorithm.cc
-//
-//}}}
-
-ftestPreprocInit();
-
-ftestGlobalInit();
-
-//
-// - main program.
-//
-int
-main ( int argc, char ** argv )
-{
-    // initialization
-    ftestMainInit();
-
-    // declare input and output variables
-    ftestOutVar( int, result );
-    ftestInVar( CanonicalForm, f );
-    ftestInVar( Variable, x );
-    ftestInVar( Variable, y );
-
-    // process argument list and set environment
-    ftestGetOpts();
-    ftestGetEnv();
-    ftestGetInVar( f );
-    ftestGetInVar( x, Variable() );
-    ftestGetInVar( y, Variable() );
-
-    // do the test!
-    if ( ftestArgGiven( x ) ) {
-	ftestRun( result = totaldegree( f, x, y ); );
-    } else {
-	ftestRun( result = totaldegree( f ); );
-    }
-
-    // print results
-    if ( ftestArgGiven( x ) ) {
-	ftestOutput( "totaldegree(f, x, y)", result );
-    } else {
-	ftestOutput( "totaldegree(f)", result );
-    }
-
-    // clean up
-    ftestMainExit();
-}
diff --git a/factory/lgs.cc b/factory/lgs.cc
deleted file mode 100644
index 24a62a9..0000000
--- a/factory/lgs.cc
+++ /dev/null
@@ -1,309 +0,0 @@
-/* ===================================================================
-    Dateiname:          lgs.cc
-   =================================================================== */
-
-#include "lgs.h"
-#include "bifacConfig.h"
-
-#ifdef HAVE_BIFAC
-
-//--<>---------------------------------
-LGS::LGS( int r, int c, bool inv )// KONSTRUKTOR
-//--<>---------------------------------
-{
-  INVERSE = inv;
-
-  max_columns = c;
-  max_rows    = (r>c) ? c : r ;
-
-  if( INVERSE )
-  {
-    c *=2;
-  }
-
-  CFMatrix  AA(max_rows, c);
-  CFMatrix  bb(max_rows, 1);
-  A=AA;
-  b=bb;
-  pivot = new int [max_columns+1]; // We start with index 1 (easier)
-  for( int i=0; i<=max_columns; i++)    pivot[i]=0;
-  now_row = 1;   // We start counting in the first row
-}
-
-
-//--<>---------------------------------
-LGS::~LGS( void )// DESTRUKTOR
-//--<>---------------------------------
-{
-  delete[] pivot;
-}
-
-//--<>---------------------------------
-void LGS::reset(void)
-//--<>---------------------------------
-{ // Clear the matrix for a new computation
-  now_row=1;
-  for( int i=0; i<=max_columns; i++)
-    pivot[i]=0;
-}
-
-//--<>---------------------------------
-bool LGS::new_row( const CFMatrix Z, const CanonicalForm bb)
-//--<>---------------------------------
-{ // Insert a new row
-  ASSERT ( (1 <= now_row && now_row <=max_rows), "wrong number of rows => Matrix has max. rank");
-  int i;
-
-//    if (INVERSE)
-//    cout << "* Integriere Zeile "<<now_row << " (max " <<max_rows<<" x "
-//         <<  max_columns << ")\n"
-//         << "Z = " << Z << "\nb = " << bb << endl << flush;
-
-
-
-
-  // === Insert a new row ===
-  for(i=1; i<=max_columns; i++)
-    A(now_row, i) = Z(1,i);
-  b(now_row, 1) = bb;
-
-
-  //  cout << "* reduzierte Matrix (vor lin_dep) " << A << endl;
-  // === check linear dependency ===
-  if ( ! lin_dep() )
-    now_row++;
-  else
-    return(false);
-
-  // === Reduce the previous rows ===
-  for(i=1; i<now_row-1; i++)
-    reduce(now_row-1,i );
-
-
-  //  cout << "\n* Zeile Z =" << Z << " ist integriert!\n" << A << flush;
-
-//    if( INVERSE ) cout << A;
-//  cout << "* Verlasse new_row!\n" << "* Z = " << Z << endl << flush;
-  return(true); // row was linear independent
-}
-
-
-//--<>---------------------------------
-bool LGS::lin_dep( void )
-//--<>---------------------------------
-{ // check if new row is linear dependent of the former ones
-
-  int i;
-
-  // === Reduce the actual row ===
-  for(i=1; i<now_row; i++)
-    reduce(i, now_row);
-
-//  cerr << "* Bin noch in [lin_dep]\n" << flush;
-
-  // === Quest for a pivot ===
-  for ( i=1; i<=max_columns; i++)
-    if( A(now_row,i) != 0 )
-    {
-      pivot[now_row] = i;
-      break;//      i = max_columns;
-
-    }
-//  cout << "* pivot["<<now_row<<"] = " << pivot[now_row] << endl << flush;
-
-  // === Is the reduced row (0,...,0)? ====
-  if( pivot[now_row] == 0 )
-  {
-    if( INVERSE )
-      for ( i=1; i<=max_columns; i++)
-        A(now_row, max_columns+i) = 0;
-    return (true);
-  }
-  // === The row is linear independent ====
-//  cout << "* reduzierte Matrix (1) ist " << A << endl;
-  if( INVERSE )   // Identity matrix
-    A(now_row, now_row+max_columns) = 1;
-//  cout << "* reduzierte Matrix (2) ist " << A << endl;
-  return(false);
-}
-
-
-//--<>---------------------------------
-void LGS::reduce(int fix, int row)
-//--<>---------------------------------
-{ // Reduce the `row� by means of row `fix�
-
-  if( A(row, pivot[fix]) == 0 ) return;
-
-  CanonicalForm mul =  A(row, pivot[fix]) / A(fix, pivot[fix]);
-
-//    cout << "* Multiplikationsfaktor ist " << mul << endl;
-//    cout << "* Aktuelle Matrix ist " << A
-//         << "\n  b = " << b << endl;
-//    cout << "max_columns = "<< max_columns << endl;
-//    cout << "* now_row = " << now_row <<", row=" << row << endl << flush;
-//    cout << "* Pivot[" << row << "] = " << pivot[row] << endl << flush;
-//    cout << "* Pivot[" << fix << "] = " << pivot[fix] << endl << flush;
-
-
-  for (int i=1; i<=max_columns; i++)
-    if( A(fix,i) != 0 )
-      A(row, i) -= mul* A(fix,i);
-  if( b(fix,1) != 0 )
-    b(row,1) -= mul * b(fix,1);
-
-
-  if ( INVERSE )
-    for (int i=max_columns+1; i<=2*max_columns; i++)
-      if( A(fix,i) != 0 )
-        A(row, i) -= (mul* A(fix,i));
-//      A(row,i) = 777;
-
-//   cout << "* reduzierte Matrix ist " << A << endl;
-//    cout << "* Verlasse [reduce]\n" << flush;
-
-}
-///////////////////////////////////////////////////////
-// The Matrix (A | I) has maximal rank and
-// the �A� part has to be normalized only
-//--<>---------------------------------
-void LGS::inverse( CFMatrix & I )
-//--<>---------------------------------
-{
-  int i,j;
-  CanonicalForm mul;
-
-//  cout << "* PR�-Invers:" << A << endl;
-  for(i=1; i<=max_rows; i++)
-  {
-    for( j=max_columns+1; j<=2*max_columns; j++)
-      if( A(i,j)!=0 )
-        A(i,j) /= A( i, pivot[i]);
-    A( i, pivot[i]) = 1;
-  }
-// cout << "* Inverse Matrix ist " << A << endl;
-
-  for(i=1; i<=max_rows; i++)
-  {
-//    cout << "pivot["<<i<<"] = " << pivot[i]<< endl;
-    for(j=1; j<=max_columns; j++)
-      I(pivot[i],j) = A(i, j+max_columns);
-  }
-}
-//--<>---------------------------------
-int LGS::rank(void)
-//--<>---------------------------------
-{ // Return the current rank of the matrix
-  return( now_row-1);
-}
-
-
-//--<>---------------------------------
-void LGS::print(void)
-//--<>---------------------------------
-{ // Return the current rank of the matrix
-#ifndef NOSTREAMIO
-  cout << "A = " << A << "\nb = " << b << endl;
-#endif
-}
-
-
-
-
-//--<>---------------------------------
-int LGS::corank(void)
-//--<>---------------------------------
-{ // Return the current rank of the matrix
-  return(  ( (max_rows < max_columns ) ? max_rows : max_columns )-now_row+1 );
-}
-
-//--<>---------------------------------
-int LGS::ErgCol(int row, int basis[])
-//--<>---------------------------------
-{
-  bool state = false;
-
-  for( int i=1; i<=max_columns; i++)
-  {
-    if( A(row,i) != 0 )
-    {
-      state = true;
-      for( int j=1; j<=basis[0]; j++)
-        if( i==basis[j] )
-          state = false;
-      if( state == true )
-        return (i);
-    }
-  }
-  // A row contains only pivot entry/-ies
-  for( int j=1; j<=basis[0]; j++)
-    if(  A(row, basis[j]) != 0 )
-      return( -basis[j] );
-
-
-  AUSGABE_LGS("Zeile ist " << row << endl);
-  AUSGABE_ERR("* Mistake in [lgs.cc]! Impossible result. Aborting!\n");
-  exit (1);
-}
-
-
-//--<>---------------------------------
-CFMatrix LGS::GetKernelBasis(void)
-//--<>---------------------------------
-{
-  int i,z;
-  int dim = corank();
-
-  bool* tmp_vec = new bool[max_columns+1];
-  int*  basis   = new int [dim+1];
-  basis[0]=1;
-  CFMatrix erg  (dim, max_columns); // Each row is one solution
-
-  // === Searching free parameters ===
-  for( i=1; i<=max_rows; i++)
-    tmp_vec[i]=false;
-  for( i=1; i<now_row; i++)
-    if( pivot[i] != 0 )
-      tmp_vec[pivot[i]] = true;
-
-  for( i=1; i<=max_columns; i++)
-    if(tmp_vec[i] == false)
-    {
-      basis[basis[0]]=i;
-      basis[0]++;
-    }
-  ASSERT(basis[0]-1==dim, "Wrong dimensions");
-
-
-//    cout << "* Freie Parameter sind:";
-//    for ( int k=1; k<basis[0]; k++) cout << basis[k] << ", ";
-//    cout << endl;
-
-// === Creating the basis vectors ===
-  for(z=1; z<now_row; z++)
-    for(i=1; i<=dim; i++)
-    {
-      erg(i, basis[i]) = 1;
-      erg(i, pivot[z]) = -(A(z, basis[i]) / A(z,pivot[z]));
-    }
-
-//  cout << "Kernbasis ist " << erg;
-  return erg;
-}
-
-//--<>---------------------------------
-CFMatrix LGS::GetSolutionVector(void)
-//--<>---------------------------------
-{ // Ax=b has exactly one solution vector x
-  int z;
-  CFMatrix erg  (1, max_columns);
-
-  // === Creating the basis vectors ===
-  for(z=1; z<=max_columns; z++)
-  {
-    erg(1,pivot[z])  = b(z,1);         // Vector b
-    erg(1,pivot[z]) /= A(z,pivot[z]);
-  }
-  return erg;
-}
-#endif
diff --git a/factory/lgs.h b/factory/lgs.h
deleted file mode 100644
index c67d850..0000000
--- a/factory/lgs.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* ======================================================================
-    Dateiname:          lgs.h
-
-    Beschreibung: Enth�lt alle Definition und Funktionen zum
-                  Umgang mit dem linearen Gleichungssystemen.
-   =================================================================== */
-
-#ifndef lgs__H
-#define lgs__H
-
-
-
-#include "cf_factory.h"
-#ifdef HAVE_BIFAC
-
-
-class LGS
-{
-////////////////////////////////////////////////////////////////
-  public:
-////////////////////////////////////////////////////////////////
-
-  // === KONST-/ DESTRUKTOREN ====
-  LGS         (int rows, int columns, bool inverse =false );  // Konstruktor
-  virtual ~LGS( void );  // DESTRUKTOR
-
-  // === Funktionen =======
-  bool   new_row( const CFMatrix Z, const CanonicalForm b =0);
-
-  int       rank( void );
-  int       corank( void );
-  CFMatrix  GetSolutionVector( void );
-  CFMatrix  GetKernelBasis( void );
-  void      reset(void);
-  void      inverse( CFMatrix& I);
-  void      print(void);
-
-
-////////////////////////////////////////////////////////////////
- private:
-////////////////////////////////////////////////////////////////
-
-  // === Funktionen =======
-  bool     lin_dep(void);
-  void     reduce(int fix, int row);
-  int      ErgCol(int row, int basis[]);
-
-  // === Variable =======
-  CFMatrix A, b;       // Matrices of the linear equation system
-
-  bool KERN;        // compute the kernel
-  bool INVERSE;     // compute at once the inverse matrix
-  int max_columns;  // F�r so viele Spalten wurde Platz alloziiert.
-  int max_rows;     // F�r so viele Zeilen wurde Platz alloziiert.
-  int now_row;      // Soviele der Zeilen wurden bisher benutzt.
-  int* pivot;      // pivot column of the i-te row
-};
-
-#endif
-// =============== Ende der Datei 'lgs.h' ============================
-
-#endif
diff --git a/factory/sm_sparsemod.cc b/factory/sm_sparsemod.cc
deleted file mode 100644
index e10162d..0000000
--- a/factory/sm_sparsemod.cc
+++ /dev/null
@@ -1,629 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: sm_sparsemod.cc 14267 2011-06-08 13:20:17Z mlee $ */
-
-//{{{ docu
-//
-// sm_sparsemod.cc - zippel's sparse modular gcd.
-//
-// Contributed by Marion Bruder <bruder at math.uni-sb.de>.
-//
-// Used by: cf_gcf.cc
-//
-//}}}
-
-#include <config.h>
-
-#include "assert.h"
-#include "debug.h"
-
-#include "canonicalform.h"
-#include "cf_map.h"
-#include "cf_reval.h"
-#include "cf_irred.h"
-#include "cf_iter.h"
-#include "cf_primes.h"
-#include "cf_random.h"
-#include "fac_util.h"
-#include "cf_algorithm.h"
-#include "sm_util.h"
-#include "sm_sparsemod.h"
-#include "templates/ftmpl_array.h"
-#include "templates/ftmpl_functions.h"
-
-static CanonicalForm
-smodgcd( const CanonicalForm & u, const CanonicalForm & v, const CanonicalForm & lcggt, const REvaluation & alpha, CFRandom & gen, int CHAR, const Variable & extension )
-{
-  DEBOUTLN( cerr, " ALPHA = " << alpha );
-
-  DEBOUTLN( cerr, " u = " << u );
-  DEBOUTLN( cerr, " v = " << v );
-
-  //    diverse Fallunterscheidungen  //
-
-  if ( u.isZero() )
-    return v;
-  else if ( v.isZero() )
-    return u;
-  else if ( u.inBaseDomain() )
-    if ( v.inBaseDomain() )
-      return gcd( u, v );
-    else
-      return gcd( u, icontent( u ) );
-  else if ( v.inBaseDomain() )
-    return gcd( icontent( u ), v);
-  else if ( u.isUnivariate() )
-  {
-    if ( v.isUnivariate() )
-      return gcd( u, v );
-    else
-      return gcd( v, u );
-  }
-
-  //   u und v Polynome in levU - Variablen x1, ..., xlevU
-  //   mit den gleichen Variablen, welches in sparsemod gesichert wurde
-
-  int levU = level( u );
-  CFArray G( 1, levU );
-  Variable x( 1 );
-  CanonicalForm alphau = alpha( u, 2, levU );
-  CanonicalForm alphav = alpha( v, 2, levU );
-
-  G[1] = gcd( alphau, alphav );       // univariater gcd berechnen in x1
-
-  DEBOUTLN( cerr, " G[1] ohne lc = " << G[1] );
-  //  Leitkoeffizienten auf univariaten gcd aufsetzen   //
-
-  if( alpha(lcggt) != 0 && degree(G[1]) != 0 )
-  {
-    //G[1] =( alpha( lcggt ))*( ( 1/lc( G[1] ) ) * G[1] );
-    G[1] =( alpha( lcggt ))*( ( 1/Leitkoeffizient( G[1] ) ) * G[1] );
-  }
-
-  if ( degree( G[1]) < 0 )
-  {
-   return 1 ;
-  }
-
-
-  if ( degree( G[1] ) == 0 )
-  {
-    // zwei Auswertungen um sicherzugehen, dass gcd Eins ist!
-    return 1;
-  }
-
-  CFIterator J = G[ 1 ];
-  CFArray g( 1, degree( G[ 1 ]) + 1 );
-  int * emma = new int[ degree( G[1] ) + 2  ];
-  int s, m, i = 1;
-
-  //  g[i] enthaelt die momentan berechneten Monome bzgl x^emma[i] //
-
-  while ( J.hasTerms() )
-  {
-    g[ i ] = J.coeff() ;
-    emma[ i ] = J.exp();
-    J++;
-    i++;
-  }
-
-  m = i-1;           /// Anzahl der Terme bzgl x1
-  int * n = new int[ m+1  ];
-  CFArray U( 2, levU ), V( 2, levU );
-
-  int  N, d   ;
-  int k, j, zip ;
-
-  // fuer jede Variabel interpolieren, um g[s] zu erhalten  //
-
-  DEBOUTLN( cerr, " unigcd mit alpha mit lc = " << G[1] );
-
-  for( s = 2 ;s <= levU ; s++ )
-  {
-    U[ s ] = alpha( u, s+1, levU );  // s Variablen stehen lassen, fuer
-    V[ s ] = alpha( v, s+1, levU );  // den Rest alpha einsetzen
-    d = tmin( degree( U[ s ], s ), degree( V[ s ], s ));
-
-    DEBOUTLN( cerr, " U["<< s << "] = " << U[s] );
-    DEBOUTLN( cerr, " V["<< s << "] = " << V[s] );
-    DEBOUTLN( cerr, " d = " << d );
-
-    for ( i = 1; i <= m ; i++ )
-    {
-      // Anzahl der Monome berechnen pro gi liefert das Skeletonpolynom //
-      n[ i ] = countmonome( g[ i ] );
-      //cout << "n["<<i<<"] = "<< n[i] << endl;
-    }
-
-    for ( i = 1; i <= m    ; i++ )
-    {
-      if ( i ==1 )
-        N = n[i];
-      else
-      {
-        if ( n[i]> N )
-          N = n[i];
-      }
-    }
-
-    //      int tau[d+1][m+1][N+1];               /// keine Integers !!!
-    typedef CanonicalForm** CF_ptr_ptr;
-    typedef CanonicalForm* CF_ptr;
-
-    CanonicalForm ***tau = new CF_ptr_ptr[m+1];
-    for ( i = 1; i <= m; i++ )
-    {
-      tau[i] = new CF_ptr[d+1];
-      for ( j = 1; j <= d; j++ )
-        tau[i][j] = new CanonicalForm[N+1];
-    }
-
-    CFArray beta( 1, d );
-
-    for ( i = 1; i <= d ; i++ )
-    {
-      beta[ i ] =  gen.generate();   // verschiedene Elemente aus Zp
-      //  cout << "  beta["<<i << "] = " << beta[i];
-    }
-
-    Array<REvaluation> xi( 1, N );
-    REvaluation a( 2, s-1, gen  );
-
-    for ( i = 1 ; i <= N ; i++ )
-    {
-      a.nextpoint();
-      xi[ i ] = a;//REvaluation( 2, s-1, gen );
-      // cout << "  xi["<<i<<"] = "<< xi[i];
-    }
-
-    //CFArray T(1, d*N );
-
-    if ( d == 0 )
-    {
-      ASSERT( 0, "alpha bad point! try some other gcd algorithm" );
-      return gcd(u, v);
-    }
-
-    CFMatrix T( d, N ) ;  // diese Moeglichkeit laeuft!!!
-                    //help = Koeff( T( j, k ), emma[ i ] );
-                    //tau[i][j][k] = help; //.intval();
-
-    for ( j = 1 ; j <= d ; j++ ) // jedesmal andere REvaluation??
-    {
-      for ( k = 1 ; k <= N ; k++ )
-      {
-        CanonicalForm zwischenu, zwischenv, help, nfa ;
-
-        zwischenu = U[ s ]( beta[ j ], s );
-        zwischenv = V[ s ]( beta[ j ], s );
-
-        T( j, k) = gcd ( xi[k]( zwischenu, 2, s-1 ), xi[k]( zwischenv, 2, s-1 ));
-
-        nfa = lcggt( beta[j], s );
-        nfa =  alpha( nfa, s+1, levU );
-
-        //T(j, k ) = (xi[k]( nfa, 2, s-1 ))*((1/lc(T( j, k ))) * T( j, k ));
-        T(j, k ) = (xi[k]( nfa, 2, s-1 ))*((1/Leitkoeffizient(T( j, k ))) * T( j, k ));
-
-        //cout <<"T("<<j<<", "<< k <<") = " << T(j, k) << endl;
-
-        for ( i = 1 ; i <= m ; i++ )
-        {
-          // diese Moeglichkeit laeuft!!!
-          //help = Koeff( T( j, k ), emma[ i ] );
-          //tau[i][j][k] = help; //.intval();
-          if ( T( j, k).inBaseDomain() )
-          {
-            if ( emma[i] == 0 )
-              tau[i][j][k] = T( j, k );
-            else
-              tau[i][j][k] =  0 ;
-          }
-          else
-          {
-            tau[i][j][k] = T(j, k)[emma[i]];
-          }
-        }
-      }
-
-      CFMatrix h( m, d );
-
-      for ( i = 1; i <= m ; i++ )
-      {
-        for ( j = 1 ; j <= d ; j++ )
-        {
-          zip = n[i] +1;
-          CanonicalForm * zwischen = new CanonicalForm[ zip ];//n[i]+1 ];
-
-          for ( k = 1 ; k <= n[i] ; k++ )
-          {
-            zwischen[ k ] = tau[i][j][k];
-          }
-
-          //cout <<" werte fuer sinterpol : " << endl;
-          //cout <<" g["<<i<<"] = " << g[i] << " xi = " << xi << endl;
-          //cout << " zwischen = " << zwischen << " ni = " << n[i]<<endl;
-          h[ i ][ j ] = sinterpol( g[i], xi, zwischen, n[i] );
-          DEBOUTLN( cerr, " Ergebnis von sinterpol h["<<i<<"]["<<j<< "] = " << h[i][j] );
-          delete [] zwischen;
-        }
-      }
-      for ( i = 1 ; i <= m ; i++ )
-      {
-        CFArray zwitscher( 1, d );
-        for ( j = 1 ; j <= d ; j++ )
-        {
-          zwitscher[ j ] = h[ i ][ j ];
-        }
-
-        DEBOUTLN( cerr, "Werte fuer dinterpol : " );
-        DEBOUTLN( cerr, " d = " << d << " g["<<i<<"] = "<< g[i] );
-        DEBOUTLN( cerr, " zwitscher = " << zwitscher );
-        DEBOUTLN( cerr, " alpha["<<s<< "] = "<< alpha[s] << " beta = "<<beta << " n["<<i<<"] = " << n[i] );
-
-        g[ i ] = dinterpol( d, g[i], zwitscher, alpha, s, beta, n[ i ], CHAR );
-        DEBOUTLN( cerr, " Ergebnis von dinterpol g["<<i<<"] = " << g[i] );
-
-      }
-
-      for ( i = 1 ; i <= m ; i++ )
-      {
-        G[ s ] += g[ i ] * ( power( x, emma[i] ) );
-      }
-      DEBOUTLN( cerr, "G["<<s<<"] = " << G[s] );
-      for ( i = 1; i <= m; i++ )
-      {
-        for ( j = 1; j <= d; j++ )
-          delete [] tau[i][j];
-        delete [] tau[i];
-      }
-      delete [] tau;
-    }
-  }
-  delete [] emma;
-
-  return G[ levU ];
-}
-
-// In sparsemod testen, ob G[levU] | u und G[levU] | v ///
-static CanonicalForm
-internalSparsemod( const CanonicalForm & F, const CanonicalForm & G )
-{
-  // On(SW_USE_EZGCD );
-  On( SW_SYMMETRIC_FF );
-  //cout << " in sparse " << endl;
-  if( F.inCoeffDomain() &&  G.inCoeffDomain() )
-  {
-    return gcd( F, G );
-  }
-
-  CanonicalForm f, g, ff, gg, ggt, res, fmodp, gmodp ;
-  int i, count = 10;
-
-  //   COMPRESS    ///////////////////
-
-  CFArray A(1, 2);
-  A[1] = F;
-  A[2] = G;
-  CFMap M, N;
-  compress(A, M, N);
-  f = M(A[1]);
-  g = M(A[2]);
-
-  // POLYNOME PRIMITIV BZGL DER ERSTEN VARIABLE  /////
-
-  CanonicalForm primif, primig, lcf, lcg, lcggt, lcggtmodp, result ;
-  ff = content( f, Variable(1) );//contentsparse( f, 1  );
-  gg = content( g, Variable(1) );//contentsparse( g, 1  );
-
-  primif = f/ff;
-  primig = g/gg;
-  ggt = gcd( ff, gg );
-
-  if( primif.inCoeffDomain() &&  primig.inCoeffDomain() )
-  {
-    return N( gcd( primif, primig ) ) * N( ggt );
-  }
-
-  // Variablen, die in beiden Polynomen auftreten /////
-
-  int levis, m, levelprimif, levelprimig;
-  int  ABFRAGE = 1 ;
-
-  levelprimif = level( primif );
-  levelprimig = level( primig );
-
-  if ( levelprimif > levelprimig )
-    levis = levelprimif;
-  else
-    levis = levelprimig;
-
-  if ( levis < 0 )
-    return N( gcd( primif, primig ) );
-
-  int * varf = new int[levis];
-  int * varg = new int[levis];
-  int * schnitt = new int[levis];
-
-  while ( ABFRAGE == 1 )
-  {
-    levelprimif = level(primif);
-    levelprimig = level(primig);
-
-    if ( levelprimif > levelprimig )
-      levis = levelprimif;
-    else
-      levis = levelprimig;
-
-    if ( levis < 0 )
-      return N( gcd(primif, primig ));
-
-    for( i = 1; i <= levis ; i++ )
-    {
-      if ( degree( primif, i ) != 0 )
-        varf[i] = 1;
-      else
-        varf[i] = 0;
-      if ( degree( primig, i ) != 0 )
-        varg[i] = 1;
-      else
-        varg[i] = 0;
-      if ( varg[i] == 1 && varf[i] == 1 )
-        schnitt[i] = 1;
-      else
-        schnitt[i] = 0;
-    }
-
-    levelprimif = level(primif);
-    levelprimig = level(primig);
-
-    for ( m  = 1; m <= levis ; m++)
-    {
-      if ( schnitt[m] == 0 )
-      {
-        if ( varf[m] == 1)
-        {
-          primif = content( primif, m ); //contentsparse( primif, m  );
-        }
-        else
-        {
-          primig = content( primig, m ); //contentsparse( primig, m  );
-        }
-      }
-    }
-
-    if ( level( primif ) == level( primig ) )
-      ABFRAGE = 0 ;
-
-  }
-
-  delete [] varf; delete [] varg; delete [] schnitt;
-
-  //  Nochmal compress fuer den Fall, dass eine Variable rausfliegt //
-
-  CFArray C(1, 2);
-  C[1] = primif;
-  C[2] = primig;
-  CFMap MM, NN ;
-  compress(C, MM, NN);
-  primif = MM(C[1]);
-  primig = MM(C[2]);
-
-  if ( level( primif) != level( primig ) )
-    ASSERT( 0, "this should n e v e r happen !!!!" );
-
-  //cout << " primif = " << primif << endl;
-  //cout << " primig = " << primig << endl;
-
-  if( primif.inCoeffDomain() &&  primig.inCoeffDomain() )
-  {
-    return N( NN( gcd( primif, primig ) ) ) * N( ggt );
-  }
-
-  // erst hier Leitkoeffizienten updaten  /////////
-
-  //if( primif.inCoeffDomain() || primif.isUnivariate
-
-  lcf = LC(primif, 1 );
-  lcg = LC(primig, 1 );
-  lcggt = gcd ( lcf, lcg );
-
-  //   BOUND BESTIMMEN fuer Charakteristik Null   /////////
-
-  int CHAR = getCharacteristic(), deg  ;
-  if ( CHAR < 10 )
-    deg = 3; // Default Erweiterung bei kleiner Primzahl;
-  else
-    deg = 1;
-  CanonicalForm B, L, Bound, lcF = Leitkoeffizient( primif); //lc( primif ) ;
-  B =  2 * maxNorm( primif ) * maxNorm( g ) ;
-  L = lcF ;
-  Bound = abs( 2 * B * L + 1 );
-  int length = 1;
-
-  CFArray p( 1, 10 ) ;
-
-  if( CHAR == 0 )
-  {
-    p[ 1 ]  = cf_getBigPrime( count );
-    CanonicalForm q = p[ 1 ];
-
-    while ( q < Bound )
-    {
-      count++;
-      length++;
-      p[ length ] = cf_getBigPrime( count );
-      q     *= p[ length ];  //G[levU] = ( 1/lc(G[levU] ))* G[levU];// sinnig?
-      //cout << " lcggt = " << lcggt << endl;
-      //bool ja;
-      //ja = fdivides( lcggt, lc( G[levU] ) );
-      //cout << " ja = " << ja << endl;
-      //cout << " vor Verlassen " << endl;
-    }
-  }
-  else
-  {
-    //int q  = CHAR;
-    //setCharacteristic( 0 );
-    //CanonicalForm Bound2 = mapinto( Bound ) ;
-    //cout << " Bound2 " << Bound2 << endl;
-    //cout << " CHAR =  " << q << endl;
-
-    // erstmal ohne Erweiterung !!!
-    //deg = 3; // Default Erweiterung
-    //q *= ( q * q ) ;cout << "q = " << q << endl;
-
-    //Bestimme Grad der Koerpererweiterung voellig unnuetz!!!
-    //while ( q < abs( Bound2 ) )
-    //        {
-    //  q *= CHAR;cout << " q = " << q << endl;
-    //deg++;cout << " degchar = " << deg << endl;
-    //cout << " in Graderhoehung? " << endl;
-
-    //}
-    //setCharacteristic( CHAR );
-    //cerr << " JUHU " << endl;
-  }
-
-  //        ENDE BOUNDBESTIMMUNG       /////////////////
-
-  FFRandom gen ;
-  levelprimif = level( primif );
-  REvaluation am( 2, levelprimif, FFRandom ( ));
-  int k, help ;
-  CFArray resultat( 1, length );//cout << " nach Resultat " << endl;
-  CanonicalForm zwischen;
-  Variable alpha1( levelprimif + 1 );
-  ABFRAGE = 0;
-
-
-  for ( i = 1 ; i <= 10; i++ )               // 10 Versuche mit sparsemod
-  {
-    if ( CHAR == 0 )
-    {
-      for( k = 1; k <= length ; k++)
-      {
-        help = p[ k ].intval();
-        setCharacteristic( help );
-        FFRandom mache;
-        am = REvaluation( 2, levelprimif, mache  );
-        am.nextpoint();
-        fmodp  = mapinto( primif );
-        gmodp = mapinto( primig );
-        lcggtmodp = mapinto ( lcggt );
-
-        zwischen = smodgcd( fmodp, gmodp, lcggtmodp, am, mache, CHAR, Variable( 1 ));
-        // Variable ( 1 ) Interface fuer endliche Koerper
-
-        // Char auf 0 wegen Chinese Remainder ////////
-
-        setCharacteristic( 0 );
-
-        resultat[ k ] = mapinto( zwischen );
-      }
-
-      ////////////////////////////////////////////////////////////
-      // result[k] mod p[k] via Chinese Remainder zu Resultat //////
-      // ueber Z hochziehen                                //////
-      ////////////////////////////////////////////////////////////
-
-      if( length != 1 )
-        ChinesePoly( length, resultat, p, result );
-      else
-        result = resultat[1];
-
-      CanonicalForm contentresult = content( result, 1 );
-
-      if ( contentresult != 0 )
-        res = result/contentresult;
-      else
-        res = result;
-
-      if ( fdivides( res, primif ) && fdivides( res, primig ) )
-        return  N(NN(res))*N(ggt) ;     /// compress rueckgaengig machen!
-      else
-      {
-
-        // Start all over again ///
-
-        count++;
-        for ( k = 1; k <= length ; k++)
-        {
-          p[k] = cf_getBigPrime( count );
-          count++;
-        }
-      }
-    }
-    else
-    {
-      // Fall Char != 0 ///
-      // in algebraische Erweiterung vom Grad deg gehen //
-      //cout << " IN CHAR != 0 " << endl;
-      //cout << " degree = " << deg << endl;
-      CanonicalForm minimalpoly;
-      //cout << " vor mini " << endl;
-      minimalpoly = find_irreducible( deg, gen, alpha1 );
-      //cout << " nach mini " << endl;
-      Variable alpha2 = rootOf( minimalpoly, 'a' ) ;
-      AlgExtRandomF hallo( alpha2 );
-      //cout << " vor am " << endl;
-      REvaluation am (  2, levelprimif, hallo );
-      //cout << " nach ma " << endl;
-      am.nextpoint();
-      //cout << "vor smodgcd " << endl;
-      result = smodgcd( primif, primig, lcggt, am, hallo, CHAR, alpha2  );
-      if ( result == 1 && ABFRAGE == 0)
-      {
-        // zwei Auswertungen fuer gcd Eins
-        am.nextpoint();
-        ABFRAGE = 1;
-      }
-      //CanonicalForm contentresult = contentsparse(  result, 1 );
-      //zuerst mal auf Nummer sicher gehen ...
-      else
-      {
-        CanonicalForm contentresult = content(  result, 1 );
-        //cout << "RESULT = " << result << endl;
-        if ( contentresult != 0 )
-          res = result/contentresult;
-        else
-          res = result;
-
-        if ( ( fdivides( res, primif )) && ( fdivides ( res, primig ) ))
-        {
-          // make monic ////
-          res = (1/lc(res)) * res;
-          // eventuell auch hier Leitkoeffizient anstatt lc ?
-
-          return  N( NN( res ) ) * N( ggt ) ;
-        }
-        else
-        {
-          // Grad der Erweiterung sukzessive um eins erhoehen
-          deg++;
-          //cout << " deg = " << deg << endl;
-          am.nextpoint();
-          // nextpoint() unnoetig?
-        }
-      }
-    }
-  }
-
-
-  //Fuer den Fall der unwahrscheinlichen Faelle, dass die Versuche
-  //nicht ausreichen :
-
-  ASSERT( 0, "sparsemod failed! try some other gcd algorithm" );
-  if( CHAR == 0 )
-    setCharacteristic( 0 );
-
-  return 0;
-}
-
-CanonicalForm
-sparsemod( const CanonicalForm & F, const CanonicalForm & G )
-{
-    Off( SW_USE_SPARSEMOD );
-    CanonicalForm result = internalSparsemod( F, G );
-    On( SW_USE_SPARSEMOD );
-    return result;
-}
diff --git a/factory/sm_sparsemod.h b/factory/sm_sparsemod.h
deleted file mode 100644
index 44d5fa7..0000000
--- a/factory/sm_sparsemod.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: sm_sparsemod.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_SM_SPARSEMOD_H
-#define INCL_SM_SPARSEMOD_H
-
-//{{{ docu
-//
-// sm_sparsemod.h - header to sm_sparsemod.cc.
-//
-// Contributed by Marion Bruder <bruder at math.uni-sb.de>.
-//
-//}}}
-
-#include <config.h>
-
-#include "canonicalform.h"
-
-CanonicalForm sparsemod( const CanonicalForm & F, const CanonicalForm & G );
-
-#endif /* ! INCL_SM_SPARSEMOD_H */
diff --git a/factory/sm_util.cc b/factory/sm_util.cc
deleted file mode 100644
index 486e663..0000000
--- a/factory/sm_util.cc
+++ /dev/null
@@ -1,328 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: sm_util.cc 13772 2010-12-15 14:53:39Z hannes $ */
-
-//{{{ docu
-//
-// sm_util.cc - utlities for sparse modular gcd.
-//
-// Dependencies: Routines used by and only by sm_sparsemod.cc.
-//
-// Contributed by Marion Bruder <bruder at math.uni-sb.de>.
-//
-//}}}
-
-#include <config.h>
-
-#include "assert.h"
-#include "debug.h"
-
-#include "cf_defs.h"
-#include "cf_algorithm.h"
-#include "cf_iter.h"
-#include "cf_reval.h"
-#include "canonicalform.h"
-#include "variable.h"
-#include "templates/ftmpl_array.h"
-
-//{{{ static CanonicalForm fmonome( const CanonicalForm & f  )
-//{{{ docu
-//
-// fmonome() - return the leading monomial of a poly.
-//
-// As in Leitkoeffizient(), the leading monomial is calculated
-// with respect to inCoeffDomain().  The leading monomial is
-// returned with coefficient 1.
-//
-//}}}
-static CanonicalForm
-fmonome( const CanonicalForm & f  )
-{
-  if ( f.inCoeffDomain() )
-    {
-      return 1;
-    }
-  else
-    {
-      CFIterator J = f;
-      CanonicalForm  result;
-      result = power( f.mvar() , J.exp() ) * fmonome( J.coeff() );
-      return result;
-    }
-}
-//}}}
-
-//{{{ static CanonicalForm interpol( const CFArray & values, const CanonicalForm & point, const CFArray & points, const Variable & x, int d, int CHAR )
-//{{{ docu
-//
-// interpol() - Newton interpolation.
-//
-// Calculate f in x such that f(point) = values[1],
-// f(points[i]) = values[i], i=2, ..., d+1.
-// Make sure that you are calculating in a field.
-//
-// alpha: the values at the interpolation points (= values)
-// punkte: the point at which we interpolate (= (point, points))
-//
-//}}}
-static CanonicalForm
-interpol( const CFArray & values, const CanonicalForm & point, const CFArray & points, const Variable & x, int d, int CHAR )
-{
-  CFArray alpha( 1, d+1 );
-  int i;
-  for ( i = 1 ; i <= d+1 ; i++ )
-    {
-      alpha[i] = values[i];
-    }
-
-  int k, j;
-  CFArray punkte( 1 , d+1 );
-  for ( i = 1 ; i <= d+1 ; i++ )
-    {
-      if ( i == 1 )
-        {
-          punkte[i] = point;
-        }
-      else
-        {
-          punkte[i] = points[i-1];
-        }
-    }
-
-  // calculate Newton coefficients alpha[i]
-  for ( k = 2 ; k <= d+1 ; k++ )
-    {
-      for ( j = d+1 ; j >= k ; j-- )
-        {
-          alpha[j] = (alpha[j] - alpha[j-1]) / (punkte[j] - punkte[j-k+1]);
-        }
-    }
-
-  // calculate f from Newton coefficients
-  CanonicalForm f = alpha [1], produkt = 1;
-  for ( i = 1 ; i <= d ; i++ )
-    {
-      produkt *= ( x - punkte[i] );
-      f += ( alpha[i+1] * produkt ) ;
-    }
-
-  return f;
-}
-//}}}
-
-//{{{ int countmonome( const CanonicalForm & f )
-//{{{ docu
-//
-// countmonome() - count the number of monomials in a poly.
-//
-// As in Leitkoeffizient(), the number of monomials is calculated
-// with respect to inCoeffDomain().
-//
-//}}}
-int
-countmonome( const CanonicalForm & f )
-{
-  if ( f.inCoeffDomain() )
-    {
-      return 1;
-    }
-  else
-    {
-      CFIterator I = f;
-      int result = 0;
-
-      while ( I.hasTerms() )
-        {
-          result += countmonome( I.coeff() );
-          I++;
-        }
-      return result;
-    }
-}
-//}}}
-
-//{{{ CanonicalForm Leitkoeffizient( const CanonicalForm & f )
-//{{{ docu
-//
-// Leitkoeffizient() - get the leading coefficient of a poly.
-//
-// In contrary to the method lc(), the leading coefficient is calculated
-// with respect to to the method inCoeffDomain(), so that a poly over an
-// algebraic extension will have a leading coefficient in this algebraic
-// extension (and *not* in its groundfield).
-//
-//}}}
-CanonicalForm
-Leitkoeffizient( const CanonicalForm & f )
-{
-  if ( f.inCoeffDomain() )
-    return f;
-  else
-    {
-      CFIterator J = f;
-      CanonicalForm result;
-      result = Leitkoeffizient( J.coeff() );
-      return result;
-    }
-}
-//}}}
-
-//{{{ void ChinesePoly( int arraylength, const CFArray & Polys, const CFArray & primes, CanonicalForm & result )
-//{{{ docu
-//
-// ChinesePoly - chinese remaindering mod p.
-//
-// Given n=arraylength polynomials Polys[1] (mod primes[1]), ...,
-// Polys[n] (mod primes[n]), we calculate result such that
-// result = Polys[i] (mod primes[i]) for all i.
-//
-// Note: We assume that all monomials which occure in Polys[2],
-// ..., Polys[n] also occure in Polys[1].
-//
-// bound: number of monomials of Polys[1]
-// mono: array of monomials of Polys[1].  For each monomial, we
-//   get the coefficients of this monomial in all Polys, store them
-//   in koeffi and do chinese remaindering over these coeffcients.
-//   The resulting polynomial is constructed monomial-wise from
-//   the results.
-// polis: used to trace through monomials of Polys
-// h: result of remaindering of koeffi[1], ..., koeffi[n]
-// Primes: do we need that?
-//
-//}}}
-void
-ChinesePoly( int arraylength, const CFArray & Polys, const CFArray & primes, CanonicalForm & result )
-{
-  DEBINCLEVEL( cerr, "ChinesePoly" );
-
-  CFArray koeffi( 1, arraylength ), polis( 1, arraylength );
-  CFArray Primes( 1, arraylength );
-  int bound = countmonome( Polys[1] );
-  CFArray mono( 1, bound );
-  int i, j;
-  CanonicalForm h, unnecessaryforme;
-
-  DEBOUTLN( cerr, "Interpolating " << Polys );
-  DEBOUTLN( cerr, "modulo" << primes );
-  for ( i = 1 ; i <= arraylength ; i++ )
-    {
-      polis[i]  = Polys[i];
-      Primes[i] = primes[i];
-    }
-
-  for ( i = 1 ; i <= bound ; i++ )
-    {
-      mono[i] = fmonome( polis[1] );
-      koeffi[1] = lc( polis[1] );                // maybe better use Leitkoeffizient ??
-      polis[1] -= mono[i] * koeffi[1];
-      for ( j = 2 ; j <= arraylength ; j++ )
-        {
-          koeffi[j] = lc( polis[j] );                // see above
-          polis[j] -= mono[i] * koeffi[j];
-        }
-
-      // calculate interpolating poly for each monomial
-      chineseRemainder( koeffi, Primes, h, unnecessaryforme );
-      result += h * mono[i];
-    }
-  DEBOUTLN( cerr, "result = " << result );
-
-  DEBDECLEVEL( cerr, "ChinesePoly" );
-}
-//}}}
-
-//{{{ CanonicalForm dinterpol( int d, const CanonicalForm & gi, const CFArray & zwischen, const REvaluation & alpha, int s, const CFArray & beta, int ni, int CHAR )
-//{{{ docu
-//
-// dinterpol() - calculate interpolating poly (???).
-//
-// Calculate f such that f is congruent to gi mod (x_s - alpha_s) and
-// congruent to zwischen[i] mod (x_s - beta[i]) for all i.
-//
-//}}}
-CanonicalForm
-dinterpol( int d, const CanonicalForm & gi, const CFArray & zwischen, const REvaluation & alpha, int s, const CFArray & beta, int ni, int CHAR )
-{
-  int i, j, lev = s;
-  Variable x( lev );
-
-  CFArray polis( 1, d+1 );
-  polis[1] = gi;
-  for ( i = 2 ; i <= d+1 ; i++ )
-    {
-      polis[i] = zwischen[i-1];
-    }
-
-  CFArray mono( 1, ni ), koeffi( 1, d+1 );
-  CanonicalForm h , f = 0;
-
-  for ( i = 1 ; i <= ni ; i++ )
-    {
-      mono[i] = fmonome( polis[1] );
-
-      koeffi[1] = Leitkoeffizient( polis[1] );
-      polis[1] -= mono[i] * koeffi[1];
-
-      for ( j = 2 ; j <= d+1 ; j++ )
-        {
-          koeffi[j] = Leitkoeffizient( polis[j] );
-          polis[j] -= mono[i] * koeffi[j];
-        }
-
-      // calculate interpolating poly for each monomial
-      h = interpol( koeffi, alpha[s] , beta, x , d , CHAR );
-
-      f += h * mono[i];
-    }
-
-  return f;
-}
-//}}}
-
-//{{{ CanonicalForm sinterpol( const CanonicalForm & gi, const Array<REvaluation> & xi, CanonicalForm* zwischen, int n )
-//{{{ docu
-//
-// sinterpol - sparse interpolation (???).
-//
-// Loese Gleichungssystem:
-// x[1], .., x[q]( Tupel ) eingesetzt fuer die Variablen in gi ergibt
-// zwischen[1], .., zwischen[q]
-//
-//}}}
-CanonicalForm
-sinterpol( const CanonicalForm & gi, const Array<REvaluation> & xi, CanonicalForm* zwischen, int n )
-{
-  CanonicalForm f = gi;
-  int i, j;
-  CFArray mono( 1 , n );
-
-  //  mono[i] is the i'th monomial
-  for ( i = 1 ; i <= n ; i++ )
-    {
-      mono[i] = fmonome( f );
-      f -= mono[i]*Leitkoeffizient(f);
-    }
-
-  //  fill up matrix a
-  CFMatrix a( n , n + 1 );
-  for ( i = 1 ; i <= n ; i++ )
-    for ( j = 1 ; j <= n + 1 ; j++ )
-      {
-        if ( j == n+1 )
-          {
-            a[i][j] = zwischen[i];
-          }
-        else
-          {
-            a[i][j] = xi[i]( mono[j] );
-          }
-      }
-
-  // sove a*y=zwischen and get soultions y1, .., yn mod p
-  linearSystemSolve( a );
-
-  for ( i = 1 ; i <= n ; i++ )
-    f += a[i][n+1] * mono[i];
-
-  return f;
-}
-//}}}
diff --git a/factory/sm_util.h b/factory/sm_util.h
deleted file mode 100644
index e32f362..0000000
--- a/factory/sm_util.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: sm_util.h 13772 2010-12-15 14:53:39Z hannes $ */
-
-#ifndef INCL_SM_UTIL_H
-#define INCL_SM_UTIL_H
-
-//{{{ docu
-//
-// sm_util.h - header to sm_util.cc.
-//
-// Contributed by Marion Bruder <bruder at math.uni-sb.de>.
-//
-//}}}
-
-#include <config.h>
-
-#include "canonicalform.h"
-#include "cf_reval.h"
-#include "templates/ftmpl_array.h"
-
-typedef Array<REvaluation> REArray;
-
-int countmonome( const CanonicalForm & f );
-
-CanonicalForm Leitkoeffizient( const CanonicalForm & f );
-
-void ChinesePoly( int arraylength, const CFArray & Polys, const CFArray & primes, CanonicalForm & result );
-
-CanonicalForm dinterpol( int d, const CanonicalForm & gi, const CFArray & zwischen, const REvaluation & alpha, int s, const CFArray & beta, int ni, int CHAR );
-
-CanonicalForm sinterpol( const CanonicalForm & gi, const REArray & xi, CanonicalForm* zwischen, int n );
-
-#endif /* ! INCL_SM_UTIL_H */
diff --git a/factory/winnt/INSTALL.nt b/factory/winnt/INSTALL.nt
deleted file mode 100644
index 9d06eba..0000000
--- a/factory/winnt/INSTALL.nt
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-      --- This `INSTALL' file corresponds to Factory version 1.3b ---
-
-
-		 INSTALL file for Factory on Windows NT 4.0
-		 ==========================================
-
-NOTE: The copyright state of Factory is given in the file COPYING
-in the top level directory of Factory.
-
-NOTE: Please read also the file INSTALL in the factory root directory.
-
-This is a prerelease of the Factory-Port to Microsoft Windows NT 4.0 using
-the Microsoft Visual C++ 5.0 compiler. To compile Factory on Windows NT you
-have also to copy a ported version of the GNU MP library which you can
-download from the same site you have downloaded Factory.
-
-To build Factory on Windows NT you have to do the following steps:
-
-1) Copy the files gmp.h and gmp.lib into the Factory directory.
-2) Change into the winnt directory.
-3) Make Factory with
-               nmake /f nt.mak
-4) There is no installation script yet. So you have to copy the library files
-   gmp.lib and factory.lib as well as gmp.h, factory.h, factoryconf.h and
-   the template subdirectory to a suitable place on your system.
-
-NOTE: There is no support for GF(q) tables yet!
diff --git a/factory/winnt/config.h b/factory/winnt/config.h
deleted file mode 100644
index 2a4fad4..0000000
--- a/factory/winnt/config.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/* emacs edit mode for this file is -*- C -*- */
-/* $Id: config.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_CONFIG_H
-#define INCL_CONFIG_H
-
-/* {{{ docu
- *
- * config.h.in - used by `configure' to create `config.h'.
- *
- * This file is included at building time from almost all source
- * files belonging to Factory.  Furthermore, it is (textually)
- * included into `factoryconf.h' by `makeheader' so we have an
- * installed version of this file, too.  This way, the installed
- * source files will be compiled with the same settings as the
- * library itself.
- *
- * In general, you should let `configure' guess the correct
- * values for the `#define's below.  But if something seriously
- * goes wrong in configuring, please inform the authors and feel
- * free to edit the marked section.
- *
- * ---RS---
- * This is the specialized version of config.h for compiling
- * Factory on Windows NT 4.0 with MS Visula C++ 5.x
- * ---RS---
- */
-/* }}} */
-
-/************** START OF CONFIGURABLE SECTION **************/
-
-/* Define to empty if the keyword does not work.  */
-/* #undef const */
-
-/* Define as __inline if that's what the C compiler calls it.  */
-/* #undef inline */
-
-/* factory version */
-#define FACTORYVERSION "1.3b"
-
-/* factory configuration */
-#define FACTORYCONFIGURATION "WINNT"
-
-/* where the gftables live */
-#define GFTABLEDIR "."
-
-/* define if your compiler does arithmetic shift */
-#define HAS_ARITHMETIC_SHIFT 1
-
-/* define to build factory without stream IO */
-#undef NOSTREAMIO
-
-/* define if linked to Singular */
-#undef SINGULAR
-
-/* define if linked with factory memory manager */
-#define USE_MEMUTIL 1
-
-/* define if linked with old factory memory manager */
-#define USE_OLD_MEMMAN 1
-
-/* define if linked with new factory manager, debugging version */
-#undef MDEBUG
-
-/* define if you do not want to activate assertions */
-#undef NOASSERT
-
-/* define if you want to activate the timing stuff */
-#undef TIMING
-
-/* define if you want to have debugging output */
-#undef DEBUGOUTPUT
-
-/* define type of your compilers 64 bit integer type */
-#define INT64 __int64
-
-/************** END OF CONFIGURABLE SECTION **************/
-
-#endif /* ! INCL_CONFIG_H */
diff --git a/factory/winnt/factory.h b/factory/winnt/factory.h
deleted file mode 100644
index 247b866..0000000
--- a/factory/winnt/factory.h
+++ /dev/null
@@ -1,1048 +0,0 @@
-/* winnt/factory.h automatically generated by makeheader from factory.template */
-/* emacs edit mode for this file is -*- C++ -*- */
-/* $Id: factory.h 13143 2010-08-20 11:40:52Z hannes $ */
-
-#ifndef INCL_FACTORY_H
-#define INCL_FACTORY_H
-
-//{{{ docu
-//
-// factory.template - template to generate `factory.h'.
-//
-// `factory.h' is the user interface to Factory.  Created
-// automatically by `makeheader', it collects all important
-// declarations from all important Factory header files into one
-// overall header file leaving out all boring Factory internal
-// stuff.  See `./bin/makeheader' for an explanation of the syntax
-// of this file.
-//
-// Note: In this file the order of "includes" matters (since this
-// are not real includes)!  In general, files at the end depend
-// on files at the beginning.
-//
-//}}}
-
-#include <factoryconf.h>
-
-#ifndef NOSTREAMIO
-#ifdef HAVE_IOSTREAM
-#include <iostream>
-#define OSTREAM std::ostream
-#define ISTREAM std::istream
-#elif defined(HAVE_IOSTREAM_H)
-#include <iostream.h>
-#define OSTREAM ostream
-#define ISTREAM istream
-#endif
-#endif /* ! NOSTREAMIO */
-
-#ifdef SINGULAR
-#include "cf_gmp.h"
-#else
-#include <gmp.h>
-#endif /* SINGULAR */
-
-#include <templates/ftmpl_array.h>
-#include <templates/ftmpl_factor.h>
-#include <templates/ftmpl_list.h>
-#include <templates/ftmpl_matrix.h>
-
-/* stuff included from ./cf_globals.h */
-
-
-extern const char factoryVersion[];
-extern const char factoryConfiguration[];
-
-
-/* stuff included from ./cf_primes.h */
-
-
-int cf_getPrime( int i );
-
-int cf_getNumPrimes();
-
-int cf_getSmallPrime( int i );
-
-int cf_getNumSmallPrimes();
-
-int cf_getBigPrime( int i );
-
-int cf_getNumBigPrimes();
-
-
-/* stuff included from ./cf_defs.h */
-
-
-#define LEVELBASE -1000000
-#define LEVELTRANS -500000
-#define LEVELQUOT 1000000
-#define LEVELEXPR 1000001
-
-#define UndefinedDomain 32000
-#define PrimePowerDomain 5
-#define GaloisFieldDomain 4
-#define FiniteFieldDomain 3
-#define RationalDomain 2
-#define IntegerDomain 1
-
-//{{{ constants
-//{{{ docu
-//
-// - factory switches.
-//
-//}}}
-const int SW_RATIONAL = 0;
-const int SW_QUOTIENT = 1;
-const int SW_SYMMETRIC_FF = 2;
-const int SW_BERLEKAMP = 3;
-const int SW_FAC_USE_BIG_PRIMES = 4;
-const int SW_FAC_QUADRATICLIFT = 5;
-const int SW_USE_EZGCD = 6;
-const int SW_USE_EZGCD_P = 7;
-const int SW_USE_SPARSEMOD = 8;
-const int SW_USE_NTL=9;
-const int SW_USE_NTL_GCD_0=10;
-const int SW_USE_NTL_GCD_P=11;
-const int SW_USE_NTL_SORT=12;
-const int SW_USE_CHINREM_GCD=13;
-const int SW_USE_GCD_P=14;
-const int SW_USE_QGCD=15;
-const int SW_USE_fieldGCD=16;
-//}}}
-
-
-/* stuff included from ./variable.h */
-
-
-class CanonicalForm;
-
-class Variable
-{
-private:
-    int _level;
-    Variable( int l, bool flag );
-public:
-    Variable() : _level(LEVELBASE) {}
-    Variable( int l );
-    Variable( char name );
-    Variable( int l, char name );
-    Variable( const Variable & v ) : _level(v._level) {}
-    ~Variable() {};
-    Variable& operator= ( const Variable & v )
-    {
-	_level = v._level;
-	return *this;
-    }
-    int level() const { return _level; }
-    char name() const;
-    static Variable highest() { return Variable( LEVELQUOT-1 ); }
-    Variable next() const { return Variable( _level+1 ); }
-    friend bool operator == ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level == rhs._level;
-    }
-    friend bool operator != ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level != rhs._level;
-    }
-    friend bool operator > ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level > rhs._level;
-    }
-    friend bool operator < ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level < rhs._level;
-    }
-    friend bool operator >= ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level >= rhs._level;
-    }
-    friend bool operator <= ( const Variable & lhs, const Variable & rhs )
-    {
-	return lhs._level <= rhs._level;
-    }
-#ifndef NOSTREAMIO
-    friend OSTREAM & operator << ( OSTREAM & os, const Variable & v );
-#endif /* NOSTREAMIO */
-    friend void swap_levels();
-    friend Variable rootOf( const CanonicalForm &, char name );
-};
-Variable rootOf( const CanonicalForm &, char name = '@' );
-
-inline int level( const Variable & v ) { return v.level(); }
-inline char name( const Variable & v ) { return v.name(); }
-
-CanonicalForm getMipo( const Variable & alpha, const Variable & x );
-bool hasMipo( const Variable & alpha );
-
-char getDefaultVarName();
-char getDefaultExtName();
-
-int ExtensionLevel();
-
-
-/* stuff included from ./canonicalform.h */
-
-
-#undef CF_INLINE
-#define CF_INLINE
-#undef CF_NO_INLINE
-#define CF_NO_INLINE
-
-
-class InternalCF;
-
-inline int is_imm ( const InternalCF * const ptr )
-{
-    // returns 0 if ptr is not immediate       
-    return ( ((int)((long)ptr)) & 3 );
-}
-
-
-int initCanonicalForm( void );
-
-static int cf_is_initialized_now = initCanonicalForm();
-
-//{{{ class CanonicalForm
-class CanonicalForm
-{
-private:
-    InternalCF *value;
-public:
-    // constructors, destructors, selectors
-    CF_INLINE CanonicalForm();
-    CF_INLINE CanonicalForm( const CanonicalForm& );
-    CF_INLINE CanonicalForm( InternalCF* );
-    CF_INLINE CanonicalForm( const int );
-    CF_INLINE CanonicalForm( const Variable & );
-    CF_INLINE CanonicalForm( const Variable &, int );
-    CanonicalForm( const char *, const int base=10 ); // use with caution - does only handle integers !!!
-
-    CF_NO_INLINE ~CanonicalForm();
-
-    InternalCF* getval() const; // use with caution !!!
-
-    CanonicalForm deepCopy() const;
-
-    // predicates
-    CF_NO_INLINE bool isOne() const;
-    CF_NO_INLINE bool isZero() const;
-    inline bool isImm() const { return is_imm( value ); };
-
-    bool inZ() const;
-    bool inQ() const;
-    bool inFF() const;
-    bool inGF() const;
-    bool inPP() const;
-    bool inBaseDomain() const;
-    bool inExtension() const;
-    bool inCoeffDomain() const;
-    bool inPolyDomain() const;
-    bool inQuotDomain() const;
-
-    bool isFFinGF() const;
-    bool isUnivariate() const;
-    bool isHomogeneous() const;
-
-    // conversion functions
-    int intval() const;
-    CanonicalForm mapinto () const;
-
-    CanonicalForm lc () const;
-    CanonicalForm Lc () const;
-    CanonicalForm LC () const;
-    CanonicalForm LC ( const Variable & v ) const;
-
-    int degree () const;
-    int degree ( const Variable & v ) const;
-
-    CanonicalForm tailcoeff () const;
-    int taildegree () const;
-
-    int level () const;
-    Variable mvar () const;
-
-    CanonicalForm num () const;
-    CanonicalForm den () const;
-
-    // assignment operators
-    CF_NO_INLINE CanonicalForm& operator = ( const CanonicalForm& );
-    CF_NO_INLINE CanonicalForm& operator = ( const int );
-
-    CanonicalForm& operator += ( const CanonicalForm& );
-    CanonicalForm& operator -= ( const CanonicalForm& );
-    CanonicalForm& operator *= ( const CanonicalForm& );
-    CanonicalForm& operator /= ( const CanonicalForm& );
-    CanonicalForm& operator %= ( const CanonicalForm& );
-    CanonicalForm& div ( const CanonicalForm& );
-    CanonicalForm& mod ( const CanonicalForm& );
-
-    // evaluation operators
-    CanonicalForm operator () ( const CanonicalForm & f ) const;
-    CanonicalForm operator () ( const CanonicalForm & f, const Variable & v ) const;
-
-    CanonicalForm operator [] ( int i ) const;
-
-    CanonicalForm deriv() const;
-    CanonicalForm deriv( const Variable & x ) const;
-
-    int sign() const;
-    CanonicalForm sqrt() const;
-    int ilog2() const;
-
-    // comparison operators
-    friend bool operator == ( const CanonicalForm&, const CanonicalForm& );
-    friend bool operator != ( const CanonicalForm&, const CanonicalForm& );
-    friend bool operator > ( const CanonicalForm&, const CanonicalForm& );
-    friend bool operator < ( const CanonicalForm&, const CanonicalForm& );
-
-    // arithmetic operators
-    friend CF_NO_INLINE CanonicalForm operator - ( const CanonicalForm& );
-
-    friend void divrem ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
-    friend bool divremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
-
-    friend CanonicalForm bgcd ( const CanonicalForm &, const CanonicalForm & );
-    friend CanonicalForm bextgcd ( const CanonicalForm &, const CanonicalForm &, CanonicalForm &, CanonicalForm & );
-
-    // input/output
-#ifndef NOSTREAMIO
-    void print( OSTREAM&, char * ) const;
-    void print( OSTREAM& ) const;
-    friend OSTREAM& operator << ( OSTREAM&, const CanonicalForm& );
-    friend ISTREAM& operator >> ( ISTREAM&, CanonicalForm& );
-#endif /* NOSTREAMIO */
-
-    // obsolete methods
-    static CanonicalForm genCoeff( int what, int i = 0 );
-    CanonicalForm genZero() const;
-    CanonicalForm genOne() const;
-
-    friend class CFIterator;
-};
-//}}}
-
-CF_INLINE CanonicalForm
-operator + ( const CanonicalForm&, const CanonicalForm& );
-
-CF_NO_INLINE CanonicalForm
-operator - ( const CanonicalForm&, const CanonicalForm& );
-
-CF_INLINE CanonicalForm
-operator * ( const CanonicalForm&, const CanonicalForm& );
-
-CF_NO_INLINE CanonicalForm
-operator / ( const CanonicalForm&, const CanonicalForm& );
-
-CF_NO_INLINE CanonicalForm
-operator % ( const CanonicalForm&, const CanonicalForm& );
-
-CF_NO_INLINE CanonicalForm
-div ( const CanonicalForm&, const CanonicalForm& );
-
-CF_NO_INLINE CanonicalForm
-mod ( const CanonicalForm&, const CanonicalForm& );
-
-
-//{{{ function declarations from canonicalform.cc
-CanonicalForm blcm ( const CanonicalForm & f, const CanonicalForm & g );
-
-CanonicalForm power ( const CanonicalForm & f, int n );
-
-CanonicalForm power ( const Variable & v, int n );
-//}}}
-
-//{{{ function declarations from cf_gcd.cc
-CanonicalForm gcd ( const CanonicalForm&, const CanonicalForm& );
-
-CanonicalForm gcd_poly ( const CanonicalForm & f, const CanonicalForm & g );
-
-CanonicalForm extgcd ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& );
-
-CanonicalForm lcm ( const CanonicalForm&, const CanonicalForm& );
-
-CanonicalForm pp ( const CanonicalForm& );
-
-CanonicalForm content ( const CanonicalForm& );
-
-CanonicalForm content ( const CanonicalForm&, const Variable& );
-
-CanonicalForm icontent ( const CanonicalForm & f );
-
-CanonicalForm vcontent ( const CanonicalForm & f, const Variable & x );
-//}}}
-
-//{{{ function declarations from cf_ops.cc
-CanonicalForm swapvar ( const CanonicalForm &, const Variable &, const Variable & );
-
-CanonicalForm replacevar ( const CanonicalForm &, const Variable &, const Variable & );
-
-int getNumVars( const CanonicalForm & f );
-
-CanonicalForm getVars( const CanonicalForm & f );
-
-CanonicalForm apply ( const CanonicalForm & f, void (*mf)( CanonicalForm &, int & ) );
-
-CanonicalForm mapdomain ( const CanonicalForm & f, CanonicalForm (*mf)( const CanonicalForm & ) );
-
-int * degrees ( const CanonicalForm & f, int * degs = 0 );
-
-int totaldegree ( const CanonicalForm & f );
-
-int totaldegree ( const CanonicalForm & f, const Variable & v1, const Variable & v2 );
-
-int size ( const CanonicalForm & f, const Variable & v );
-
-int size ( const CanonicalForm & f );
-//}}}
-
-//{{{ inline functions corresponding to CanonicalForm methods
-//{{{ docu
-//
-// - inline functions corresponding to CanonicalForm methods.
-//
-// These function exist for convenience only and because it is
-// more beautiful to write 'degree( f )' than 'f.degree()'.
-//
-//}}}
-inline CanonicalForm
-lc ( const CanonicalForm & f ) { return f.lc(); }
-
-inline CanonicalForm
-Lc ( const CanonicalForm & f ) { return f.Lc(); }
-
-inline CanonicalForm
-LC ( const CanonicalForm & f ) { return f.LC(); }
-
-inline CanonicalForm
-LC ( const CanonicalForm & f, const Variable & v ) { return f.LC( v ); }
-
-inline int
-degree ( const CanonicalForm & f ) { return f.degree(); }
-
-inline int
-degree ( const CanonicalForm & f, const Variable & v ) { return f.degree( v ); }
-
-inline int
-taildegree ( const CanonicalForm & f ) { return f.taildegree(); }
-
-inline CanonicalForm
-tailcoeff ( const CanonicalForm & f ) { return f.tailcoeff(); }
-
-inline int
-level ( const CanonicalForm & f ) { return f.level(); }
-
-inline Variable
-mvar ( const CanonicalForm & f ) { return f.mvar(); }
-
-inline CanonicalForm
-num ( const CanonicalForm & f ) { return f.num(); }
-
-inline CanonicalForm
-den ( const CanonicalForm & f ) { return f.den(); }
-
-inline int
-sign ( const CanonicalForm & a ) { return a.sign(); }
-
-inline CanonicalForm
-deriv ( const CanonicalForm & f, const Variable & x ) { return f.deriv( x ); }
-
-inline CanonicalForm
-sqrt ( const CanonicalForm & a ) { return a.sqrt(); }
-
-inline int
-ilog2 ( const CanonicalForm & a ) { return a.ilog2(); }
-
-inline CanonicalForm
-mapinto ( const CanonicalForm & f ) { return f.mapinto(); }
-//}}}
-
-//{{{ inline functions
-inline CanonicalForm
-head ( const CanonicalForm & f )
-{
-    if ( f.level() > 0 )
-	return power( f.mvar(), f.degree() ) * f.LC();
-    else
-	return f;
-}
-
-inline int
-headdegree ( const CanonicalForm & f ) { return totaldegree( head( f ) ); }
-
-
-//}}}
-
-//{{{ other function declarations
-void setCharacteristic( int c ); // -> Fp && Q
-void setCharacteristic( int c, int n ); // -> PrimePower
-void setCharacteristic( int c, int n, char name ); // -> GF(q)
-
-int getCharacteristic();
-int getGFDegree();
-CanonicalForm getGFGenerator();
-
-void On( int );
-void Off( int );
-bool isOn( int );
-//}}}
-
-//{{{ type definitions
-typedef Factor<CanonicalForm> CFFactor;
-typedef List<CFFactor> CFFList;
-typedef ListIterator<CFFactor> CFFListIterator;
-typedef List<CanonicalForm> CFList;
-typedef ListIterator<CanonicalForm> CFListIterator;
-typedef Array<CanonicalForm> CFArray;
-typedef Matrix<CanonicalForm> CFMatrix;
-//}}}
-
-
-/* stuff included from ./cf_binom.h */
-
-
-CanonicalForm binomialpower ( const Variable&, const CanonicalForm&, int );
-
-
-/* stuff included from ./cf_algorithm.h */
-
-
-//{{{ function declarations from cf_algorithm.cc
-CanonicalForm psr ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
-
-CanonicalForm psq ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
-
-void psqr ( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & q, CanonicalForm & r, const Variable & x );
-
-CanonicalForm bCommonDen ( const CanonicalForm & f );
-
-bool fdivides ( const CanonicalForm & f, const CanonicalForm & g );
-
-CanonicalForm maxNorm ( const CanonicalForm & f );
-
-CanonicalForm euclideanNorm ( const CanonicalForm & f );
-//}}}
-
-//{{{ function declarations from cf_chinese.cc
-void chineseRemainder ( const CanonicalForm & x1, const CanonicalForm & q1, const CanonicalForm & x2, const CanonicalForm & q2, CanonicalForm & xnew, CanonicalForm & qnew );
-
-void chineseRemainder ( const CFArray & x, const CFArray & q, CanonicalForm & xnew, CanonicalForm & qnew );
-
-CanonicalForm Farey ( const CanonicalForm & f, const CanonicalForm & q );
-//}}}
-
-//{{{ function declarations from cf_factor.cc
-bool isPurePoly(const CanonicalForm & f);
-
-bool isPurePoly_m(const CanonicalForm & f);
-
-CFFList factorize ( const CanonicalForm & f, bool issqrfree = false );
-
-CFFList factorize ( const CanonicalForm & f, const Variable & alpha );
-
-CFFList sqrFree ( const CanonicalForm & f );
-
-bool isSqrFree ( const CanonicalForm & f );
-
-CanonicalForm homogenize( const CanonicalForm & f, const Variable & x);
-CanonicalForm homogenize( const CanonicalForm & f, const Variable & x,
-                                const Variable & v1, const Variable & v2);
-Variable get_max_degree_Variable(const CanonicalForm & f);
-CFList get_Terms( const CanonicalForm & f );
-void getTerms( const CanonicalForm & f, const CanonicalForm & t, CFList & result );
-
-
-//}}}
-
-//{{{ function declarations from cf_linsys.cc
-bool linearSystemSolve ( CFMatrix & M );
-
-CanonicalForm determinant ( const CFMatrix & M, int n );
-//}}}
-
-//{{{ function declarations from cf_resultant.cc
-CFArray subResChain ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
-
-CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x );
-//}}}
-
-//{{{ inline CanonicalForm abs ( const CanonicalForm & f )
-//{{{ docu
-//
-// abs() - return absolute value of `f'.
-//
-// The absolute value is defined in terms of the function
-// `sign()'.  If it reports negative sign for `f' than -`f' is
-// returned, otherwise `f'.
-//
-// This behaviour is most useful for integers and rationals.  But
-// it may be used to sign-normalize the leading coefficient of
-// arbitrary polynomials, too.
-//
-// Type info:
-// ----------
-// f: CurrentPP
-//
-//}}}
-inline CanonicalForm
-abs ( const CanonicalForm & f )
-{
-    // it is not only more general to use `sign()' instead of a
-    // direct comparison `f < 0', it is faster, too
-    if ( sign( f ) < 0 )
-        return -f;
-    else
-        return f;
-}
-//}}}
-
-
-/* stuff included from ./cf_eval.h */
-
-
-class Evaluation
-{
-protected:
-    CFArray values;
-public:
-    Evaluation() : values() {}
-    Evaluation( int min, int max ) : values( min, max ) {}
-    Evaluation( const Evaluation & e ) : values( e.values ) {}
-    virtual ~Evaluation() {}
-    Evaluation& operator= ( const Evaluation & e );
-    int min() const { return values.min(); }
-    int max() const { return values.max(); }
-    CanonicalForm operator[] ( int i ) const { return values[i]; }
-    CanonicalForm operator[] ( const Variable & v ) const { return operator[](v.level()); }
-    CanonicalForm operator() ( const CanonicalForm& f ) const;
-    CanonicalForm operator() ( const CanonicalForm & f, int i, int j ) const;
-    virtual void nextpoint();
-#ifndef NOSTREAMIO
-    friend OSTREAM& operator<< ( OSTREAM& s, const Evaluation &e );
-#endif /* NOSTREAMIO */
-};
-
-
-/* stuff included from ./cf_generator.h */
-
-
-class CFGenerator
-{
-public:
-    CFGenerator() {}
-    virtual ~CFGenerator() {}
-    virtual bool hasItems() const { return false; }
-    virtual void reset() {};
-    virtual CanonicalForm item() const { return 0; }
-    virtual void next() {};
-};
-
-class FFGenerator : public CFGenerator
-{
-private:
-    int current;
-public:
-    FFGenerator() : current(0) {}
-    ~FFGenerator() {}
-    bool hasItems() const;
-    void reset() { current = 0; }
-    CanonicalForm item() const;
-    void next();
-    void operator++ () { next(); }
-    void operator++ ( int ) { next(); }
-};
-
-class GFGenerator : public CFGenerator
-{
-private:
-    int current;
-public:
-    GFGenerator();
-    ~GFGenerator() {}
-    bool hasItems() const;
-    void reset();
-    CanonicalForm item() const;
-    void next();
-    void operator++ () { next(); }
-    void operator++ ( int ) { next(); }
-};
-
-class AlgExtGenerator //??? : public CFGenerator
-{
-private:
-    Variable algext;
-    FFGenerator **gensf;
-    GFGenerator **gensg;
-    int n;
-    bool nomoreitems;
-    AlgExtGenerator();
-    AlgExtGenerator( const AlgExtGenerator & );
-    AlgExtGenerator& operator= ( const AlgExtGenerator & );
-public:
-    AlgExtGenerator( const Variable & a );
-    ~AlgExtGenerator();
-
-    bool hasItems() const { return ! nomoreitems; }
-    void reset();
-    CanonicalForm item() const;
-    void next();
-    void operator++ () { next(); }
-    void operator++ ( int ) { next(); }
-};
-
-class CFGenFactory
-{
-public:
-    static CFGenerator* generate();
-};
-
-
-/* stuff included from ./cf_iter.h */
-
-
-#undef CF_INLINE
-#define CF_INLINE
-#undef CF_NO_INLINE
-#define CF_NO_INLINE
-
-
-class term;
-typedef term * termList;
-
-class CFIterator {
-private:
-    CanonicalForm data;
-    termList cursor;
-    bool ispoly, hasterms;
-public:
-    CFIterator ();
-    CFIterator ( const CFIterator& );
-    CFIterator ( const CanonicalForm& );
-    CFIterator ( const CanonicalForm&, const Variable& );
-
-    ~CFIterator ();
-
-    CFIterator& operator= ( const CFIterator& );
-    CFIterator& operator= ( const CanonicalForm& );
-
-    CF_NO_INLINE CFIterator& operator++ ();
-    CF_NO_INLINE CFIterator& operator++ ( int );
-    CF_NO_INLINE int hasTerms () const;
-    CF_NO_INLINE CanonicalForm coeff () const;
-    CF_NO_INLINE int exp () const;
-};
-
-
-/* stuff included from ./cf_random.h */
-
-
-class CFRandom {
-public:
-    virtual ~CFRandom() {}
-    virtual CanonicalForm generate() const { return 0; }
-    virtual CFRandom * clone() const { return new CFRandom(); }
-};
-
-class GFRandom : public CFRandom
-{
-public:
-    GFRandom() {};
-    ~GFRandom() {}
-    CanonicalForm generate() const;
-    CFRandom * clone() const;
-};
-
-class FFRandom : public CFRandom
-{
-public:
-    FFRandom() {}
-    ~FFRandom() {}
-    CanonicalForm generate() const;
-    CFRandom * clone() const;
-};
-
-class IntRandom : public CFRandom
-{
-private:
-    int max;
-public:
-    IntRandom();
-    IntRandom( int m );
-    ~IntRandom();
-    CanonicalForm generate() const;
-    CFRandom * clone() const;
-};
-
-class AlgExtRandomF : public CFRandom {
-private:
-    Variable algext;
-    CFRandom * gen;
-    int n;
-    AlgExtRandomF();
-    AlgExtRandomF( const Variable & v, CFRandom * g, int nn );
-    AlgExtRandomF& operator= ( const AlgExtRandomF & );
-public:
-    AlgExtRandomF( const AlgExtRandomF & );
-    AlgExtRandomF( const Variable & v );
-    AlgExtRandomF( const Variable & v1, const Variable & v2 );
-    ~AlgExtRandomF();
-    CanonicalForm generate() const;
-    CFRandom * clone() const;
-};
-
-class CFRandomFactory {
-public:
-    static CFRandom * generate();
-};
-
-int factoryrandom( int n );
-
-void factoryseed( int s );
-
-
-/* stuff included from ./cf_irred.h */
-
-
-CanonicalForm find_irreducible ( int deg, CFRandom & gen, const Variable & x );
-
-
-/* stuff included from ./fac_util.h */
-
-
-class modpk
-{
-private:
-    CanonicalForm pk;
-    CanonicalForm pkhalf;
-    int p;
-    int k;
-public:
-    modpk();
-    modpk( int q, int l );
-    modpk( const modpk & m );
-    modpk& operator= ( const modpk& m );
-    ~modpk() {}
-    int getp() const { return p; }
-    int getk() const { return k; }
-    CanonicalForm inverse( const CanonicalForm & f, bool symmetric = true ) const;
-    CanonicalForm getpk() const { return pk; }
-    CanonicalForm operator() ( const CanonicalForm & f, bool symmetric = true ) const;
-};
-
-
-CanonicalForm replaceLc( const CanonicalForm & f, const CanonicalForm & c );
-
-CanonicalForm remainder( const CanonicalForm & f, const CanonicalForm & g, const modpk & pk );
-
-void divremainder( const CanonicalForm & f, const CanonicalForm & g, CanonicalForm & quot, CanonicalForm & rem, const modpk & pk );
-
-bool Hensel ( const CanonicalForm & U, CFArray & G, const CFArray & lcG, const Evaluation & A, const modpk & bound, const Variable & x );
-
-/* some special array functions */
-
-CanonicalForm sum ( const CFArray & a, int f, int l );
-
-CanonicalForm prod ( const CFArray & a, int f, int l );
-
-CanonicalForm sum ( const CFArray & a );
-
-CanonicalForm prod ( const CFArray & a );
-
-CanonicalForm crossprod ( const CFArray & a, const CFArray & b );
-
-
-/* stuff included from ./cf_map.h */
-
-
-//{{{ class MapPair
-//{{{ docu
-//
-// class MapPair - stores one mapping pair (Variable -> CanonicalForm).
-//
-// This class is only used to store such pairs.  It has no
-// methods to transform a CanonicalForm as the class CFMap has.
-//
-// V, S: the pair (V -> S)
-//
-//}}}
-//{{{ inline method docu
-//
-// Variable var () const
-// CanonicalForm subst () const
-//
-// var(), subst() - selectors, return V and P, resp.
-//
-//}}}
-class MapPair
-{
-private:
-    Variable V;
-    CanonicalForm S;
-public:
-    MapPair ( const Variable & v, const CanonicalForm & s ) : V(v), S(s) {}
-    MapPair () : V(), S(1) {}
-    MapPair ( const MapPair & p ) : V(p.V), S(p.S) {}
-    ~MapPair () {}
-    MapPair & operator = ( const MapPair & p );
-    Variable var () const { return V; }
-    CanonicalForm subst () const { return S; }
-#ifndef NOSTREAMIO
-    void print( OSTREAM&) const;
-    friend OSTREAM & operator << ( OSTREAM & s, const MapPair & p );
-#endif /* NOSTREAMIO */
-};
-//}}}
-
-typedef List<MapPair> MPList;
-typedef ListIterator<MapPair> MPListIterator;
-
-//{{{ class CFMap
-//{{{ docu
-//
-// class CFMap - class to map canonical forms.
-//
-// Use an object of class CFMap to insert 'values' into canonical
-// form.  Such a mapping is defined by a list of MapPairs (V -> S)
-// describing which canonical form S to insert for variable V.
-// Hereby, the substituted canonical forms are not subject to
-// further substitutions.
-//
-// P: list of MapPairs, sorted by level in descending order
-//
-//}}}
-class CFMap
-{
-private:
-  MPList P;
-public:
-  CFMap () {}
-  CFMap ( const CanonicalForm & s ) : P( MapPair( Variable(), s ) ) {}
-  CFMap ( const Variable & v ) : P( MapPair( v, 1 ) ) {}
-  CFMap ( const Variable & v, const CanonicalForm & s ) : P( MapPair( v, s ) ) {}
-  ~CFMap () {}
-  CFMap ( const CFList & L );
-  CFMap ( const CFMap & m ) : P( m.P ) {}
-  CFMap & operator = ( const CFMap & m );
-  void newpair ( const Variable & v, const CanonicalForm & s );
-  CanonicalForm operator () ( const CanonicalForm & f ) const;
-#ifndef NOSTREAMIO
-  friend OSTREAM & operator << ( OSTREAM & s, const CFMap & m );
-#endif /* NOSTREAMIO */
-};
-//}}}
-
-CanonicalForm compress ( const CanonicalForm & f, CFMap & m );
-void compress ( const CFArray & a, CFMap & M, CFMap & N );
-void compress ( const CanonicalForm & f, const CanonicalForm & g, CFMap & M, CFMap & N );
-
-
-/* stuff included from ./cf_reval.h */
-
-
-class REvaluation : public Evaluation
-{
-protected: // neeeded in FFREvaluation
-    CFRandom * gen;
-public:
-    REvaluation() : Evaluation(), gen(0) {}
-    REvaluation( int min, int max, const CFRandom & sample ) : Evaluation( min, max ), gen( sample.clone() ) {}
-    REvaluation( const REvaluation & e );
-    ~REvaluation();
-    REvaluation& operator= ( const REvaluation & e );
-    void nextpoint();
-};
-
-
-/* stuff included from ./fac_sqrfree.h */
-
-
-#ifdef SINGULAR
-
-/* stuff included from ./gfops.h */
-
-
-int gf_gf2ff ( int a );
-
-bool gf_isff ( int a );
-
-
-/* stuff included from ./singext.h */
-
-
-MP_INT gmp_numerator ( const CanonicalForm & f );
-
-MP_INT gmp_denominator ( const CanonicalForm & f );
-
-int gf_value (const CanonicalForm & f );
-
-CanonicalForm make_cf ( const MP_INT & n );
-
-CanonicalForm make_cf ( const MP_INT & n, const MP_INT & d, bool normalize );
-
-CanonicalForm make_cf_from_gf ( const int z );
-
-
-#endif /* SINGULAR */
-
-#ifdef HAVE_BIFAC
-/* stuff included from ./bifac.h */
-
-
-CFFList AbsFactorize( const CanonicalForm  & a );
-
-class BIFAC
-{
-////////////////////////////////////////////////////////////////
-  public:
-////////////////////////////////////////////////////////////////  
-
-  // === KONST-/ DESTRUKTOREN ====
-  BIFAC         ( void );  // Konstruktor
-  virtual ~BIFAC( void );  // DESTRUKTOR
-
-  // === Funktionen =======
-  void     bifac(CanonicalForm f, bool absolute=true);
-  CFFList  getFactors( void ){ return  gl_RL; };
-
-
-////////////////////////////////////////////////////////////////
- private:
-////////////////////////////////////////////////////////////////
-
-  // === Funktionen =======
-  void   passedTime();
-  void   biGanzMachen(  CanonicalForm & f );
-  void   biNormieren( CanonicalForm & f ) ;
-  void   convertResult(  CanonicalForm & f, int ch, int sw);
-  int    findCharacteristic(CanonicalForm f);
-//  void   matrix_drucken( CFMatrix M );
-  long int  anz_terme(  CanonicalForm & f );
-
-  CFList matrix2basis(CFMatrix A, int dim, int m, int n, CanonicalForm f);
-  CFList basisOfG(CanonicalForm f);
-  CFMatrix createA (CFList G, CanonicalForm f);
-  CanonicalForm  create_g    (CFList G);
-  CFList         createRg    (CFList G, CanonicalForm f);
-  CFList         createEg    (CFList G, CanonicalForm f);
-  CFList         createEgUni (CFList G, CanonicalForm f);
-
-  void     unifac(CanonicalForm f, int grad);
-  CanonicalForm RationalFactor (CanonicalForm phi, CanonicalForm f, \
-				CanonicalForm fx, CanonicalForm g);
-  void   RationalFactorizationOnly (CFFList Phis, CanonicalForm f, CanonicalForm g);
-  CFList getAbsoluteFactors (CanonicalForm f1, CanonicalForm phi);
-  void   AbsoluteFactorization (CFFList Phis, CanonicalForm f, CanonicalForm g);
-  void   bifacSqrFree( CanonicalForm f );
-  void   bifacMain(CanonicalForm f);
-  
-
-  // === Variable =======
-  CFFList gl_RL;    // where to store the rational factorization
-  CFList  gl_AL;    // where to store the absolute factorization
-  bool   absolute;  // Compute an absolute factorization as well? 
-  int    exponent;  // 
-};
-
-#endif /* HAVE_BIFAC */
-
-#endif /* ! INCL_FACTORY_H */
diff --git a/factory/winnt/factoryconf.h b/factory/winnt/factoryconf.h
deleted file mode 100644
index d735131..0000000
--- a/factory/winnt/factoryconf.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/* winnt/factoryconf.h automatically generated by makeheader from factoryconf.template */
-/* emacs edit mode for this file is -*- C -*- */
-/* $Id: factoryconf.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_FACTORYCONF_H
-#define INCL_FACTORYCONF_H
-
-/* {{{ docu
-*
-* factoryconf.template - template to generate `factoryconf.h'.
-*
-* `factoryconf.h' serves as a configuration file for the
-* installed source files (templates and `factory.h') the same
-* way as `config.h' serves as a configuration file for the
-* source files from which the library is build.  Additionally,
-* we paste a copy of our `assert.h' into this file which is
-* necessary for the templates to translate.
-*
-*/
-/* }}} */
-
-/* stuff included from ./winnt/config.h */
-
-/* emacs edit mode for this file is -*- C -*- */
-/* $Id: factoryconf.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-#ifndef INCL_CONFIG_H
-#define INCL_CONFIG_H
-
-/* {{{ docu
- *
- * config.h.in - used by `configure' to create `config.h'.
- *
- * This file is included at building time from almost all source
- * files belonging to Factory.  Furthermore, it is (textually)
- * included into `factoryconf.h' by `makeheader' so we have an
- * installed version of this file, too.  This way, the installed
- * source files will be compiled with the same settings as the
- * library itself.
- *
- * In general, you should let `configure' guess the correct
- * values for the `#define's below.  But if something seriously
- * goes wrong in configuring, please inform the authors and feel
- * free to edit the marked section.
- *
- * ---RS---
- * This is the specialized version of config.h for compiling
- * Factory on Windows NT 4.0 with MS Visula C++ 5.x
- * ---RS---
- */
-/* }}} */
-
-/************** START OF CONFIGURABLE SECTION **************/
-
-/* Define to empty if the keyword does not work.  */
-/* #undef const */
-
-/* Define as __inline if that's what the C compiler calls it.  */
-/* #undef inline */
-
-/* factory version */
-#define FACTORYVERSION "1.3b"
-
-/* factory configuration */
-#define FACTORYCONFIGURATION "WINNT"
-
-/* where the gftables live */
-#define GFTABLEDIR "."
-
-/* define if your compiler does arithmetic shift */
-#define HAS_ARITHMETIC_SHIFT 1
-
-/* define to build factory without stream IO */
-#undef NOSTREAMIO
-
-/* define if linked to Singular */
-#undef SINGULAR
-
-/* define if linked with factory memory manager */
-#define USE_MEMUTIL 1
-
-/* define if linked with old factory memory manager */
-#define USE_OLD_MEMMAN 1
-
-/* define if linked with new factory manager, debugging version */
-#undef MDEBUG
-
-/* define if you do not want to activate assertions */
-#undef NOASSERT
-
-/* define if you want to activate the timing stuff */
-#undef TIMING
-
-/* define if you want to have debugging output */
-#undef DEBUGOUTPUT
-
-/* define type of your compilers 64 bit integer type */
-#define INT64 __int64
-
-/************** END OF CONFIGURABLE SECTION **************/
-
-#endif /* ! INCL_CONFIG_H */
-
-/* stuff included from ./assert.h */
-
-/* emacs edit mode for this file is -*- C -*- */
-/* $Id: factoryconf.h 12231 2009-11-02 10:12:22Z hannes $ */
-
-/* This is for compatibility with standard assert.h */
-#if defined (NDEBUG) && ! defined (NOASSERT)
-#define NOASSERT
-#endif
-
-/* It should be possible to include this file multiple times for different */
-/* settings of NOASSERT */
-
-/* {{{ undefines */
-#undef __ASSERT
-#undef __ASSERT1
-#undef STICKYASSERT
-#undef STICKYASSERT1
-#undef ASSERT
-#undef ASSERT1
-
-#undef __WARN
-#undef STICKYWARN
-#undef WARN
-
-#undef PVIRT_VOID
-#undef PVIRT_INTCF
-#undef PVIRT_BOOL
-#undef PVIRT_INT
-#undef PVIRT_CHARCC
-/* }}} */
-
-#ifdef HAVE_CSTDIO
-#include <cstdio>
-#else
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-/* {{{ permanent macro definitions */
-#ifndef __GNUC__
-#define __ASSERT(expression, message, file, line) \
-(fprintf( stderr, "error: " message "\n%s:%u: failed assertion `%s'\n", \
- file, line, expression ), abort(), 0 )
-#define __ASSERT1(expression, message, parameter1, file, line)  \
-(fprintf( stderr, "error: " message "\n%s:%u: failed assertion `%s'\n", \
- parameter1, file, line, expression ), abort(), 0 )
-
-#define STICKYASSERT(expression, message) \
-((void)((expression) ? 0 : __ASSERT(#expression, message, __FILE__, __LINE__)))
-#define STICKYASSERT1(expression, message, parameter1) \
-((void)((expression) ? 0 : __ASSERT1(#expression, message, parameter1, __FILE__, __LINE__)))
-
-#define __WARN(expression, message, file, line)  \
-(fprintf( stderr, "warning: " message "\n%s:%u: failed assertion `%s'\n", \
- file, line, expression ), 0 )
-#define STICKYWARN(expression, message) \
-((void)((expression) ? 0 : __WARN(#expression, message, __FILE__, __LINE__)))
-#else /* __GNUCC__ */
-/* use preprocessor macro __PRETTY_FUNCTION__ for more informative output */
-#define __ASSERT(expression, message, file, line, function) \
-(fprintf( stderr, "error: " message "\n%s:%u: In function `%s':\nfailed assertion `%s'\n", \
- file, line, function, expression ), abort(), 0 )
-#define __ASSERT1(expression, message, parameter1, file, line, function)  \
-(fprintf( stderr, "error: " message "\n%s:%u: In function `%s':\nfailed assertion `%s'\n", \
- parameter1, file, line, function, expression ), abort(), 0 )
-
-#define STICKYASSERT(expression, message) \
-((void)((expression) ? 0 : __ASSERT(#expression, message, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-#define STICKYASSERT1(expression, message, parameter1) \
-((void)((expression) ? 0 : __ASSERT1(#expression, message, parameter1, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-
-#define __WARN(expression, message, file, line, function)  \
-(fprintf( stderr, "warning: " message "\n%s:%u: In function `%s':\nfailed assertion `%s'\n", \
- file, line, function, expression ), 0 )
-#define STICKYWARN(expression, message) \
-((void)((expression) ? 0 : __WARN(#expression, message, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-#endif /* __GNUCC__ */
-/* }}} */
-
-/* {{{ macro definitions dependent on NOASSERT */
-#ifndef NOASSERT
-#ifndef __GNUC__
-#define ASSERT(expression, message) \
-((void)((expression) ? 0 : __ASSERT(#expression, message, __FILE__, __LINE__)))
-#define ASSERT1(expression, message, parameter1) \
-((void)((expression) ? 0 : __ASSERT1(#expression, message, parameter1, __FILE__, __LINE__)))
-
-#define WARN(expression, message) \
-((void)((expression) ? 0 : __WARN(#expression, message, __FILE__, __LINE__)))
-#else /* __GNUCC__ */
-/* use preprocessor macro __PRETTY_FUNCTION__ for more informative output */
-#define ASSERT(expression, message) \
-((void)((expression) ? 0 : __ASSERT(#expression, message, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-#define ASSERT1(expression, message, parameter1) \
-((void)((expression) ? 0 : __ASSERT1(#expression, message, parameter1, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-
-#define WARN(expression, message) \
-((void)((expression) ? 0 : __WARN(#expression, message, __FILE__, __LINE__, __PRETTY_FUNCTION__)))
-#endif /* __GNUCC__ */
-
-#define PVIRT_VOID(msg) \
-{ fprintf( stderr, "pure method( " msg " ) called\n" ); abort(); }
-#define PVIRT_INTCF(msg) \
-{ fprintf( stderr, "pure method( " msg " ) called\n" ); abort(); return 0; }
-#define PVIRT_BOOL(msg) \
-{ fprintf( stderr, "pure method( " msg " ) called\n" ); abort(); return false; }
-#define PVIRT_INT(msg) \
-{ fprintf( stderr, "pure method( " msg " ) called\n" ); abort(); return 0; }
-#define PVIRT_CHARCC(msg) \
-{ fprintf( stderr, "pure method( " msg " ) called\n" ); abort(); return 0; }
-#else /* NOASSERT */
-#define ASSERT(expression, message)
-#define ASSERT1(expression, message, parameter1)
-
-#define WARN(expression, message)
-
-#define PVIRT_VOID(msg) = 0
-#define PVIRT_INTCF(msg) = 0
-#define PVIRT_BOOL(msg) = 0
-#define PVIRT_INT(msg) = 0
-#define PVIRT_CHARCC(msg) = 0
-#endif /* NOASSERT */
-/* }}} */
-
-#endif /* ! INCL_FACTORYCONF_H */
diff --git a/factory/winnt/nt.mak b/factory/winnt/nt.mak
deleted file mode 100644
index 62fbfae..0000000
--- a/factory/winnt/nt.mak
+++ /dev/null
@@ -1,81 +0,0 @@
-NODEBUG = 1
-
-!include <ntwin32.mak>
-
-objs =	"canonicalform.obj" \
-	"cf_algorithm.obj" \
-	"cf_binom.obj" \
-	"cf_char.obj" \
-	"cf_chinese.obj" \
-	"cf_eval.obj" \
-	"cf_factor.obj" \
-	"cf_factory.obj" \
-	"cf_gcd.obj" \
-	"cf_generator.obj" \
-	"cf_globals.obj" \
-	"cf_irred.obj" \
-	"cf_iter.obj" \
-	"cf_linsys.obj" \
-	"cf_map.obj" \
-	"cf_ops.obj" \
-	"cf_primes.obj" \
-	"cf_random.obj" \
-	"cf_resultant.obj" \
-	"cf_reval.obj" \
-	"cf_switches.obj" \
-	"cf_util.obj" \
-	"debug.obj" \
-	"fac_berlekamp.obj" \
-	"fac_cantzass.obj" \
-	"fac_distrib.obj" \
-	"fac_ezgcd.obj" \
-	"fac_iterfor.obj" \
-	"fac_multihensel.obj" \
-	"fac_multivar.obj" \
-	"fac_sqrfree.obj" \
-	"fac_univar.obj" \
-	"fac_util.obj" \
-	"ffops.obj" \
-	"ftmpl_inst.obj" \
-	"gfops.obj" \
-	"gf_tabutil.obj" \
-	"initgmp.obj" \
-	"int_cf.obj" \
-	"int_int.obj" \
-	"int_poly.obj" \
-	"int_pp.obj" \
-	"int_rat.obj" \
-	"newdelete.obj" \
-	"parseutil.obj" \
-	"readcf.obj" \
-	"sm_sparsemod.obj" \
-	"sm_util.obj" \
-	"variable.obj" \
-	"memutil.obj"
-
-
-INCLUDE = .;$(INCLUDE)
-LIB = .;$(LIB)
-
-cpp = cl
-cflags = -W3 -DWINNT -D__STDC__ -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -D_X86_=1 -DWINVER=0x400 
-cppflags = $(cflags) $(cdebug) $(cvarsmt) /GX /MT
-
-all:	factory.lib
-
-.SUFFIXES: .cc .obj .c .h .exe
-
-
-.c.obj:
-	$(cpp) $(cppflags) /c $*.c
-
-
-.cc.obj:
-	$(cpp) /TP $(cppflags) /c $*.cc
-
-factory.lib: $(objs)
-	$(implib) -out:factory.lib $(objs)
-
-testfac.exe: testfac.obj factory.lib
-	$(link) /nodefaultlib:libc $(linkdebug) -out:testfac.exe testfac.obj factory.lib gmp.lib $(conlibsmt)
-
diff --git a/kernel/bbcone.h b/kernel/bbcone.h
deleted file mode 100755
index 84bb001..0000000
--- a/kernel/bbcone.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef BBCONE_H
-#define BBCONE_H
-
-#ifdef HAVE_FANS
-#include <gfanlib/gfanlib.h>
-
-extern int coneID;
-
-void bbcone_setup();
-intvec* zVector2Intvec(const gfan::ZVector zv);
-intvec* zMatrix2Intvec(const gfan::ZMatrix zm);
-gfan::ZMatrix intmat2ZMatrix(const intvec* iMat);
-gfan::ZVector intvec2ZVector(const intvec* iVec);
-std::string toString(gfan::ZMatrix const &m, char *tab=0);
-int integerToInt(gfan::Integer const &V, bool &ok);
-
-int getDimension(gfan::ZCone* zc);
-int getCodimension(gfan::ZCone* zc);
-int getLinealityDimension(gfan::ZCone* zc);
-int isSimplicial(gfan::ZCone* zc);
-
-bool containsInSupport(gfan::ZCone* zc, gfan::ZCone* zd);
-bool containsInSupport(gfan::ZCone* zc, intvec* vec);
-
-#endif
-#endif
diff --git a/kernel/bbfan.h b/kernel/bbfan.h
deleted file mode 100755
index 86ad31d..0000000
--- a/kernel/bbfan.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef BBFAN_H
-#define BBFAN_H
-
-#ifdef HAVE_FANS
-#include <gfanlib/gfanlib.h>
-
-extern int fanID;
-
-void bbfan_setup();
-
-int getAmbientDimension(gfan::ZFan* zf);
-int getCodimension(gfan::ZFan* zf);
-int getDimension(gfan::ZFan* zf);
-int getLinealityDimension(gfan::ZFan* zf);
-
-#endif
-#endif
diff --git a/kernel/bbpolytope.h b/kernel/bbpolytope.h
deleted file mode 100755
index d75683f..0000000
--- a/kernel/bbpolytope.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#ifndef BBPOLYTOPE_H
-#define BBPOLYTOPE_H
-
-#ifdef HAVE_FANS
-#include <gfanlib/gfanlib.h>
-
-extern int polytopeID;
-
-void bbpolytope_setup();
-
-intvec* getFacetNormals(gfan::ZCone *zc);
-int getAmbientDimension(gfan::ZCone* zc); // zc is meant to represent a polytope here
-int getCodimension(gfan::ZCone *zc);
-int getDimension(gfan::ZCone* zc);
-
-#endif
-#endif
diff --git a/kernel/gfan.cc b/kernel/gfan.cc
deleted file mode 100644
index ca08a3c..0000000
--- a/kernel/gfan.cc
+++ /dev/null
@@ -1,4512 +0,0 @@
-/*
-Compute the Groebner fan of an ideal
-$Author: monerjan $
-$Date: 2009/11/03 06:57:32 $
-$Header: /usr/local/Singular/cvsroot/kernel/gfan.cc,v 1.103 2009/11/03 06:57:32 monerjan Exp $
-$Id: gfan.cc 14493 2012-01-16 11:00:07Z motsak $
-*/
-
-#include <kernel/mod2.h>
-
-#ifdef HAVE_FANS
-#include <kernel/options.h>
-#include <kernel/kstd1.h>
-#include <kernel/kutil.h>
-#include <kernel/polys.h>
-#include <kernel/ideals.h>
-#include <kernel/kmatrix.h>
-#include <kernel/GMPrat.h>
-
-#include "ring.h"	//apparently not needed
-#include <Singular/lists.h>
-#include <kernel/prCopy.h>
-#include <kernel/stairc.h>
-#include <fstream>	//read-write cones to files
-#include <string>
-#include <sstream>
-#include <stdlib.h>
-#include <assert.h>
-#include <gfanlib/gfanlib.h>
-
-/*DO NOT REMOVE THIS*/
-#ifndef GMPRATIONAL
-#define GMPRATIONAL
-#endif
-
-#include <setoper.h>
-#include <cdd.h>
-#include <cddmp.h>
-
-#ifndef gfan_DEBUG
-// #define gfan_DEBUG
-#ifndef gfan_DEBUGLEVEL
-#define gfan_DEBUGLEVEL 1
-#endif
-#endif
-
-//NOTE Defining this will slow things down!
-//Only good for very coarse profiling
-// #define gfanp
-#ifdef gfanp
-  #include <sys/time.h>
-  #include <iostream>
-#endif
-
-//NOTE DO NOT REMOVE THIS
-#ifndef SHALLOW
-  #define SHALLOW
-#endif
-
-#ifndef USE_ZFAN
-  #define USE_ZFAN
-#endif
-
-#include <gfan.h>
-using namespace std;
-
-#define ivIsStrictlyPositive iv64isStrictlyPositive
-
-/**
-*\brief Class facet
-*	Implements the facet structure as a linked list
-*
-*/
-		
-/** \brief The default constructor for facets
-*/
-facet::facet()			
-{
-	// Pointer to next facet.  */
-	/* Defaults to NULL. This way there is no need to check explicitly */
-	this->fNormal=NULL;
-	this->interiorPoint=NULL;		
-	this->UCN=0;
-	this->codim2Ptr=NULL;
-	this->codim=1;		//default for (codim-1)-facets
-	this->numCodim2Facets=0;
-	this->numRays=0;
-	this->flipGB=NULL;
-	this->next=NULL;
-	this->prev=NULL;		
-	this->flipRing=NULL;	//the ring on the other side
-	this->isFlippable=FALSE;
-}
-		
-/** \brief Constructor for facets of codim == 2
-* Note that as of now the code of the constructors is only for facets and codim2-faces. One
-* could easily change that by renaming numCodim2Facets to numCodimNminusOneFacets or similar
-*/
-facet::facet(const int &n)
-{
-	this->fNormal=NULL;
-	this->interiorPoint=NULL;			
-	this->UCN=0;
-	this->codim2Ptr=NULL;
-	if(n==2)
-	{
-		this->codim=n;
-	}//NOTE Handle exception here!			
-	this->numCodim2Facets=0;
-	this->numRays=0;
-	this->flipGB=NULL;
-	this->next=NULL;
-	this->prev=NULL;
-	this->flipRing=NULL;
-	this->isFlippable=FALSE;
-}
-		
-/** \brief The copy constructor
-* By default only copies the fNormal, f2Normals and UCN
-*/
-facet::facet(const facet& f)
-{
-	this->fNormal=iv64Copy(f.fNormal);
-	this->UCN=f.UCN;
-	this->isFlippable=f.isFlippable;
-	//Needed for flip2
-	//NOTE ONLY REFERENCE
-	this->interiorPoint=iv64Copy(f.interiorPoint);//only referencing is prolly not the best thing to do in a copy constructor
-	facet* f2Copy;
-	f2Copy=f.codim2Ptr;
-	facet* f2Act;
-	f2Act=this->codim2Ptr;
-	while(f2Copy!=NULL)
-	{
-		if(f2Act==NULL
-#ifndef NDEBUG
-  #if SIZEOF_LONG==8
-				 || f2Act==(facet*)0xfefefefefefefefe
-  #elif SIZEOF_LONG==4
-				 || f2Act==(facet*)0xfefefefe
-  #endif
-#endif
-		  )
-		{
-			f2Act=new facet(2);
-			this->codim2Ptr=f2Act;			
-		}
-		else
-		{
-			facet* marker;
-			marker = f2Act;
-			f2Act->next = new facet(2);
-			f2Act = f2Act->next;
-			f2Act->prev = marker;
-		}
-		int64vec *f2Normal;
-		f2Normal = f2Copy->getFacetNormal();
-// 		f2Act->setFacetNormal(f2Copy->getFacetNormal());
-		f2Act->setFacetNormal(f2Normal);
-		delete f2Normal;
-		f2Act->setUCN(f2Copy->getUCN());
-		f2Copy = f2Copy->next;
-	}	
-}
-
-/** \brief Shallow copy constructor for facets
-* We only need the interior point for equality testing
-*/
-facet* facet::shallowCopy(const facet& f)
-{
-	facet *res = new facet();
-	res->fNormal=(int64vec * const)f.fNormal;
-	res->UCN=f.UCN;
-	res->isFlippable=f.isFlippable;
-	res->interiorPoint=(int64vec * const)f.interiorPoint;
-	res->codim2Ptr=(facet * const)f.codim2Ptr;
-	res->prev=NULL;
-	res->next=NULL;
-	res->flipGB=NULL;
-	res->flipRing=NULL;
-	return res;
-}
-
-void facet::shallowDelete()
-{
-#ifndef NDEBUG
-// 	printf("shallowdel at UCN %i\n", this->getUCN());
-#endif
-	this->fNormal=NULL;
-// 	this->UCN=0;
-	this->interiorPoint=NULL;
-	this->codim2Ptr=NULL;
-	this->prev=NULL;
-	this->next=NULL;
-	this->flipGB=NULL;
-	this->flipRing=NULL;
-	assert(this->fNormal==NULL);	
-// 	delete(this);
-}
-		
-/** The default destructor */
-facet::~facet()
-{
-#ifndef NDEBUG
-// 	printf("~facet at UCN %i\n",this->getUCN());
-#endif
-	if(this->fNormal!=NULL)
-		delete this->fNormal;
-	if(this->interiorPoint!=NULL)
-		delete this->interiorPoint;
-	/* Cleanup the codim2-structure */
-// 	if(this->codim==2)
-// 	{
-// 		facet *codim2Ptr;
-// 		codim2Ptr = this->codim2Ptr;
-// 		while(codim2Ptr!=NULL)
-// 		{
-// 			if(codim2Ptr->fNormal!=NULL)
-// 			{
-// 				delete codim2Ptr->fNormal;//NOTE Do not want this anymore since the rays are now in gcone!
-// 				codim2Ptr = codim2Ptr->next;
-// 			}
-// 		}
-// 	}
-	//The rays are stored in the cone!
-	if(this->flipGB!=NULL)
-		idDelete((ideal *)&this->flipGB);
-// 	if(this->flipRing!=NULL && this->flipRing->idroot!=(idhdl)0xfbfbfbfbfbfbfbfb)
-// 		rDelete(this->flipRing); //See vol II/134
-// 	this->flipRing=NULL;
-	this->prev=NULL;
-	this->next=NULL;
-}
-		
-inline const int64vec *facet::getRef2FacetNormal() const
-{
-	return(this->fNormal);
-}	
-
-/** Equality check for facets based on unique interior points*/
-static bool areEqual2(facet* f, facet *g)
-{
-#ifdef gfanp
-	gcone::numberOfFacetChecks++;
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	bool res = TRUE;
-	const int64vec *fIntP = f->getRef2InteriorPoint();
-	const int64vec *gIntP = g->getRef2InteriorPoint();
-	for(int ii=0;ii<pVariables;ii++)
-	{
-		if( (*fIntP)[ii] != (*gIntP)[ii] )
-		{
-			res=FALSE;
-			break;
-		}
-	}
-// 	if( fIntP->compare(gIntP)!=0) res=FALSE;
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	gcone::t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif	
-	return res;
-}
-
-/** \brief Comparison of facets
- * called from enqueueNewFacets
-* The facet normals are primitve vectors since we call gcone::normalize() on all cones.
-* Hence it should suffice to check whether facet normal f equals minus facet normal s.
-* If so we check the extremal rays
-*
-* BEWARE: It would be better to use const int64vec* but that will lead to call something like
-* int foo=((int64vec*)f2Normal)->compare((int64vec*)s2Normal) resulting in much higher memory usage
-*/
-static bool areEqual(facet *f, facet *s)
-{
-#ifdef gfanp
-	gcone::numberOfFacetChecks++;
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	bool res = TRUE;
-	int notParallelCtr=0;
-	int ctr=0;
-	const int64vec* fNormal; //No new since iv64Copy and therefore getFacetNormal return a new
-	const int64vec* sNormal;
-	fNormal = f->getRef2FacetNormal();
-	sNormal = s->getRef2FacetNormal();
-#include "intvec.h"
-	//Do not need parallelity. Too time consuming
-//  	if(!isParallel(*fNormal,*sNormal))
-// 	if(fNormal->compare(ivNeg(sNormal))!=0)//This results in a Mandelbug
- // 		notParallelCtr++;
-// 	else//parallelity, so we check the codim2-facets
-	int64vec *fNRef=const_cast<int64vec*>(fNormal);
-	int64vec *sNRef=const_cast<int64vec*>(sNormal);
-	if(isParallel(*fNRef,*sNRef))
-// 	if(fNormal->compare((sNormal))!=0)//Behold! Teh definitive Mandelbug
-	{
-		facet* f2Act;
-		facet* s2Act;
-		f2Act = f->codim2Ptr;		
-		ctr=0;
-		while(f2Act!=NULL)
-		{
-			const int64vec* f2Normal;
-			f2Normal = f2Act->getRef2FacetNormal();
-// 			int64vec *f2Ref=const_cast<int64vec*>(f2Normal);
-			s2Act = s->codim2Ptr;
-			while(s2Act!=NULL)
-			{
-				const int64vec* s2Normal;
-				s2Normal = s2Act->getRef2FacetNormal();
-// 				bool foo=areEqual(f2Normal,s2Normal);
-// 				int64vec *s2Ref=const_cast<int64vec*>(s2Normal);
-				int foo=f2Normal->compare(s2Normal);
-				if(foo==0)
-					ctr++;
-				s2Act = s2Act->next;
-			}
-			f2Act = f2Act->next;
-		}		
-	}
-	if(ctr==f->numCodim2Facets)
-		res=TRUE;
-	else
-	{
-#ifdef gfanp
-		gcone::parallelButNotEqual++;
-#endif
-		res=FALSE;
-	}
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	gcone::t_areEqual += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-	return res;
-}	
-		
-/** Stores the facet normal \param int64vec*/
-inline void facet::setFacetNormal(int64vec *iv)
-{
-	if(this->fNormal!=NULL)
-		delete this->fNormal;
-	this->fNormal = iv64Copy(iv);			
-}
-		
-/** Hopefully returns the facet normal 
-* Mind: iv64Copy returns a new int64vec, so use this in the following way:
-* int64vec *iv;
-* iv = this->getFacetNormal();
-* [...]
-* delete(iv);
-*/
-inline int64vec *facet::getFacetNormal() const
-{				
-	return iv64Copy(this->fNormal);
-}
-
-/** Method to print the facet normal*/
-inline void facet::printNormal() const
-{
-	fNormal->show();
-}
-		
-/** Store the flipped GB*/
-inline void facet::setFlipGB(ideal I)
-{
-	this->flipGB=idCopy(I);
-}
-		
-/** Returns a pointer to the flipped GB
-Seems not be used
-Anyhow idCopy would make sense here.
-*/
-inline ideal facet::getFlipGB()
-{
-	return this->flipGB;
-}
-		
-/** Print the flipped GB*/
-inline void facet::printFlipGB()
-{
-#ifndef NDEBUG
-	idShow(this->flipGB);
-#endif
-}
-		
-/** Set the UCN */
-inline void facet::setUCN(int n)
-{
-	this->UCN=n;
-}
-		
-/** \brief Get the UCN 
-* Returns the UCN iff this != NULL, else -1
-*/
-inline int facet::getUCN()
-{
-#ifndef NDEBUG
-  #if SIZEOF_LONG==8
-	if((this!=NULL && this!=(facet * const)0xfbfbfbfbfbfbfbfb))
-  #elif SIZEOF_LONG==4
-	if((this!=NULL && this!=(facet * const)0xfbfbfbfb))
-  #endif
-#endif
-#ifdef NDEBUG
-	if(this!=NULL)
-#endif			
-		return this->UCN;
-	else
-		return -1;
-}
-		
-/** Store an interior point of the facet */
-inline void facet::setInteriorPoint(int64vec *iv)
-{
-	if(this->interiorPoint!=NULL)
-		delete this->interiorPoint;
-	this->interiorPoint = iv64Copy(iv);
-}
-		
-/** Returns a pointer to this->interiorPoint
-* MIND: iv64Copy returns a new int64vec
-* @see facet::getFacetNormal
-*/
-inline int64vec *facet::getInteriorPoint()
-{
-	return iv64Copy(this->interiorPoint);
-}
-
-inline const int64vec *facet::getRef2InteriorPoint()
-{
-	return (this->interiorPoint);
-}
-		
-/** \brief Debugging function
-* prints the facet normal an all (codim-2)-facets that belong to it
-*/
-volatile void facet::fDebugPrint()
-{
-  #ifndef NDEBUG
-	facet *codim2Act;			
-	codim2Act = this->codim2Ptr;
-	int64vec *fNormal;
-	fNormal = this->getFacetNormal();	
-	printf("=======================\n");
-	printf("Facet normal = (");fNormal->show(1,1);printf(")\n");
-	printf("-----------------------\n");
-	printf("Codim2 facets:\n");
-	while(codim2Act!=NULL)
-	{
-		int64vec *f2Normal;
-		f2Normal = codim2Act->getFacetNormal();
-		printf("(");f2Normal->show(1,0);printf(")\n");
-		codim2Act = codim2Act->next;
-		delete f2Normal;
-	}
-	printf("=======================\n");
- 	delete fNormal;
-  #endif
-}
-
-
-/**
-*\brief Implements the cone structure
-*
-* A cone is represented by a linked list of facet normals
-* @see facet
-*/
-
-
-/** \brief Default constructor. 
- *
- * Initialises this->next=NULL and this->facetPtr=NULL
- */
-gcone::gcone()
-{
-	this->next=NULL;
-	this->prev=NULL;
-	this->facetPtr=NULL;	//maybe this->facetPtr = new facet();			
-	this->baseRing=currRing;
-	this->counter++;
-	this->UCN=this->counter;			
-	this->numFacets=0;
-	this->ivIntPt=NULL;
-	this->gcRays=NULL;
-}
-		
-/** \brief Constructor with ring and ideal
- *
- * This constructor takes the root ring and the root ideal as parameters and stores 
- * them in the private members gcone::rootRing and gcone::inputIdeal
- * This constructor is only called once in the computation of the Gröbner fan,
- * namely for the very first cone. Therefore pred is set to 1.
- * Might set it to this->UCN though...
- * Since knowledge of the root ring is only needed when using reverse search,
- * this constructor is not needed when using the "second" method
-*/
-gcone::gcone(ring r, ideal I)
-{
-	this->next=NULL;
-	this->prev=NULL;
-	this->facetPtr=NULL;			
-	this->inputIdeal=I;
-	this->baseRing=currRing;
-	this->counter++;
-	this->UCN=this->counter;
-	this->pred=1;
-	this->numFacets=0;
-	this->ivIntPt=NULL;
-	this->gcRays=NULL;
-}
-		
-/** \brief Copy constructor 
- *
- * Copies a cone, sets this->gcBasis to the flipped GB
- * Call this only after a successful call to gcone::flip which sets facet::flipGB
-*/		
-gcone::gcone(const gcone& gc, const facet &f)
-{
-	this->next=NULL;
-// 	this->prev=(gcone *)&gc; //comment in to get a tree
-	this->prev=NULL;
-	this->numVars=gc.numVars;
-	this->counter++;
-	this->UCN=this->counter;
-	this->pred=gc.UCN;
-	this->facetPtr=NULL;
-   	this->gcBasis=idrCopyR(f.flipGB, f.flipRing);
-//  	this->inputIdeal=idCopy(this->gcBasis);
-	this->baseRing=rCopy(f.flipRing);
-	this->numFacets=0;
-	this->ivIntPt=NULL;
-	this->gcRays=NULL;
-}
-		
-/** \brief Default destructor 
-*/
-gcone::~gcone()
-{
-#ifndef NDEBUG
-  #if SIZEOF_LONG==8
-	if( ( this->gcBasis!=(ideal)(0xfbfbfbfbfbfbfbfb) ) && (this->gcBasis!=NULL) )
-		idDelete((ideal*)&this->gcBasis);
-  #elif SIZEOF_LONG!=8
-	if(this->gcBasis!=(ideal)0xfbfbfbfb)
-		idDelete((ideal *)&this->gcBasis);
-  #endif
-#else
-	if(this->gcBasis!=NULL)
-		idDelete((ideal *)&this->gcBasis);
-#endif
-// 	idDelete((ideal *)&this->gcBasis);
-// 	if(this->inputIdeal!=NULL)
-// 		idDelete((ideal *)&this->inputIdeal);
-// 	if (this->rootRing!=NULL && this->rootRing!=(ip_sring *)0xfefefefefefefefe)
-// 		rDelete(this->rootRing);
-	if(this->UCN!=1 && this->baseRing!=NULL)
-		rDelete(this->baseRing);
-	facet *fAct;
-	facet *fDel;
-	/*Delete the facet structure*/
-	fAct=this->facetPtr;
-	fDel=fAct;
-	while(fAct!=NULL)
-	{
-		fDel=fAct;
-		fAct=fAct->next;
-		delete fDel;
-	}
-	this->counter--;
-	//should be deleted in noRevS
-// 	dd_FreeMatrix(this->ddFacets);
-	//dd_FreeMatrix(this->ddFacets);
-	for(int ii=0;ii<this->numRays;ii++)
-		delete(gcRays[ii]);
-	omFree(gcRays);
-}			
-
-/** Returns the number of cones existing at the time*/
-inline int gcone::getCounter()
-{
-	return this->counter;
-}
-	
-/** \brief Set the interior point of a cone */
-inline void gcone::setIntPoint(int64vec *iv)
-{
-	if(this->ivIntPt!=NULL)
-		delete this->ivIntPt;
-	this->ivIntPt=iv64Copy(iv);
-}
-		
-/** \brief Returns either a physical copy the interior point of a cone or just a reference to it.*/
-inline int64vec *gcone::getIntPoint(bool shallow)
-{
-	if(shallow==TRUE)
-		return this->ivIntPt;
-	else
-		return iv64Copy(this->ivIntPt);
-}
-		
-/** \brief Print the interior point */
-inline void gcone::showIntPoint()
-{
-	ivIntPt->show();
-}
-		
-/** \brief Print facets
- * This is mainly for debugging purposes. Usually called from within gdb
- */
-volatile void gcone::showFacets(const short codim)
-{
-  #ifndef NDEBUG
-	facet *f=this->facetPtr;
-	facet *f2=NULL;
-	if(codim==2)
-		f2=this->facetPtr->codim2Ptr;
-	while(f!=NULL)
-	{
-		int64vec *iv;
-		iv = f->getFacetNormal();
-		printf("(");iv->show(1,0);
-		if(f->isFlippable==FALSE)
-			printf(")* ");
-		else
-			printf(") ");
-		delete iv;
-		if(codim==2)
-		{
-			f2=f->codim2Ptr;
-			while(f2!=NULL)
-			{
-				printf("[");f2->getFacetNormal()->show(1,0);printf("]");
-				f2 = f2->next;
-			}
-			printf("\n");
-		}
-		f=f->next;
-	}
-	printf("\n");
-  #endif
-}
-		
-/** For debugging purposes only */
-static volatile void showSLA(facet &f)
-{
-  #ifndef NDEBUG
-	facet *fAct;
-	fAct = &f;
-	if(fAct!=NULL)
-	{
-		facet *codim2Act;
-		codim2Act = fAct->codim2Ptr;
-		
-		printf("\n");
-		while(fAct!=NULL)
-		{
-			int64vec *fNormal;		
-			fNormal=fAct->getFacetNormal();
-			printf("(");fNormal->show(1,0);
-			if(fAct->isFlippable==TRUE)
-				printf(") ");
-			else
-				printf(")* ");
-			delete fNormal;
-			codim2Act = fAct->codim2Ptr;
-			printf(" Codim2: ");
-			while(codim2Act!=NULL)
-			{
-				int64vec *f2Normal;
-				f2Normal = codim2Act->getFacetNormal();
-				printf("(");f2Normal->show(1,0);printf(") ");
-				delete f2Normal;
-				codim2Act = codim2Act->next;
-			}
-			printf("UCN = %i\n",fAct->getUCN());
-			fAct = fAct->next;
-		}
-	}
-  #endif
-}
-		
-static void idDebugPrint(const ideal &I)
-{
-  #ifndef NDEBUG
-	int numElts=IDELEMS(I);
-	printf("Ideal with %i generators\n", numElts);
-	printf("Leading terms: ");
-	for (int ii=0;ii<numElts;ii++)
-	{
-		pWrite0(pHead(I->m[ii]));
-		printf(",");
-	}
-	printf("\n");
-  #endif
-}
-
-static void invPrint(const ideal &I)
-{
-// 	int numElts=IDELEMS(I);
-// 	cout << "inv = ";
-// 	for(int ii=0;ii<numElts;ii++);
-// 	{
-// 		pWrite0(pHead(I->m[ii]));
-// 		cout << ",";
-// 	}
-// 	cout << endl;
-}
-
-static bool isMonomial(const ideal &I)
-{
-	bool res = TRUE;
-	for(int ii=0;ii<IDELEMS(I);ii++)
-	{
-		if(pLength((poly)I->m[ii])>1)
-		{
-			res = FALSE;
-			break;
-		}
-	}
-	return res;
-}
-		
-/** \brief Set gcone::numFacets */
-inline void gcone::setNumFacets()
-{
-}
-		
-/** \brief Get gcone::numFacets */
-inline int gcone::getNumFacets()
-{
-	return this->numFacets;
-}
-		
-inline int gcone::getUCN()
-{
-	if( this!=NULL)// && ( this!=(gcone * const)0xfbfbfbfbfbfbfbfb && this!=(gcone * const)0xfbfbfbfb ) )
-		return this->UCN;
-	else
-		return -1;
-}
-
-inline int gcone::getPredUCN()
-{
-	return this->pred;
-}
-/** Returns a copy of the this->baseRing */
-inline ring gcone::getBaseRing()
-{
-	return rCopy(this->baseRing);
-}
-
-inline void gcone::setBaseRing(ring r)
-{
-	this->baseRing=rCopy(r);
-}
-
-inline ring gcone::getRef2BaseRing()
-{
-	return this->baseRing;
-}
-
-/** \brief Compute the normals of the cone
- *
- * This method computes a representation of the cone in terms of facet normals. It takes an ideal
- * as its input. Redundancies are automatically removed using cddlib's dd_MatrixCanonicalize.
- * Other methods for redundancy checkings might be implemented later. See Anders' diss p.44.
- * Note that in order to use cddlib a 0-th column has to be added to the matrix since cddlib expects 
- * each row to represent an inequality of type const+x1+...+xn <= 0. While computing the normals we come across
- * the set \f$ \partial\mathcal{G} \f$ which we might store for later use. C.f p71 of journal
- * As a result of this procedure the pointer facetPtr points to the first facet of the cone.
- *
- * Optionally, if the parameter bool compIntPoint is set to TRUE the method will also compute
- * an interior point of the cone.
-		 */
-void gcone::getConeNormals(const ideal &I, bool compIntPoint)
-{
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	poly aktpoly;
-	int rows; 			// will contain the dimensions of the ineq matrix - deprecated by
-	dd_rowrange ddrows;
-	dd_colrange ddcols;
-	dd_rowset ddredrows;		// # of redundant rows in ddineq
-	dd_rowset ddlinset;		// the opposite
-	dd_rowindex ddnewpos=NULL;		  // all to make dd_Canonicalize happy
-	dd_NumberType ddnumb=dd_Integer; //Number type
-	dd_ErrorType dderr=dd_NoError;		
-	//Compute the # inequalities i.e. rows of the matrix
-	rows=0; //Initialization
-	for (int ii=0;ii<IDELEMS(I);ii++)
-	{
-// 		aktpoly=(poly)I->m[ii];
-// 		rows=rows+pLength(aktpoly)-1;
-		rows=rows+pLength((poly)I->m[ii])-1;
-	}
-
-	dd_rowrange aktmatrixrow=0;	// needed to store the diffs of the expvects in the rows of ddineq
-	ddrows=rows;
-	ddcols=this->numVars;
-	dd_MatrixPtr ddineq; 		//Matrix to store the inequalities			
-	ddineq=dd_CreateMatrix(ddrows,ddcols+1); //The first col has to be 0 since cddlib checks for additive consts there
-		
-	// We loop through each g\in GB and compute the resulting inequalities
-	for (int i=0; i<IDELEMS(I); i++)
-	{
-		aktpoly=(poly)I->m[i];		//get aktpoly as i-th component of I
-		//simpler version of storing expvect diffs
-		int *leadexpv=(int*)omAlloc(((this->numVars)+1)*sizeof(int));
-		pGetExpV(aktpoly,leadexpv);
-		poly pNextTerm=aktpoly;
-		while(pNext(pNextTerm)/*pNext(aktpoly)*/!=NULL)
-		{
-			pNextTerm/*aktpoly*/=pNext(pNextTerm);
-			int *tailexpv=(int*)omAlloc(((this->numVars)+1)*sizeof(int));
-			pGetExpV(pNextTerm,tailexpv);			
-			for(int kk=1;kk<=this->numVars;kk++)
-			{				
-				dd_set_si(ddineq->matrix[(dd_rowrange)aktmatrixrow][kk],leadexpv[kk]-tailexpv[kk]);
-			}
-			aktmatrixrow += 1;
-			omFree(tailexpv);
-		}		
-		omFree(leadexpv);	
-	} //for
-#if true
-	/*Let's make the preprocessing here. This could already be done in the above for-loop,
-	* but for a start it is more convenient here.
-	* We check the necessary condition of FJT p.18
-	* Quote: [...] every non-zero spoly should have at least one of its terms in inv(G)
-	*/
-// 	ideal initialForm=idInit(IDELEMS(I),1);
-// 	int64vec *gamma=new int64vec(this->numVars);
-	int falseGammaCounter=0;
-	int *redRowsArray=NULL;
-	int num_alloc=0;
-	int num_elts=0;	
-	for(int ii=0;ii<ddineq->rowsize;ii++)
-	{
-		ideal initialForm=idInit(IDELEMS(I),I->rank);
-		//read row ii into gamma
-// 		int64 tmp;
-		int64vec *gamma=new int64vec(this->numVars);
-		for(int jj=1;jj<=this->numVars;jj++)
-		{
-			int64 tmp;
-			tmp=(int64)mpq_get_d(ddineq->matrix[ii][jj]);
-			(*gamma)[jj-1]=(int64)tmp;
-		}
-		computeInv((ideal&)I,initialForm,*gamma);
-		delete gamma;
-		//Create leading ideal
-		ideal L=idInit(IDELEMS(initialForm),1);
-		for(int jj=0;jj<IDELEMS(initialForm);jj++)
-		{
-			poly p=pHead(initialForm->m[jj]);
-			L->m[jj]=pCopy(/*pHead(initialForm->m[jj]))*/p);
-			pDelete(&p);
-		}		
-		
-		LObject *P = new sLObject();//TODO What's the difference between sLObject and LObject?
-		memset(P,0,sizeof(LObject));
-
-		for(int jj=0;jj<=IDELEMS(initialForm)-2;jj++)
-		{
-			bool isMaybeFacet=FALSE;
-			P->p1=initialForm->m[jj];	//build spolys of initialForm in_v
-
-			for(int kk=jj+1;kk<=IDELEMS(initialForm)-1;kk++)
-			{
-				P->p2=initialForm->m[kk];
-				ksCreateSpoly(P);							
-				if(P->p!=NULL)	//spoly non zero=?
-				{	
-					poly p;//NOTE Don't use pInit here. Evil memleak will follow
-					poly q;
-					poly pDel,qDel;
-					p=pCopy(P->p);
-					q=pHead(p);	//Monomial q
-					pDelete(&q);
-					pDel=p; qDel=q;
-					isMaybeFacet=FALSE;
-					//TODO: Suffices to check LTs here
-					while(p!=NULL)
-					{						
-						q=pHead(p);
-						for(int ll=0;ll<IDELEMS(L);ll++)
-						{
-							if(pLmEqual(L->m[ll],q) || pDivisibleBy(L->m[ll],q))
-							{							
-								isMaybeFacet=TRUE;
- 								break;//for
-							}
-						}
-						pDelete(&q);
-						if(isMaybeFacet==TRUE)
-						{
-							break;//while(p!=NULL)
-						}
-						p=pNext(p);
-					}//while
-// 					pDelete(&p);//NOTE Better to use pDel and qDel. Commenting in this line will not work!
-					if(q!=NULL) pDelete(&q);
-					pDelete(&pDel);
-					pDelete(&qDel);
-					if(isMaybeFacet==FALSE)
-					{
-						dd_set_si(ddineq->matrix[ii][0],1);						
-// 						if(num_alloc==0)
-// 							num_alloc += 1;
-// 						else						
-// 							num_alloc += 1;
-						if(num_alloc==num_elts)	num_alloc==0 ? num_alloc=1 : num_alloc*=2;
-						
-						void *tmp = realloc(redRowsArray,(num_alloc*sizeof(int)));
-						if(!tmp)
-						{
-							WerrorS("Woah dude! Couldn't realloc memory\n");
-							exit(-1);
-						}
-						redRowsArray = (int*)tmp;
-						redRowsArray[num_elts]=ii;
-						num_elts++;
-						//break;//for(int kk, since we have found one that is not in L	
-						goto _start;	//mea culpa, mea culpa, mea maxima culpa
-					}
-				}//if(P->p!=NULL)
-				pDelete(&(P->p));
-			}//for k
-		}//for jj
-		_start:;
-		idDelete(&L);
-		delete P;
-		idDelete(&initialForm);
-	}//for(ii<ddineq-rowsize
-// 	delete gamma;
-	int offset=0;//needed for correction of redRowsArray[ii]
-#ifndef NDEBUG
-	printf("Removed %i of %i in preprocessing step\n",num_elts,ddineq->rowsize);
-#endif
-	for( int ii=0;ii<num_elts;ii++ )
-	{
-		dd_MatrixRowRemove(&ddineq,redRowsArray[ii]+1-offset);//cddlib sucks at enumeration
-		offset++;
-	}	
-	free(redRowsArray);//NOTE May crash on some machines.
-	/*And now for the strictly positive rows
-	* Doesn't gain significant speedup
-	*/
-	/*int *posRowsArray=NULL;
-	num_alloc=0;
-	num_elts=0;
-	for(int ii=0;ii<ddineq->rowsize;ii++)
-	{
-		int64vec *ivPos = new int64vec(this->numVars);
-		for(int jj=0;jj<this->numVars;jj++)
-			(*ivPos)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
-		bool isStrictlyPos=FALSE;
-		int posCtr=0;		
-		for(int jj=0;jj<this->numVars;jj++)
-		{
-			int64vec *ivCanonical = new int64vec(this->numVars);
-			jj==0 ? (*ivCanonical)[ivPos->length()-1]=1 : (*ivCanonical)[jj-1]=1;
-			if(dotProduct(*ivCanonical,*ivPos)!=0)
-			{
-				if ((*ivPos)[jj]>=0)
-				{				
-					posCtr++;				
-				}
-			}			
-			delete ivCanonical;
-		}
-		if(posCtr==ivPos->length())
-			isStrictlyPos=TRUE;
-		if(isStrictlyPos==TRUE)
-		{
-			if(num_alloc==0)
-				num_alloc += 1;
-			else
-				num_alloc += 1;
-			void *tmp = realloc(posRowsArray,(num_alloc*sizeof(int)));
-			if(!tmp)
-			{
-				WerrorS("Woah dude! Couldn't realloc memory\n");
-				exit(-1);
-			}
-			posRowsArray = (int*)tmp;
-			posRowsArray[num_elts]=ii;
-			num_elts++;	
-		}
-		delete ivPos;
-	}
-	offset=0;
-	for(int ii=0;ii<num_elts;ii++)
-	{
-		dd_MatrixRowRemove(&ddineq,posRowsArray[ii]+1-offset);
-		offset++;
-	}
-	free(posRowsArray);*/
-#endif
-
-	dd_MatrixCanonicalize(&ddineq, &ddlinset, &ddredrows, &ddnewpos, &dderr);	
-	ddrows = ddineq->rowsize;	//Size of the matrix with redundancies removed
-	ddcols = ddineq->colsize;
-	
-	this->ddFacets = dd_CopyMatrix(ddineq);
-			
-	/*Write the normals into class facet*/	
-	facet *fAct; 	//pointer to active facet	
-	int numNonFlip=0;
-	for (int kk = 0; kk<ddrows; kk++)
-	{
-		int64 ggT=1;//NOTE Why does (int)mpq_get_d(ddineq->matrix[kk][1]) not work?
-		int64vec *load = new int64vec(this->numVars);//int64vec to store a single facet normal that will then be stored via setFacetNormal
-		for (int jj = 1; jj <ddcols; jj++)
-		{
-			int64 val;
-			val = (int64)mpq_get_d(ddineq->matrix[kk][jj]);
-			(*load)[jj-1] = val;	//store typecasted entry at pos jj-1 of load
-			ggT = int64gcd(ggT,/*(int64&)foo*/val);
-		}//for (int jj = 1; jj <ddcols; jj++)
-		if(ggT>1)
-		{
-			for(int ll=0;ll<this->numVars;ll++)
-				(*load)[ll] /= ggT;//make primitive vector
-		}
-		/*Quick'n'dirty hack for flippability. Executed only if gcone::hasHomInput==FALSE
-		* Otherwise every facet intersects the positive orthant
-		*/	
-		if(gcone::hasHomInput==FALSE)
-		{
-			//TODO: No dP needed
-			bool isFlip=FALSE;
-			for(int jj = 0; jj<load->length(); jj++)
-			{
-// 				int64vec *ivCanonical = new int64vec(load->length());
-// 				(*ivCanonical)[jj]=1;
-// 				if (dotProduct(*load,*ivCanonical)<0)	
-// 				{
-// 					isFlip=TRUE;
-// 					break;	//URGHS
-// 				}
-// 				delete ivCanonical;
-				if((*load)[jj]<0)
-				{
-					isFlip=TRUE;
-					break;
-				}				
-			}/*End of check for flippability*/
-// 			if(iv64isStrictlyPositive(load))
-// 				isFlip=TRUE;
-			if(isFlip==FALSE)
-			{
-				this->numFacets++;
-				numNonFlip++;
-				if(this->numFacets==1)
-				{
-					facet *fRoot = new facet();
-					this->facetPtr = fRoot;
-					fAct = fRoot;							
-				}
-				else
-				{
-					fAct->next = new facet();
-					fAct = fAct->next;
-				}
-				fAct->isFlippable=FALSE;
-				fAct->setFacetNormal(load);
-				fAct->setUCN(this->getUCN());
-#ifndef NDEBUG
-				printf("Marking facet (");load->show(1,0);printf(") as non flippable\n");		
-#endif
-			}
-			else
-			{
-				this->numFacets++;
-				if(this->numFacets==1)
-				{
-					facet *fRoot = new facet();
-					this->facetPtr = fRoot;
-					fAct = fRoot;
-				}
-				else
-				{
-					fAct->next = new facet();
-					fAct = fAct->next;
-				}
-				fAct->isFlippable=TRUE;
-				fAct->setFacetNormal(load);
-				fAct->setUCN(this->getUCN());					
-			}
-		}//hasHomInput==FALSE
-		else	//Every facet is flippable
-		{	/*Now load should be full and we can call setFacetNormal*/					
-			this->numFacets++;
-			if(this->numFacets==1)
-			{
-				facet *fRoot = new facet();
-				this->facetPtr = fRoot;
-				fAct = fRoot;
-			}
-			else
-			{
-				fAct->next = new facet();
-				fAct = fAct->next;
-			}
-			fAct->isFlippable=TRUE;
-			fAct->setFacetNormal(load);
-			fAct->setUCN(this->getUCN());					
-		}//if (isFlippable==FALSE)
-		delete load;				
-	}//for (int kk = 0; kk<ddrows; kk++)
-			
-	//In cases like I=<x-1,y-1> there are only non-flippable facets...
-	if(numNonFlip==this->numFacets)
-	{
-		WerrorS ("Only non-flippable facets. Terminating...\n");
-// 		exit(-1);//Bit harsh maybe...
-	}
-			
-	/*
-	Now we should have a linked list containing the facet normals of those facets that are
-	-irredundant
-	-flipable
-	Adressing is done via *facetPtr
-	*/			
-	if (compIntPoint==TRUE)
-	{
-		int64vec *iv = new int64vec(this->numVars);
-		dd_MatrixPtr posRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
-		int jj=1;
-		for (int ii=0;ii<=this->numVars;ii++)
-		{
-			dd_set_si(posRestr->matrix[ii][jj],1);
-			jj++;							
-		}
-		dd_MatrixAppendTo(&ddineq,posRestr);
-		interiorPoint(ddineq, *iv);	//NOTE ddineq contains non-flippable facets
-		this->setIntPoint(iv);	//stores the interior point in gcone::ivIntPt
-		delete iv;
-		dd_FreeMatrix(posRestr);
-	}	
-	//Clean up but don't delete the return value!	
-	//dd_FreeMatrix(ddineq);	
-	set_free(ddredrows);//check
-	set_free(ddlinset);//check
-	//free(ddnewpos);//<-- NOTE Here the crash occurs omAlloc issue?
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_getConeNormals += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-
-}//gcone::getConeNormals(ideal I)
-		
-/** \brief Compute the (codim-2)-facets of a given cone
- * This method is used during noRevS
- * Additionally we check whether the codim2-facet normal is strictly positive. Otherwise
- * the facet is marked as non-flippable.
- */
-void gcone::getCodim2Normals(const gcone &gc)
-{
-#ifdef gfanp
-	timeval start, end;
-  	gettimeofday(&start, 0);
-#endif
-	//this->facetPtr->codim2Ptr = new facet(2);	//instantiate a (codim-2)-facet
-	facet *fAct;
-	fAct = this->facetPtr;		
-	facet *codim2Act;
-	//codim2Act = this->facetPtr->codim2Ptr;
-	dd_MatrixPtr ddineq;//,P,ddakt;
-	dd_ErrorType err;
-	//ddineq = facets2Matrix(gc);	//get a matrix representation of the cone
-	ddineq = dd_CopyMatrix(gc.ddFacets);
-	/*Now set appropriate linearity*/
-	for (int ii=0; ii<this->numFacets; ii++)			
-	{	
-		dd_rowset impl_linset, redset;
-		dd_rowindex newpos;
-		dd_MatrixPtr ddakt;
-  		ddakt = dd_CopyMatrix(ddineq);
-// 		ddakt->representation=dd_Inequality;	//Not using this makes it faster. But why does the quick check below still work?
-// 		ddakt->representation=dd_Generator;
-		set_addelem(ddakt->linset,ii+1);/*Now set appropriate linearity*/
-#ifdef gfanp
-		timeval t_ddMC_start, t_ddMC_end;
-		gettimeofday(&t_ddMC_start,0);
-#endif				
- 		//dd_MatrixCanonicalize(&ddakt, &impl_linset, &redset, &newpos, &err);
-		dd_PolyhedraPtr ddpolyh;
-		ddpolyh=dd_DDMatrix2Poly(ddakt, &err);
-// 		ddpolyh=dd_DDMatrix2Poly2(ddakt, dd_MaxCutoff, &err);
-		dd_MatrixPtr P;
-		P=dd_CopyGenerators(ddpolyh);		
-		dd_FreePolyhedra(ddpolyh);
-		//TODO Call for one cone , normalize - check equalities - plus lineality -done
-#ifdef gfanp
-		gettimeofday(&t_ddMC_end,0);
-		t_ddMC += (t_ddMC_end.tv_sec - t_ddMC_start.tv_sec + 1e-6*(t_ddMC_end.tv_usec - t_ddMC_start.tv_usec));
-#endif	
-		/* We loop through each row of P normalize it by making all
-		* entries integer ones and add the resulting vector to the
-		* int matrix facet::codim2Facets */
-		for (int jj=1;jj<=/*ddakt*/P->rowsize;jj++)
-		{					
-			fAct->numCodim2Facets++;
-			if(fAct->numCodim2Facets==1)					
-			{						
-				fAct->codim2Ptr = new facet(2);						
-				codim2Act = fAct->codim2Ptr;
-			}
-			else
-			{
-				codim2Act->next = new facet(2);
-				codim2Act = codim2Act->next;
-			}
-			int64vec *n = new int64vec(this->numVars);
-#ifdef gfanp
-			timeval t_mI_start, t_mI_end;
-			gettimeofday(&t_mI_start,0);
-#endif
-			makeInt(P,jj,*n);
-			/*for(int kk=0;kk<this->numVars;kk++)
-			{
-				int foo;
-				foo = (int)mpq_get_d(ddakt->matrix[ii][kk+1]);
-				(*n)[kk]=foo;
-			}*/
-#ifdef gfanp
-			gettimeofday(&t_mI_end,0);
-			t_mI += (t_mI_end.tv_sec - t_mI_start.tv_sec + 1e-6*(t_mI_end.tv_usec - t_mI_start.tv_usec));
-#endif
-			codim2Act->setFacetNormal(n);
-			delete n;					
-		}		
-		/*We check whether the facet spanned by the codim-2 facets
-		* intersects with the positive orthant. Otherwise we define this
-		* facet to be non-flippable. Works since we set the appropriate 
-		* linearity for ddakt above.
-		*/
-		//TODO It might be faster to compute jus the implied equations instead of a relative interior point
-// 		int64vec *iv_intPoint = new int64vec(this->numVars);
-// 		dd_MatrixPtr shiftMatrix;
-// 		dd_MatrixPtr intPointMatrix;
-// 		shiftMatrix = dd_CreateMatrix(this->numVars,this->numVars+1);
-// 		for(int kk=0;kk<this->numVars;kk++)
-// 		{
-// 			dd_set_si(shiftMatrix->matrix[kk][0],1);
-// 			dd_set_si(shiftMatrix->matrix[kk][kk+1],1);
-// 		}
-// 		intPointMatrix=dd_MatrixAppend(ddakt,shiftMatrix);
-// #ifdef gfanp
-// 		timeval t_iP_start, t_iP_end;
-// 		gettimeofday(&t_iP_start, 0);
-// #endif		
-// 		interiorPoint(intPointMatrix,*iv_intPoint);
-// // 		dd_rowset impl_linste,lbasis;
-// // 		dd_LPSolutionPtr lps=NULL;
-// // 		dd_ErrorType err;
-// // 		dd_FindRelativeInterior(intPointMatrix, &impl_linset, &lbasis, &lps, &err);
-// #ifdef gfanp
-// 		gettimeofday(&t_iP_end, 0);
-// 		t_iP += (t_iP_end.tv_sec - t_iP_start.tv_sec + 1e-6*(t_iP_end.tv_usec - t_iP_start.tv_usec));
-// #endif
-// 		for(int ll=0;ll<this->numVars;ll++)
-// 		{
-// 			if( (*iv_intPoint)[ll] < 0 )
-// 			{
-// 				fAct->isFlippable=FALSE;
-// 				break;
-// 			}
-// 		}
-		/*End of check*/
-		/*This test should be way less time consuming*/
-#ifdef gfanp
-		timeval t_iP_start, t_iP_end;
-		gettimeofday(&t_iP_start, 0);
-#endif
-		bool containsStrictlyPosRay=TRUE;
-		for(int ii=0;ii<ddakt->rowsize;ii++)
-		{
-			containsStrictlyPosRay=TRUE;
-			for(int jj=1;jj<this->numVars;jj++)
-			{
-				if(ddakt->matrix[ii][jj]<=0)
-				{
-					containsStrictlyPosRay=FALSE;
-					break;
-				}
-			}
-			if(containsStrictlyPosRay==TRUE)
-				break;
-		}
-		if(containsStrictlyPosRay==FALSE)
-		//TODO Not sufficient. Intersect with pos orthant for pos int
-			fAct->isFlippable=FALSE;
-#ifdef gfanp
-		gettimeofday(&t_iP_end, 0);
-		t_iP += (t_iP_end.tv_sec - t_iP_start.tv_sec + 1e-6*(t_iP_end.tv_usec - t_iP_start.tv_usec));
-#endif
-		/**/
-		fAct = fAct->next;	
-		dd_FreeMatrix(ddakt);
-		dd_FreeMatrix(P);
-	}//for 	
-	dd_FreeMatrix(ddineq);
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_getCodim2Normals += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-}
-		
-/** Really extremal rays this time ;)
-* Extremal rays are unique modulo the homogeneity space.
-* Therefore we dd_MatrixAppend gc->ddFacets and gcone::dd_LinealitySpace
-* into ddineq. Next we compute the extremal rays of the so given subspace.
-* Figuring out whether a ray belongs to a given facet(normal) is done by
-* checking whether the inner product of the ray with the normal is zero.
-* We use ivAdd here which returns a new int64vec. Therefore we need to avoid
-* a memory leak which would be cause by the line 
-* iv=ivAdd(iv,b)
-* So we keep pointer tmp to iv and delete(tmp), so there should not occur a 
-* memleak
-* TODO normalization
-*/
-void gcone::getExtremalRays(const gcone &gc)
-{
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-	timeval poly_start, poly_end;
-	gettimeofday(&poly_start,0);
-#endif
-	//Add lineality space - dd_LinealitySpace
-	dd_MatrixPtr ddineq;
-	dd_ErrorType err;	
-	ddineq = (dd_LinealitySpace->rowsize>0) ? dd_AppendMatrix(gc.ddFacets,gcone::dd_LinealitySpace) : dd_CopyMatrix(gc.ddFacets);
-	/* In case the input is non-homogeneous we add constrains for the positive orthant.
-	* This is justified by the fact that for non-homog ideals we only consider the 
-	* restricted fan. This way we can be sure to find strictly positive interior points.
-	* This in turn makes life easy when checking for flippability!
-	* Drawback: Makes the LP larger so probably slows down computations a wee bit.
-	*/
-	dd_MatrixPtr ddPosRestr;
-	if(hasHomInput==FALSE)
-	{
-		dd_MatrixPtr tmp;
-		ddPosRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
-		for(int ii=0;ii<this->numVars;ii++)
-			dd_set_si(ddPosRestr->matrix[ii][ii+1],1);
-		dd_MatrixAppendTo(&ddineq,ddPosRestr);
-		assert(ddineq);
-		dd_FreeMatrix(ddPosRestr);
-	}	
-	dd_PolyhedraPtr ddPolyh;
-	ddPolyh = dd_DDMatrix2Poly(ddineq, &err);
-	dd_MatrixPtr P;
-	P=dd_CopyGenerators(ddPolyh);//Here we actually compute the rays!
-	dd_FreePolyhedra(ddPolyh);
-	dd_FreeMatrix(ddineq);
-#ifdef gfanp
-	gettimeofday(&poly_end,0);
-	t_ddPolyh += (poly_end.tv_sec - poly_start.tv_sec + 1e-6*(poly_end.tv_usec - poly_start.tv_usec));
-#endif
-	/* Compute interior point on the fly*/
-	int64vec *ivIntPointOfCone = new int64vec(this->numVars);
-	int64vec *foo = new int64vec(this->numVars);
-	for(int ii=0;ii<P->rowsize;ii++)
-	{
-		int64vec *tmp = ivIntPointOfCone;
-		makeInt(P,ii+1,*foo);
-		ivIntPointOfCone = iv64Add(ivIntPointOfCone,foo);
-		delete tmp;
-	}
-	delete foo;
-	int64 ggT=(*ivIntPointOfCone)[0];
-	for (int ii=0;ii<(this->numVars);ii++)
-	{
-		if( (*ivIntPointOfCone)[ii]>INT_MAX ) 
-			WarnS("Interior point exceeds INT_MAX!\n");
-		//Compute intgcd
-		ggT=int64gcd(ggT,(*ivIntPointOfCone)[ii]);
-	}
-	
-	//Divide out a common gcd > 1
-	if(ggT>1)
-	{
-		for(int ii=0;ii<this->numVars;ii++)
-		{
-			(*ivIntPointOfCone)[ii] /= ggT;
-			if( (*ivIntPointOfCone)[ii]>INT_MAX ) WarnS("Interior point still exceeds INT_MAX after GCD!\n");
-		}
-	}
-
-	/*For homogeneous input (like Det3,3,5) the int points may be negative. So add a suitable multiple of (1,_,1)*/
-	if(hasHomInput==TRUE && iv64isStrictlyPositive(ivIntPointOfCone)==FALSE)
-	{
-		int64vec *ivOne = new int64vec(this->numVars);
-		int maxNegEntry=0;
-		for(int ii=0;ii<this->numVars;ii++)
-		{
-// 			(*ivOne)[ii]=1;
-			if ((*ivIntPointOfCone)[ii]<maxNegEntry) maxNegEntry=(*ivIntPointOfCone)[ii];
-		}
-		maxNegEntry *= -1;
-		maxNegEntry++;//To be on the safe side
-		for(int ii=0;ii<this->numVars;ii++)
-			(*ivOne)[ii]=maxNegEntry;
-		int64vec *tmp=ivIntPointOfCone;
-		ivIntPointOfCone=iv64Add(ivIntPointOfCone,ivOne);
-		delete(tmp);
-// 		while( !iv64isStrictlyPositive(ivIntPointOfCone) )
-// 		{
-// 			int64vec *tmp = ivIntPointOfCone;
-// 			for(int jj=0;jj<this->numVars;jj++)
-// 				(*ivOne)[jj] = (*ivOne)[jj] << 1; //times 2
-// 			ivIntPointOfCone = ivAdd(ivIntPointOfCone,ivOne);
-// 			delete tmp;				
-// 		}
-		delete ivOne;
-		int64 ggT=(*ivIntPointOfCone)[0];
-		for(int ii=0;ii<this->numVars;ii++)
-			ggT=int64gcd( ggT, (*ivIntPointOfCone)[ii]);
-		if(ggT>1)
-		{
-			for(int jj=0;jj<this->numVars;jj++)
-				(*ivIntPointOfCone)[jj] /= ggT;
-		}
-	}
-// 	assert(iv64isStrictlyPositive(ivIntPointOfCone));
-	
-	this->setIntPoint(ivIntPointOfCone);
-	delete(ivIntPointOfCone);
-	/* end of interior point computation*/
-	
-	//Loop through the rows of P and check whether fNormal*row[i]=0 => row[i] belongs to fNormal
-	int rows=P->rowsize;
-	facet *fAct=gc.facetPtr;
-	//Construct an array to hold the extremal rays of the cone
-	this->gcRays = (int64vec**)omAlloc0(sizeof(int64vec*)*P->rowsize);	
-	for(int ii=0;ii<P->rowsize;ii++)
-	{
-		int64vec *rowvec = new int64vec(this->numVars);
-		makeInt(P,ii+1,*rowvec);//get an integer entry instead of rational, rowvec is primitve
-		this->gcRays[ii] = iv64Copy(rowvec);
-		delete rowvec;
-	}	
-	this->numRays=P->rowsize;
-	//Check which rays belong to which facet
-	while(fAct!=NULL)
-	{
-		const int64vec *fNormal;// = new int64vec(this->numVars);
-		fNormal = fAct->getRef2FacetNormal();//->getFacetNormal();
-		int64vec *ivIntPointOfFacet = new int64vec(this->numVars);
-		for(int ii=0;ii<rows;ii++)
-		{			
- 			if(dotProduct(*fNormal,this->gcRays[ii])==0)
-			{
-				int64vec *tmp = ivIntPointOfFacet;//Prevent memleak
-				fAct->numCodim2Facets++;
-				facet *codim2Act;
-				if(fAct->numCodim2Facets==1)					
-				{						
-					fAct->codim2Ptr = new facet(2);						
-					codim2Act = fAct->codim2Ptr;
-				}
-				else
-				{
-					codim2Act->next = new facet(2);
-					codim2Act = codim2Act->next;
-				}
-				//codim2Act->setFacetNormal(rowvec);
-				//Rather just let codim2Act point to the corresponding int64vec of gcRays
-				codim2Act->fNormal=this->gcRays[ii];
-				fAct->numRays++;				 
-				//Memleak avoided via tmp
-				ivIntPointOfFacet=iv64Add(ivIntPointOfFacet,this->gcRays[ii]);
-				//Now tmp still points to the OLD address of ivIntPointOfFacet
-				delete(tmp);
-					
-			}
-		}//For non-homog input ivIntPointOfFacet should already be >0 here
-// 		if(!hasHomInput) {assert(iv64isStrictlyPositive(ivIntPointOfFacet));}
-		//if we have no strictly pos ray but the input is homogeneous
-		//then add a suitable multiple of (1,...,1)
-		if( !iv64isStrictlyPositive(ivIntPointOfFacet) && hasHomInput==TRUE)
-		{
-			int64vec *ivOne = new int64vec(this->numVars);
-			for(int ii=0;ii<this->numVars;ii++)
-				(*ivOne)[ii]=1;
-			while( !iv64isStrictlyPositive(ivIntPointOfFacet) )
-			{
-				int64vec *tmp = ivIntPointOfFacet;
-				for(int jj=0;jj<this->numVars;jj++)
-				{
-					(*ivOne)[jj] = (*ivOne)[jj] << 1; //times 2
-				}
-				ivIntPointOfFacet = iv64Add(ivIntPointOfFacet/*diff*/,ivOne);
-				delete tmp;				
-			}
-			delete ivOne;
-		}
-		int64 ggT=(*ivIntPointOfFacet)[0];
-		for(int ii=0;ii<this->numVars;ii++)
-			ggT=int64gcd(ggT,(*ivIntPointOfFacet)[ii]);
-		if(ggT>1)
-		{
-			for(int ii=0;ii<this->numVars;ii++)
-				(*ivIntPointOfFacet)[ii] /= ggT;
-		}			
-		fAct->setInteriorPoint(ivIntPointOfFacet);
-		
-		delete(ivIntPointOfFacet);
-		//Now (if we have at least 3 variables) do a bubblesort on the rays
-		/*if(this->numVars>2)
-		{
-			facet *A[fAct->numRays-1];
-			facet *f2Act=fAct->codim2Ptr;
-			for(unsigned ii=0;ii<fAct->numRays;ii++)
-			{
-				A[ii]=f2Act;
-				f2Act=f2Act->next;
-			}
-			bool exchanged=FALSE;
-			unsigned n=fAct->numRays-1;
-			do
-			{
-				exchanged=FALSE;//n=fAct->numRays-1;				
-				for(unsigned ii=0;ii<=n-1;ii++)
-				{					
-					if((A[ii]->fNormal)->compare((A[ii+1]->fNormal))==1)
-					{
-						//Swap rays
-						cout << "Swapping ";
-						A[ii]->fNormal->show(1,0); cout << " with "; A[ii+1]->fNormal->show(1,0); cout << endl;
-						A[ii]->next=A[ii+1]->next;
-						if(ii>0)
-							A[ii-1]->next=A[ii+1];
-						A[ii+1]->next=A[ii];
-						if(ii==0)
-							fAct->codim2Ptr=A[ii+1];
-						//end swap
-						facet *tmp=A[ii];//swap in list
-						A[ii+1]=A[ii];
-						A[ii]=tmp;
-// 						tmp=NULL;			
-					}					
-				}
-				n--;			
-			}while(exchanged==TRUE && n>=0);
-		}*///if pVariables>2
-// 		delete fNormal;		
-		fAct = fAct->next;
-	}//end of facet checking
-	dd_FreeMatrix(P);
-	//Now all extremal rays should be set w.r.t their respective fNormal
-	//TODO Not sufficient -> vol2 II/125&127
-	//NOTE Sufficient according to cddlibs doc. These ARE rays
-	//What the hell... let's just take interior points
-	if(gcone::hasHomInput==FALSE)
-	{
-		fAct=gc.facetPtr;
-		while(fAct!=NULL)
-		{
-// 			bool containsStrictlyPosRay=FALSE;
-// 			facet *codim2Act;
-// 			codim2Act = fAct->codim2Ptr;
-// 			while(codim2Act!=NULL)
-// 			{
-// 				int64vec *rayvec;
-// 				rayvec = codim2Act->getFacetNormal();//Mind this is no normal but a ray!
-// 				//int negCtr=0;
-// 				if(iv64isStrictlyPositive(rayvec))
-// 				{
-// 					containsStrictlyPosRay=TRUE;
-// 					delete(rayvec);
-// 					break;
-// 				}				
-// 				delete(rayvec);
-// 				codim2Act = codim2Act->next;
-// 			}
-// 			if(containsStrictlyPosRay==FALSE)
-// 				fAct->isFlippable=FALSE;
-			if(!iv64isStrictlyPositive(fAct->interiorPoint))
-				fAct->isFlippable=FALSE;
-			fAct = fAct->next;
-		}
-	}//hasHomInput?	
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	t_getExtremalRays += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif	
-}
-
-/** Order the spanning rays in a lex way hopefully using qsort()*/
-void gcone::orderRays()
-{
-//   qsort(gcRays,sizeof(int64vec),int64vec::compare);
-}
-	
-inline bool gcone::iv64isStrictlyPositive(const int64vec * iv64)
-{
-	bool res=TRUE;
-	for(int ii=0;ii<iv64->length();ii++)
-	{
-		if((*iv64)[ii]<=0)
-		{
-			res=FALSE;
-			break;
-		}		
-	}
-	return res;
-}
-
-/** \brief Compute the Groebner Basis on the other side of a shared facet 
- *
- * Implements algorithm 4.3.2 from Anders' thesis.
- * As shown there it is not necessary to compute an interior point. The knowledge of the facet normal
- * suffices. A term \f$ x^\gamma \f$ of \f$ g \f$ is in \f$  in_\omega(g) \f$ iff \f$ \gamma - leadexp(g)\f$
- * is parallel to \f$ leadexp(g) \f$
- * Parallelity is checked using basic linear algebra. See gcone::isParallel.
- * Other possibilities include computing the rank of the matrix consisting of the vectors in question and
- * computing an interior point of the facet and taking all terms having the same weight with respect 
- * to this interior point.
- *\param ideal, facet
- * Input: a marked,reduced Groebner basis and a facet
- */
-inline void gcone::flip(ideal gb, facet *f)		//Compute "the other side"
-{	
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif		
-	int64vec *fNormal;// = new int64vec(this->numVars);	//facet normal, check for parallelity			
-	fNormal = f->getFacetNormal();	//read this->fNormal;
-#ifndef NDEBUG
-// 	std::cout << "running gcone::flip" << std::endl;
-	printf("flipping UCN %i over facet",this->getUCN());
-	fNormal->show(1,0);
-	printf(") with UCN %i\n",f->getUCN() );	
-#endif
-	if(this->getUCN() != f->getUCN())
-	{
-		WerrorS("Uh oh... Trying to flip over facet with incompatible UCN");
-		exit(-1);
-	}
-	/*1st step: Compute the initial ideal*/
-	/*poly initialFormElement[IDELEMS(gb)];*/	//array of #polys in GB to store initial form
-	ideal initialForm=idInit(IDELEMS(gb),this->gcBasis->rank);
-	
-	computeInv(gb,initialForm,*fNormal);
-
-#ifndef NDEBUG
-/*	cout << "Initial ideal is: " << endl;
-	idShow(initialForm);
-	//f->printFlipGB();*/
-// 	cout << "===" << endl;
-#endif			
-	/*2nd step: lift initial ideal to a GB of the neighbouring cone using minus alpha as weight*/
-	/*Substep 2.1
-	compute $G_{-\alpha}(in_v(I)) 
-	see journal p. 66
-	NOTE Check for different rings. Prolly it will not always be necessary to add a weight, if the
-	srcRing already has a weighted ordering
-	*/
-	ring srcRing=currRing;
-	ring tmpRing;
-			
-	if( (srcRing->order[0]!=ringorder_a))
-	{
-		int64vec *iv;// = new int64vec(this->numVars);
-		iv = ivNeg(fNormal);//ivNeg uses iv64Copy -> new
-// 		tmpRing=rCopyAndAddWeight(srcRing,ivNeg(fNormal));
-		tmpRing=rCopyAndAddWeight(srcRing,iv);
-		delete iv;
-	}
-	else
-	{
-		tmpRing=rCopy0(srcRing);
-		int length=fNormal->length();
-		int *A=(int *)omAlloc0(length*sizeof(int));
-		for(int jj=0;jj<length;jj++)
-		{
-			A[jj]=-(*fNormal)[jj];
-		}
-		omFree(tmpRing->wvhdl[0]);
-		tmpRing->wvhdl[0]=(int*)A;
-		tmpRing->block1[0]=length;
-		rComplete(tmpRing);
-		//omFree(A);
-	}
-  	delete fNormal; 
-	rChangeCurrRing(tmpRing);	
-			
-	ideal ina;			
-	ina=idrCopyR(initialForm,srcRing);
-	idDelete(&initialForm);
-	ideal H;
-//  	H=kStd(ina,NULL,isHomog,NULL);	//we know it is homogeneous
-#ifdef gfanp
-	timeval t_kStd_start, t_kStd_end;
-	gettimeofday(&t_kStd_start,0);
-#endif
-	if(gcone::hasHomInput==TRUE)
-		H=kStd(ina,NULL,isHomog,NULL/*,gcone::hilbertFunction*/);
-	else
-		H=kStd(ina,NULL,isNotHomog,NULL);	//This is \mathcal(G)_{>_-\alpha}(in_v(I))
-#ifdef gfanp
-	gettimeofday(&t_kStd_end, 0);
-	t_kStd += (t_kStd_end.tv_sec - t_kStd_start.tv_sec + 1e-6*(t_kStd_end.tv_usec - t_kStd_start.tv_usec));
-#endif
-	idSkipZeroes(H);
-	idDelete(&ina);
-
-	/*Substep 2.2
-	do the lifting and mark according to H
-	*/
-	rChangeCurrRing(srcRing);
-	ideal srcRing_H;
-	ideal srcRing_HH;			
-	srcRing_H=idrCopyR(H,tmpRing);
-	//H is needed further below, so don't idDelete here
- 	srcRing_HH=ffG(srcRing_H,this->gcBasis);
- 	idDelete(&srcRing_H);
-		
-	/*Substep 2.2.1
-	 * Mark according to G_-\alpha
-	 * Here we have a minimal basis srcRing_HH. In order to turn this basis into a reduced basis
-	 * we have to compute an interior point of C(srcRing_HH). For this we need to know the cone
-	 * represented by srcRing_HH MARKED ACCORDING TO G_{-\alpha}
-	 * Thus we check whether the leading monomials of srcRing_HH and srcRing_H coincide. If not we 
-	 * compute the difference accordingly
-	*/
-#ifdef gfanp
-	timeval t_markings_start, t_markings_end;
-	gettimeofday(&t_markings_start, 0);
-#endif		
-	bool markingsAreCorrect=FALSE;
-	dd_MatrixPtr intPointMatrix;
-	int iPMatrixRows=0;
-	dd_rowrange aktrow=0;			
-	for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
-	{
-		poly aktpoly=(poly)srcRing_HH->m[ii];//This is a pointer, so don't pDelete
-		iPMatrixRows = iPMatrixRows+pLength(aktpoly);		
-	}
-	/* additionally one row for the standard-simplex and another for a row that becomes 0 during
-	 * construction of the differences
-	 */
-	intPointMatrix = dd_CreateMatrix(iPMatrixRows+2,this->numVars+1); 
-	intPointMatrix->numbtype=dd_Integer;	//NOTE: DO NOT REMOVE OR CHANGE TO dd_Rational
-	
-	for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
-	{
-		markingsAreCorrect=FALSE;	//crucial to initialise here
-		poly aktpoly=srcRing_HH->m[ii]; //Only a pointer, so don't pDelete
-		/*Comparison of leading monomials is done via exponent vectors*/
-		for (int jj=0;jj<IDELEMS(H);jj++)
-		{
-			int *src_ExpV = (int *)omAlloc((this->numVars+1)*sizeof(int));
-			int *dst_ExpV = (int *)omAlloc((this->numVars+1)*sizeof(int));
-			pGetExpV(aktpoly,src_ExpV);
-			rChangeCurrRing(tmpRing);	//this ring change is crucial!
-			poly p=pCopy(H->m[ii]);
-			pGetExpV(p/*pCopy(H->m[ii])*/,dst_ExpV);
-			pDelete(&p);
-			rChangeCurrRing(srcRing);
-			bool expVAreEqual=TRUE;
-			for (int kk=1;kk<=this->numVars;kk++)
-			{
-#ifndef NDEBUG
-// 				cout << src_ExpV[kk] << "," << dst_ExpV[kk] << endl;
-#endif
-				if (src_ExpV[kk]!=dst_ExpV[kk])
-				{
-					expVAreEqual=FALSE;
-				}
-			}								
-			if (expVAreEqual==TRUE)
-			{
-				markingsAreCorrect=TRUE; //everything is fine
-#ifndef NDEBUG
-// 				cout << "correct markings" << endl;
-#endif
-			}//if (pHead(aktpoly)==pHead(H->m[jj])
-			omFree(src_ExpV);
-			omFree(dst_ExpV);
-		}//for (int jj=0;jj<IDELEMS(H);jj++)
-		
-		int *leadExpV=(int *)omAlloc((this->numVars+1)*sizeof(int));
-		if (markingsAreCorrect==TRUE)
-		{
-			pGetExpV(aktpoly,leadExpV);
-		}
-		else
-		{
-			rChangeCurrRing(tmpRing);
-			pGetExpV(pHead(H->m[ii]),leadExpV); //We use H->m[ii] as leading monomial
-			rChangeCurrRing(srcRing);
-		}
-		/*compute differences of the expvects*/				
-		while (pNext(aktpoly)!=NULL)
-		{
-			int *v=(int *)omAlloc((this->numVars+1)*sizeof(int));
-			/*The following if-else-block makes sure the first term (i.e. the wrongly marked term) 
-			is not omitted when computing the differences*/
-			if(markingsAreCorrect==TRUE)
-			{
-				aktpoly=pNext(aktpoly);
-				pGetExpV(aktpoly,v);
-			}
-			else
-			{
-				pGetExpV(pHead(aktpoly),v);
-				markingsAreCorrect=TRUE;
-			}
-			int ctr=0;
-			for (int jj=0;jj<this->numVars;jj++)
-			{				
-				/*Store into ddMatrix*/				
-				if(leadExpV[jj+1]-v[jj+1])
-					ctr++;
-				dd_set_si(intPointMatrix->matrix[aktrow][jj+1],leadExpV[jj+1]-v[jj+1]);
-			}
-			/*It ought to be more sensible to avoid 0-rows in the first place*/
-// 			if(ctr==this->numVars)//We have a 0-row
-// 				dd_MatrixRowRemove(&intPointMatrix,aktrow);
-// 			else
-				aktrow +=1;
-			omFree(v);
-		}
-		omFree(leadExpV);
-	}//for (int ii=0;ii<IDELEMS(srcRing_HH);ii++)
-#ifdef gfanp
-	gettimeofday(&t_markings_end, 0);
-	t_markings += (t_markings_end.tv_sec - t_markings_start.tv_sec + 1e-6*(t_markings_end.tv_usec - t_markings_start.tv_usec));
-#endif
-	/*Now it is safe to idDelete(H)*/
-	idDelete(&H);
-	/*Preprocessing goes here since otherwise we would delete the constraint
-	* for the standard simplex.
-	*/
-	preprocessInequalities(intPointMatrix);
-	/*Now we add the constraint for the standard simplex*/
-// 	dd_set_si(intPointMatrix->matrix[aktrow][0],-1);
-// 	for (int jj=1;jj<=this->numVars;jj++)
-// 	{
-// 		dd_set_si(intPointMatrix->matrix[aktrow][jj],1);
-// 	}
-	//Let's make sure we compute interior points from the positive orthant
-// 	dd_MatrixPtr posRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
-// 	
-// 	int jj=1;
-// 	for (int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		dd_set_si(posRestr->matrix[ii][jj],1);
-// 		jj++;							
-// 	}
-	/*We create a matrix containing the standard simplex
-	* and constraints to assure a strictly positive point
-	* is computed */
-	dd_MatrixPtr posRestr = dd_CreateMatrix(this->numVars+1, this->numVars+1);
-	for(int ii=0;ii<posRestr->rowsize;ii++)
-	{
-		if(ii==0)
-		{
-			dd_set_si(posRestr->matrix[ii][0],-1);
-			for(int jj=1;jj<=this->numVars;jj++)			
-				dd_set_si(posRestr->matrix[ii][jj],1);			
-		}
-		else
-		{
-			/** Set all variables to \geq 1/10. YMMV but this choice is pretty equal*/
-			dd_set_si2(posRestr->matrix[ii][0],-1,2);
-			dd_set_si(posRestr->matrix[ii][ii],1);
-		}
-	}
-	dd_MatrixAppendTo(&intPointMatrix,posRestr);
-	dd_FreeMatrix(posRestr);
-
-	int64vec *iv_weight = new int64vec(this->numVars);
-#ifdef gfanp
-	timeval t_dd_start, t_dd_end;
-	gettimeofday(&t_dd_start, 0);
-#endif
-	dd_ErrorType err;
-	dd_rowset implLin, redrows;
-	dd_rowindex newpos;
-
-	//NOTE Here we should remove interiorPoint and instead
-	// create and ordering like (a(omega),a(fNormal),dp)
-// 	if(this->ivIntPt==NULL)
-		interiorPoint(intPointMatrix, *iv_weight);	//iv_weight now contains the interior point
-// 	else
-// 		iv_weight=this->getIntPoint();
-	dd_FreeMatrix(intPointMatrix);
-	/*Crude attempt for interior point */
-	/*dd_PolyhedraPtr ddpolyh;
-	dd_ErrorType err;
-	dd_rowset impl_linset,redset;
-	dd_rowindex newpos;
-	dd_MatrixCanonicalize(&intPointMatrix, &impl_linset, &redset, &newpos, &err);
-	ddpolyh=dd_DDMatrix2Poly(intPointMatrix, &err);
-	dd_MatrixPtr P;
-	P=dd_CopyGenerators(ddpolyh);
-	dd_FreePolyhedra(ddpolyh);
-	for(int ii=0;ii<P->rowsize;ii++)
-	{
- 		int64vec *iv_row=new int64vec(this->numVars);
-		makeInt(P,ii+1,*iv_row);
-		iv_weight =ivAdd(iv_weight, iv_row);
-		delete iv_row;
-	}
-	dd_FreeMatrix(P);
-	dd_FreeMatrix(intPointMatrix);*/
-#ifdef gfanp
-	gettimeofday(&t_dd_end, 0);
-	t_dd += (t_dd_end.tv_sec - t_dd_start.tv_sec + 1e-6*(t_dd_end.tv_usec - t_dd_start.tv_usec));
-#endif	
-	
-	/*Step 3
-	* turn the minimal basis into a reduced one */			
-	// NOTE May assume that at this point srcRing already has 3 blocks of orderins, starting with a
-	// Thus: 
-	//ring dstRing=rCopyAndChangeWeight(srcRing,iv_weight);	
-	ring dstRing=rCopy0(tmpRing);
-	int length=iv_weight->length();
-	int *A=(int *)omAlloc0(length*sizeof(int));
-	for(int jj=0;jj<length;jj++)
-	{
-		A[jj]=(*iv_weight)[jj];
-	}
-	dstRing->wvhdl[0]=(int*)A;
-	rComplete(dstRing);
-	rChangeCurrRing(dstRing);
- 	rDelete(tmpRing);
-	delete iv_weight;
-
-	ideal dstRing_I;			
-	dstRing_I=idrCopyR(srcRing_HH,srcRing);
-	idDelete(&srcRing_HH); //Hmm.... causes trouble - no more
-	//dstRing_I=idrCopyR(inputIdeal,srcRing);
-	BITSET save=test;
-	test|=Sy_bit(OPT_REDSB);
-	test|=Sy_bit(OPT_REDTAIL);
-#ifndef NDEBUG
-// 	test|=Sy_bit(6);	//OPT_DEBUG
-#endif
-	ideal tmpI;
-	//NOTE Any of the two variants of tmpI={idrCopy(),dstRing_I} does the trick
-	//tmpI = idrCopyR(this->inputIdeal,this->baseRing);
-	tmpI = dstRing_I;
-#ifdef gfanp
-	gettimeofday(&t_kStd_start,0);
-#endif
-	if(gcone::hasHomInput==TRUE)
-		dstRing_I=kStd(tmpI,NULL,isHomog,NULL/*,gcone::hilbertFunction*/);
-	else
-		dstRing_I=kStd(tmpI,NULL,isNotHomog,NULL);
-#ifdef gfanp
-	gettimeofday(&t_kStd_end, 0);
-	t_kStd += (t_kStd_end.tv_sec - t_kStd_start.tv_sec + 1e-6*(t_kStd_end.tv_usec - t_kStd_start.tv_usec));
-#endif
-	idDelete(&tmpI);
-	idNorm(dstRing_I);			
-// 	kInterRed(dstRing_I);
-	idSkipZeroes(dstRing_I);
-	test=save;
-	/*End of step 3 - reduction*/
-			
-	f->setFlipGB(dstRing_I);//store the flipped GB
-// 	idDelete(&dstRing_I);
-	f->flipRing=rCopy(dstRing);	//store the ring on the other side
-#ifndef NDEBUG
- 	printf("Flipped GB is UCN %i:\n",counter+1);
- 	idDebugPrint(dstRing_I);
-	printf("\n");
-#endif	
-	idDelete(&dstRing_I);	
-	rChangeCurrRing(srcRing);	//return to the ring we started the computation of flipGB in
- 	rDelete(dstRing);
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_flip += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-}//void flip(ideal gb, facet *f)
-
-/** \brief A slightly different approach to flipping
-* Here we use the fact that in_v(in_u(I))=in_(u+eps*v)(I). Therefore, we do no longer
-* need to compute an interior point and run BBA on the minimal basis but we can rather
-* use the ordering (a(omega),a(fNormal),dp)
-* The second parameter facet *f must not be const since we need to store f->flipGB
-* Problem: Assume we start in a cone with ordering (dp,C). Then \f$ in_\omega(I) \f$
-* will be from a ring with (a(),dp,C) and our resulting cone from (a(),a(),dp,C). Hence a way
-* must be found to circumvent the sequence of a()'s growing to a ridiculous size.
-* Therefore: We use (a(),a(),dp,C) for the computation of the reduced basis. But then we 
-* do have an interior point of the cone by adding the extremal rays. So we replace 
-* the latter cone by a cone with (a(sum_of_rays),dp,C). 
-* Con: It's incredibly ugly
-* Pro: No messing around with readConeFromFile()
-* Is there a way to construct a vector from \f$ \omega \f$ and the facet normal?
-*/
-inline void gcone::flip2(const ideal &gb, facet *f)
-{
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	const int64vec *fNormal;
-	fNormal = f->getRef2FacetNormal();/*->getFacetNormal();*/	//read this->fNormal;
-#ifndef NDEBUG
-// 	printf("flipping UCN %i over facet(",this->getUCN());
-// 	fNormal->show(1,0);
-// 	printf(") with UCN %i\n",f->getUCN());	
-#endif
-	if(this->getUCN() != f->getUCN())
-	{	printf("%i vs %i\n",this->getUCN(), f->getUCN() );
-		WerrorS("Uh oh... Trying to flip over facet with incompatible UCN");
-		exit(-1);
-	}
-	/*1st step: Compute the initial ideal*/
-	ideal initialForm=idInit(IDELEMS(gb),this->gcBasis->rank);	
-	computeInv( gb, initialForm, *fNormal );
-	ring srcRing=currRing;
-	ring tmpRing;
-	
-	const int64vec *intPointOfFacet;
-	intPointOfFacet=f->getInteriorPoint();
-	//Now we need two blocks of ringorder_a!
-	//May assume the same situation as in flip() here			
-	if( (srcRing->order[0]!=ringorder_a/*64*/) && (srcRing->order[1]!=ringorder_a/*64*/) )
-	{
-		int64vec *iv = new int64vec(this->numVars);//init with 1s, since we do not need a 2nd block here but later
-// 		int64vec *iv_foo = new int64vec(this->numVars,1);//placeholder
-		int64vec *ivw = ivNeg(const_cast<int64vec*>(fNormal));		
-		tmpRing=rCopyAndAddWeight2(srcRing,ivw/*intPointOfFacet*/,iv);
-		delete iv;delete ivw;
-// 		delete iv_foo;
-	}
-	else 
-	{
-		int64vec *iv=new int64vec(this->numVars);
-		int64vec *ivw=ivNeg(const_cast<int64vec*>(fNormal));
-		tmpRing=rCopyAndAddWeight2(srcRing,ivw,iv);
-		delete iv; delete ivw;
-		/*tmpRing=rCopy0(srcRing);
-		int length=fNormal->length();
-		int *A1=(int *)omAlloc0(length*sizeof(int));
-		int *A2=(int *)omAlloc0(length*sizeof(int));
-		for(int jj=0;jj<length;jj++)
-		{
-			A1[jj] = -(*fNormal)[jj];
-			A2[jj] = 1;//-(*fNormal)[jj];//NOTE Do we need this here? This is only the facet ideal
-		}
-		omFree(tmpRing->wvhdl[0]);
-		if(tmpRing->wvhdl[1]!=NULL)
-			omFree(tmpRing->wvhdl[1]);
-		tmpRing->wvhdl[0]=(int*)A1;		
-		tmpRing->block1[0]=length;
-		tmpRing->wvhdl[1]=(int*)A2;		
-		tmpRing->block1[1]=length;
-		rComplete(tmpRing);*/
-	}
-// 	delete fNormal; //NOTE Do not delete when using getRef2FacetNormal();
-	rChangeCurrRing(tmpRing);	
-	//Now currRing should have (a(),a(),dp,C)		
-	ideal ina;			
-	ina=idrCopyR(initialForm,srcRing);
-	idDelete(&initialForm);
-	ideal H;
-#ifdef gfanp
-	timeval t_kStd_start, t_kStd_end;
-	gettimeofday(&t_kStd_start,0);
-#endif
-	BITSET save=test;
-	test|=Sy_bit(OPT_REDSB);
-	test|=Sy_bit(OPT_REDTAIL);
-// 	if(gcone::hasHomInput==TRUE)
-		H=kStd(ina,NULL,testHomog/*isHomog*/,NULL/*,gcone::hilbertFunction*/);
-// 	else
-// 		H=kStd(ina,NULL,isNotHomog,NULL);	//This is \mathcal(G)_{>_-\alpha}(in_v(I))
-	test=save;
-#ifdef gfanp
-	gettimeofday(&t_kStd_end, 0);
-	t_kStd += (t_kStd_end.tv_sec - t_kStd_start.tv_sec + 1e-6*(t_kStd_end.tv_usec - t_kStd_start.tv_usec));
-#endif
-	idSkipZeroes(H);
-	idDelete(&ina);
-	
-	rChangeCurrRing(srcRing);
-	ideal srcRing_H;
-	ideal srcRing_HH;			
-	srcRing_H=idrCopyR(H,tmpRing);
-	//H is needed further below, so don't idDelete here
-	srcRing_HH=ffG(srcRing_H,this->gcBasis);
-	idDelete(&srcRing_H);
-	//Now BBA(srcRing_HH) with (a(),a(),dp)
-	/* Evil modification of currRing */
-	ring dstRing=rCopy0(tmpRing);
-	int length=this->numVars;
-	int *A1=(int *)omAlloc0(length*sizeof(int));
-	int *A2=(int *)omAlloc0(length*sizeof(int));
-	const int64vec *ivw=f->getRef2FacetNormal();
-	for(int jj=0;jj<length;jj++)
-	{
-		A1[jj] = (*intPointOfFacet)[jj];
-		A2[jj] = -(*ivw)[jj];//TODO Or minus (*ivw)[ii] ??? NOTE minus
-	}
-	omFree(dstRing->wvhdl[0]);
-	if(dstRing->wvhdl[1]!=NULL)
-		omFree(dstRing->wvhdl[1]);
-	dstRing->wvhdl[0]=(int*)A1;		
-	dstRing->block1[0]=length;
-	dstRing->wvhdl[1]=(int*)A2;		
-	dstRing->block1[1]=length;
-	rComplete(dstRing);
-	rChangeCurrRing(dstRing);
-	ideal dstRing_I;			
-	dstRing_I=idrCopyR(srcRing_HH,srcRing);
-	idDelete(&srcRing_HH); //Hmm.... causes trouble - no more	
-	save=test;
-	test|=Sy_bit(OPT_REDSB);
-	test|=Sy_bit(OPT_REDTAIL);
-	ideal tmpI;
-	tmpI = dstRing_I;
-#ifdef gfanp
-// 	timeval t_kStd_start, t_kStd_end;
-	gettimeofday(&t_kStd_start,0);
-#endif
-// 	if(gcone::hasHomInput==TRUE)
-// 		dstRing_I=kStd(tmpI,NULL,isHomog,NULL/*,gcone::hilbertFunction*/);
-// 	else
-		dstRing_I=kStd(tmpI,NULL,testHomog,NULL);
-#ifdef gfanp
-	gettimeofday(&t_kStd_end, 0);
-	t_kStd += (t_kStd_end.tv_sec - t_kStd_start.tv_sec + 1e-6*(t_kStd_end.tv_usec - t_kStd_start.tv_usec));
-#endif
-	idDelete(&tmpI);
-	idNorm(dstRing_I);			
-	idSkipZeroes(dstRing_I);
-	test=save;
-	/*End of step 3 - reduction*/
-	
-	f->setFlipGB(dstRing_I);
-	f->flipRing=rCopy(dstRing);
-	rDelete(tmpRing);
-	rDelete(dstRing);
-	//Now we should have dstRing with (a(),a(),dp,C)
-	//This must be replaced with (a(),dp,C) BEFORE gcTmp is actually added to the list
-	//of cones in noRevS
-	rChangeCurrRing(srcRing);
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_flip2 += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-}//flip2
-
-/** \brief Compute initial ideal
- * Compute the initial ideal in_v(G) wrt a (possible) facet normal
- * used in gcone::getFacetNormal in order to preprocess possible facet normals
- * and in gcone::flip for obvious reasons.
-*/
-/*inline*/ void gcone::computeInv(const ideal &gb, ideal &initialForm, const int64vec &fNormal)
-{
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	for (int ii=0;ii<IDELEMS(gb);ii++)
-	{
-		poly initialFormElement;
-		poly aktpoly = (poly)gb->m[ii];//Ptr, so don't pDelete(aktpoly)
-		int *leadExpV=(int *)omAlloc((this->numVars+1)*sizeof(int));
-		pGetExpV(aktpoly,leadExpV);	//find the leading exponent in leadExpV[1],...,leadExpV[n], use pNext(p)
-		initialFormElement=pHead(aktpoly);
-// 		int *v=(int *)omAlloc((this->numVars+1)*sizeof(int));
-		while(pNext(aktpoly)!=NULL)	/*loop trough terms and check for parallelity*/
-		{
-			int64vec *check = new int64vec(this->numVars);
-			aktpoly=pNext(aktpoly);	//next term
-			int *v=(int *)omAlloc((this->numVars+1)*sizeof(int));
-			pGetExpV(aktpoly,v);		
-			/* Convert (int)v into (int64vec)check */
-// 			bool notPar=FALSE;
-			for (int jj=0;jj<this->numVars;jj++)
-			{
-				(*check)[jj]=v[jj+1]-leadExpV[jj+1];
-// 				register int64 foo=(fNormal)[jj];
-// 				if( ( (*check)[jj]  == /*fNormal[jj]*/foo ) 
-// 				 || ( (/*fNormal[jj]*/foo!=0) && ( ( (*check)[jj] % /*fNormal[jj]*/foo ) !=0 ) ) ) 
-// 				{
-// 					notPar=TRUE;
-// 					break;
-// 				}
-			}
-			omFree(v);
-			if (isParallel(*check,fNormal))//Found a parallel vector. Add it
-//  			if(notPar==FALSE)
-			{
-				initialFormElement = pAdd((initialFormElement),(poly)pHead(aktpoly));//pAdd = p_Add_q destroys args
-			}
-			delete check;
-		}//while
-// 		omFree(v);
-#ifndef NDEBUG
-//  		cout << "Initial Form=";				
-//  		pWrite(initialFormElement[ii]);
-//  		cout << "---" << endl;
-#endif
-		/*Now initialFormElement must be added to (ideal)initialForm */
-		initialForm->m[ii]=pCopy(initialFormElement);
-		pDelete(&initialFormElement);
-		omFree(leadExpV);
-	}//for
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_computeInv += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif
-}
-
-/** \brief Compute the remainder of a polynomial by a given ideal
- *
- * Compute \f$ f^{\mathcal{G}} \f$
- * Algorithm is taken from Cox, Little, O'Shea, IVA 2nd Ed. p 62
- * However, since we are only interested in the remainder, there is no need to
- * compute the factors \f$ a_i \f$
- */
-//NOTE: Should be replaced by kNF or kNF2
-//NOTE: Done
-//NOTE: removed with r12286
-		
-/** \brief Compute \f$ f-f^{\mathcal{G}} \f$
-*/
-//NOTE: use kNF or kNF2 instead of restOfDivision
-inline ideal gcone::ffG(const ideal &H, const ideal &G)
-{
-	int size=IDELEMS(H);
-	ideal res=idInit(size,1);
-	for (int ii=0;ii<size;ii++)
-	{
-// 		poly temp1;//=pInit();
-// 		poly temp2;//=pInit();
-		poly temp3;//=pInit();//polys to temporarily store values for pSub
-// 		res->m[ii]=pCopy(kNF(G, NULL,H->m[ii],0,0));
-//  		temp1=pCopy(H->m[ii]);//TRY
-// 		temp2=pCopy(res->m[ii]);
-		//NOTE if gfanHeuristic=0 (sic!) this results in dPolyErrors - mon from wrong ring
-//  		temp2=pCopy(kNF(G, NULL,H->m[ii],0,0));//TRY
-//  		temp3=pSub(temp1, temp2);//TRY
-		temp3=pSub(pCopy(H->m[ii]),pCopy(kNF(G,NULL,H->m[ii],0,0)));//NOTRY
-		res->m[ii]=pCopy(temp3);
-		//res->m[ii]=pSub(temp1,temp2); //buggy		
-		//cout << "res->m["<<ii<<"]=";pWrite(res->m[ii]);
-// 		pDelete(&temp1);//TRY
-// 		pDelete(&temp2);
-		pDelete(&temp3);
-	}
-	return res;
-}
-	
-/** \brief Preprocessing of inequlities
-* Do some preprocessing on the matrix of inequalities
-* 1) Replace several constraints on the pos. orthants by just one for each orthant
-* 2) Remove duplicates of inequalities
-* 3) Remove inequalities that arise as sums of other inequalities
-*/
-void gcone::preprocessInequalities(dd_MatrixPtr &ddineq)
-{
-/*	int *posRowsArray=NULL;
-	int num_alloc=0;
-	int num_elts=0;
- 	int offset=0;*/
-	//Remove zeroes (and strictly pos rows?)
-	for(int ii=0;ii<ddineq->rowsize;ii++)
-	{
-		int64vec *iv = new int64vec(this->numVars);
-		int64vec *ivNull = new int64vec(this->numVars);//Needed for intvec64::compare(*int64vec)
-		int posCtr=0;
-		for(int jj=0;jj<this->numVars;jj++)
-		{
-			(*iv)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
-			if((*iv)[jj]>0)//check for strictly pos rows
-				posCtr++;
-			//Behold! This will delete the row for the standard simplex!
-		}
-// 		if( (iv->compare(0)==0) || (posCtr==iv->length()) )
-		if( (posCtr==iv->length()) || (iv->compare(ivNull)==0) )		
-		{
-			dd_MatrixRowRemove(&ddineq,ii+1);
-			ii--;//Yes. This is on purpose
-		}
-		delete iv;
-		delete ivNull;
-	}
-	//Remove duplicates of rows
-// 	posRowsArray=NULL;
-// 	num_alloc=0;
-// 	num_elts=0;
-// 	offset=0;
-// 	int num_newRows = ddineq->rowsize;
-// 	for(int ii=0;ii<ddineq->rowsize-1;ii++)
-// 	for(int ii=0;ii<num_newRows-1;ii++)
-// 	{
-// 		int64vec *iv = new int64vec(this->numVars);//1st vector to check against
-// 		for(int jj=0;jj<this->numVars;jj++)
-// 			(*iv)[jj]=(int)mpq_get_d(ddineq->matrix[ii][jj+1]);
-// 		for(int jj=ii+1;jj</*ddineq->rowsize*/num_newRows;jj++)
-// 		{
-// 			int64vec *ivCheck = new int64vec(this->numVars);//Checked against iv
-// 			for(int kk=0;kk<this->numVars;kk++)
-// 				(*ivCheck)[kk]=(int)mpq_get_d(ddineq->matrix[jj][kk+1]);
-// 			if (iv->compare(ivCheck)==0)
-// 			{
-// // 				cout << "=" << endl;
-// // 				num_alloc++;
-// // 				void *tmp=realloc(posRowsArray,(num_alloc*sizeof(int)));
-// // 				if(!tmp)
-// // 				{
-// // 					WerrorS("Woah dude! Couldn't realloc memory\n");
-// // 					exit(-1);
-// // 				}
-// // 				posRowsArray = (int*)tmp;
-// // 				posRowsArray[num_elts]=jj;
-// // 				num_elts++;
-// 				dd_MatrixRowRemove(&ddineq,jj+1);
-// 				num_newRows = ddineq->rowsize;
-// 			}
-// 			delete ivCheck;
-// 		}
-// 		delete iv;
-// 	}
-// 	for(int ii=0;ii<num_elts;ii++)
-// 	{
-// 		dd_MatrixRowRemove(&ddineq,posRowsArray[ii]+1-offset);
-// 		offset++;
-// 	}
-// 	free(posRowsArray);
-	//Apply Thm 2.1 of JOTA Vol 53 No 1 April 1987*/	
-}//preprocessInequalities
-	
-/** \brief Compute a Groebner Basis
- *
- * Computes the Groebner basis and stores the result in gcone::gcBasis
- *\param ideal
- *\return void
- */
-inline void gcone::getGB(const ideal &inputIdeal)		
-{
-	BITSET save=test;
-	test|=Sy_bit(OPT_REDSB);
-	test|=Sy_bit(OPT_REDTAIL);
-	ideal gb;
-	gb=kStd(inputIdeal,NULL,testHomog,NULL);
-	idNorm(gb);
-	idSkipZeroes(gb);
-	this->gcBasis=gb;	//write the GB into gcBasis
-	test=save;
-}//void getGB
-		
-/** \brief Compute the negative of a given int64vec
-	*/		
-static int64vec* ivNeg(/*const*/int64vec *iv)
-{	//Hm, switching to int64vec const int64vec does no longer work
-	int64vec *res;// = new int64vec(iv->length());
-	res=iv64Copy(iv);
-	*res *= (int)-1;						
-	return res;
-}
-
-
-/** \brief Compute the dot product of two intvecs
-*
-*/
-static int dotProduct(const int64vec &iva, const int64vec &ivb)				
-{			
-	int res=0;	
-	for (int i=0;i<pVariables;i++)
-	{
-// #ifndef NDEBUG
-// 	(const_cast<int64vec*>(&iva))->show(1,0); (const_cast<int64vec*>(&ivb))->show(1,0);
-// #endif
-		res = res+(iva[i]*ivb[i]);
-	}
-	return res;
-}
-/** \brief Check whether two intvecs are parallel
- *
- * \f$ \alpha\parallel\beta\Leftrightarrow\langle\alpha,\beta\rangle^2=\langle\alpha,\alpha\rangle\langle\beta,\beta\rangle \f$
- */
-static bool isParallel(const int64vec &a,const int64vec &b)
-{	
-	bool res;
-	int lhs=dotProduct(a,b)*dotProduct(a,b);
-	int rhs=dotProduct(a,a)*dotProduct(b,b);
-	return res = (lhs==rhs)?TRUE:FALSE;
-}
-
-/** \brief Compute an interior point of a given cone
- * Result will be written into int64vec iv. 
- * Any rational point is automatically converted into an integer.
- */
-void gcone::interiorPoint( dd_MatrixPtr &M, int64vec &iv) //no const &M here since we want to remove redundant rows
-{
-	dd_LPPtr lp,lpInt;
-	dd_ErrorType err=dd_NoError;
-	dd_LPSolverType solver=dd_DualSimplex;
-	dd_LPSolutionPtr lpSol=NULL;
-// 	dd_rowset ddlinset,ddredrows;	//needed for dd_FindRelativeInterior
-//  	dd_rowindex ddnewpos;
-	dd_NumberType numb;	
-	//M->representation=dd_Inequality;
-			
-	//NOTE: Make this n-dimensional!
-	//dd_set_si(M->rowvec[0],1);dd_set_si(M->rowvec[1],1);dd_set_si(M->rowvec[2],1);
-									
-	/*NOTE: Leave the following line commented out!
-	* Otherwise it will slow down computations a great deal
-	* */
-// 	dd_MatrixCanonicalizeLinearity(&M, &ddlinset, &ddnewpos, &err);
-	//if (err!=dd_NoError){cout << "Error during dd_MatrixCanonicalize" << endl;}
-	dd_MatrixPtr posRestr=dd_CreateMatrix(this->numVars,this->numVars+1);
-	int jj=1;
-	for (int ii=0;ii<this->numVars;ii++)
-	{
-		dd_set_si(posRestr->matrix[ii][jj],1);
-		jj++;							
-	}
-	dd_MatrixAppendTo(&M,posRestr);
-	dd_FreeMatrix(posRestr);
-	lp=dd_Matrix2LP(M, &err);
-	if (err!=dd_NoError){WerrorS("Error during dd_Matrix2LP in gcone::interiorPoint");}
-	if (lp==NULL){WerrorS("LP is NULL");}
-#ifndef NDEBUG
-//			dd_WriteLP(stdout,lp);
-#endif	
-					
-	lpInt=dd_MakeLPforInteriorFinding(lp);
-	if (err!=dd_NoError){WerrorS("Error during dd_MakeLPForInteriorFinding in gcone::interiorPoint");}
-#ifndef NDEBUG
-// 			dd_WriteLP(stdout,lpInt);
-#endif			
-// 	dd_FindRelativeInterior(M,&ddlinset,&ddredrows,&lpSol,&err);
-	if (err!=dd_NoError)
-	{
-		WerrorS("Error during dd_FindRelativeInterior in gcone::interiorPoint");
-		dd_WriteErrorMessages(stdout, err);
-	}			
-	dd_LPSolve(lpInt,solver,&err);	//This will not result in a point from the relative interior
-// 	if (err!=dd_NoError){WerrorS("Error during dd_LPSolve");}									
-	lpSol=dd_CopyLPSolution(lpInt);
-// 	if (err!=dd_NoError){WerrorS("Error during dd_CopyLPSolution");}
-#ifndef NDEBUG
-	printf("Interior point: ");
-	for (int ii=1; ii<(lpSol->d)-1;ii++)
-	{
-		dd_WriteNumber(stdout,lpSol->sol[ii]);
-	}
-	printf("\n");
-#endif			
-	//NOTE The following strongly resembles parts of makeInt. 
-	//Maybe merge sometimes
-	mpz_t kgV; mpz_init(kgV);
-	mpz_set_str(kgV,"1",10);
-	mpz_t den; mpz_init(den);
-	mpz_t tmp; mpz_init(tmp);
-	mpq_get_den(tmp,lpSol->sol[1]);
-	for (int ii=1;ii<(lpSol->d)-1;ii++)
-	{
-		mpq_get_den(den,lpSol->sol[ii+1]);
-		mpz_lcm(kgV,tmp,den);
-		mpz_set(tmp, kgV);
-	}
-	mpq_t qkgV;
-	mpq_init(qkgV);
-	mpq_set_z(qkgV,kgV);
-	for (int ii=1;ii<(lpSol->d)-1;ii++)
-	{
-		mpq_t product;
-		mpq_init(product);
-		mpq_mul(product,qkgV,lpSol->sol[ii]);
-		iv[ii-1]=(int)mpz_get_d(mpq_numref(product));
-		mpq_clear(product);
-	}
-#ifndef NDEBUG
-// 			iv.show();
-// 			cout << endl;
-#endif
-	mpq_clear(qkgV);
-	mpz_clear(tmp);
-	mpz_clear(den);
-	mpz_clear(kgV);			
-			
-	dd_FreeLPSolution(lpSol);
-	dd_FreeLPData(lpInt);
-	dd_FreeLPData(lp);
-// 	set_free(ddlinset);
-// 	set_free(ddredrows); 	
-			
-}//void interiorPoint(dd_MatrixPtr const &M)
-
-/** Computes an interior point of a cone by taking two interior points a,b from two different facets
-* and then computing b+(a-b)/2
-* Of course this only works for flippable facets 
-* Two cases may occur: 
-* 1st: There are only two facets who share the only strictly positive ray
-* 2nd: There are at least two facets which have a distinct positive ray
-* In the former case we use linear algebra to determine an interior point,
-* in the latter case we simply add up the two rays
-*
-* Way too bad! The case may occur that the cone is spanned by three rays, of which only two are strictly
-* positive => these lie in a plane and thus their sum is not from relative interior.
-* So let's just sum up all rays, find one strictly positive and shift the point along that ray
-* 
-* Used by noRevS
-*NOTE no longer used nor maintained. MM Mar 9, 2010
-*/
-// void gcone::interiorPoint2()
-// {//idPrint(this->gcBasis);
-// #ifndef NDEBUG
-// 	if(this->ivIntPt!=NULL)
-// 		WarnS("Interior point already exists - ovrewriting!");
-// #endif
-// 	facet *f1 = this->facetPtr;
-// 	facet *f2 = NULL;
-// 	int64vec *intF1=NULL;
-// 	while(f1!=NULL)
-// 	{
-// 		if(f1->isFlippable)
-// 		{
-// 			facet *f1Ray = f1->codim2Ptr;
-// 			while(f1Ray!=NULL)
-// 			{
-// 				const int64vec *check=f1Ray->getRef2FacetNormal();
-// 				if(iv64isStrictlyPositive(check))
-// 				{
-// 					intF1=iv64Copy(check);
-// 					break;
-// 				}				
-// 				f1Ray=f1Ray->next;
-// 			}
-// 		}
-// 		if(intF1!=NULL)
-// 			break;
-// 		f1=f1->next;
-// 	}
-// 	if(f1!=NULL && f1->next!=NULL)//Choose another facet, different from f1
-// 		f2=f1->next;
-// 	else
-// 		f2=this->facetPtr;
-// 	if(intF1==NULL && hasHomInput==TRUE)
-// 	{
-// 		intF1 = new int64vec(this->numVars);
-// 		for(int ii=0;ii<this->numVars;ii++)
-// 			(*intF1)[ii]=1;
-// 	}
-// 	assert(f1); assert(f2);
-// 	int64vec *intF2=f2->getInteriorPoint();
-// 	mpq_t *qPosRay = new mpq_t[this->numVars];//The positive ray from above
-// 	mpq_t *qIntPt = new mpq_t[this->numVars];//starting vector a+((b-a)/2)
-// 	mpq_t *qPosIntPt = new mpq_t[this->numVars];//This should be >0 eventually
-// 	for(int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		mpq_init(qPosRay[ii]);
-// 		mpq_init(qIntPt[ii]);
-// 		mpq_init(qPosIntPt[ii]);
-// 	}	
-// 	//Compute a+((b-a)/2) && Convert intF1 to mpq
-// 	for(int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		mpq_t a,b;
-// 		mpq_init(a); mpq_init(b);
-// 		mpq_set_si(a,(*intF1)[ii],1);
-// 		mpq_set_si(b,(*intF2)[ii],1);
-// 		mpq_t diff;
-// 		mpq_init(diff);
-// 		mpq_sub(diff,b,a);	//diff=b-a
-// 		mpq_t quot;
-// 		mpq_init(quot);
-// 		mpq_div_2exp(quot,diff,1);	//quot=diff/2=(b-a)/2
-// 		mpq_clear(diff);
-// 		//Don't be clever and reuse diff here
-// 		mpq_t sum; mpq_init(sum);
-// 		mpq_add(sum,b,quot);	//sum=b+quot=a+(b-a)/2
-// 		mpq_set(qIntPt[ii],sum);
-// 		mpq_clear(sum);
-// 		mpq_clear(quot);
-// 		mpq_clear(a); mpq_clear(b);
-// 		//Now for intF1
-// 		mpq_set_si(qPosRay[ii],(*intF1)[ii],1);
-// 	}
-// 	//Now add: qPosIntPt=qPosRay+qIntPt until qPosIntPt >0
-// 	while(TRUE)
-// 	{	
-// 		bool success=FALSE;
-// 		int posCtr=0;	
-// 		for(int ii=0;ii<this->numVars;ii++)
-// 		{
-// 			mpq_t sum; mpq_init(sum);
-// 			mpq_add(sum,qPosRay[ii],qIntPt[ii]);
-// 			mpq_set(qPosIntPt[ii],sum);
-// 			mpq_clear(sum);
-// 			if(mpq_sgn(qPosIntPt[ii])==1)
-// 				posCtr++;
-// 		}
-// 		if(posCtr==this->numVars)//qPosIntPt > 0 
-// 			break;
-// 		else
-// 		{
-// 			mpq_t qTwo; mpq_init(qTwo);
-// 			mpq_set_ui(qTwo,2,1);
-// 			for(int jj=0;jj<this->numVars;jj++)
-// 			{
-// 				mpq_t tmp; mpq_init(tmp);
-// 				mpq_mul(tmp,qPosRay[jj],qTwo);
-// 				mpq_set( qPosRay[jj], tmp);
-// 				mpq_clear(tmp);
-// 			}
-// 			mpq_clear(qTwo);
-// 		}
-// 	}//while
-// 	//Now qPosIntPt ought to be >0, so convert back to int :D
-// 	/*Compute lcm of the denominators*/
-// 	mpz_t *denom = new mpz_t[this->numVars];
-// 	mpz_t tmp,kgV;
-// 	mpz_init(tmp); mpz_init(kgV);
-// 	for (int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		mpz_t z;
-// 		mpz_init(z);
-// 		mpq_get_den(z,qPosIntPt[ii]);
-// 		mpz_init(denom[ii]);
-// 		mpz_set( denom[ii], z);
-// 		mpz_clear(z);				
-// 	}
-// 		
-// 	mpz_set(tmp,denom[0]);
-// 	for (int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		mpz_lcm(kgV,tmp,denom[ii]);
-// 		mpz_set(tmp,kgV);				
-// 	}
-// 	mpz_clear(tmp);	
-// 	/*Multiply the nominators by kgV*/
-// 	mpq_t qkgV,res;
-// 	mpq_init(qkgV);
-// 	mpq_canonicalize(qkgV);		
-// 	mpq_init(res);
-// 	mpq_canonicalize(res);
-// 				
-// 	mpq_set_num(qkgV,kgV);
-// 	int64vec *n=new int64vec(this->numVars);
-// 	for (int ii=0;ii<this->numVars;ii++)
-// 	{
-// 		mpq_canonicalize(qPosIntPt[ii]);
-// 		mpq_mul(res,qkgV,qPosIntPt[ii]);
-// 		(*n)[ii]=(int)mpz_get_d(mpq_numref(res));
-// 	}
-// 	this->setIntPoint(n);
-// 	delete n;
-// 	delete [] qPosIntPt;
-// 	delete [] denom;
-// 	delete [] qPosRay;
-// 	delete [] qIntPt;
-// 	mpz_clear(kgV);
-// 	mpq_clear(qkgV); mpq_clear(res);
-// }
-	
-/** \brief Copy a ring and add a weighted ordering in first place
- * 
- */
-ring gcone::rCopyAndAddWeight(const ring &r, int64vec *ivw)				
-{
-	ring res=rCopy0(r);
-	int jj;
-			
-	omFree(res->order);
-	res->order =(int *)omAlloc0(4*sizeof(int/*64*/));
-	omFree(res->block0);
-	res->block0=(int *)omAlloc0(4*sizeof(int/*64*/));
-	omFree(res->block1);
-	res->block1=(int *)omAlloc0(4*sizeof(int/*64*/));
-	omfree(res->wvhdl);
-	res->wvhdl =(int **)omAlloc0(4*sizeof(int/*64*/**));
-			
-	res->order[0]=ringorder_a/*64*/;
-	res->block0[0]=1;
-	res->block1[0]=res->N;
-	res->order[1]=ringorder_dp;	//basically useless, since that should never be used			
-	res->block0[1]=1;
-	res->block1[1]=res->N;
-	res->order[2]=ringorder_C;
-
-	int length=ivw->length();
-	int/*64*/ *A=(int/*64*/ *)omAlloc0(length*sizeof(int/*64*/));
-	for (jj=0;jj<length;jj++)
-	{				
-		A[jj]=(*ivw)[jj];
-		if((*ivw)[jj]>=INT_MAX) WarnS("A[jj] exceeds INT_MAX in gcone::rCopyAndAddWeight!\n");
-	}			
-	res->wvhdl[0]=(int *)A;
-	res->block1[0]=length;
-			
-	rComplete(res);
-	return res;
-}//rCopyAndAdd
-		
-ring gcone::rCopyAndAddWeight2(const ring &r,const int64vec *ivw, const int64vec *fNormal)				
-{
-	ring res=rCopy0(r);
-			
-	omFree(res->order);
-	res->order =(int *)omAlloc0(5*sizeof(int/*64*/));
-	omFree(res->block0);
-	res->block0=(int *)omAlloc0(5*sizeof(int/*64*/));
-	omFree(res->block1);
-	res->block1=(int *)omAlloc0(5*sizeof(int/*64*/));
-	omfree(res->wvhdl);
-	res->wvhdl =(int **)omAlloc0(5*sizeof(int/*64*/**));
-			
-	res->order[0]=ringorder_a/*64*/;
-	res->block0[0]=1;
-	res->block1[0]=res->N;
-	res->order[1]=ringorder_a/*64*/;
-	res->block0[1]=1;
-	res->block1[1]=res->N;
-	
-	res->order[2]=ringorder_dp;
-	res->block0[2]=1;
-	res->block1[2]=res->N;
-	
-	res->order[3]=ringorder_C;
-
-	int length=ivw->length();
-	int/*64*/ *A1=(int/*64*/ *)omAlloc0(length*sizeof(int/*64*/));
-	int/*64*/ *A2=(int/*64*/ *)omAlloc0(length*sizeof(int/*64*/));
-	for (int jj=0;jj<length;jj++)
-	{				
-		A1[jj]=(*ivw)[jj];
-		A2[jj]=-(*fNormal)[jj];
-		if((*ivw)[jj]>=INT_MAX || (*fNormal)[jj]>=INT_MAX) WarnS("A[jj] exceeds INT_MAX in gcone::rCopyAndAddWeight2!\n");
-	}			
-	res->wvhdl[0]=(int *)A1;
-	res->block1[0]=length;
-	res->wvhdl[1]=(int *)A2;
-	res->block1[1]=length;
-	rComplete(res);
-	return res;
-}
-		
-//NOTE not needed anywhere
-// ring rCopyAndChangeWeight(ring const &r, int64vec *ivw)
-// {
-// 	ring res=rCopy0(currRing);
-// 	rComplete(res);
-// 	rSetWeightVec(res,(int64*)ivw);
-// 	//rChangeCurrRing(rnew);
-// 	return res;
-// }
-		
-/** \brief Checks whether a given facet is a search facet
- * Determines whether a given facet of a cone is the search facet of a neighbouring cone
- * This is done in the following way:
- * We loop through all facets of the cone and find the "smallest" facet, i.e. the unique facet
- * that is first crossed during the generic walk.
- * We then check whether the fNormal of this facet is parallel to the fNormal of our testfacet.
- * If this is the case, then our facet is indeed a search facet and TRUE is retuned. 
-*/
-//removed with r12286
-		
-/** \brief Check for equality of two intvecs
- */
-static bool ivAreEqual(const int64vec &a, const int64vec &b)
-{
-	bool res=TRUE;
-	for(int ii=0;ii<pVariables;ii++)
-	{
-		if(a[ii]!=b[ii])
-		{
-			res=FALSE;
-			break;
-		}
-	}
-	return res;
-}
-		
-/** \brief The reverse search algorithm
- */
-//removed with r12286
-/** \brief Compute the lineality/homogeneity space
-* It is the kernel of the inequality matrix Ax=0
-* As a result gcone::dd_LinealitySpace is set
-*/
-dd_MatrixPtr gcone::computeLinealitySpace()
-{
-	dd_MatrixPtr res;
-	dd_MatrixPtr ddineq;
-	ddineq=dd_CopyMatrix(this->ddFacets);	
-	//Add a row of 0s in 0th place
-	dd_MatrixPtr ddAppendRowOfZeroes=dd_CreateMatrix(1,this->numVars+1);
-	dd_MatrixPtr ddFoo=dd_AppendMatrix(ddAppendRowOfZeroes,ddineq);
-	dd_FreeMatrix(ddAppendRowOfZeroes);
-	dd_FreeMatrix(ddineq);
-	ddineq=dd_CopyMatrix(ddFoo);
-	dd_FreeMatrix(ddFoo);
-	//Cohen starts here
-	int dimKer=0;//Cohen calls this r
-	int m=ddineq->rowsize;//Rows
-	int n=ddineq->colsize;//Cols
-	int c[m+1];
-	int d[n+1];
-	for(int ii=0;ii<m;ii++)
-		c[ii]=0;
-	for(int ii=0;ii<n;ii++)
-		d[ii]=0;	
-	
-	for(int k=1;k<n;k++)
-	{
-		//Let's find a j s.t. m[j][k]!=0 && c[j]=0		
-		int condCtr=0;//Check each row for zeroness
-		for(int j=1;j<m;j++)
-		{
-			if(mpq_sgn(ddineq->matrix[j][k])!=0 && c[j]==0)
-			{
-				mpq_t quot; mpq_init(quot);
-				mpq_t one; mpq_init(one); mpq_set_str(one,"-1",10);
-				mpq_t ratd; mpq_init(ratd);
-				if((int)mpq_get_d(ddineq->matrix[j][k])!=0)
-					mpq_div(quot,one,ddineq->matrix[j][k]);
-				mpq_set(ratd,quot);
-				mpq_canonicalize(ratd);
-		
-				mpq_set_str(ddineq->matrix[j][k],"-1",10);
-				for(int ss=k+1;ss<n;ss++)
-				{
-					mpq_t prod; mpq_init(prod);
-					mpq_mul(prod, ratd, ddineq->matrix[j][ss]);				
-					mpq_set(ddineq->matrix[j][ss],prod);
-					mpq_canonicalize(ddineq->matrix[j][ss]);
-					mpq_clear(prod);
-				}		
-				for(int ii=1;ii<m;ii++)
-				{
-					if(ii!=j)
-					{
-						mpq_set(ratd,ddineq->matrix[ii][k]);
-						mpq_set_str(ddineq->matrix[ii][k],"0",10);			
-						for(int ss=k+1;ss<n;ss++)
-						{
-							mpq_t prod; mpq_init(prod);
-							mpq_mul(prod, ratd, ddineq->matrix[j][ss]);
-							mpq_t sum; mpq_init(sum);
-							mpq_add(sum, ddineq->matrix[ii][ss], prod);
-							mpq_set(ddineq->matrix[ii][ss],	sum);
-							mpq_canonicalize(ddineq->matrix[ii][ss]);
-							mpq_clear(prod);
-							mpq_clear(sum);
-						}
-					}
-				}
-				c[j]=k;		
-				d[k]=j;
-				mpq_clear(quot); mpq_clear(ratd); mpq_clear(one);	
-			}
-			else
-				condCtr++;
-		}			
-		if(condCtr==m-1)	//Why -1 ???
-		{
-			dimKer++;
-			d[k]=0;
-// 			break;//goto _4;
-		}//else{
-		/*Eliminate*/
-	}//for(k
-	/*Output kernel, i.e. set gcone::dd_LinealitySpace here*/	
-// 	gcone::dd_LinealitySpace = dd_CreateMatrix(dimKer,this->numVars+1);
-	res = dd_CreateMatrix(dimKer,this->numVars+1);
-	int row=-1;
-	for(int kk=1;kk<n;kk++)
-	{
-		if(d[kk]==0)
-		{
-			row++;
-			for(int ii=1;ii<n;ii++)
-			{
-				if(d[ii]>0)
-					mpq_set(res->matrix[row][ii],ddineq->matrix[d[ii]][kk]);
-				else if(ii==kk)				
-					mpq_set_str(res->matrix[row][ii],"1",10);
-				mpq_canonicalize(res->matrix[row][ii]);
-			}
-		}
-	}
-	dd_FreeMatrix(ddineq);
-	return(res);
-	//Better safe than sorry:
-	//NOTE dd_LinealitySpace contains RATIONAL ENTRIES
-	//Therefore if you need integer ones: CALL gcone::makeInt(...) method
-}	
-
-
-/** \brief The new method of Markwig and Jensen
- * Compute gcBasis and facets for the arbitrary starting cone. Store \f$(codim-1)\f$-facets as normals.
- * In order to represent a facet uniquely compute also the \f$(codim-2)\f$-facets and norm by the gcd of the components.
- * Keep a list of facets as a linked list containing an int64vec and an integer matrix.
- * Since a \f$(codim-1)\f$-facet belongs to exactly two full dimensional cones, we remove a facet from the list as
- * soon as we compute this facet again. Comparison of facets is done by...
- */
-void gcone::noRevS(gcone &gcRoot, bool usingIntPoint)
-{	
-	facet *SearchListRoot = new facet(); //The list containing ALL facets we come across
-	facet *SearchListAct;
-	SearchListAct = NULL;
-	//SearchListAct = SearchListRoot;			
-	gcone *gcAct;
-	gcAct = &gcRoot;
-	gcone *gcPtr;	//Pointer to end of linked list of cones
-	gcPtr = &gcRoot;
-	gcone *gcNext;	//Pointer to next cone to be visited
-	gcNext = &gcRoot;
-	gcone *gcHead;
-	gcHead = &gcRoot;			
-	facet *fAct;
-	fAct = gcAct->facetPtr;				
-	ring rAct;
-	rAct = currRing;
-	int UCNcounter=gcAct->getUCN();	
-#ifndef NDEBUG
-	printf("NoRevs\n");
-	printf("Facets are:\n");
-	gcAct->showFacets();
-#endif			
-	/*Compute lineality space here
-	* Afterwards static dd_MatrixPtr gcone::dd_LinealitySpace is set*/
-	if(dd_LinealitySpace==NULL)
-		dd_LinealitySpace = gcAct->computeLinealitySpace();
-	/*End of lineality space computation*/		
-	//gcAct->getCodim2Normals(*gcAct);
-	if(fAct->codim2Ptr==NULL)
-		gcAct->getExtremalRays(*gcAct);		
-	/* Make a copy of the facet list of first cone
-	   Since the operations getCodim2Normals and normalize affect the facets
-	   we must not memcpy them before these ops! */	
-	/*facet *codim2Act; codim2Act = NULL;			
-	facet *sl2Root;
-	facet *sl2Act;*/			
-	for(int ii=0;ii<this->numFacets;ii++)
-	{
-		//only copy flippable facets! NOTE: We do not need flipRing or any such information.
-		if(fAct->isFlippable==TRUE)
-		{
-			/*Using shallow copy here*/
-#ifdef SHALLOW
-			if( ii==0 || (ii>0 && SearchListAct==NULL) ) //1st facet may be non-flippable
-			{
-				if(SearchListRoot!=NULL) delete(SearchListRoot);
-				SearchListRoot = fAct->shallowCopy(*fAct);
-				SearchListAct = SearchListRoot;	//SearchListRoot is already 'new'ed at beginning of method!
-			}
-			else
-			{			
-				SearchListAct->next = fAct->shallowCopy(*fAct);
-				SearchListAct = SearchListAct->next;						
-			}
-			fAct=fAct->next;
-#else
-			/*End of shallow copy*/
-			int64vec *fNormal;
-			fNormal = fAct->getFacetNormal();
-			if( ii==0 || (ii>0 && SearchListAct==NULL) ) //1st facet may be non-flippable
-			{						
-				SearchListAct = SearchListRoot;	//SearchListRoot is already 'new'ed at beginning of method!
-			}
-			else
-			{			
-				SearchListAct->next = new facet();
-				SearchListAct = SearchListAct->next;						
-			}
-			SearchListAct->setFacetNormal(fNormal);
-			SearchListAct->setUCN(this->getUCN());
-			SearchListAct->numCodim2Facets=fAct->numCodim2Facets;
-			SearchListAct->isFlippable=TRUE;
-			//Copy int point as well
-			int64vec *ivIntPt;
-			ivIntPt = fAct->getInteriorPoint();
-			SearchListAct->setInteriorPoint(ivIntPt);
-			delete(ivIntPt);
-			//Copy codim2-facets
-			facet *codim2Act;
-			codim2Act = NULL;			
-			facet *sl2Root;
-			facet *sl2Act;			
-			codim2Act=fAct->codim2Ptr;
-			SearchListAct->codim2Ptr = new facet(2);
-			sl2Root = SearchListAct->codim2Ptr;
-			sl2Act = sl2Root;			
-			for(int jj=0;jj<fAct->numCodim2Facets;jj++)
-// 			for(int jj=0;jj<fAct->numRays-1;jj++)
-			{
-				int64vec *f2Normal;
-				f2Normal = codim2Act->getFacetNormal();
-				if(jj==0)
-				{						
-					sl2Act = sl2Root;
-					sl2Act->setFacetNormal(f2Normal);
-				}
-				else
-				{
-					sl2Act->next = new facet(2);
-					sl2Act = sl2Act->next;
-					sl2Act->setFacetNormal(f2Normal);
-				}
-				delete f2Normal;				
-				codim2Act = codim2Act->next;
-			}
-			fAct = fAct->next;
-			delete fNormal;
-#endif
-		}//if(fAct->isFlippable==TRUE)			
-		else {fAct = fAct->next;}
-	}//End of copying facets into SLA
-	
-	SearchListAct = SearchListRoot;	//Set to beginning of list
-	/*Make SearchList doubly linked*/
-#ifndef NDEBUG
-  #if SIZEOF_LONG==8
-	while(SearchListAct!=(facet*)0xfefefefefefefefe && SearchListAct!=NULL)
-	{
-		if(SearchListAct->next!=(facet*)0xfefefefefefefefe && SearchListAct->next!=NULL){
-  #elif SIZEOF_LONG!=8
-	while(SearchListAct!=(facet*)0xfefefefe)
-	{
-		if(SearchListAct->next!=(facet*)0xfefefefe){
-  #endif
-#else
-	while(SearchListAct!=NULL)
-	{
-		if(SearchListAct->next!=NULL){
-#endif
-			SearchListAct->next->prev = SearchListAct;					
-		}
-		SearchListAct = SearchListAct->next;
-	}
-	SearchListAct = SearchListRoot;	//Set to beginning of List
-	
-// 	fAct = gcAct->facetPtr;//???
-	gcAct->writeConeToFile(*gcAct);			
-	/*End of initialisation*/
-	
-	fAct = SearchListAct;
-	/*2nd step
-	  Choose a facet from SearchList, flip it and forget the previous cone
-	  We always choose the first facet from SearchList as facet to be flipped
-	*/	
-	while( (SearchListAct!=NULL))//&& counter<490)
-	{//NOTE See to it that the cone is only changed after ALL facets have been flipped!				
-		fAct = SearchListAct;		
- 		while(fAct!=NULL)
-// 		while( (fAct->getUCN() == fAct->next->getUCN()) )		
-		{	//Since SLA should only contain flippables there should be no need to check for that			
-			gcAct->flip2(gcAct->gcBasis,fAct);
-			//NOTE rCopy needed?
-			ring rTmp=rCopy(fAct->flipRing);
-			rComplete(rTmp);
-			rChangeCurrRing(rTmp);
-			gcone *gcTmp = new gcone(*gcAct,*fAct);//copy constructor!
-			/* Now gcTmp->gcBasis and gcTmp->baseRing are set from fAct->flipGB and fAct->flipRing.
-			 * Since we come at most once across a given facet from gcAct->facetPtr we can delete them.
-			 * NOTE: Can this cause trouble with the destructor?
-			 * Answer: Yes it bloody well does!
-			 * However I'd like to delete this data here, since if we have a cone with many many facets it
-			 * should pay to get rid of the flipGB as soon as possible.
-			 * Destructor must be equipped with necessary checks.
-			*/
- 			idDelete((ideal *)&fAct->flipGB);
-			rDelete(fAct->flipRing);			
-			gcTmp->getConeNormals(gcTmp->gcBasis/*, FALSE*/);
-// 			gcTmp->getCodim2Normals(*gcTmp);
-			gcTmp->getExtremalRays(*gcTmp);
-			//NOTE Order rays lex here
-			gcTmp->orderRays();			
-// 			//NOTE If flip2 is used we need to get an interior point of gcTmp
-// 			// and replace gcTmp->baseRing with an appropriate ring with only
-// 			// one weight
-// 			gcTmp->interiorPoint2();
-			gcTmp->replaceDouble_ringorder_a_ByASingleOne();
-			//gcTmp->ddFacets should not be needed anymore, so
-			dd_FreeMatrix(gcTmp->ddFacets);
-#ifndef NDEBUG
-// 			gcTmp->showFacets(1);
-#endif
-			/*add facets to SLA here*/
-#ifdef SHALLOW
-  #ifndef NDEBUG
-			printf("fActUCN before enq2: %i\n",fAct->getUCN());
-  #endif
-			facet *tmp;
-			tmp=gcTmp->enqueue2(SearchListRoot);
-  #ifndef NDEBUG
-			printf("\nheadUCN=%i\n",tmp->getUCN());
-			printf("fActUCN after enq2: %i\n",fAct->getUCN());
-  #endif
-			SearchListRoot=tmp;
-			//SearchListRoot=gcTmp->enqueue2/*NewFacets*/(SearchListRoot);
-#else 
-			SearchListRoot=gcTmp->enqueueNewFacets(SearchListRoot);
-#endif //ifdef SHALLOW
-// 			gcTmp->writeConeToFile(*gcTmp);
- 			if(gfanHeuristic==1)
- 			{
-				gcTmp->writeConeToFile(*gcTmp);
- 				idDelete((ideal*)&gcTmp->gcBasis);//Whonder why?
-				rDelete(gcTmp->baseRing);
- 			}			
-#ifndef NDEBUG
-			if(SearchListRoot!=NULL)
-				showSLA(*SearchListRoot);
-#endif			
-			rChangeCurrRing(gcAct->baseRing);
-			rDelete(rTmp);
-			//doubly linked for easier removal
-			gcTmp->prev = gcPtr;
-			gcPtr->next=gcTmp;
-			gcPtr=gcPtr->next;
-			//Cleverly disguised exit condition follows
-			if(fAct->getUCN() == fAct->next->getUCN())
-			{
-				printf("Switching UCN from %i to %i\n",fAct->getUCN(),fAct->next->getUCN());
-				fAct=fAct->next;				
-			}
-			else
-			{
-				//rDelete(gcAct->baseRing);
-// 				printf("break\n");
-				break;
-			}
-// 			fAct=fAct->next;
-		}//while( ( (fAct->next!=NULL) && (fAct->getUCN()==fAct->next->getUCN() ) ) );		
-		//Search for cone with smallest UCN
-#ifndef NDEBUG
-  #if SIZEOF_LONG==8	//64 bit
-		while(gcNext!=(gcone * const)0xfbfbfbfbfbfbfbfb && SearchListRoot!=NULL)
-  #elif SIZEOF_LONG == 4
-		while(gcNext!=(gcone * const)0xfbfbfbfb && SearchListRoot!=NULL)
-  #endif
-#endif
-#ifdef NDEBUG
-		while(gcNext!=NULL && SearchListRoot!=NULL)	
-#endif
-		{			
-			if( gcNext->getUCN() == SearchListRoot->getUCN() )
-			{
-				if(gfanHeuristic==0)
-				{
-					gcAct = gcNext;
-					//Seems better to not to use rCopy here
-// 					rAct=rCopy(gcAct->baseRing);
-					rAct=gcAct->baseRing;
-					rComplete(rAct);
-					rChangeCurrRing(rAct);						
-					break;
-				}
-				else if(gfanHeuristic==1)
-				{
-					gcone *gcDel;
-					gcDel = gcAct;					
-					gcAct = gcNext;
-					//Read st00f from file &
-					//implant the GB into gcAct
-					readConeFromFile(gcAct->getUCN(), gcAct);
-					//Kill the baseRing but ONLY if it is not the ring the computation started in!
-// 					if(gcDel->getUCN()!=1)//WTF!? This causes the Mandelbug in gcone::areEqual(facet, facet)
-// 						rDelete(gcDel->baseRing);
-// 					rAct=rCopy(gcAct->baseRing);
-					/*The ring change occurs in readConeFromFile, so as to 
-					assure that gcAct->gcBasis belongs to the right ring*/
-					rAct=gcAct->baseRing;
-					rComplete(rAct);
-					rChangeCurrRing(rAct);
-					break;
-				}				
-			}
-			else if(gcNext->getUCN() < SearchListRoot->getUCN() )
-			{
-				idDelete( (ideal*)&gcNext->gcBasis );				
-// 				rDelete(gcNext->baseRing);//TODO Why does this crash?
-			}
-			/*else
-			{
-				if(gfanHeuristic==1)
-				{
-					gcone *gcDel;
-					gcDel = gcNext;
-					if(gcDel->getUCN()!=1)
-						rDelete(gcDel->baseRing);
-				}					
-			}*/			
- 			gcNext = gcNext->next;
-		}
-		UCNcounter++;
-		SearchListAct = SearchListRoot;		
-	}
-	printf("\nFound %i cones - terminating\n", counter);
-}//void noRevS(gcone &gc)	
-		
-		
-/** \brief Make a set of rational vectors into integers
- *
- * We compute the lcm of the denominators and multiply with this to get integer values.
- * If the gcd of the nominators > 1 we divide by the gcd => primitive vector.
- * Expects a new int64vec as 3rd parameter
- * \param dd_MatrixPtr,int64vec
- */
-void gcone::makeInt(const dd_MatrixPtr &M, const int line, int64vec &n)
-{			
-	mpz_t *denom = new mpz_t[this->numVars];
-	for(int ii=0;ii<this->numVars;ii++)
-	{
-		mpz_init_set_str(denom[ii],"0",10);
-	}
-		
-	mpz_t kgV,tmp;
-	mpz_init(kgV);
-	mpz_init(tmp);
-			
-	for (int ii=0;ii<(M->colsize)-1;ii++)
-	{
-		mpz_t z;
-		mpz_init(z);
-		mpq_get_den(z,M->matrix[line-1][ii+1]);
-		mpz_set( denom[ii], z);
-		mpz_clear(z);				
-	}
-						
-	/*Compute lcm of the denominators*/
-	mpz_set(tmp,denom[0]);
-	for (int ii=0;ii<(M->colsize)-1;ii++)
-	{
-		mpz_lcm(kgV,tmp,denom[ii]);
-		mpz_set(tmp,kgV);				
-	}
-	mpz_clear(tmp);	
-	/*Multiply the nominators by kgV*/
-	mpq_t qkgV,res;
-	mpq_init(qkgV);
-	mpq_set_str(qkgV,"1",10);
-	mpq_canonicalize(qkgV);
-			
-	mpq_init(res);
-	mpq_set_str(res,"1",10);
-	mpq_canonicalize(res);
-			
-	mpq_set_num(qkgV,kgV);
-			
-//	mpq_canonicalize(qkgV);
-// 	int ggT=1;
-	for (int ii=0;ii<(M->colsize)-1;ii++)
-	{
-		mpq_mul(res,qkgV,M->matrix[line-1][ii+1]);
-		n[ii]=(int64)mpz_get_d(mpq_numref(res));
-// 		ggT=int64gcd(ggT,n[ii]);
-	}
-	int64 ggT=n[0];
-	for(int ii=0;ii<this->numVars;ii++)
-		ggT=int64gcd(ggT,n[ii]);	
-	//Normalisation
-	if(ggT>1)
-	{
-		for(int ii=0;ii<this->numVars;ii++)
-			n[ii] /= ggT;
-	}
-	delete [] denom;
-	mpz_clear(kgV);
-	mpq_clear(qkgV); mpq_clear(res);			
-			
-}
-/**
- * For all codim-2-facets we compute the gcd of the components of the facet normal and 
- * divide it out. Thus we get a normalized representation of each
- * (codim-2)-facet normal, i.e. a primitive vector
- * Actually we now also normalize the facet normals.
- */
-// void gcone::normalize()
-// {
-// 	int *ggT = new int;
-// 		*ggT=1;
-// 	facet *fAct;
-// 	facet *codim2Act;
-// 	fAct = this->facetPtr;
-// 	codim2Act = fAct->codim2Ptr;
-// 	while(fAct!=NULL)
-// 	{
-// 		int64vec *fNormal;
-// 		fNormal = fAct->getFacetNormal();
-// 		int *ggT = new int;
-// 		*ggT=1;
-// 		for(int ii=0;ii<this->numVars;ii++)
-// 		{
-// 			*ggT=intgcd((*ggT),(*fNormal)[ii]);
-// 		}
-// 		if(*ggT>1)//We only need to do this if the ggT is non-trivial
-// 		{
-// // 			int64vec *fCopy = fAct->getFacetNormal();
-// 			for(int ii=0;ii<this->numVars;ii++)
-// 				(*fNormal)[ii] = ((*fNormal)[ii])/(*ggT);
-// 			fAct->setFacetNormal(fNormal);
-// 		}		
-// 		delete fNormal;
-// 		delete ggT;
-// 		/*And now for the codim2*/
-// 		while(codim2Act!=NULL)
-// 		{				
-// 			int64vec *n;
-// 			n=codim2Act->getFacetNormal();
-// 			int *ggT=new int;
-// 			*ggT=1;
-// 			for(int ii=0;ii<this->numVars;ii++)
-// 			{
-// 				*ggT = intgcd((*ggT),(*n)[ii]);
-// 			}
-// 			if(*ggT>1)
-// 			{
-// 				for(int ii=0;ii<this->numVars;ii++)
-// 				{
-// 					(*n)[ii] = ((*n)[ii])/(*ggT);
-// 				}
-// 				codim2Act->setFacetNormal(n);
-// 			}
-// 			codim2Act = codim2Act->next;
-// 			delete n;
-// 			delete ggT;
-// 		}
-// 		fAct = fAct->next;
-// 	}
-// }
-
-/** \brief Enqueue new facets into the searchlist 
- * The searchlist (SLA for short) is implemented as a FIFO
- * Checks are done as follows:
- * 1) Check facet fAct against all facets in SLA for parallelity. If it is not parallel to any one add it.
- * 2) If it is parallel compare the codim2 facets. If they coincide the facets are equal and we delete the 
- *	facet from SLA and do not add fAct.
- * It may very well happen, that SLA=\f$ \emptyset \f$ but we do not have checked all fActs yet. In this case we
- * can be sure, that none of the facets that are still there already were in SLA once, so we just dump them into SLA.
- * Takes ptr to search list root
- * Returns a pointer to new first element of Searchlist
- */
-facet * gcone::enqueueNewFacets(facet *f)
-{
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	facet *slHead;
-	slHead = f;
-	facet *slAct;	//called with f=SearchListRoot
-	slAct = f;
-	facet *slEnd;	//Pointer to end of SLA
-	slEnd = f;
-// 	facet *slEndStatic;	//marks the end before a new facet is added		
-	facet *fAct;
-	fAct = this->facetPtr;
-	facet *codim2Act;
-	codim2Act = this->facetPtr->codim2Ptr;
-	facet *sl2Act;
-	sl2Act = f->codim2Ptr;
-	/** Pointer to a facet that will be deleted */
-	volatile facet *deleteMarker;
-	deleteMarker = NULL;
-			
-	/** \brief  Flag to mark a facet that might be added
-	 * The following case may occur:
-	 * A facet fAct is found to be parallel but not equal to the current facet slAct from SLA.
-	 * This does however not mean that there does not exist a facet behind the current slAct that is actually equal
-	 * to fAct. In this case we set the boolean flag maybe to TRUE. If we encounter an equality lateron, it is reset to
-	 * FALSE and the according slAct is deleted. 
-	 * If slAct->next==NULL AND maybe==TRUE we know, that fAct must be added
-	 */
-
-	/**A facet was removed, lengthOfSearchlist-- thus we must not rely on 
-	 * if(notParallelCtr==lengthOfSearchList) but rather
-	 * if( (notParallelCtr==lengthOfSearchList && removalOccured==FALSE)
-	 */
-	volatile bool removalOccured=FALSE;
-	while(slEnd->next!=NULL)
-	{
-		slEnd=slEnd->next;
-	}
-	/*1st step: compare facetNormals*/			
-	while(fAct!=NULL)
-	{						
-		if(fAct->isFlippable==TRUE)
-		{
-			int64vec *fNormal=NULL;
-			fNormal=fAct->getFacetNormal();			
-			slAct = slHead;
-			/*If slAct==NULL and fAct!=NULL 
-			we just copy all remaining facets into SLA*/
-			if(slAct==NULL)
-			{
-				facet *fCopy;
-				fCopy = fAct;
-				while(fCopy!=NULL)
-				{
-					if(fCopy->isFlippable==TRUE)//We must assure fCopy is also flippable
-					{
-						if(slAct==NULL)
-						{
-							slAct = new facet(*fCopy/*,TRUE*/);//copy constructor
-							slHead = slAct;								
-						}
-						else
-						{
-							slAct->next = new facet(*fCopy/*,TRUE*/);
-							slAct = slAct->next;
-						}
-					}
-					fCopy = fCopy->next;
-				}
-				break;//Where does this lead to?
-			}
-			/*End of dumping into SLA*/
-			while(slAct!=NULL)
-			{
-				int64vec *slNormal=NULL;
-				removalOccured=FALSE;
-				slNormal = slAct->getFacetNormal();
-#ifndef NDEBUG
-				printf("Checking facet (");fNormal->show(1,1);printf(") against (");slNormal->show(1,1);printf(")\n");
-#endif				
-// 				if( (areEqual(fAct,slAct) && (!areEqual2(fAct,slAct)) ))
-// 					exit(-1);
- 				if(areEqual2(fAct,slAct))
-				{					
-					deleteMarker = slAct;
-					if(slAct==slHead)
-					{						
-						slHead = slAct->next;						
-						if(slHead!=NULL)
-							slHead->prev = NULL;
-					}
-					else if (slAct==slEnd)
-					{
-						slEnd=slEnd->prev;
-						slEnd->next = NULL;
-					}								
-					else
-					{
-						slAct->prev->next = slAct->next;
-						slAct->next->prev = slAct->prev;
-					}
-					removalOccured=TRUE;
-					gcone::lengthOfSearchList--;
-					if(deleteMarker!=NULL)
-					{
-// 						delete deleteMarker;
-// 						deleteMarker=NULL;
-					}
-#ifndef NDEBUG
-					printf("Removing (");fNormal->show(1,1);printf(") from list\n");
-#endif
-					delete slNormal;
-					break;//leave the while loop, since we found fAct=slAct thus delete slAct and do not add fAct
-				}
-				slAct = slAct->next;
-				/* NOTE The following lines must not be here but rather called inside the if-block above.
-				Otherwise results get crappy. Unfortunately there are two slAct=slAct->next calls now,
-				(not nice!) but since they are in seperate branches of the if-statement there should not
-				be a way it gets called twice thus ommiting one facet:
-				slAct = slAct->next;*/
-				if(deleteMarker!=NULL)
-				{						
-//  					delete deleteMarker;
-//  					deleteMarker=NULL;
-				}
-				delete slNormal;
-						//if slAct was marked as to be deleted, delete it here!
-			}//while(slAct!=NULL)
-			if(removalOccured==FALSE)
-			{
-#ifndef NDEBUG
-// 				cout << "Adding facet (";fNormal->show(1,0);cout << ") to SLA " << endl;
-#endif
-				//Add fAct to SLA
-				facet *marker;
-				marker = slEnd;
-				facet *f2Act;
-				f2Act = fAct->codim2Ptr;
-
-				slEnd->next = new facet();
-				slEnd = slEnd->next;//Update slEnd
-				facet *slEndCodim2Root;
-				facet *slEndCodim2Act;
-				slEndCodim2Root = slEnd->codim2Ptr;
-				slEndCodim2Act = slEndCodim2Root;
-								
-				slEnd->setUCN(this->getUCN());
-				slEnd->isFlippable = TRUE;
-				slEnd->setFacetNormal(fNormal);
-				//NOTE Add interior point here
-				//This is ugly but needed for flip2
-				//Better: have slEnd->interiorPoint point to fAct->interiorPoint
-				//NOTE Only reference -> c.f. copy constructor
-				//slEnd->setInteriorPoint(fAct->getInteriorPoint());
-				slEnd->interiorPoint = fAct->interiorPoint;
-				slEnd->prev = marker;
-				//Copy codim2-facets
-				//int64vec *f2Normal=new int64vec(this->numVars);
-				while(f2Act!=NULL)
-				{
-					int64vec *f2Normal;
-					f2Normal=f2Act->getFacetNormal();
-					if(slEndCodim2Root==NULL)
-					{
-						slEndCodim2Root = new facet(2);
-						slEnd->codim2Ptr = slEndCodim2Root;			
-						slEndCodim2Root->setFacetNormal(f2Normal);
-						slEndCodim2Act = slEndCodim2Root;
-					}
-					else					
-					{
-						slEndCodim2Act->next = new facet(2);
-						slEndCodim2Act = slEndCodim2Act->next;
-						slEndCodim2Act->setFacetNormal(f2Normal);
-					}
-					f2Act = f2Act->next;
-					delete f2Normal;
-				}
-				gcone::lengthOfSearchList++;							
-			}//if( (notParallelCtr==lengthOfSearchList && removalOccured==FALSE) ||
-			fAct = fAct->next;
- 			delete fNormal;
-//  			delete slNormal;
-		}//if(fAct->isFlippable==TRUE)
-		else
-		{
-			fAct = fAct->next;
-		}
-		if(gcone::maxSize<gcone::lengthOfSearchList)
-			gcone::maxSize= gcone::lengthOfSearchList;
-	}//while(fAct!=NULL)
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_enqueue += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif						
-	return slHead;
-}//addC2N
-
-/** Enqueuing using shallow copies*/
-facet * gcone::enqueue2(facet *f)
-{
-	assert(f!=NULL);
-#ifdef gfanp
-	timeval start, end;
-	gettimeofday(&start, 0);
-#endif
-	facet *slHead;
-	slHead = f;
-	facet *slAct;	//called with f=SearchListRoot
-	slAct = f;
-	static facet *slEnd;	//Pointer to end of SLA
-	if(slEnd==NULL)
-		slEnd = f;
-	
-	facet *fAct;
-	fAct = this->facetPtr;//New facets to compare
-	facet *codim2Act;
-	codim2Act = this->facetPtr->codim2Ptr;
-	volatile bool removalOccured=FALSE;
-	while(slEnd->next!=NULL)
-	{
-		slEnd=slEnd->next;
-	}	
-	while(fAct!=NULL)
-	{
-		if(fAct->isFlippable)
-		{
-			facet *fDeleteMarker=NULL;
-			slAct = slHead;
-			if(slAct==NULL)
-			{
-				printf("Zero length SLA\n");
-				facet *fCopy;
-				fCopy = fAct;				
-				while(fCopy!=NULL)
-				{
-					if(fCopy->isFlippable==TRUE)//We must assure fCopy is also flippable
-					{
-						if(slAct==NULL)
-						{
-							slAct = slAct->shallowCopy(*fCopy);//shallow copy constructor
-							slHead = slAct;								
-						}
-						else
-						{
-							slAct->next = slAct->shallowCopy(*fCopy);
-							slAct = slAct->next;
-						}
-					}
-					fCopy = fCopy->next;
-				}
-				break;	//WTF?
-			}
-			/*Comparison starts here*/
-			while(slAct!=NULL)
-			{
-				removalOccured=FALSE;
-#ifndef NDEBUG
-	printf("Checking facet (");fAct->fNormal->show(1,1);printf(") against (");slAct->fNormal->show(1,1);printf(")\n");
-#endif	
-				if(areEqual2(fAct,slAct))
-				{
-					fDeleteMarker=slAct;
-					if(slAct==slHead)
-					{
-// 						fDeleteMarker=slHead;
-// 						printf("headUCN at enq=%i\n",slHead->getUCN());
-						slHead = slAct->next;						
-// 						printf("headUCN at enq=%i\n",slHead->getUCN());
-						if(slHead!=NULL)
-						{
-							slHead->prev = NULL;
-						}
-						fDeleteMarker->shallowDelete();
- 						//delete fDeleteMarker;//NOTE this messes up fAct in noRevS!
-// 						printf("headUCN at enq=%i\n",slHead->getUCN());
-					}
-					else if (slAct==slEnd)
-					{
-						slEnd=slEnd->prev;
-						slEnd->next = NULL;
-						fDeleteMarker->shallowDelete();
-						delete(fDeleteMarker);
-					}								
-					else
-					{
-						slAct->prev->next = slAct->next;
-						slAct->next->prev = slAct->prev;
-						fDeleteMarker->shallowDelete();
-						delete(fDeleteMarker);
-					}
-					removalOccured=TRUE;
-					gcone::lengthOfSearchList--;
-#ifndef NDEBUG
-printf("Removing (");fAct->fNormal->show(1,1);printf(") from list\n");
-#endif
-					break;//leave the while loop, since we found fAct=slAct thus delete slAct and do not add fAct
-				}
-				slAct = slAct->next;				
-			}//while(slAct!=NULL)
-			if(removalOccured==FALSE)
-			{
-				facet *marker=slEnd;
-				slEnd->next = fAct->shallowCopy(*fAct);
-				slEnd = slEnd->next;
-				slEnd->prev=marker;
-				gcone::lengthOfSearchList++;
-			}
-			fAct = fAct->next;
-// 			if(fDeleteMarker!=NULL)
-// 			{
-// 				fDeleteMarker->shallowDelete();
-// 				delete(fDeleteMarker);
-// 				fDeleteMarker=NULL;
-// 			}
-		}
-		else
-			fAct = fAct->next;
-	}//while(fAct!=NULL)
-	
-#ifdef gfanp
-	gettimeofday(&end, 0);
-	time_enqueue += (end.tv_sec - start.tv_sec + 1e-6*(end.tv_usec - start.tv_usec));
-#endif	
-// 	printf("headUCN at enq=%i\n",slHead->getUCN());
-	return slHead;
-}
-
-/** 
-* During flip2 every gc->baseRing gets two ringorder_a
-* To avoid having an awful lot of those in the end we endow
-* gc->baseRing by a suitable ring with (a,dp,C) and copy all
-* necessary stuff over
-* But first we will try to just do an inplace exchange and copying only the
-* gc->gcBasis
-*/
-void gcone::replaceDouble_ringorder_a_ByASingleOne()
-{
-	ring srcRing=currRing;
-	ring replacementRing=rCopy0((ring)this->baseRing);
-	/*We assume we have (a(),a(),dp) here*/
-	omFree(replacementRing->order);
-	replacementRing->order =(int *)omAlloc0(4*sizeof(int/*64*/));
-	omFree(replacementRing->block0);
-	replacementRing->block0=(int *)omAlloc0(4*sizeof(int/*64*/));
-	omFree(replacementRing->block1);
-	replacementRing->block1=(int *)omAlloc0(4*sizeof(int/*64*/));
-	omfree(replacementRing->wvhdl);
-	replacementRing->wvhdl =(int **)omAlloc0(4*sizeof(int/*64*/**));
-			
-	replacementRing->order[0]=ringorder_a/*64*/;
-	replacementRing->block0[0]=1;
-	replacementRing->block1[0]=replacementRing->N;
-		
-	replacementRing->order[1]=ringorder_dp;
-	replacementRing->block0[1]=1;
-	replacementRing->block1[1]=replacementRing->N;
-	
-	replacementRing->order[2]=ringorder_C;
-
-	int64vec *ivw = this->getIntPoint(TRUE);//returns a reference
-// 	assert(this->ivIntPt);	
-	int length=ivw->length();	
-	int/*64*/ *A=(int/*64*/ *)omAlloc0(length*sizeof(int/*64*/));
-	for (int jj=0;jj<length;jj++)
-	{
-		A[jj]=(*ivw)[jj];
-		if((*ivw)[jj]>=INT_MAX) WarnS("A[jj] exceeds INT_MAX in gcone::replaceDouble_ringorder_a_ByASingleOne!\n");
-	}	
-	//delete ivw; //Not needed if this->getIntPoint(TRUE)
-	replacementRing->wvhdl[0]=(int *)A;
-	replacementRing->block1[0]=length;
-	/*Finish*/
-	rComplete(replacementRing);
-	rChangeCurrRing(replacementRing);
-	ideal temporaryGroebnerBasis=idrCopyR(this->gcBasis,this->baseRing);
-	rDelete(this->baseRing);
-	this->baseRing=rCopy(replacementRing);
-	this->gcBasis=idCopy(temporaryGroebnerBasis);	
-	/*And back to where we came from*/
-	rChangeCurrRing(srcRing);
-	idDelete( (ideal*)&temporaryGroebnerBasis );
-	rDelete(replacementRing);	
-}
-
-/** \brief Compute the gcd of two ints
- */
-static int64 int64gcd(const int64 &a, const int64 &b)
-{
-	int64 r, p=a, q=b;
-	if(p < 0)
-		p = -p;
-	if(q < 0)
-		q = -q;
-	while(q != 0)
-	{
-		r = p % q;
-		p = q;
-		q = r;
-	}
-	return p;
-}
-	
-static int intgcd(const int &a, const int &b)
-{
-	int r, p=a, q=b;
-	if(p < 0)
-		p = -p;
-	if(q < 0)
-		q = -q;
-	while(q != 0)
-	{
-		r = p % q;
-		p = q;
-		q = r;
-	}
-	return p;
-}
-		
-/** \brief Construct a dd_MatrixPtr from a cone's list of facets
- * NO LONGER USED
- */
-// inline dd_MatrixPtr gcone::facets2Matrix(const gcone &gc)
-// {
-// 	facet *fAct;
-// 	fAct = gc.facetPtr;
-// 	
-// 	dd_MatrixPtr M;
-// 	dd_rowrange ddrows;
-// 	dd_colrange ddcols;
-// 	ddcols=(this->numVars)+1;
-// 	ddrows=this->numFacets;
-// 	dd_NumberType numb = dd_Integer;
-// 	M=dd_CreateMatrix(ddrows,ddcols);			
-// 			
-// 	int jj=0;
-// 	
-// 	while(fAct!=NULL)
-// 	{
-// 		int64vec *comp;
-// 		comp = fAct->getFacetNormal();
-// 		for(int ii=0;ii<this->numVars;ii++)
-// 		{
-// 			dd_set_si(M->matrix[jj][ii+1],(*comp)[ii]);
-// 		}
-// 		jj++;
-// 		delete comp;
-// 		fAct=fAct->next;				
-// 	}			
-// 	return M;
-// }
-		
-/** \brief Write information about a cone into a file on disk
- *
- * This methods writes the information needed for the "second" method into a file.
- * The file's is divided in sections containing information on
- * 1) the ring
- * 2) the cone's Groebner Basis
- * 3) the cone's facets
- * Each line contains exactly one date
- * Each section starts with its name in CAPITALS
- */
-void gcone::writeConeToFile(const gcone &gc, bool usingIntPoints)
-{
-	int UCN=gc.UCN;
-	stringstream ss;
-	ss << UCN;
-	string UCNstr = ss.str();		
-			
- 	string prefix="/tmp/Singular/cone";
-// 	string prefix="./";	//crude hack -> run tests in separate directories
-	string suffix=".sg";
-	string filename;
-	filename.append(prefix);
-	filename.append(UCNstr);
-	filename.append(suffix);
-		
-// 	int thisPID = getpid();
-// 	ss << thisPID;
-// 	string strPID = ss.str();
-// 	string prefix="./";
-						
-	ofstream gcOutputFile(filename.c_str());
-	assert(gcOutputFile);
-	facet *fAct;
-	fAct = gc.facetPtr;			
-	facet *f2Act;
-	f2Act=fAct->codim2Ptr;
-	
-	char *ringString = rString(gc.baseRing);
-			
-	if (!gcOutputFile)
-	{
-		WerrorS("Error opening file for writing in writeConeToFile\n");
-	}
-	else
-	{	
-		gcOutputFile << "UCN" << endl;
-		gcOutputFile << this->UCN << endl;
-		gcOutputFile << "RING" << endl;	
-		gcOutputFile << ringString << endl;
-		gcOutputFile << "GCBASISLENGTH" << endl;
-		gcOutputFile << IDELEMS(gc.gcBasis) << endl;			
-		//Write this->gcBasis into file
-		gcOutputFile << "GCBASIS" << endl;				
-		for (int ii=0;ii<IDELEMS(gc.gcBasis);ii++)
-		{					
-			gcOutputFile << p_String((poly)gc.gcBasis->m[ii],gc.baseRing) << endl;
-		}				
-					
-		gcOutputFile << "FACETS" << endl;								
-		
-		while(fAct!=NULL)
-		{	
-			const int64vec *iv=fAct->getRef2FacetNormal();
-// 			iv=fAct->getRef2FacetNormal();//->getFacetNormal();
-			f2Act=fAct->codim2Ptr;
-			for (int ii=0;ii<iv->length();ii++)
-			{
-// 				if (ii<iv->length()-1)
-// 					gcOutputFile << (*iv)[ii] << ",";
-// 				else
-// 					gcOutputFile << (*iv)[ii] << " ";
-				gcOutputFile << (*iv)[ii];
-				(ii<iv->length()-1) ? gcOutputFile << "," : gcOutputFile << " ";
-			}
-			//delete iv;
-			while(f2Act!=NULL)
-			{
-				const int64vec *iv2;
-				iv2=f2Act->getRef2FacetNormal();
-				for(int jj=0;jj<iv2->length();jj++)
-				{
-// 					if (jj<iv2->length()-1)
-// 						gcOutputFile << (*iv2)[jj] << ",";
-// 					else
-// 						gcOutputFile << (*iv2)[jj] << " ";
-					gcOutputFile << (*iv2)[jj];
-					(jj<iv2->length()-1) ? gcOutputFile << "," : gcOutputFile << " ";
-				}
-				f2Act = f2Act->next;
-			}
-			gcOutputFile << endl;
-			fAct=fAct->next;
-		}			
-	gcOutputFile.close();
-	}
-	delete [] ringString;
-			
-}//writeConeToFile(gcone const &gc)
-		
-/** \brief Reads a cone from a file identified by its number
-* ||depending on whether flip or flip2 is used, switch the flag flipFlag
-* ||defaults to 0 => flip
-* ||1 => flip2
-*/
-void gcone::readConeFromFile(int UCN, gcone *gc)
-{
-	//int UCN=gc.UCN;
-	stringstream ss;
-	ss << UCN;
-	string UCNstr = ss.str();
-	int gcBasisLength=0;
-	size_t found;	//used for find_first_(not)_of
-
-	string prefix="/tmp/Singular/cone";
-	string suffix=".sg";
-	string filename;
-	filename.append(prefix);
-	filename.append(UCNstr);
-	filename.append(suffix);
-					
-	ifstream gcInputFile(filename.c_str(), ifstream::in);
-	
-	ring saveRing=currRing;	
-	//Comment the following if you uncomment the if(line=="RING") part below
-//  	rChangeCurrRing(gc->baseRing);
-	
-	while( !gcInputFile.eof() )
-	{
-		string line;
-		getline(gcInputFile,line);
-		if(line=="RING")
-		{
-			getline(gcInputFile,line);
-			found = line.find("a(");
-			line.erase(0,found+2);
-			string strweight;
-			strweight=line.substr(0,line.find_first_of(")"));
-						
-			int64vec *iv=new int64vec(this->numVars);// 			
-			for(int ii=0;ii<this->numVars;ii++)
-			{
-				string weight;
-				weight=line.substr(0,line.find_first_of(",)"));
-				char *w=new char[weight.size()+1];
-				strcpy(w,weight.c_str());
-				(*iv)[ii]=atol(w/*weight.c_str()*/);//Better to long. Weight bound in Singular:2147483647
-				delete[] w;
-				line.erase(0,line.find_first_of(",)")+1);
-			}
-			found = line.find("a(");
-			
-			ring newRing;
-			if(currRing->order[0]!=ringorder_a/*64*/)
-			{
-					newRing=rCopyAndAddWeight(currRing,iv);
-			}
-			else
-			{ 	
-					newRing=rCopy0(currRing);
-					int length=this->numVars;
-					int *A=(int *)omAlloc0(length*sizeof(int));
-					for(int jj=0;jj<length;jj++)
-					{
-						A[jj]=(*iv)[jj];
-					}
-					omFree(newRing->wvhdl[0]);
-					newRing->wvhdl[0]=(int*)A;
-					newRing->block1[0]=length;
-			}
-			delete iv;
- 			rComplete(newRing);
-			gc->baseRing=rCopy(newRing);
-			rDelete(newRing);
-			rComplete(gc->baseRing);
-			if(currRing!=gc->baseRing)
-				rChangeCurrRing(gc->baseRing);
-		}
-		
-		if(line=="GCBASISLENGTH")
-		{
-			string strGcBasisLength;
-			getline(gcInputFile, line);
-			strGcBasisLength = line;
-			char *s=new char[strGcBasisLength.size()+1];
-			strcpy(s,strGcBasisLength.c_str());
-			int size=atoi(s/*strGcBasisLength.c_str()*/);
-			delete[] s;
-			gcBasisLength=size;		
-			gc->gcBasis=idInit(size,1);
-		}
-		if(line=="GCBASIS")
-		{
-			for(int jj=0;jj<gcBasisLength;jj++)
-			{
-				getline(gcInputFile,line);
-				//magically convert strings into polynomials
-				//polys.cc:p_Read
-				//check until first occurance of + or -
-				//data or c_str	
-// 				poly strPoly;//=pInit();//Ought to be inside the while loop, but that will eat your memory
-				poly resPoly=pInit();	//The poly to be read in		
-				while(!line.empty())
-				{
-					poly strPoly;//=pInit();
-					
-					string strMonom, strCoeff, strCoeffNom, strCoeffDenom;
-					bool hasCoeffInQ = FALSE;	//does the polynomial have rational coeff?
-					bool hasNegCoeff = FALSE;	//or a negative one?
-					found = line.find_first_of("+-");	//get the first monomial
-					string tmp;
-					tmp=line[found];
-// 					if(found!=0 && (tmp.compare("-")==0) )
-// 						hasNegCoeff = TRUE;	//We have a coeff < 0
-					if(found==0)
-					{
-						if(tmp.compare("-")==0)
-							hasNegCoeff = TRUE;
-						line.erase(0,1);	//remove leading + or -
-						found = line.find_first_of("+-");	//adjust found
-					}
-					strMonom = line.substr(0,found);
-					line.erase(0,found);
-					number nCoeff=nInit(1);
-					number nCoeffNom=nInit(1);
-					number nCoeffDenom=nInit(1);
-					found = strMonom.find_first_of("/");
-					if(found!=string::npos)	//i.e. "/" exists in strMonom
-					{
-						hasCoeffInQ = TRUE;
-						strCoeffNom=strMonom.substr(0,found);						
-						strCoeffDenom=strMonom.substr(found+1,strMonom.find_first_not_of("1234567890",found+1));
-						strMonom.erase(0,found);
-						strMonom.erase(0,strMonom.find_first_not_of("1234567890/"));	
-						char *Nom=new char[strCoeffNom.size()+1];
-						char *Denom=new char[strCoeffDenom.size()+1];
-						strcpy(Nom,strCoeffNom.c_str());
-						strcpy(Denom,strCoeffDenom.c_str());		
-						nRead(Nom/*strCoeffNom.c_str()*/, &nCoeffNom);
-						nRead(Denom/*strCoeffDenom.c_str()*/, &nCoeffDenom);
-						delete[] Nom;
-						delete[] Denom;
-					}
-					else
-					{
-						found = strMonom.find_first_not_of("1234567890");
-						strCoeff = strMonom.substr(0,found);						
-						if(!strCoeff.empty())
-						{
-							char *coeff = new char[strCoeff.size()+1];
-							strcpy(coeff, strCoeff.c_str());
- 							nRead(coeff/*strCoeff.c_str()*/,&nCoeff);
-							delete[] coeff;
-						}
-					}
-					char* monom = new char[strMonom.size()+1];
-					strcpy(monom, strMonom.c_str());						
-					p_Read(monom,strPoly,currRing);	//strPoly:=monom
-					delete[] monom;	
-					switch (hasCoeffInQ)
-					{
-						case TRUE:
-							if(hasNegCoeff)
-								nCoeffNom=nNeg(nCoeffNom);
-							pSetCoeff(strPoly, nDiv(nCoeffNom, nCoeffDenom));
-							break;
-						case FALSE:
-							if(hasNegCoeff)
-								nCoeff=nNeg(nCoeff);							
-							if(!nIsOne(nCoeff))
-							{
-								pSetCoeff(strPoly, nCoeff );
-							}
-							break;
-					}
-						//pSetCoeff(strPoly, (number) intCoeff);//Why is this set to zero instead of 1???
-					if(pIsConstantComp(resPoly))
-					{
-						resPoly=pCopy(strPoly);
-						pDelete(&strPoly);
-					}
-					else
-					{
-// 						poly tmp=pAdd(pCopy(resPoly),strPoly);//foo is destroyed
-// 						pDelete(&resPoly);
-// 						resPoly=tmp;
-// 						pDelete(&tmp);
-						resPoly=pAdd(resPoly,strPoly);//pAdd = p_Add_q, destroys args
-					}
-					/*if(nCoeff!=NULL)					
-						nDelete(&nCoeff);*/ //NOTE This may cause a crash on certain examples...
-					nDelete(&nCoeffNom);
-					nDelete(&nCoeffDenom);
-				}//while(!line.empty())			
-				gc->gcBasis->m[jj]=pCopy(resPoly);
-				pDelete(&resPoly);	//reset
-			}
-// 			break;
-		}//if(line=="GCBASIS")	
-		if(line=="FACETS")
-		{
-			facet *fAct=gc->facetPtr;
-			while(fAct!=NULL)
-			{
-				getline(gcInputFile,line);
-				found = line.find("\t");
-				string normalString=line.substr(0,found);
-				int64vec *fN = new int64vec(this->numVars);
-				for(int ii=0;ii<this->numVars;ii++)
-				{
-					string component;
-					found = normalString.find(",");
-					component=normalString.substr(0,found);
-					char *sComp = new char[component.size()+1];
-					strcpy(sComp,component.c_str());
-					(*fN)[ii]=atol(sComp/*component.c_str()*/);
-					delete[] sComp;
-					normalString.erase(0,found+1);
-				}
-				/*Only the following line needs to be commented out if you decide not to delete fNormals*/
-// 				fAct->setFacetNormal(fN);
-				delete(fN);
-				fAct = fAct->next;	//Booh, this is ugly
-			}			
-			break; //NOTE Must always be in the last if-block!
-		}
-	}//while(!gcInputFile.eof())	
-	gcInputFile.close();
-	rChangeCurrRing(saveRing);
-}
-	
-
-/** \brief Sort the rays of a facet lexicographically
-*/
-// void gcone::sortRays(gcone *gc)
-// {
-// 	facet *fAct;
-// 	fAct = this->facetPtr->codim2Ptr;
-// 	while(fAct->next!=NULL)
-// 	{
-// 		if(fAct->fNormal->compare(fAct->fNormal->next)==-1
-// 	}
-// }
-
-/** \brief Gather the output
-* List of lists
-* If heuristic==1 readConeFromFile() is called once more on every cone. This may slow down the computation but it also
-* allows us to rDelete(gcDel->baseRing) and the such in gcone::noRevS.
-*\param *gc Pointer to gcone, preferably gcRoot ;-)
-*\param n the number of cones as determined by gcRoot->getCounter()
-*
-*/
-lists lprepareResult(gcone *gc, const int n)
-{
-	gcone *gcAct;
-	gcAct = gc;	
-	facet *fAct;
-	fAct = gc->facetPtr;
-	
-	lists res=(lists)omAllocBin(slists_bin);
-	res->Init(n);	//initialize to store n cones
-	for(int ii=0;ii<n;ii++)
-	{
-		if(gfanHeuristic==1)// && gcAct->getUCN()>1)
-		{
-			gcAct->readConeFromFile(gcAct->getUCN(),gcAct);	
-// 			rChangeCurrRing(gcAct->getBaseRing());//NOTE memleak?
-		}
-		rChangeCurrRing(gcAct->getRef2BaseRing());	
-		res->m[ii].rtyp=LIST_CMD;
-		lists l=(lists)omAllocBin(slists_bin);
-		l->Init(6);
-		l->m[0].rtyp=INT_CMD;
-		l->m[0].data=(void*)gcAct->getUCN();
-		l->m[1].rtyp=IDEAL_CMD;
-		/*The following is necessary for leaves in the tree of cones
-		* Since we don't use them in the computation and gcBasis is 
-		* set to (poly)NULL in noRevS we need to get this back here.
-		*/
-// 		if(gcAct->gcBasis->m[0]==(poly)NULL)
-// 		if(gfanHeuristic==1 && gcAct->getUCN()>1)
-// 			gcAct->readConeFromFile(gcAct->getUCN(),gcAct);
-// 		ring saveRing=currRing;
-// 		ring tmpRing=gcAct->getBaseRing;
-// 		rChangeCurrRing(tmpRing);
-// 		l->m[1].data=(void*)idrCopyR_NoSort(gcAct->gcBasis,gcAct->getBaseRing());
-// 		l->m[1].data=(void*)idrCopyR(gcAct->gcBasis,gcAct->getBaseRing());//NOTE memleak?
-		l->m[1].data=(void*)idrCopyR(gcAct->gcBasis,gcAct->getRef2BaseRing());
-// 		rChangeCurrRing(saveRing);
-
-		l->m[2].rtyp=INTVEC_CMD;
-		int64vec iv=(gcAct->f2M(gcAct,gcAct->facetPtr));//NOTE memleak?
-		l->m[2].data=(void*)iv64Copy(&iv);
-		
-		l->m[3].rtyp=LIST_CMD;
-			lists lCodim2List = (lists)omAllocBin(slists_bin);
-			lCodim2List->Init(gcAct->numFacets); 
-			fAct = gcAct->facetPtr;//fAct->codim2Ptr;
-			int jj=0;
-			while(fAct!=NULL && jj<gcAct->numFacets)
-			{
-				lCodim2List->m[jj].rtyp=INTVEC_CMD;
-				int64vec ivC2=(gcAct->f2M(gcAct,fAct,2));
-				lCodim2List->m[jj].data=(void*)iv64Copy(&ivC2);
-				jj++;
-				fAct = fAct->next;
-			} 		
-		l->m[3].data=(void*)lCodim2List;		
-		l->m[4].rtyp=INTVEC_CMD/*RING_CMD*/;
-		l->m[4].data=(void*)(gcAct->getIntPoint/*BaseRing*/()); 		
-		l->m[5].rtyp=INT_CMD;
-		l->m[5].data=(void*)gcAct->getPredUCN();
-		res->m[ii].data=(void*)l;
-		gcAct = gcAct->next;
-	}	
-	return res;
-}
-
-/** Convert gc->gcRays into an intvec in order to be used with bbcone stuff*/
-intvec *gcRays2Intmat(gcone *gc)
-{
-  int r = gc->numRays;
-  int c = gc->numVars;  //Spalten
-  intvec *res = new intvec(r,c,(int)0);
-  
-  int offset=0;
-  for(int ii=0;ii<gc->numRays;ii++)
-  {
-    int64vec *ivTmp=iv64Copy(gc->gcRays[ii]);
-    for(int jj=0;jj<pVariables;jj++)
-      (*res)[offset+jj]=(int)(*ivTmp)[jj];
-    offset += pVariables;
-    delete ivTmp;
-  }
-  return res;
-}
-
-/** \brief Put stuff in gfanlib's datatype gfan::ZFan
-*/
-void prepareGfanLib(gcone *gc, gfan::ZFan *fan)
-{
-  using namespace gfan;
-  int ambientDimension = gc->numVars;
-  gcone *gcAct;
-  gcAct = gc;
-
-  //Iterate over all cones and adjoin to PolyhedralFan
-   while(gcAct!=NULL)
-  {     
-    intvec *rays=gcRays2Intmat(gcAct);
-    ZMatrix zm = intmat2ZMatrix(rays);
-    delete rays;
-    ZCone *zc = new ZCone();
-    *zc = ZCone::givenByRays(zm, gfan::ZMatrix(0, zm.getWidth()));
-//     delete &zm;
-    zc->canonicalize();//As per Anders' hint
-    fan->insert(*zc);
-//     delete zc;
-    gcAct=gcAct->next;
-  }
-}
-
-/** \brief Write facets of a cone into a matrix
-* Takes a pointer to a facet as 2nd arg 
-* f should always point to gc->facetPtr
-* param n is used to determine whether it operates in codim 1 or 2
-* We have to cast the int64vecs to int64vec due to issues with list structure
-*/
-inline int64vec gcone::f2M(gcone *gc, facet *f, int n)
-{
-	facet *fAct;
-	int64vec *res;//=new int64vec(this->numVars);	
-// 	int codim=n;
-// 	int bound;
-// 	if(f==gc->facetPtr)
-	if(n==1)
-	{
-		int64vec *m1Res=new int64vec(gc->numFacets,gc->numVars,0);
-		res = iv64Copy(m1Res);
-		fAct = gc->facetPtr;
-		delete m1Res;
-// 		bound = gc->numFacets*(this->numVars);		
-	}
-	else
-	{
-		fAct = f->codim2Ptr;
-		int64vec *m2Res = new int64vec(f->numCodim2Facets,gc->numVars,0);
-		res = iv64Copy(m2Res);
-		delete m2Res;	
-// 		bound = fAct->numCodim2Facets*(this->numVars);
-
-	}
-	int ii=0;
-	while(fAct!=NULL )//&& ii < bound )
-	{
-		const int64vec *fNormal;
-		fNormal = fAct->getRef2FacetNormal();//->getFacetNormal();
-		for(int jj=0;jj<this->numVars;jj++)
-		{
-			(*res)[ii]=(int)(*fNormal)[jj];//This is ugly and prone to overflow
-			ii++;
-		}
-		fAct = fAct->next;
-	}	
-	return *res;
-}
-
-int gcone::counter=0;
-int gfanHeuristic;
-int gcone::lengthOfSearchList;
-int gcone::maxSize;
-dd_MatrixPtr gcone::dd_LinealitySpace;
-int64vec *gcone::hilbertFunction;
-#ifdef gfanp
-// int gcone::lengthOfSearchList=0;
-float gcone::time_getConeNormals;
-float gcone::time_getCodim2Normals;
-float gcone::t_getExtremalRays;
-float gcone::t_ddPolyh;
-float gcone::time_flip;
-float gcone::time_flip2;
-float gcone::t_areEqual;
-float gcone::t_markings;
-float gcone::t_dd;
-float gcone::t_kStd=0;
-float gcone::time_enqueue;
-float gcone::time_computeInv;
-float gcone::t_ddMC;
-float gcone::t_mI;
-float gcone::t_iP;
-float gcone::t_isParallel;
-unsigned gcone::parallelButNotEqual=0;
-unsigned gcone::numberOfFacetChecks=0;
-#endif
-int gcone::numVars;
-bool gcone::hasHomInput=FALSE;
-int64vec *gcone::ivZeroVector;
-// ideal gfan(ideal inputIdeal, int h)
-/** Main routine 
- * The first and second parameter are mandatory. The third (and maybe fourth) parameter is for Janko :)
- */
-#ifndef USE_ZFAN
-lists grfan(ideal inputIdeal, int h, bool singleCone=FALSE)
-#else
-gfan::ZFan* grfan(ideal inputIdeal, int h, bool singleCone=FALSE)
-#endif
-{
-	lists lResList; //this is the object we return	
-	gfan::ZFan *zResFan = new gfan::ZFan(pVariables);
-	
-	if(rHasGlobalOrdering(currRing))
-	{	
-// 		int numvar = pVariables; 
-		gfanHeuristic = h;
-		
-		enum searchMethod {
-			reverseSearch,
-			noRevS
-		};
-	
-		searchMethod method;
-		method = noRevS;
-	
-		ring inputRing=currRing;	// The ring the user entered
-// 		ring rootRing;			// The ring associated to the target ordering
-
-		dd_set_global_constants();
-		if(method==noRevS)
-		{
-			gcone *gcRoot = new gcone(currRing,inputIdeal);
-			gcone *gcAct;
-			gcAct = gcRoot;
-			gcone::numVars=pVariables;
-			//gcAct->numVars=pVariables;//NOTE is now static
-			gcAct->getGB(inputIdeal);
-			/*Check whether input is homogeneous
-			if TRUE each facet intersects the positive orthant, so we don't need the
-			flippability test in getConeNormals & getExtremalRays
-			*/
-			if(idHomIdeal(gcAct->gcBasis,NULL))//disabled for tests
-			{
-				gcone::hasHomInput=TRUE;
-// 				gcone::hilbertFunction=hHstdSeries(inputIdeal,NULL,NULL,NULL,currRing);
-			}
-			else
-			{
-				gcone::ivZeroVector = new int64vec(pVariables);
-				for(int ii=0;ii<pVariables;ii++)
-					(*gcone::ivZeroVector)[ii]=0;
-			}
-
-			if(isMonomial(gcAct->gcBasis))
-			{//FIXME
-				WerrorS("Monomial input - terminating");
-				dd_free_global_constants();
-				//This is filthy
-				goto pointOfNoReturn;				
-			}			
-			gcAct->getConeNormals(gcAct->gcBasis);
-			gcone::dd_LinealitySpace = gcAct->computeLinealitySpace();
-			gcAct->getExtremalRays(*gcAct);
-			if(singleCone==FALSE)//Is Janko here?
-			{//Compute the whole fan
-			  gcAct->noRevS(*gcAct);	//Here we go!
-			}			    
-			//Switch back to the ring the computation was started in
-			rChangeCurrRing(inputRing);
-			//res=gcAct->gcBasis;
-			//Below is a workaround, since gcAct->gcBasis gets deleted in noRevS
-#ifndef USE_ZFAN
-			lResList=lprepareResult(gcRoot,gcRoot->getCounter());
-#else
-			prepareGfanLib(gcRoot,zResFan);
-#endif
-			/*Cleanup*/
-			gcone *gcDel;	
-			gcDel = gcRoot;
-			gcAct = gcRoot;
-			while(gcAct!=NULL)
-			{
-				gcDel = gcAct;
-				gcAct = gcAct->next;
-// 				delete gcDel;
-			}
-		}//method==noRevS
-		dd_FreeMatrix(gcone::dd_LinealitySpace);
-		dd_free_global_constants();
-	}//rHasGlobalOrdering
-	else
-	{
-		//Simply return an empty list
-		WerrorS("Ring has non-global ordering.\nThis function requires your current ring to be endowed with a global ordering.\n Now terminating!");
-// 		gcone *gcRoot=new gcone();
-// 		gcone *gcPtr = gcRoot;
-// 		for(int ii=0;ii<10000;ii++)
-// 		{
-// 			gcPtr->setBaseRing(currRing);
-// 			facet *fPtr=gcPtr->facetPtr=new facet();
-// 			for(int jj=0;jj<5;jj++)
-// 			{
-// 				int64vec *iv=new int64vec(pVariables);
-// 				fPtr->setFacetNormal(iv);				
-// 				delete(iv);
-// 				fPtr->next=new facet();
-// 				fPtr=fPtr->next;
-// 			}
-// 			gcPtr->next=new gcone();
-// 			gcPtr->next->prev=gcPtr;
-// 			gcPtr=gcPtr->next;			
-// 		}
-// 		gcPtr=gcRoot;
-// 		while(gcPtr!=NULL)
-// 		{
-// 			gcPtr=gcPtr->next;
-// // 			delete(gcPtr->prev);
-// 		}
-		goto pointOfNoReturn;
-	}
-	/*Return result*/
-#ifdef gfanp
-	cout << endl << "t_getConeNormals:" << gcone::time_getConeNormals << endl;
-	/*cout << "t_getCodim2Normals:" << gcone::time_getCodim2Normals << endl;
-	cout << "  t_ddMC:" << gcone::t_ddMC << endl;
-	cout << "  t_mI:" << gcone::t_mI << endl;
-	cout << "  t_iP:" << gcone::t_iP << endl;*/
-	cout << "t_getExtremalRays:" << gcone::t_getExtremalRays << endl;
-	cout << "  t_ddPolyh:" << gcone::t_ddPolyh << endl;
-	cout << "t_Flip:" << gcone::time_flip << endl;
-	cout << "  t_markings:" << gcone::t_markings << endl;
-	cout << "  t_dd:" << gcone::t_dd << endl;
-	cout << "  t_kStd:" << gcone::t_kStd << endl;
-	cout << "t_Flip2:" << gcone::time_flip2 << endl;
-	cout << "  t_dd:" << gcone::t_dd << endl;
-	cout << "  t_kStd:" << gcone::t_kStd << endl;
-	cout << "t_computeInv:" << gcone::time_computeInv << endl;
-	cout << "t_enqueue:" << gcone::time_enqueue << endl;
-	cout << "  t_areEqual:" <<gcone::t_areEqual << endl;
-	cout << "t_isParallel:" <<gcone::t_isParallel << endl;
-	cout << endl;
-	cout << "Checked " << gcone::numberOfFacetChecks << " Facets" << endl;
-	cout << " out of which there were " << gcone::parallelButNotEqual << " parallel but not equal." << endl;
-#endif
-	printf("Maximum lenght of list of facets: %i", gcone::maxSize);
-pointOfNoReturn:
-#ifndef USE_ZFAN
-	return lResList;
-#else
-	return zResFan;
-#endif
-}
-
-/** Compute a single Gröbner cone by specifying an ideal and a weight vector.
- * NOTE: We do NOT check whether the vector is from the relative interior of the cone.
- * That is upon the user to assure.
- */
-// lists grcone_by_intvec(ideal inputIdeal)
-// {
-//   if( (rRingOrder_t)currRing->order[0] == ringorder_wp)
-//   {
-//     lists lResList;
-//     lResList=grfan(inputIdeal, 0, TRUE);
-//   }
-//   else
-//     WerrorS("Need wp ordering");
-// }
-#endif
diff --git a/kernel/gfan.h b/kernel/gfan.h
deleted file mode 100644
index 2c62d29..0000000
--- a/kernel/gfan.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
-gfan.h Interface to gfan.cc
-
-$Author: monerjan $
-$Date: 2009/11/03 06:57:32 $
-$Header: /usr/local/Singular/cvsroot/kernel/gfan.h,v 1.13 2009/11/03 06:57:32 monerjan Exp $
-$Id: gfan.h 14493 2012-01-16 11:00:07Z motsak $
-*/
-#ifdef HAVE_FANS
-
-#ifndef GFAN_H
-#define GFAN_H
-
-#include <kernel/int64vec.h>
-
-#include <setoper.h>
-#include <cdd.h>
-#include <cddmp.h>
-#include <kernel/bbfan.h>
-#include <kernel/bbcone.h>
-extern int gfanHeuristic;
-
-#ifndef USE_ZFAN
-#define USE_ZFAN
-#endif
-#ifndef USE_ZFAN
-  lists grfan(ideal inputIdeal, int heuristic, bool singleCone);
-#else
-  #include <../gfanlib/gfanlib.h>
-  gfan::ZFan *grfan(ideal inputIdeal, int h, bool singleCone);
-#endif
-// lists grcone_by_intvec(ideal inputIdeal);
-
-class facet
-{
-	private:
-		/** \brief Inner normal of the facet, describing it uniquely up to isomorphism */
-		int64vec *fNormal;
-		
-		/** \brief An interior point of the facet*/
-		int64vec *interiorPoint;
-		
-		/** \brief Universal Cone Number
-		 * The number of the cone the facet belongs to, Set in getConeNormals()
-		 */
-		int UCN;
-		
-		/** \brief The codim of the facet
-		 */
-		short codim;
-		
-		/** \brief The Groebner basis on the other side of a shared facet
-		 *
-		 * In order not to have to compute the flipped GB twice we store the basis we already get
-		 * when identifying search facets. Thus in the next step of the reverse search we can 
-		 * just copy the old cone and update the facet and the gcBasis.
-		 * facet::flibGB is set via facet::setFlipGB() and printed via facet::printFlipGB
-		 */
-		ideal flipGB;		//The Groebner Basis on the other side, computed via gcone::flip
-		
-	public:	
-		/** \brief Boolean value to indicate whether a facet is flippable or not
-	 	* This is also used to mark facets that nominally are flippable but which do
-	 	* not intersect with the positive orthant. This check is done in gcone::getCodim2Normals
-		 */	
-		bool isFlippable;	//**flippable facet? */
-		//bool isIncoming;	//Is the facet incoming or outgoing in the reverse search? No longer in use
-		facet *next;		//Pointer to next facet
-		facet *prev;		//Pointer to predecessor. Needed for the SearchList in noRevS
-		facet *codim2Ptr;	//Pointer to (codim-2)-facet. Bit of recursion here ;-)
-		int numCodim2Facets;	//#of (codim-2)-facets of this facet. Set in getCodim2Normals()
-		unsigned numRays;	//Number of spanning rays of the facet
-		ring flipRing;		//the ring on the other side of the facet
-// 		int64vec **fRays;
-				
-		/** The default constructor. */
-		facet();
-		/** Constructor for lower dimensional faces*/
-		facet(const int &n);
-		/**  The copy constructor */
-		facet(const facet& f);
-		/** A shallow copy of facets*/
-		facet* shallowCopy(const facet& f);
-		void shallowDelete();
-		/** The default destructor */
-		~facet();
-		/** Comparison operator*/
-// 		inline bool operator==(const facet *f,const facet *g);			
-		/** \brief Comparison of facets*/
-// 		inline bool areEqual(facet *f, facet *g);//Now static
-		/** Stores the facet normal \param int64vec*/
-		inline void setFacetNormal(int64vec *iv);
-		/** Returns the facet normal */
-		inline int64vec *getFacetNormal() const;
-		/** Return a reference to the facet normal*/
-		inline const int64vec *getRef2FacetNormal() const;
-		/** Method to print the facet normal*/
-		inline void printNormal() const;
-		/** Store the flipped GB*/
-		inline void setFlipGB(ideal I);
-		/** Return the flipped GB*/
-		inline ideal getFlipGB();
-		/** Print the flipped GB*/
-		inline void printFlipGB();
-		/** Set the UCN */
-		inline void setUCN(int n);
-		/** \brief Get the UCN 
-		 * Returns the UCN iff this != NULL, else -1
-		 */
-		inline int getUCN();
-		/** Store an interior point of the facet */
-		inline void setInteriorPoint(int64vec *iv);
-		inline int64vec *getInteriorPoint();
-		inline const int64vec *getRef2InteriorPoint();
-		/** \brief Debugging function
-		 * prints the facet normal an all (codim-2)-facets that belong to it
-		 */
-		volatile void fDebugPrint();
-		friend class gcone;		
-};
-
-		
-/**
- *\brief Implements the cone structure
- *
- * A cone is represented by a linked list of facet normals
- * @see facet
- */
-
-class gcone
-{
-	private:		
-		ideal inputIdeal;	//the original
-		ring baseRing;		//the basering of the cone				
-		int64vec *ivIntPt;	//an interior point of the cone
-		int UCN;		//unique number of the cone
-		int pred;		//UCN of the cone this one is derived from
- 		static int counter;
-		
-	public:	
-		/** \brief Pointer to the first facet */
-		facet *facetPtr;	//Will hold the adress of the first facet; set by gcone::getConeNormals
-#ifdef gfanp
-		static float time_getConeNormals;
-		static float time_getCodim2Normals;
-		static float t_getExtremalRays;
-		static float t_ddPolyh;
-		static float time_flip;
-		static float time_flip2;
-		static float t_areEqual;
-		static float t_ffG;
-		static float t_markings;
-		static float t_dd;
-		static float t_kStd;
-		static float time_enqueue;		
-		static float time_computeInv;
-		static float t_ddMC;
-		static float t_mI;
-		static float t_iP;
-		static float t_isParallel;
-		static unsigned parallelButNotEqual;
-		static unsigned numberOfFacetChecks;
-#endif
-		/** Matrix to contain the homogeneity/lineality space */
-		static dd_MatrixPtr dd_LinealitySpace;
-		static int lengthOfSearchList;
-		/** Maximum size of the searchlist*/
-		static int maxSize;
-		/** is the ideal homogeneous? */
-		static bool hasHomInput;
-		/** # of variables in the ring */
-		static int numVars;		//#of variables in the ring
-		/** The hilbert function - for the homogeneous case*/
-		static int64vec *hilbertFunction;
-		/** The zero vector. Needed in case of fNormal mismatch*/
-		static int64vec *ivZeroVector;
-		
-		/** # of facets of the cone
-		 * This value is set by gcone::getConeNormals
-		 */
-		int numFacets;		//#of facets of the cone
-		
-		/**
-		 * At least as a workaround we store the irredundant facets of a matrix here.
-		 * This is needed to compute an interior points of a cone. Note that there 
-		 * will be non-flippable facets in it!		 
-		 */
-		dd_MatrixPtr ddFacets;	//Matrix to store irredundant facets of the cone
-		
-		/** Array of intvecs representing the rays of the cone*/
-		int64vec **gcRays;
-		unsigned numRays;	//#rays of the cone
-		/** Contains the Groebner basis of the cone. Is set by gcone::getGB(ideal I)*/
-		ideal gcBasis;		//GB of the cone, set by gcone::getGB();
-		gcone *next;		//Pointer to next cone
-		gcone *prev;
-		
-		gcone();
-		gcone(ring r, ideal I);
-		gcone(const gcone& gc, const facet &f);
-		~gcone();
-		inline int getCounter();
-		inline ring getBaseRing();
-		inline ring getRef2BaseRing();
-		inline void setBaseRing(ring r);
-		inline void setIntPoint(int64vec *iv);
-		inline int64vec *getIntPoint(bool shallow=FALSE);
-		inline void showIntPoint();
-		inline void setNumFacets();
-		inline int getNumFacets();
-		inline int getUCN();
-		inline int getPredUCN();		
-		volatile void showFacets(short codim=1);
-// 		volatile void showSLA(facet &f);
-// 		void idDebugPrint(const ideal &I);
-// 		void invPrint(const ideal &I);
-// 		bool isMonomial(const ideal &I);
-// 		int64vec *ivNeg(const int64vec *iv);
-// 		inline int dotProduct(int64vec &iva, int64vec &ivb);
-// 		inline int dotProduct(const int64vec &iva, const int64vec &ivb);
-// 		inline bool isParallel(const int64vec &a, const int64vec &b);				
-		void noRevS(gcone &gcRoot, bool usingIntPoint=FALSE);
-// 		inline int intgcd(const int &a, const int &b);
-		void writeConeToFile(const gcone &gc, bool usingIntPoints=FALSE);
-		void readConeFromFile(int gcNum, gcone *gc);
-		int64vec f2M(gcone *gc, facet *f, int n=1);
-// 		inline void sortRays(gcone *gc);
-		//The real stuff
-		void getConeNormals(const ideal &I, bool compIntPoint=FALSE);
-		void getCodim2Normals(const gcone &gc);
-		void getExtremalRays(const gcone &gc);
-		void orderRays();
-		void flip(ideal gb, facet *f);
-		void flip2(const ideal &gb, facet *f);
-		void computeInv(const ideal &gb, ideal &inv, const int64vec &f);
-		//poly restOfDiv(poly const &f, ideal const &I); removed with r12286
-		inline ideal ffG(const ideal &H, const ideal &G);
-		inline void getGB(ideal const &inputIdeal);		
-		void interiorPoint( dd_MatrixPtr &M, int64vec &iv);//used from flip and optionally from getConeNormals
-// 		void interiorPoint2(); //removed Feb 8th, 2010, new method Feb 19th, 2010, again removed Mar 16th, 2010
-		void preprocessInequalities(dd_MatrixPtr &M);
-		ring rCopyAndAddWeight(const ring &r, int64vec *ivw);
-		ring rCopyAndAddWeight2(const ring &, const int64vec *, const int64vec *);
-// 		ring rCopyAndChangeWeight(const ring &r, int64vec *ivw);	//NOTE remove	
-// 		void reverseSearch(gcone *gcAct); //NOTE both removed from r12286
-// 		bool isSearchFacet(gcone &gcTmp, facet *testfacet); //NOTE remove
-		void makeInt(const dd_MatrixPtr &M, const int line, int64vec &n);
-// 		void normalize();//NOTE REMOVE
-		facet * enqueueNewFacets(facet *f);
-		facet * enqueue2(facet *f);
-// 		dd_MatrixPtr facets2Matrix(const gcone &gc);//NOTE remove
-		/** Compute the lineality space Ax=0 and return it as dd_MatrixPtr dd_LinealitySpace*/
-		dd_MatrixPtr computeLinealitySpace();
-		inline bool iv64isStrictlyPositive(const int64vec *);
-		/** Exchange 2 ordertype_a by just 1 */
-		void replaceDouble_ringorder_a_ByASingleOne();
-// 		static void gcone::idPrint(ideal &I);		
-// 		friend class facet;	
-};
-lists lprepareResult(gcone *gc, const int n);
-static int64 int64gcd(const int64 &a, const int64 &b);
-static int intgcd(const int &a, const int &b);
-static int dotProduct(const int64vec &iva, const int64vec &ivb);
-static bool isParallel(const int64vec &a, const int64vec &b);
-static int64vec *ivNeg(/*const*/ int64vec *iv);
-static void idDebugPrint(const ideal &I);
-static volatile void showSLA(facet &f);
-static bool isMonomial(const ideal &I);
-static bool ivAreEqual(const int64vec &a, const int64vec &b);
-static bool areEqual2(facet *f, facet *g);
-static bool areEqual( facet *f, facet *g);
-// bool iv64isStrictlyPositive(int64vec *);
-#endif
-#endif
diff --git a/kernel/install-sh b/kernel/install-sh
deleted file mode 100755
index 18719da..0000000
--- a/kernel/install-sh
+++ /dev/null
@@ -1,246 +0,0 @@
-#!/bin/sh
-#
-# install - install a program, script, or datafile
-# This comes from X11R5.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-#
-
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit="${DOITPROG-}"
-
-
-# put in absolute paths if you don't have them in your path; or use env. vars.
-
-mvprog="${MVPROG-mv}"
-cpprog="${CPPROG-cp}"
-chmodprog="${CHMODPROG-chmod}"
-chownprog="${CHOWNPROG-chown}"
-chgrpprog="${CHGRPPROG-chgrp}"
-stripprog="${STRIPPROG-strip}"
-rmprog="${RMPROG-rm}"
-mkdirprog="${MKDIRPROG-mkdir}"
-
-tranformbasename=""
-transform_arg=""
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
-chowncmd=""
-chgrpcmd=""
-stripcmd=""
-rmcmd="$rmprog -f"
-mvcmd="$mvprog"
-src=""
-dst=""
-dir_arg=""
-
-while [ x"$1" != x ]; do
-    case $1 in
-	-c) instcmd="$cpprog"
-	    shift
-	    continue;;
-
-	-d) dir_arg=true
-	    shift
-	    continue;;
-
-	-m) chmodcmd="$chmodprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-o) chowncmd="$chownprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-g) chgrpcmd="$chgrpprog $2"
-	    shift
-	    shift
-	    continue;;
-
-	-s) stripcmd="$stripprog"
-	    shift
-	    continue;;
-
-	-t=*) transformarg=`echo $1 | sed 's/-t=//'`
-	    shift
-	    continue;;
-
-	-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
-	    shift
-	    continue;;
-
-	*)  if [ x"$src" = x ]
-	    then
-		src=$1
-	    else
-		# this colon is to work around a 386BSD /bin/sh bug
-		:
-		dst=$1
-	    fi
-	    shift
-	    continue;;
-    esac
-done
-
-if [ x"$src" = x ]
-then
-	echo "install:	no input file specified"
-	exit 1
-else
-	true
-fi
-
-if [ x"$dir_arg" != x ]; then
-	dst=$src
-	src=""
-	
-	if [ -d $dst ]; then
-		instcmd=:
-	else
-		instcmd=mkdir
-	fi
-else
-
-# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
-# might cause directories to be created, which would be especially bad 
-# if $src (and thus $dsttmp) contains '*'.
-
-# obachman 6/15/98
-# Here is an ugly fix for a bug in cygwin
-# '[ test -f $src ]' evaluates to true, even if only $src.exe exists
-# However 'cp $src $dst' can  not find $src, if only $src.exe exists
-	if test -f "$src.exe" && test -x "$src.exe"; then
-		src="$src.exe"
-		true
-	elif [ -f $src -o -d $src ]
-	then
-		true
-	else
-		echo "install:  $src does not exist"
-		exit 1
-	fi
-	
-	if [ x"$dst" = x ]
-	then
-		echo "install:	no destination specified"
-		exit 1
-	else
-		true
-	fi
-
-# If destination is a directory, append the input filename; if your system
-# does not like double slashes in filenames, you may need to add some logic
-
-	if [ -d $dst ]
-	then
-		dst="$dst"/`basename $src`
-	else
-		true
-	fi
-fi
-
-## this sed command emulates the dirname command
-dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-#  this part is taken from Noah Friedman's mkinstalldirs script
-
-# Skip lots of stat calls in the usual case.
-if [ ! -d "$dstdir" ]; then
-defaultIFS='	
-'
-IFS="${IFS-${defaultIFS}}"
-
-oIFS="${IFS}"
-# Some sh's can't handle IFS=/ for some reason.
-IFS='%'
-set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
-IFS="${oIFS}"
-
-pathcomp=''
-
-while [ $# -ne 0 ] ; do
-	pathcomp="${pathcomp}${1}"
-	shift
-
-	if [ ! -d "${pathcomp}" ] ;
-        then
-		$mkdirprog "${pathcomp}"
-	else
-		true
-	fi
-
-	pathcomp="${pathcomp}/"
-done
-fi
-
-if [ x"$dir_arg" != x ]
-then
-	$doit $instcmd $dst &&
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
-else
-
-# If we're going to rename the final executable, determine the name now.
-
-	if [ x"$transformarg" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		echo "basename $dst $transformbasename | sed $transformarg$transformbasename"
-		dstfile=`basename $dst $transformbasename | 
-			sed $transformarg`$transformbasename
-	fi
-
-# don't allow the sed command to completely eliminate the filename
-
-	if [ x"$dstfile" = x ] 
-	then
-		dstfile=`basename $dst`
-	else
-		true
-	fi
-
-# Make a temp file name in the proper directory.
-
-	dsttmp=$dstdir/#inst.$$#
-
-# Move or copy the file name to the temp name
-
-	$doit $instcmd $src $dsttmp &&
-
-	trap "rm -f ${dsttmp}" 0 &&
-
-# and set any options; do chmod last to preserve setuid bits
-
-# If any of these fail, we abort the whole thing.  If we want to
-# ignore errors from any of these, just make sure not to ignore
-# errors from the above "$doit $instcmd $src $dsttmp" command.
-
-	if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
-	if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
-	if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
-	if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
-
-# Now rename the file to the real destination.
-
-	$doit $rmcmd -f $dstdir/$dstfile &&
-	$doit $mvcmd $dsttmp $dstdir/$dstfile 
-
-fi &&
-
-
-exit 0
diff --git a/kernel/mod2.h.in b/kernel/mod2.h.in
deleted file mode 100644
index 8dedce1..0000000
--- a/kernel/mod2.h.in
+++ /dev/null
@@ -1,622 +0,0 @@
-/* -*-c++-*- */
-/*******************************************************************
- *  Computer Algebra System SINGULAR
- *
- *  mod2.h: Main configuration file for Singular
- *          DO NOT EDIT!
- *
- *  Version: $Id: mod2.h.in 14400 2011-09-29 15:45:39Z hannes $
- *******************************************************************/
-#ifndef MOD2_H
-#define MOD2_H
-
-/*******************************************************************
- * Defines which are set by configure
- ******************************************************************/
-/* Define to use dynamic linking */
-#undef HAVE_DL
-/* Define to use readline lib for fancy display: configure result */
-#undef HAVE_LIBREADLINE
-/* Define to use static readline lib for fancy display */
-#undef HAVE_READLINE
-/* define to use dynamic version of readline lib */
-#undef HAVE_DYN_RL
-/* Define to have dbm links */
-#undef HAVE_DBM
-/* Define to have MP links */
-#undef HAVE_MPSR
-/* Define to have factory functionality added */
-#undef HAVE_FACTORY
-/* Define if you have stdc headers */
-#undef STDC_HEADERS
-/* Define if you have asm/sigcontext.h */
-#undef HAVE_ASM_SIGCONTEXT_H
-/* Define if you have sys/file.h */
-#undef HAVE_SYS_FILE_H
-/* Define if you have sys/stat.h */
-#undef HAVE_SYS_STAT_H
-/* Define if you have sys/param.h */
-#undef HAVE_SYS_PARAM_H
-/* Define if you have sys/file.h */
-#undef HAVE_SYS_TYPES_H
-/* Define if you have sys/ioctl.h */
-#undef HAVE_SYS_IOCTL_H
-/* Define if you have sys/time.h */
-#undef HAVE_SYS_TIME_H
-/* Define if you have sys/times.h */
-#undef HAVE_SYS_TIMES_H
-/* io header: */
-/* Define if you have termcap.h */
-#undef HAVE_TERMCAP_H
-/* Define if you have termios.h */
-#undef HAVE_TERMIOS_H
-/* Define if you have term.h */
-#undef HAVE_TERM_H
-/* Define if you have readline/history.h */
-#undef HAVE_READLINE_HISTORY_H
-/* Define if readline/readline.h is ok */
-#undef READLINE_READLINE_H_OK
-/* Define if time.h and sys/time.h can be included at the same time */
-#undef TIME_WITH_SYS_TIME
-/* Define if you have alloca.h */
-#undef HAVE_ALLOCA_H
-/* Define if you have pwd.h */
-#undef HAVE_PWD_H
-/* Define if you have unistd.h */
-#undef HAVE_UNISTD_H
-/* define if you have malloc.h */
-#undef HAVE_MALLOC_H
-/* define if you have pwd.h*/
-#undef HAVE_PWD_H
-/* Define if you have alloca */
-#undef HAVE_ALLOCA
-/* Define if you have getpagesize */
-#undef GETPAGESIZE
-/* Define if you have vprintf */
-#undef HAVE_VPRINTF
-/* Define if you have gettimeofday */
-#undef HAVE_GETTIMEOFDAY
-/* Define if you have atexit */
-#undef HAVE_ATEXIT
-/* Define if you have bcopy, bzero and bcmp
-   Linux needs that define! */
-#undef HAVE_BCOPY
-/* Define if sprintf does not return number of printed chars */
-#undef BSD_SPRINTF
-/* define if you have explicit C++ constructors */
-#undef HAVE_EXPLICIT_CONSTR
-/* Define if you have the getcwd function.  */
-#undef HAVE_GETCWD
-/* Define if you have the getwd function.  */
-#undef HAVE_GETWD
-/* Define if you have snprintf */
-#undef HAVE_VSNPRINTF
-/* Define if you have readlink */
-#undef HAVE_READLINK
-/* Define if you have usleep */
-#undef HAVE_USLEEP
-/* Define if you have sleep */
-#undef HAVE_SLEEP
-/* Define if you have setenv */
-#undef HAVE_SETENV
-/* Define if you have petpwnam */
-#undef HAVE_GETPWNAM
-/* Define if you have popen */
-#undef HAVE_POPEN
-/* Define if you have sysconf */
-#undef HAVE_SYSCONF
-/* Define if you have siginterrupt (BSD4.3) */
-#undef HAVE_SIGINTERRUPT
-/* Define if you have pselect */
-#undef HAVE_PSELECT
-/* define for boost includes and lib */
-//////////////////////// #undef HAVE_BOOST_DYNAMIC_BITSET_HPP
-/* define for std:vector includes */
-#undef USE_STDVECBOOL
-/* Define sizeof(char) */
-#define SIZEOF_CHAR 1
-/* Define sizeof(short) */
-#define SIZEOF_SHORT 2
-/* Define sizeof(int) */
-#define SIZEOF_INT 4
-/* Define sizeof(long) */
-#define SIZEOF_LONG 4
-/* Define sizeof(void*) */
-#define SIZEOF_VOIDP 4
-/* Define sizeof(double) */
-#define SIZEOF_DOUBLE 8
-/* Define if your integer format is big endian */
-#undef WORDS_BIGENDIAN
-/* Define major version of Singular -- should be set in ../configure.in!!!*/
-#define SINGULAR_MAJOR_VERSION 0
-/* Define minor version of Singular -- should be set in ../configure.in!!! */
-#define SINGULAR_MINOR_VERSION 0
-/* Define sub version of Singular -- should be set in ../configure.in!!! */
-#define SINGULAR_SUB_VERSION 0
-/* Define version as a string */
-#define S_VERSION1 ""
-/* Define version date as a string */
-#define S_VERSION2 ""
-/* Define uname identifier as a string */
-#define S_UNAME ""
-/* Absolute pathname of root directory of Singular source */
-#define S_ROOT_DIR ""
-/* Define to enable dynamic module code */
-#undef HAVE_DYNAMIC_LOADING
-/* Define to enable plural */
-#undef HAVE_PLURAL
-/* Define to enable ratGB/ ratGRING */
-#undef HAVE_RATGRING
-/* Define to enable shiftbba */
-#undef HAVE_SHIFTBBA
-/* Define to enable libsvd */
-#undef HAVE_SVD
-/* CPU type: i[3456]86: */
-#undef SI_CPU_I386
-/* CPU type: sparc: */
-#undef SI_CPU_SPARC
-/* CPU type: ppc: */
-#undef SI_CPU_PPC
-/* CPU type: IA64: */
-#undef SI_CPU_IA64
-/* CPU type: x86_64: */
-#undef SI_CPU_X86_64
-/* whether development version of python is available */
-#undef HAVE_PYTHON
-/* whether static development version of python is available */
-#undef HAVE_STATIC_PYTHON
-/* whether python should be embedded */
-#undef EMBED_PYTHON
-
-/*******************************************************************
- * Defines which are not set by configure
- ******************************************************************/
-
-/* Default value for timer resolution in ticks per second */
-/* set to 10 for resolution of tenth of a second, etc */
-#define TIMER_RESOLUTION 1
-
-/* Undefine to disable the quote/eval of expressions */
-#define SIQ 1
-
-/* Undefine to disable Gerhard's and Wilfried's fast and dirty std computations */
-#define FAST_AND_DIRTY
-
-/* eigenvalues */
-#ifndef HAVE_DYNAMIC_LOADING
-#define HAVE_EIGENVAL 1
-
-/* Gauss-Manin system */
-#define HAVE_GMS 1
-#endif
-
-/* linear algebra extensions from pcv.h/pcv.cc */
-#define HAVE_PCV 1
-
-/* procedures to compute groebner bases with the f5 implementation */
-/* still testing */
-#undef HAVE_F5 
-
-/* procedures to compute groebner bases with the f5c implementation */
-/* still testing */
-#undef HAVE_F5C
-
-/* letterplace gb:*/
-#define HAVE_SHIFTBBA 1
-
-/* rings as coefficients */
-#define HAVE_RINGS
-
-/* procedures to compute with units */
-#define HAVE_UNITS
-
-/* Define to use scanner when loading libraries */
-#define HAVE_LIBPARSER
-
-/*#define PROFILING*/
-#ifdef PROFILING
-#define PROFILER ,0,0
-#else
-#define PROFILER
-#endif
-
-/*******************************************************************
- * Evaluate the set defines
- ******************************************************************/
-/* Spectrum needs GMP */
-#define HAVE_SPECTRUM 1
-
-#if SIZEOF_VOIDP == 8
-/* SIZEOF_LONG == SIZEOF_VOIDP is guaranteed by configure */
-#define ALIGN_8
-#define LOG_SIZEOF_LONG  3
-#define LOG_SIZEOF_VOIDP 3
-#else
-#define LOG_SIZEOF_LONG  2
-#define LOG_SIZEOF_VOIDP 2
-#endif
-
-#ifndef CHAR_BIT
-#define CHAR_BIT 8
-#endif
-
-#define BIT_SIZEOF_LONG CHAR_BIT*SIZEOF_LONG
-
-#define SINGULAR_PATCHLEVEL 3
-#define SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION*10)+SINGULAR_PATCHLEVEL)
-
-/*******************************************************************
- * Miscellanous Defines
- ******************************************************************/
-/* Under HPUX 9, system(...) returns -1 if SIGCHLD does not equal
-   SIG_DFL. However, if it stays at SIG_DFL we get zombie processes
-   for terminated childs generated by fork. Therefors some special treatment 
-   is necessary */
-#ifdef HPUX_9
-#include <stdlib.h>
-#define system hpux9_system
-#ifdef __cplusplus
-extern "C" {
-#endif
-int hpux9_system(const char* system);
-#ifdef __cplusplus
-}
-#endif
-#endif
-
-#ifndef HAVE_LIBPARSER
-#  undef YYLPDEBUG
-#else
-#  define YYLPDEBUG 1
-#endif
-
-#ifndef FALSE
-#define FALSE       0
-#endif
-
-#ifndef TRUE
-#define TRUE        1
-#endif
-
-#ifndef NULL
-#define NULL        (0)
-#endif
-
-#ifndef SEEK_END
-#define SEEK_END 2
-#endif
-
-#ifndef SEEK_SET
-#define SEEK_SET 0
-#endif
-
-#define HALT() m2_end(2)
-
-/* define OLD_RES for res/sres/mres(i,j,k) */
-#undef OLD_RES
-
-/* the maximal ascii length of an int number + 1 = 11 for 32 bit int */
-#define MAX_INT_LEN 11
-#define MAX_INT_VAL 0x7fffffff
-
-#ifdef DO_PROFILE
-/* define to enable explicit profiling of some crucial inline
- * routines and defines  */
-#undef DO_DEEP_PROFILE
-#endif
-
-/* define to enable assume */
-#ifndef HAVE_ASSUME
-#undef HAVE_ASSUME
-#endif
-
-/* define LINKAGE to "extern C" if compiling for shared libs */
-#ifndef LINKAGE
-#if defined(PIC)
-#define LINKAGE extern "C"
-#else
-#define LINKAGE
-#endif
-#endif
-
-
-/*******************************************************************
- * DEBUG OPTIONS
- * -- only significant for for compiling without -DNDEBUG
- * -- you better know what your are doing, if you touch this
- ******************************************************************/
-#ifndef NDEBUG
-
-/* undefine to enable inline */
-#define NO_INLINE
-
-/* undefine to disable assume -- should normally be defined for NDEBUG */
-#define HAVE_ASSUME
-
-/* undef PDEBUG to disable checks of polys
-
- define PDEBUG to
-  0 for enabling pTest
-  1 plus tests in Level 1 poly routines (operations on monomials)
-  2 plus tests in Level 2 poly routines (operations on single exponents)
- -- see also polys.h for more info
-
- NOTE: you can set the value of PDEBUG on a per-file basis, before
-       including mod2.h, provided ! PDEBUG is defined in mod2.h E.g.:
-
-       #define PDEBUG 2
-       #include "mod2.h"
-       ...
-
-       makes sure that all poly operations in your file are done with 
-       PDEBUG == 2
- To break after an error occured, set a debugger breakpoint on
- dErrorBreak. 
-*/
-#ifndef PDEBUG
-#define PDEBUG 0
-#endif
-
-/* define MDEBUG to enable memory checks */
-#define MDEBUG 0
-
-#ifdef MDEBUG
-/* If ! defined(OM_NDEBUG) and (defined(OM_TRACK) or defined(OM_CHECK)
-   then omDebug routines are used for memory allocation/free:
-
-   The omDebug routines are controlled by the values of OM_TRACK, OM_CHECK
-   and OM_KEEP.  There meaning is roughly as follows:
-   OM_TRACK: strored with address                              : extra space
-     0     : no additional info is stored                      : 0
-     1     : file:line of location where address was allocated : 1 word
-     2     : plus backtrace of stack where adress was allocated: 6 words
-     3     : plus size/bin info and front-, and back padding   : 9 words
-     4     : plus file:line of location where adress was freed : 10 words
-     5     : plus backtrace of stack where adress was allocated: 15 words
-   OM_CHECK: checks done
-     0     : no checks
-     1     : constant-time checks: i.e. addr checks only
-     2     : plus linear-time checks and constant related bin check
-     3     : plus quadratic-time checks and linear-time related bin checks and
-             constant time all memory checks
-     4     : and so on
-     ==> for OM_CHECK >= 3 it gets rather slow
-   OM_KEEP:  determines whether addresses are really freed  (
-     0     : addresses are really freed
-     1     : addresses are only marked as free and not really freed.
-
-   OM_CHECK, OM_TRACK, and OM_KEEP can be set on a per-file basis 
-   (as can OM_NDEBUG),  e.g.:
-     #define OM_CHECK 3
-     #define OM_TRACK 5
-     #define OM_KEEP  1
-     #include "mod2.h"
-     #include "omalloc.h"
-   ensures that all memory allocs/free in this file are done with 
-   OM_CHECK==3 and OM_TRACK==5, and that all addresses allocated/freed 
-   in this file are only marked as free and never really freed.
- 
-   To set OM_CHECK, OM_TRACK and OM_KEEP under dynamic scope, set 
-   om_Opts.MinCheck, om_Opts.MinTrack to the respectiv values and 
-   om_Opts.Keep to the number of addresses which are kept before they are 
-   actually freed. E.g.:
-     int check=om_Opts.MinCheck, track=om_Opts.MinTrack, keep= m_OPts.Keep;
-     om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
-     ExternalRoutine();
-     om_Opts.MinCheck = check; omOpts.MinTrack = track; omOpts.Keep = keep;
-   ensures that all calls omDebug routines  occuring during the computation of
-   ExternalRoutine() are done with OM_CHECK==3 and OM_TRACK==5, and 
-   calls to omFree only mark addresses as free and not really free them.
-
-   Furthermore, the value of OM_SING_KEEP (resp. om_Opts.Keep) specifies 
-   how many addresses are kept before they are actually freed, independently 
-   of the value of OM_KEEP.
-
-   Some tips on possible values of OM_TRACK, OM_CHECK, OM_KEEP:
-   + To find out about an address that has been freed twice, first locate the
-     file(s) where the error occured, and then at the beginning of these files:
-       #define OM_CHECK 3
-       #define OM_TRACK 5
-       #define OM_KEEP  1
-       #include "mod2.h"
-       #include "omalloc.h"
-     Under dynamic scope, do (e.g., from within the debugger):
-       om_Opts.MinCheck = 3; om_Opts.MinTrack = 5; omOpts.Keep = LONG_MAX;
-   + to find out where "memory corruption" occured, increase value of 
-     OM_CHECK - the higher this value is, the more consistency checks are 
-     done (However a value > 3 checks the entire memory each time an omalloc 
-     routine is used!)
-   
-   Some more tips on the usage of omalloc:
-   + omAlloc*, omRealloc*, omFree*, omCheck* omDebug* omTest* rotuines 
-     assume that sizes are > 0 and pointers are != NULL
-   + omalloc*, omrealloc*, omfree* omcheck*, omdebug* omtest* routines allow
-     NULL pointers and sizes == 0
-   + You can safely use any free/realloc routine in combination with any alloc 
-     routine (including the debug versions): E.g., an address allocated with
-     omAllocBin can be freed with omfree, or an adress allocated with 
-     om(Debug)Alloc can be freed with omfree, or omFree, or omFreeSize, etc.
-     However, keep in mind that the efficiency decreases from 
-     Bin over Size to General routines (i.e., omFreeBin is more efficient than
-     omFreeSize which is more efficient than omFree, likewise with the alloc
-     routines).
-   + if OM_CHECK is undefined or 0, then all omCheck routines do nothing
-   + if OM_CHECK and OM_TRACK are both undefined (or 0), or if OM_NDEBUG is 
-     defined, then the "real" alloc/realloc/free macros are used, and all 
-     omTest, omDebug and omCheck routines are undefined
-   + to break after an omError occured within a debugger, 
-     set a breakpoint on dErrorBreak
-   + to do checks from within the debugger, or to do checks with explicit 
-     check level, use omTest routines.
-*/
-
-/* by default, store alloc info and file/line where addr was freed */
-#ifndef OM_TRACK
-#define OM_TRACK 4
-#endif
-/* only do constant-time memory checks */
-#ifndef OM_CHECK
-#define OM_CHECK 1
-#endif
-/* Do actually free memory: 
-   (be careful: if this is set, memory is never really freed, 
-    but only marked as free) */
-#ifndef OM_KEEP
-#define OM_KEEP 0
-#endif
-/* but only after you have freed 1000 more addresses 
-   (this is actually independent of the value of OM_KEEP and used
-   to initialize om_Opts.Keep) */
-#ifndef OM_SING_KEEP
-#define OM_SING_KEEP 1000
-#endif
-
-#endif /* MDEBUG */
-
-
-/* undef KDEBUG for check of data during std computations 
- *
- * define KDEBUG to
- * 0 for basic tests
- * 1 for tests in kSpoly 
- * NOTE: You can locally enable tests in kspoly by setting the 
- *       define at the beginning of kspoly.cc
- */
-#define KDEBUG 0
-
-/* define LDEBUG checking numbers, undefine otherwise */
-#define LDEBUG
-/* define RDEBUG checking rings (together with TRACE=9) */
-#define RDEBUG
-/* define TEST for non time critical tests, undefine otherwise */
-#define TEST
-
-/* #define PAGE_TEST */
-
-/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
-#define YYDEBUG 1
-
-/* Undefine to disable debugging of MP stuff */
-#ifdef HAVE_MPSR
-#define MPSR_DEBUG
-#endif
-
-
-/* define SPECTRUM_DEBUG and SPECTRUM_PRINT for debugging the spectrum code */
-/* define SPECTRUM_IOSTREAM to use C++ iostream for error messages          */
-
-/* #define SPECTRUM_DEBUG */
-/* #define SPECTRUM_PRINT */
-#undef  SPECTRUM_IOSTREAM
-
-#ifdef  SPECTRUM_DEBUG
-#define MULTICNT_DEBUG
-#define GMPRAT_DEBUG
-#define KMATRIX_DEBUG
-#define SPLIST_DEBUG
-#define NPOLYGON_DEBUG
-#define SEMIC_DEBUG
-#endif
-
-#ifdef  SPECTRUM_PRINT
-#define MULTICNT_PRINT
-#define GMPRAT_PRINT
-#define KMATRIX_PRINT
-#define SPLIST_PRINT
-#define NPOLYGON_PRINT
-#define SEMIC_PRINT
-#endif
-
-#ifdef  SPECTRUM_IOSTREAM
-#define MULTICNT_IOSTREAM
-#define GMPRAT_IOSTREAM
-#define KMATRIX_IOSTREAM
-#define SPLIST_IOSTREAM
-#define NPOLYGON_IOSTREAM
-#define SEMIC_IOSTREAM
-#endif
-
-
-#else /* not NDEBUG **************************************************** */
-
-#define NO_PDEBUG
-
-/* define YYDEBUG 1 for debugging bison texts, 0 otherwise */
-#define YYDEBUG 0
-
-#endif /* not NDEBUG */
-
-/*******************************************************************
- *
- * assume(x) -- a handy macro for assumptions
- *
- ******************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-// routine which is used to report the error
-// returns 0
-extern int dReportError(const char* fmt, ...);
-// within a debugger, set a breakpoint on dErrorBreak
-// which is called after the error has been reported
-extern void dErrorBreak();
-#ifdef __cplusplus
-}
-#endif
-
-#ifndef HAVE_ASSUME
-#define assume(x) ((void) 0)
-#define r_assume(x) ((void) 0)
-#else /* ! HAVE_ASSUME */
-
-#define assume_violation(s,f,l) \
-  dReportError("assume violation at %s:%d condition: %s", f,l,s)
-
-#define assume(x)   _assume(x, __FILE__, __LINE__)
-#define r_assume(x) _r_assume(x, __FILE__, __LINE__)
-
-#define _assume(x, f, l)                        \
-do                                              \
-{                                               \
-  if (! (x))                                    \
-  {                                             \
-    assume_violation(#x, f, l);                 \
-  }                                             \
-}                                               \
-while (0)
-
-#define _r_assume(x, f, l)                      \
-do                                              \
-{                                               \
-  if (! (x))                                    \
-  {                                             \
-    assume_violation(#x, f, l);                 \
-    return 0;                                   \
-  }                                             \
-}                                               \
-while (0)
-#endif /* HAVE_ASSUME */
-
-/* do have RDEBUG, unless we are doing the very real thing */
-#ifdef HAVE_ASSUME
-#ifndef RDEBUG
-#define RDEBUG 
-#endif
-#endif
-
-#if SIZEOF_VOIDP == 8
-#ifndef OM_CHECK
-#define OM_CHECK 0
-#endif
-#endif
-
-/* If we're not using GNU C, elide __attribute__ */
-#ifndef __GNUC__
-#  define  __attribute__(x)  /*NOTHING*/
-#endif
-
-#define STRINGIFY(name) #name
-#define EXPANDED_STRINGIFY(name) STRINGIFY(name)
-
-#endif /* MOD2_H  */
diff --git a/kernel/testgh b/kernel/testgh
deleted file mode 100755
index 6828725..0000000
--- a/kernel/testgh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-if [ -f grammar.hh ]
-then
-  mv grammar.hh grammar.cc.h
-fi
-if [ -f grammar.h ]
-then
-  if diff grammar.cc.h grammar.h >/dev/null
-  then
-    echo grammar.h was okay
-    /bin/rm grammar.cc.h
-  else
-    echo generating new grammar.h
-    mv grammar.cc.h grammar.h
-  fi
-else
-  echo generating grammar.h
-  mv grammar.cc.h grammar.h
-fi

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/singular.git



More information about the debian-science-commits mailing list