Index: kernel/f5gb.cc
===================================================================
--- kernel/f5gb.cc	(revision 3b5daf5c3b6d494f4399c4436450100041ce3dc0)
+++ kernel/f5gb.cc	(revision ed30c564f811fcf3caad1d97f9b7d281af74121e)
@@ -2,10 +2,10 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: f5gb.cc,v 1.11 2008-11-20 17:55:04 ederc Exp $ */
+/* $Id: f5gb.cc,v 1.12 2008-11-22 20:48:23 ederc Exp $ */
 /*
 * ABSTRACT: f5gb interface
 */
 #include "mod2.h"
-
+#include <list>
 #ifdef HAVE_F5
 #include "kutil.h"
@@ -23,9 +23,6 @@
 #include "pInline1.h"
 #include "f5gb.h"
-#include "lpolynom.h"
+#include "lpolynomial.h"
 
-
-// global variables
-const poly one = pInit();
 
 
@@ -68,5 +65,5 @@
 * computes incrementally gbs of subsets of the input 
 * gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1}
-*/  
+  
 lpoly *f5_inc(lpoly* lp, lpoly* g_prev)
 {
@@ -89,10 +86,10 @@
         *
         * return lp;
-        */
+        
 }    
 
-
+*/
 // generating the list lp of ideal generators and test if 1 is in lp
-bool generate_input_list(lpoly* lp, ideal id)
+bool generate_input_list(lpoly* lp, ideal id, poly ONE)
 {
         long j;
@@ -101,5 +98,5 @@
                 lp[j].setPoly(id->m[j]);
                 
-                if(pComparePolys(lp[j].getPoly(), one)){
+                if(pComparePolys(lp[j].getPoly(), ONE)){
                         Print("1 in GB\n");
                         return(1);
@@ -107,5 +104,5 @@
                 
                 lp[j].setIndex(j+1);
-                lp[j].setTerm(one);
+                lp[j].setTerm(ONE);
                 lp[j].setDel(false);
                 lp[j].setNext(&lp[j+1]);
@@ -126,67 +123,37 @@
 * implementation 
 */
-ideal F5main(ideal i, ring r)
-{
-        ideal iTmp, g_basis;
-        bool one_id;
-        long j,k;
-        pSetCoeff(one, nInit(1));
-        pWrite(one);
-        lpoly *lp, *gb;
-        intvec* sort;
-        iTmp = idInit(IDELEMS(i),i->rank);
-  
-        for(j=0; j<IDELEMS(i); j++)
-        {
-                if(NULL != i->m[j])
-                {
-                        iTmp->m[j] = i->m[j];
-                }
-        ;}
-        
-        iTmp = kInterRed(i,0);  
-        qsort_degree(&iTmp->m[0],&iTmp->m[IDELEMS(iTmp)-1]);
-        idShow(iTmp);
-        
-        // generating the list lp of ideal generators 
-        lp = new lpoly[IDELEMS(iTmp)];
-        
-        one_id = generate_input_list(lp,iTmp);        
-         
-        
-        // PROBLEM: muss signatur mitliefern, daher datentyp
-        //          ideal nicht zu gebrauchen? 
-        
+ideal F5main(ideal i, ring r) {
+    lpoly* lp;
+    long j;
 
-        // gb: Grobner Bases, pointer on the first element in the list, 
-        // end of the list is marked by next = NULL
-        
-        gb = new lpoly;
-        gb = &lp[IDELEMS(iTmp)-1];
-        (*gb).setNext(NULL);
-        Print("last element in sequence = first element in gb:\n");
-        pWrite((*gb).getPoly());
-        Print("Next: %p\n", lp[IDELEMS(iTmp)-2].getNext());
-        Print("Next: %p\n", lp[IDELEMS(iTmp)-1].getNext());
-        
-        for(j=IDELEMS(iTmp)-2; j>0; j--){
-                //PROBLEM: muss dynamisch Speicher allozieren
-                gb = f5_inc(&lp[j], gb);
-                
-                for(k=0; k< IDELEMS(iTmp); k++){
-                        
-                        if(pComparePolys(gb[k].getPoly(),one)){
-                                Print("1 in GB\n");
-                                return(iTmp);
-                        }
-
-                }
-        
-         
+    // definition of one-polynomial as global constant ONE
+    poly one = pInit();
+    pSetCoeff(one, nInit(1));
+    static const poly ONE = one;
+    
+    // 
+    for(j=0; j<IDELEMS(i); j++) {
+        if(NULL != i->m[j]) { 
+            if(pComparePolys(i->m[j],ONE)) {
+                Print("One Polynomial in Input => Computations stopped\n");
+                return(i);
+            }   
         }
-
-        Print("Es klappt!\n");
-        return(iTmp); 
-                        
+    } 
+    
+    i = kInterRed(i,0);  
+    qsort_degree(&i->m[0],&i->m[IDELEMS(i)-1]);
+    idShow(i);
+            
+    /* if(generate_input_list(lp,iTmp,ONE)) {
+            Print("One Polynomial in Input => Computations stopped");
+            iTmp = idInit(1,0);
+            iTmp->m[0] = ONE;
+            return(iTmp);
+    }
+    */
+    Print("Es klappt!\nWIRKLICH!");
+    return(i); 
+    
 
 
Index: kernel/f5gb.h
===================================================================
--- kernel/f5gb.h	(revision 3b5daf5c3b6d494f4399c4436450100041ce3dc0)
+++ kernel/f5gb.h	(revision ed30c564f811fcf3caad1d97f9b7d281af74121e)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: f5gb.h,v 1.10 2008-11-20 17:55:04 ederc Exp $ */
+/* $Id: f5gb.h,v 1.11 2008-11-22 20:48:23 ederc Exp $ */
 /*
 * ABSTRACT: f5gb interface
@@ -10,19 +10,19 @@
 
 #ifdef HAVE_F5
-#include "lpolynom.h"
+#include "lpolynomial.h"
 
 
 // sort polynomials in ideal i by decreasing total degree
-void qsort_degree(poly* left, poly* right);
+ void qsort_degree(poly* left, poly* right);
 
 
 // generating the list lp of ideal generators and 
 // test if 1 is in lp(return 1) or not(return 0)
-bool generate_input_list(lpoly* lp, ideal id);
+ bool generate_input_list(lpoly* lp, ideal id, poly one);
 
 /* computes incrementally gbs of subsets of the input 
    gb{f_m} -> gb{f_m,f_(m-1)} -> gb{f_m,...,f_1}  
 */
-lpoly* f5_inc(lpoly* lp, lpoly* g_prev);
+// lpoly* f5_inc(lpoly* lp, lpoly* g_prev);
 
 
