Changeset 8179468 in git
- Timestamp:
- Nov 21, 2012, 5:35:41 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- e43dc39725c5d5b404d7ba9374a3c75ad9c923fb
- Parents:
- 98b2b9136c4d2f2bb8cbfd626b15ec71f9a38552
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-21 17:35:41+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-11-22 20:43:02+01:00
- Location:
- libpolys/polys
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/polys/kbuckets.h
r98b2b91 r8179468 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 #include <polys/monomials/ring.h>7 #include <polys/templates/p_Procs.h>8 6 9 7 //#define HAVE_COEF_BUCKETS … … 15 13 // define to not really use the bucket feature 16 14 // #define HAVE_PSEUDO_BUCKETS 15 class kBucket; typedef kBucket* kBucket_pt; 16 struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly; 17 struct ip_sring; typedef struct ip_sring* ring; typedef struct ip_sring const* const_ring; 18 19 #include <polys/monomials/ring.h> // for ring->p_Procs->p_kBucketSetLm! 20 #include <polys/templates/p_Procs.h> // for p_kBucketSetLm_Proc_Ptr 17 21 18 22 ////////////////////////////////////////////////////////////////////////// … … 37 41 // i.e., afterwards Bpoly == 0 38 42 void kBucketClear(kBucket_pt bucket, poly *p, int *length); 43 39 44 inline poly kBucketClear(kBucket_pt bucket) 40 45 { … … 124 129 /// 125 130 /// Bpoly == Bpoly - m*p; where m is a monom 126 /// Does not destroy p and m 131 /// Does not destroy p and m (TODO: rename into kBucket_Minus_mm_Mult_pp!?) 127 132 /// assume (*l <= 0 || pLength(p) == *l) 128 133 void kBucket_Minus_m_Mult_p(kBucket_pt bucket, poly m, poly p, int *l, … … 200 205 // Returned monom is READ ONLY, i.e. no manipulations are allowed !!!! 201 206 // 207 inline poly kBucketGetLm(kBucket_pt bucket, p_kBucketSetLm_Proc_Ptr _p_kBucketSetLm) 208 { 209 #ifdef HAVE_COEF_BUCKETS 210 assume(bucket->coef[0]==NULL); 211 #endif 212 213 poly& lead = bucket->buckets[0]; 214 215 if (lead == NULL) 216 _p_kBucketSetLm(bucket); 217 218 #ifdef HAVE_COEF_BUCKETS 219 assume(bucket->coef[0]==NULL); 220 #endif 221 222 return lead; 223 } 224 202 225 inline poly kBucketGetLm(kBucket_pt bucket) 203 226 { 204 #ifdef HAVE_COEF_BUCKETS 205 assume(bucket->coef[0]==NULL); 206 #endif 207 if (bucket->buckets[0] == NULL) 208 bucket->bucket_ring->p_Procs->p_kBucketSetLm(bucket); 209 #ifdef HAVE_COEF_BUCKETS 210 assume(bucket->coef[0]==NULL); 211 #endif 212 return bucket->buckets[0]; 213 } 227 return kBucketGetLm(bucket, bucket->bucket_ring->p_Procs->p_kBucketSetLm); // TODO: needs ring :( 228 } 214 229 215 230 inline poly kBucketExtractLm(kBucket_pt bucket) -
libpolys/polys/nc/old.gring.cc
r98b2b91 r8179468 23 23 24 24 # define PLURAL_INTERNAL_DECLARATIONS 25 #include "nc /nc.h"26 #include " nc/sca.h"27 #include " nc/gb_hack.h"28 29 #include "monomials/ring.h"25 #include "nc.h" 26 #include "sca.h" 27 #include "gb_hack.h" 28 29 #include <polys/monomials/ring.h> 30 30 31 31 #include <coeffs/numbers.h> 32 #include "coeffrings.h"32 #include <polys/coeffrings.h> 33 33 34 34 // #include <polys/febase.h> 35 35 #include <misc/options.h> 36 36 37 #include "monomials/ring.h"38 #include "monomials/p_polys.h"39 40 #include "simpleideals.h"41 #include "matpol.h"42 43 #include "kbuckets.h"44 #include "sbuckets.h"37 #include <polys/monomials/ring.h> 38 #include <polys/monomials/p_polys.h> 39 40 #include <polys/simpleideals.h> 41 #include <polys/matpol.h> 42 43 #include <polys/kbuckets.h> 44 #include <polys/sbuckets.h> 45 45 46 46 // #include <polys/kstd1.h> 47 #include "prCopy.h"48 49 #include "operations/p_Mult_q.h"47 #include <polys/prCopy.h> 48 49 #include <polys/operations/p_Mult_q.h> 50 50 // dirty tricks: 51 #include "templates/p_MemAdd.h"51 #include <polys/templates/p_MemAdd.h> 52 52 53 53 // #include <polys/pInline1.h> 54 54 55 55 56 57 #include "nc/summator.h" 58 59 #include "nc/ncSAMult.h" // for CMultiplier etc classes 60 #include "nc/ncSAFormula.h" // for CFormulaPowerMultiplier and enum Enum_ncSAType 56 #include "summator.h" 57 58 #include "ncSAMult.h" // for CMultiplier etc classes 59 #include "ncSAFormula.h" // for CFormulaPowerMultiplier and enum Enum_ncSAType 61 60 62 61 // #ifdef HAVE_RATGRING -
libpolys/polys/nc/summator.cc
r98b2b91 r8179468 18 18 #endif 19 19 20 #include "summator.h" 21 22 #ifdef HAVE_SUMMATOR 23 20 24 #include "config.h" 21 25 #include <misc/auxiliary.h> 22 23 #ifdef HAVE_PLURAL24 26 #include <misc/options.h> 25 27 26 #include "nc/summator.h" 27 #include "monomials/ring.h" 28 #include "monomials/p_polys.h" 29 30 #include "sbuckets.h" 31 32 33 CPolynomialSummator::CPolynomialSummator(ring rBaseRing, bool bUsePolynomial): 28 #include <polys/monomials/ring.h> 29 #include <polys/monomials/p_polys.h> 30 #include <polys/sbuckets.h> 31 32 33 34 CPolynomialSummator::CPolynomialSummator(const ring& rBaseRing, bool bUsePolynomial): 34 35 m_basering(rBaseRing), m_bUsePolynomial(bUsePolynomial) 35 36 { … … 78 79 sBucketDestroy(&m_temp.m_bucket); 79 80 81 assume(out == NULL); // otherwise wrong usage pattern! 80 82 if(out != NULL) 81 83 p_Delete(&out, m_basering); … … 83 85 } 84 86 else 87 { 88 assume(m_temp.m_poly == NULL); // otherwise wrong usage pattern! 85 89 if(m_temp.m_poly!=NULL) 86 90 { … … 91 95 // m_temp.m_poly = NULL; 92 96 } 97 } 93 98 } 94 99 … … 102 107 m_temp.m_poly = p_Add_q(m_temp.m_poly, pSummand, m_basering); 103 108 else 104 sBucket_Add_p(m_temp.m_bucket, pSummand, iLength); 109 sBucket_Add_p(m_temp.m_bucket, pSummand, iLength); // sBucket_Merge_p??? 105 110 } 106 111 … … 114 119 m_temp.m_poly = p_Add_q(m_temp.m_poly, pSummand, m_basering); 115 120 else 116 sBucket_Add_p(m_temp.m_bucket, pSummand, 0); 121 sBucket_Add_p(m_temp.m_bucket, pSummand, 0); // sBucket_Merge_p??? 117 122 } 118 123 … … 193 198 194 199 195 #endif 200 #endif // ifdef HAVE_SUMMATOR -
libpolys/polys/nc/summator.h
r98b2b91 r8179468 5 5 ****************************************/ 6 6 7 // #include < summator.h> // for CPolynomialSummator class7 // #include <polys/nc/summator.h> // for CPolynomialSummator class 8 8 9 #include <polys/monomials/ring.h> 10 #include <polys/monomials/p_polys.h> 9 #define HAVE_SUMMATOR 1 10 11 #ifdef HAVE_SUMMATOR 12 13 // struct snumber; typedef struct snumber * number; 14 15 class sBucket; typedef sBucket* sBucket_pt; 16 struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly; 17 struct ip_sring; typedef struct ip_sring* ring; typedef struct ip_sring const* const_ring; 11 18 12 19 20 class kBucket; typedef kBucket* kBucket_pt; 21 22 // TODO: redesign into templates with no extra run-time cost!!! 23 // TODO: make several out of CPolynomialSummator with similar (?) usage 24 // pattern/interface!!! 25 13 26 // //////////////////////////////////////////////////////////////////////// // 14 // CPolynomialSummator: unifies bucket and polynomial summation as the 15 // later is brocken in buckets :( 16 #ifdef HAVE_PLURAL 27 /// CPolynomialSummator: unifies bucket and polynomial summation as the 28 /// later is brocken in buckets :( 17 29 class CPolynomialSummator 18 30 { 19 31 private: 20 ringm_basering;21 bool m_bUsePolynomial;32 const ring& m_basering; 33 const bool m_bUsePolynomial; 22 34 union 23 35 { 24 36 sBucket_pt m_bucket; 37 // kBucket_pt m_kbucket; 25 38 poly m_poly; 26 39 } m_temp; 27 40 public: 28 CPolynomialSummator( ringrBaseRing, bool bUsePolynomial = false);41 CPolynomialSummator(const ring& rBaseRing, bool bUsePolynomial = false); 29 42 // CPolynomialSummator(ring rBaseRing, poly pInitialSum, int iLength = 0, bool bUsePolynomial = false); 30 43 ~CPolynomialSummator(); … … 49 62 /// Copy constructor 50 63 CPolynomialSummator(const CPolynomialSummator&); 51 52 64 private: 53 65 … … 56 68 }; 57 69 58 #endif 70 #endif // ifdef HAVE_SUMMATOR 59 71 #endif // ifndef SUMMATOR_H 60 72 -
libpolys/polys/operations/p_Mult_q.h
r98b2b91 r8179468 14 14 15 15 #include <misc/auxiliary.h> 16 17 struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly; 16 18 17 19 // #include "config.h" -
libpolys/polys/sbuckets.cc
r98b2b91 r8179468 12 12 13 13 #include <polys/sbuckets.h> 14 14 15 #include <omalloc/omalloc.h> 15 16 #include <polys/monomials/ring.h> 16 17 //#include <kernel/p_Procs.h> 17 #include <polys/monomials/ /p_polys.h>18 #include <polys/monomials/p_polys.h> 18 19 19 20 -
libpolys/polys/sbuckets.h
r98b2b91 r8179468 14 14 #define S_BUCKETS_H 15 15 16 #include <polys/monomials/ring.h> 16 class sBucket; typedef sBucket* sBucket_pt; 17 struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly; 18 struct ip_sring; typedef struct ip_sring* ring; typedef struct ip_sring const* const_ring; 17 19 18 20 19 class sBucket;20 typedef sBucket* sBucket_pt;21 21 ////////////////////////////////////////////////////////////////////////// 22 22 // Creation/Destruction of buckets -
libpolys/polys/templates/p_Procs.h
r98b2b91 r8179468 11 11 #ifndef P_PROCS_H 12 12 #define P_PROCS_H 13 #include <polys/monomials/ring.h> 13 14 // #include <polys/monomials/ring.h> 14 15 // #include <polys/structs.h> 16 #include <omalloc/omalloc.h> 17 18 struct spolyrec; typedef struct spolyrec polyrec; typedef polyrec* poly; 19 struct ip_sring; typedef struct ip_sring* ring; typedef struct ip_sring const* const_ring; 15 20 16 21 /*------------- p_Proc stuff ----------------------*/ … … 21 26 typedef poly (*pp_Mult_nn_Proc_Ptr)(poly p, const number n, const ring r); 22 27 typedef poly (*p_Mult_mm_Proc_Ptr)(poly p, const poly m, const ring r); 23 typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, const poly m, 24 const ring r); 28 typedef poly (*pp_Mult_mm_Proc_Ptr)(poly p, const poly m, const ring r); 25 29 typedef poly (*pp_Mult_mm_Noether_Proc_Ptr)(poly p, const poly m, 26 30 const poly spNoether, int &ll,
Note: See TracChangeset
for help on using the changeset viewer.