Changeset 276c3f in git
- Timestamp:
- Jul 5, 2011, 3:16:22 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- e28e6d1742e673c091f48a99b5d6d522e5d5bfa2
- Parents:
- faf58fa448fff6919168c75277259dc4202064b0
- Location:
- factory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/algext.cc
rfaf58f r276c3f 190 190 191 191 return 1; 192 }193 194 CanonicalForm reduce(const CanonicalForm & f, const CanonicalForm & M)195 { // polynomials in M.mvar() are considered coefficients196 // M univariate monic polynomial197 // the coefficients of f are reduced modulo M198 if(f.inBaseDomain() || f.level() < M.level())199 return f;200 if(f.level() == M.level())201 {202 if(f.degree() < M.degree())203 return f;204 CanonicalForm tmp = mod (f, M);205 return tmp;206 }207 // here: f.level() > M.level()208 CanonicalForm result = 0;209 for(CFIterator i=f; i.hasTerms(); i++)210 result += reduce(i.coeff(),M) * power(f.mvar(),i.exp());211 return result;212 192 } 213 193 -
factory/algext.h
rfaf58f r276c3f 20 20 bool isEqual(int *a, int *b, int lower, int upper); 21 21 CanonicalForm firstLC(const CanonicalForm & f); 22 CanonicalForm reduce(const CanonicalForm & f, const CanonicalForm & M);23 22 24 23 #endif -
factory/canonicalform.h
rfaf58f r276c3f 257 257 258 258 int size ( const CanonicalForm & f ); 259 260 CanonicalForm reduce ( const CanonicalForm& f, const CanonicalForm & M); 259 261 //}}} 260 262 -
factory/cf_ops.cc
rfaf58f r276c3f 659 659 } 660 660 //}}} 661 662 CanonicalForm reduce(const CanonicalForm & f, const CanonicalForm & M) 663 { // polynomials in M.mvar() are considered coefficients 664 // M univariate monic polynomial 665 // the coefficients of f are reduced modulo M 666 if(f.inBaseDomain() || f.level() < M.level()) 667 return f; 668 if(f.level() == M.level()) 669 { 670 if(f.degree() < M.degree()) 671 return f; 672 CanonicalForm tmp = mod (f, M); 673 return tmp; 674 } 675 // here: f.level() > M.level() 676 CanonicalForm result = 0; 677 for(CFIterator i=f; i.hasTerms(); i++) 678 result += reduce(i.coeff(),M) * power(f.mvar(),i.exp()); 679 return result; 680 }
Note: See TracChangeset
for help on using the changeset viewer.