Index: kernel/sbuckets.cc
===================================================================
--- kernel/sbuckets.cc	(revision eedc8463bb5522124aa9067ea9076f8376db5bba)
+++ kernel/sbuckets.cc	(revision a795c77a2788b17b019279e7ee8ba39e3a523d5f)
@@ -8,5 +8,5 @@
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 9/00
- *  Version: $Id: sbuckets.cc,v 1.2 2004-05-14 16:26:06 levandov Exp $
+ *  Version: $Id: sbuckets.cc,v 1.3 2009-05-27 16:15:14 motsak Exp $
  *******************************************************************/
 #include "mod2.h"
@@ -41,4 +41,34 @@
 
 static omBin sBucket_bin = omGetSpecBin(sizeof(sBucket));
+
+
+//////////////////////////////////////////////////////////////////////////
+// New API:
+//
+
+/// Returns bucket ring
+const ring sBucketGetRing(const sBucket_pt bucket)
+{ return bucket->bucket_ring; }
+
+/// Copy sBucket non-intrusive!!!
+sBucket_pt    sBucketCopy(const sBucket_pt bucket)
+{
+  const ring r = bucket->bucket_ring;
+
+  sBucket_pt newbucket = sBucketCreate(r);
+
+  for(int i = 0; bucket->buckets[i].p != NULL; i++)
+  {
+    assume( i < (BIT_SIZEOF_LONG - 3) );
+    assume( pLength(bucket->buckets[i].p) == bucket->buckets[i].length );
+
+    newbucket->buckets[i].p = p_Copy(bucket->buckets[i].p, r);
+    newbucket->buckets[i].length = bucket->buckets[i].length;
+
+    assume( pLength(newbucket->buckets[i].p) == newbucket->buckets[i].length );
+  }
+
+  return newbucket;
+}
 
 /////////////////////////////////////////////////////////////////////////////
Index: kernel/sbuckets.h
===================================================================
--- kernel/sbuckets.h	(revision eedc8463bb5522124aa9067ea9076f8376db5bba)
+++ kernel/sbuckets.h	(revision a795c77a2788b17b019279e7ee8ba39e3a523d5f)
@@ -10,5 +10,5 @@
  *  Author:  obachman (Olaf Bachmann)
  *  Created: 9/00
- *  Version: $Id: sbuckets.h,v 1.2 2008-07-04 14:17:15 motsak Exp $
+ *  Version: $Id: sbuckets.h,v 1.3 2009-05-27 16:15:14 motsak Exp $
  *******************************************************************/
 #ifndef S_BUCKETS_H
@@ -16,4 +16,6 @@
 
 #include "structs.h"
+
+
 
 //////////////////////////////////////////////////////////////////////////
@@ -23,4 +25,14 @@
 void          sBucketDestroy(sBucket_pt *bucket);
 
+
+//////////////////////////////////////////////////////////////////////////
+// New API:
+//
+
+/// Copy sBucket non-intrusive!!!
+sBucket_pt    sBucketCopy(const sBucket_pt bucket);
+
+/// Returns bucket ring
+const ring sBucketGetRing(const sBucket_pt bucket);
 
 /////////////////////////////////////////////////////////////////////////////
@@ -71,5 +83,5 @@
 //////////////////////////////////////////////////////////////////////////
 ///
-/// Sorts p with bucektSort: assumes all monomials of p are different
+/// Sorts p with bucketSort: assumes all monomials of p are different
 ///
 poly sBucketSortMerge(poly p, ring r);
@@ -77,5 +89,5 @@
 //////////////////////////////////////////////////////////////////////////
 ///
-/// Sorts p with bucektSort: p may have equal monomials
+/// Sorts p with bucketSort: p may have equal monomials
 ///
 poly sBucketSortAdd(poly p, ring r);
Index: kernel/summator.cc
===================================================================
--- kernel/summator.cc	(revision eedc8463bb5522124aa9067ea9076f8376db5bba)
+++ kernel/summator.cc	(revision a795c77a2788b17b019279e7ee8ba39e3a523d5f)
@@ -7,5 +7,5 @@
  *  Author:  motsak
  *  Created:
- *  Version: $Id: summator.cc,v 1.4 2008-07-25 16:06:18 motsak Exp $
+ *  Version: $Id: summator.cc,v 1.5 2009-05-27 16:15:14 motsak Exp $
  *******************************************************************/
 
@@ -70,10 +70,10 @@
     poly out;
     int pLength;
-    
+
     sBucketClearAdd(m_temp.m_bucket, &out, &pLength);
     sBucketDestroy(&m_temp.m_bucket);
 
     if(out != NULL)
-      p_Delete(&out, m_basering);    
+      p_Delete(&out, m_basering);
 //    m_temp.m_bucket = NULL;
   }
@@ -172,3 +172,20 @@
 }
 
+
+
+CPolynomialSummator::CPolynomialSummator(const CPolynomialSummator& b): m_bUsePolynomial(b.m_bUsePolynomial), m_basering(b.m_basering)
+{
+  try{
+    if(m_bUsePolynomial)
+      m_temp.m_poly = p_Copy( b.m_temp.m_poly, m_basering);
+    else
+      m_temp.m_bucket = sBucketCopy(b.m_temp.m_bucket);
+  }
+  catch(...)
+  {
+    assume(false);
+  }
+}
+
+
 #endif
Index: kernel/summator.h
===================================================================
--- kernel/summator.h	(revision eedc8463bb5522124aa9067ea9076f8376db5bba)
+++ kernel/summator.h	(revision a795c77a2788b17b019279e7ee8ba39e3a523d5f)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: summator.h,v 1.2 2008-07-08 08:18:27 Singular Exp $ */
+/* $Id: summator.h,v 1.3 2009-05-27 16:15:14 motsak Exp $ */
 
 // #include <summator.h> // for CPolynomialSummator class
@@ -48,7 +48,11 @@
     inline operator poly() { return AddUpAndClear(); }
 
-  private: // no copies of this object at the moment!!!
-    CPolynomialSummator(const CPolynomialSummator& m);               // Copy constructor
-    CPolynomialSummator& operator= (const CPolynomialSummator& m);   // Assignment operator
+    /// Copy constructor
+    CPolynomialSummator(const CPolynomialSummator&);
+
+  private:
+
+    /// no assignment operator yet
+    CPolynomialSummator& operator= (const CPolynomialSummator&);
 };
 
