Index: factory/Makefile.am
===================================================================
--- factory/Makefile.am	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ factory/Makefile.am	(revision e699d86f1d122e6f33ebbdf5cd73abd7985274e2)
@@ -91,7 +91,4 @@
 		variable.cc \
 		NTLconvert.cc \
-		abs_fac.cc \
-		bifac.cc \
-		lgs.cc \
 		singext.cc \
 		parseutil.cc \
@@ -174,7 +171,4 @@
 		variable.h \
 		NTLconvert.h \
-		bifac.h \
-		bifacConfig.h \
-		lgs.h \
 		algext.h \
 		singext.h \
Index: ctory/abs_fac.cc
===================================================================
--- factory/abs_fac.cc	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,1076 +1,0 @@
-#include "config.h"
-#include "canonicalform.h"
-
-#ifdef HAVE_BIFAC
-
-# ifndef NOSTREAMIO
-#  include<fstream>
-# endif
-
-# 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 /* HAVE_BIFAC */
Index: ctory/bifac.cc
===================================================================
--- factory/bifac.cc	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,1299 +1,0 @@
-#include "config.h"
-
-#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 /* #ifdef HAVE_BIFAC */
Index: ctory/bifac.h
===================================================================
--- factory/bifac.h	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,102 +1,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
Index: ctory/bifacConfig.h
===================================================================
--- factory/bifacConfig.h	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,49 +1,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
Index: factory/factory.template
===================================================================
--- factory/factory.template	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ factory/factory.template	(revision e699d86f1d122e6f33ebbdf5cd73abd7985274e2)
@@ -106,8 +106,3 @@
 #include "facIrredTest.h"
 
-#ifdef HAVE_BIFAC
-/*MAKEHEADER PUBLIC ONLY*/
-#include "bifac.h"
-#endif /* HAVE_BIFAC */
-
 #endif /* ! INCL_FACTORY_H */
Index: ctory/lgs.cc
===================================================================
--- factory/lgs.cc	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,311 +1,0 @@
-/* ===================================================================
-    Dateiname:          lgs.cc
-   =================================================================== */
-#include "config.h"
-
-#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 /* #ifdef HAVE_BIFAC */
-
Index: ctory/lgs.h
===================================================================
--- factory/lgs.h	(revision 42253a424aaf4fe8863a5381517748f9af9bb4c1)
+++ 	(revision )
@@ -1,62 +1,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
