Changeset a795c77 in git
- Timestamp:
- May 27, 2009, 6:15:14 PM (14 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '7725b5cfc1eaf99630826ecc59f559d3b6831c24')
- Children:
- d7ce08deb30fcdd7bf7c010d4972aa3359545c20
- Parents:
- eedc8463bb5522124aa9067ea9076f8376db5bba
- Location:
- kernel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/sbuckets.cc
reedc846 ra795c77 8 8 * Author: obachman (Olaf Bachmann) 9 9 * Created: 9/00 10 * Version: $Id: sbuckets.cc,v 1. 2 2004-05-14 16:26:06 levandovExp $10 * Version: $Id: sbuckets.cc,v 1.3 2009-05-27 16:15:14 motsak Exp $ 11 11 *******************************************************************/ 12 12 #include "mod2.h" … … 41 41 42 42 static omBin sBucket_bin = omGetSpecBin(sizeof(sBucket)); 43 44 45 ////////////////////////////////////////////////////////////////////////// 46 // New API: 47 // 48 49 /// Returns bucket ring 50 const ring sBucketGetRing(const sBucket_pt bucket) 51 { return bucket->bucket_ring; } 52 53 /// Copy sBucket non-intrusive!!! 54 sBucket_pt sBucketCopy(const sBucket_pt bucket) 55 { 56 const ring r = bucket->bucket_ring; 57 58 sBucket_pt newbucket = sBucketCreate(r); 59 60 for(int i = 0; bucket->buckets[i].p != NULL; i++) 61 { 62 assume( i < (BIT_SIZEOF_LONG - 3) ); 63 assume( pLength(bucket->buckets[i].p) == bucket->buckets[i].length ); 64 65 newbucket->buckets[i].p = p_Copy(bucket->buckets[i].p, r); 66 newbucket->buckets[i].length = bucket->buckets[i].length; 67 68 assume( pLength(newbucket->buckets[i].p) == newbucket->buckets[i].length ); 69 } 70 71 return newbucket; 72 } 43 73 44 74 ///////////////////////////////////////////////////////////////////////////// -
kernel/sbuckets.h
reedc846 ra795c77 10 10 * Author: obachman (Olaf Bachmann) 11 11 * Created: 9/00 12 * Version: $Id: sbuckets.h,v 1. 2 2008-07-04 14:17:15motsak Exp $12 * Version: $Id: sbuckets.h,v 1.3 2009-05-27 16:15:14 motsak Exp $ 13 13 *******************************************************************/ 14 14 #ifndef S_BUCKETS_H … … 16 16 17 17 #include "structs.h" 18 19 18 20 19 21 ////////////////////////////////////////////////////////////////////////// … … 23 25 void sBucketDestroy(sBucket_pt *bucket); 24 26 27 28 ////////////////////////////////////////////////////////////////////////// 29 // New API: 30 // 31 32 /// Copy sBucket non-intrusive!!! 33 sBucket_pt sBucketCopy(const sBucket_pt bucket); 34 35 /// Returns bucket ring 36 const ring sBucketGetRing(const sBucket_pt bucket); 25 37 26 38 ///////////////////////////////////////////////////////////////////////////// … … 71 83 ////////////////////////////////////////////////////////////////////////// 72 84 /// 73 /// Sorts p with buc ektSort: assumes all monomials of p are different85 /// Sorts p with bucketSort: assumes all monomials of p are different 74 86 /// 75 87 poly sBucketSortMerge(poly p, ring r); … … 77 89 ////////////////////////////////////////////////////////////////////////// 78 90 /// 79 /// Sorts p with buc ektSort: p may have equal monomials91 /// Sorts p with bucketSort: p may have equal monomials 80 92 /// 81 93 poly sBucketSortAdd(poly p, ring r); -
kernel/summator.cc
reedc846 ra795c77 7 7 * Author: motsak 8 8 * Created: 9 * Version: $Id: summator.cc,v 1. 4 2008-07-25 16:06:18motsak Exp $9 * Version: $Id: summator.cc,v 1.5 2009-05-27 16:15:14 motsak Exp $ 10 10 *******************************************************************/ 11 11 … … 70 70 poly out; 71 71 int pLength; 72 72 73 73 sBucketClearAdd(m_temp.m_bucket, &out, &pLength); 74 74 sBucketDestroy(&m_temp.m_bucket); 75 75 76 76 if(out != NULL) 77 p_Delete(&out, m_basering); 77 p_Delete(&out, m_basering); 78 78 // m_temp.m_bucket = NULL; 79 79 } … … 172 172 } 173 173 174 175 176 CPolynomialSummator::CPolynomialSummator(const CPolynomialSummator& b): m_bUsePolynomial(b.m_bUsePolynomial), m_basering(b.m_basering) 177 { 178 try{ 179 if(m_bUsePolynomial) 180 m_temp.m_poly = p_Copy( b.m_temp.m_poly, m_basering); 181 else 182 m_temp.m_bucket = sBucketCopy(b.m_temp.m_bucket); 183 } 184 catch(...) 185 { 186 assume(false); 187 } 188 } 189 190 174 191 #endif -
kernel/summator.h
reedc846 ra795c77 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: summator.h,v 1. 2 2008-07-08 08:18:27 SingularExp $ */6 /* $Id: summator.h,v 1.3 2009-05-27 16:15:14 motsak Exp $ */ 7 7 8 8 // #include <summator.h> // for CPolynomialSummator class … … 48 48 inline operator poly() { return AddUpAndClear(); } 49 49 50 private: // no copies of this object at the moment!!! 51 CPolynomialSummator(const CPolynomialSummator& m); // Copy constructor 52 CPolynomialSummator& operator= (const CPolynomialSummator& m); // Assignment operator 50 /// Copy constructor 51 CPolynomialSummator(const CPolynomialSummator&); 52 53 private: 54 55 /// no assignment operator yet 56 CPolynomialSummator& operator= (const CPolynomialSummator&); 53 57 }; 54 58
Note: See TracChangeset
for help on using the changeset viewer.