Index: libfac/charset/charset.cc
===================================================================
--- libfac/charset/charset.cc	(revision 2c3cda8da51049289f57702038ff42c44f290497)
+++ libfac/charset/charset.cc	(revision 9e9b7c1dbc45990a692860b6f085c25b0cdab8f2)
@@ -2,5 +2,5 @@
 ////////////////////////////////////////////////////////////
 // emacs edit mode for this file is -*- C++ -*-
-/* $Id: charset.cc,v 1.14 2008-04-08 16:19:09 Singular Exp $ */
+/* $Id: charset.cc,v 1.15 2008-05-31 17:20:10 Singular Exp $ */
 /////////////////////////////////////////////////////////////
 // FACTORY - Includes
@@ -530,5 +530,6 @@
 
 static CFList
-irras( CFList & AS, int & ja, CanonicalForm & reducible){
+irras( CFList & AS, int & ja, CanonicalForm & reducible)
+{
   CFFList qs;
   CFList ts,as;
@@ -539,5 +540,6 @@
   ja = 0;
   DEBOUTLN(CERR, "irras: called with: AS= ", AS);
-  for ( i=AS; i.hasItem(); i++ ){
+  for ( i=AS; i.hasItem(); i++ )
+  {
     elem = i.getItem();
     nr += 1;
@@ -545,9 +547,12 @@
     if ( degree(elem) > 1 ) // linear poly's are irreduzible
     {
+      //qs = Factorize2(elem,CanonicalForm(0));
       qs = Factorize(elem);
-    }
-    else{
+      // remove a constant
+      if (qs.getFirst().factor().degree()==0) qs.removeFirst();
+    }
+    else
+    {
       qs=(CFFactor(elem,1));
-      qs.insert(CFFactor(CanonicalForm(1),1));
     }
     DEBOUTLN(CERR, "  = ", qs);
@@ -555,6 +560,7 @@
     if ( interrupt_handle() ) return CFList() ;
     // INTERRUPTHANDLER
-    qs.removeFirst();
-    if ( (qs.length() >= 2 ) || (qs.getFirst().exp() > 1)){
+
+    if ( (qs.length() >= 2 ) || (qs.getFirst().exp() > 1))
+    {
       DEBOUTLN(CERR, "irras: Setting ind=0, ja= ", nr);
       ja=nr; ind=0; reducible= elem;
@@ -564,23 +570,27 @@
   }
   //  CERR << "ind= " << ind << "\n";
-  if ( (ind == 1) ){ //&& ( as.length() > 1) ){
-    if ( irreducible(AS) ){ // as quasilinear? => irreducible!
+  if ( (ind == 1) ) //&& ( as.length() > 1) )
+  {
+    if ( irreducible(AS) )
+    { // as quasilinear? => irreducible!
       ja = 0;
       DEBOUTLN(CERR, "as is irreducible. as= ", AS);
     }
-    else {
+    else
+    {
       i=AS;
-      for ( nr=1; nr< AS.length(); nr++){
+      for ( nr=1; nr< AS.length(); nr++)
+      {
         as.append(i.getItem());
         i++;
-        if ( degree(i.getItem()) > 1 ){// search for a non linear elem
+        if ( degree(i.getItem()) > 1 )
+        {  // search for a non linear elem
           elem=i.getItem();
-//          CERR << "f=  " << elem << "\n";
-//        CERR << "as= " << as << "\n";
-          qs= newfactoras(elem,as,success);
-//          CERR << "irras:newfactoras    qs= " << qs << "\n";
-//          qs= factoras(elem,as,success);
-//          CERR << "irras:factoras qs= " << qs << "\n";
-          if ( qs.length() > 1 || qs.getFirst().exp() > 1 ){ //found elem is reducible
+          if (as.length()==1)
+            qs = Factorize2(elem,as.getFirst());
+          else
+            qs= newfactoras(elem,as,success);
+          if ( qs.length() > 1 || qs.getFirst().exp() > 1 )
+          { //found elem is reducible
             reducible=elem;
             ja=nr+1;
@@ -595,7 +605,11 @@
   return ts;
 }
+
 ///////////////////////////////////////////////////////////////////////////////
 /*
 $Log: not supported by cvs2svn $
+Revision 1.14  2008/04/08 16:19:09  Singular
+*hannes: removed rcsid
+
 Revision 1.13  2008/03/18 17:46:14  Singular
 *hannes: gcc 4.2
Index: libfac/factor/Factor.cc
===================================================================
--- libfac/factor/Factor.cc	(revision 2c3cda8da51049289f57702038ff42c44f290497)
+++ libfac/factor/Factor.cc	(revision 9e9b7c1dbc45990a692860b6f085c25b0cdab8f2)
@@ -1,5 +1,5 @@
 /* Copyright 1996 Michael Messollen. All rights reserved. */
 ///////////////////////////////////////////////////////////////////////////////
-/* $Id: Factor.cc,v 1.45 2008-04-08 16:19:10 Singular Exp $ */
+/* $Id: Factor.cc,v 1.46 2008-05-31 17:20:10 Singular Exp $ */
 static const char * errmsg = "\nYou found a bug!\nPlease inform singular@mathematik.uni-kl.de\nPlease include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
 ///////////////////////////////////////////////////////////////////////////////
@@ -880,4 +880,5 @@
 CFFList Factorize(const CanonicalForm & F, int is_SqrFree )
 {
+  out_cf("Factorize ",F,"\n");
   CFFList Outputlist,SqrFreeList,Intermediatelist,Outputlist2;
   ListIterator<CFFactor> i,j;
@@ -893,5 +894,5 @@
   DEBINCLEVEL(CERR, "Factorize");
   DEBOUTLN(CERR, "Called with F= ", F);
-  if ( getCharacteristic() == 0 )
+  if (( getCharacteristic() == 0 ) || (F.isUnivariate()))
   { // char == 0
     TIMING_START(factorize_time);
@@ -910,5 +911,5 @@
   // search an "optimal" main variavble
   int mv=F.level();
-  if ((mv != LEVELBASE) && (! F.isUnivariate()) )
+  if ((mv != LEVELBASE) /* && (! F.isUnivariate()) */)
   {
      mv=find_mvar(F);
@@ -940,4 +941,5 @@
   else
     SqrFreeList.append(CFFactor(F,1));
+
   DEBOUTLN(CERR, "SqrFreeMV= ", SqrFreeList);
   for ( i=SqrFreeList; i.hasItem(); i++ )
@@ -952,4 +954,5 @@
       if ( g.isUnivariate() )
       {
+        out_cf("univ. poly: ",g,"\n");
         Intermediatelist=factorize(g,1); // poly is sqr-free!
         for ( j=Intermediatelist; j.hasItem(); j++ )
@@ -1009,5 +1012,4 @@
     swapvar(F,Variable(mv),F.mvar());
   }
-
   DEBDECLEVEL(CERR, "Factorize");
   TIMING_END(factorize_time);
@@ -1333,4 +1335,7 @@
 /*
 $Log: not supported by cvs2svn $
+Revision 1.45  2008/04/08 16:19:10  Singular
+*hannes: removed rcsid
+
 Revision 1.44  2008/03/18 17:46:15  Singular
 *hannes: gcc 4.2
Index: libfac/factor/Factor.h
===================================================================
--- libfac/factor/Factor.h	(revision 2c3cda8da51049289f57702038ff42c44f290497)
+++ libfac/factor/Factor.h	(revision 9e9b7c1dbc45990a692860b6f085c25b0cdab8f2)
@@ -2,5 +2,5 @@
 ////////////////////////////////////////////////////////////
 // emacs edit mode for this file is -*- C++ -*-
-// $Id: Factor.h,v 1.5 2002-08-19 11:11:33 Singular Exp $
+// $Id: Factor.h,v 1.6 2008-05-31 17:20:10 Singular Exp $
 ///////////////////////////////////////////////////////////////////////////////
 #ifndef FACTOR_H
@@ -11,4 +11,5 @@
 CFFList Factorize( const CanonicalForm & F, int is_SqrFree=0 ) ;
 CFFList Factorize( const CanonicalForm & F, const CanonicalForm & mi, int is_SqrFree=0 ) ;
+CFFList Factorize2(CanonicalForm F, const CanonicalForm & minpoly );
 /*ENDPUBLIC*/
 
@@ -18,4 +19,7 @@
 /*
 $Log: not supported by cvs2svn $
+Revision 1.5  2002/08/19 11:11:33  Singular
+* hannes/pfister: alg_gcd etc.
+
 Revision 1.4  2002/07/30 15:05:38  Singular
 *hannes: added Factorize for alg. ext.
Index: libfac/factor/SqrFree.cc
===================================================================
--- libfac/factor/SqrFree.cc	(revision 2c3cda8da51049289f57702038ff42c44f290497)
+++ libfac/factor/SqrFree.cc	(revision 9e9b7c1dbc45990a692860b6f085c25b0cdab8f2)
@@ -2,5 +2,5 @@
 ///////////////////////////////////////////////////////////////////////////////
 // emacs edit mode for this file is -*- C++ -*-
-/* $Id: SqrFree.cc,v 1.20 2008-05-14 12:38:26 Singular Exp $ */
+/* $Id: SqrFree.cc,v 1.21 2008-05-31 17:20:10 Singular Exp $ */
 static const char * errmsg = "\nYou found a bug!\nPlease inform singular@mathematik.uni-kl.de\n Please include above information and your input (the ideal/polynomial and characteristic) in your bug-report.\nThank you.";
 ///////////////////////////////////////////////////////////////////////////////
@@ -388,5 +388,5 @@
         if (!mipo.isZero())
         {
-          #if 1
+          #if 0
           Variable alpha=rootOf(mipo);
           CanonicalForm ff=replacevar(f,mipo.mvar(),alpha);
@@ -455,4 +455,7 @@
 /*
 $Log: not supported by cvs2svn $
+Revision 1.20  2008/05/14 12:38:26  Singular
+*hannes: swapvar ->replacevar
+
 Revision 1.19  2008/05/05 14:54:29  Singular
 *hannes: switch representation and normalize in SqrFreeMV
