Changeset 9d3636 in git
- Timestamp:
- Feb 11, 2003, 5:28:51 PM (21 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 0191db90f1b4ad6d544bae570504054ff0db0eaf
- Parents:
- 2d5452f3d3805a37d772af1fae5d485b759089df
- Location:
- factory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/NTLconvert.cc
r2d5452 r9d3636 1 /* $Id: NTLconvert.cc,v 1. 5 2003-02-04 16:24:59Singular Exp $ */1 /* $Id: NTLconvert.cc,v 1.6 2003-02-11 16:28:48 Singular Exp $ */ 2 2 #include <config.h> 3 3 … … 292 292 } 293 293 294 static int 295 NTLcmpCF( const CFFactor & f, const CFFactor & g ) 296 { 297 if (f.exp() > g.exp()) return 1; 298 if (f.exp() < g.exp()) return 0; 299 if (f.factor() > g.factor()) return 1; 300 return 0; 301 } 302 294 303 //////////////////////////////////////////////////////////////////////////////// 295 304 // NAME: convertNTLvec_pair_ZZpX_long2FacCFFList // … … 326 335 // so it is omitted 327 336 328 // Start by appending the multiplicity329 if (!IsOne(multi))330 rueckgabe.append(CFFactor(CanonicalForm(to_long(rep(multi))),1));331 337 332 338 // Go through the vector e and compute the CFFList … … 336 342 rueckgabe.append(CFFactor(convertNTLZZpX2CF(e[i].a,x),e[i].b)); 337 343 } 338 344 if(isOn(SW_USE_NTL_SORT)) rueckgabe.sort(NTLcmpCF); 345 // the multiplicity at pos 1 346 if (!IsOne(multi)) 347 rueckgabe.insert(CFFactor(CanonicalForm(to_long(rep(multi))),1)); 339 348 return rueckgabe; 340 349 } … … 394 403 rueckgabe.append(CFFactor(bigone,exponent)); 395 404 } 396 405 if(isOn(SW_USE_NTL_SORT)) rueckgabe.sort(NTLcmpCF); 397 406 return rueckgabe; 398 407 } … … 607 616 608 617 609 // Start by appending the multiplicity610 611 //if (!IsOne(multi))612 rueckgabe.append(CFFactor(convertZZ2CF(multi),1));613 614 618 // Go through the vector e and build up the CFFList 615 619 // As usual bigone summarizes the result … … 634 638 rueckgabe.append(CFFactor(bigone,exponent)); 635 639 } 640 if(isOn(SW_USE_NTL_SORT)) rueckgabe.sort(NTLcmpCF); 641 // the multiplicity at pos 1 642 //if (!IsOne(multi)) 643 rueckgabe.insert(CFFactor(convertZZ2CF(multi),1)); 644 636 645 //return the converted list 637 646 return rueckgabe; … … 690 699 //important for the factorization, but nevertheless would take computing time, so it is omitted 691 700 692 693 // Start by appending the multiplicity694 if (!IsOne(multi))695 rueckgabe.append(CFFactor(convertNTLZZpE2CF(multi,alpha),1));696 697 698 701 // Go through the vector e and build up the CFFList 699 702 // As usual bigone summarizes the result during every loop … … 720 723 } 721 724 } 722 723 725 //append the computed polynomials together with its exponent to the CFFList 724 726 rueckgabe.append(CFFactor(bigone,exponent)); 725 726 } 727 } 728 if(isOn(SW_USE_NTL_SORT)) rueckgabe.sort(NTLcmpCF); 729 // Start by appending the multiplicity 730 if (!IsOne(multi)) 731 rueckgabe.insert(CFFactor(convertNTLZZpE2CF(multi,alpha),1)); 732 727 733 //return the computed CFFList 728 734 return rueckgabe; … … 788 794 for (int i=e.length()-1;i>=0;i--) 789 795 { 790 bigone=0; 791 792 polynom=e[i].a; 793 exponent=e[i].b; 794 795 for (int j=0;j<deg(polynom)+1;j++) 796 { 797 if (IsOne(coeff(polynom,j))) 798 { 799 bigone+=power(x,j); 800 } 801 else 802 { 803 CanonicalForm coefficient=convertNTLGF2E2CF(coeff(polynom,j),alpha); 804 if (coeff(polynom,j)!=0) 805 { 806 bigone += (power(x,j)*coefficient); 807 } 808 } 809 } 810 811 // append the computed polynomial together with its multiplicity 812 rueckgabe.append(CFFactor(bigone,exponent)); 813 814 } 815 // return the computed CFFList 796 bigone=0; 797 798 polynom=e[i].a; 799 exponent=e[i].b; 800 801 for (int j=0;j<deg(polynom)+1;j++) 802 { 803 if (IsOne(coeff(polynom,j))) 804 { 805 bigone+=power(x,j); 806 } 807 else 808 { 809 CanonicalForm coefficient=convertNTLGF2E2CF(coeff(polynom,j),alpha); 810 if (coeff(polynom,j)!=0) 811 { 812 bigone += (power(x,j)*coefficient); 813 } 814 } 815 } 816 817 // append the computed polynomial together with its multiplicity 818 rueckgabe.append(CFFactor(bigone,exponent)); 819 820 } 821 if(isOn(SW_USE_NTL_SORT)) rueckgabe.sort(NTLcmpCF); 822 // return the computed CFFList 816 823 return rueckgabe; 817 824 } … … 852 859 return result; 853 860 } 854 855 856 861 #endif -
factory/cf_defs.h
r2d5452 r9d3636 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_defs.h,v 1. 8 2002-07-30 15:23:15Singular Exp $ */2 /* $Id: cf_defs.h,v 1.9 2003-02-11 16:28:50 Singular Exp $ */ 3 3 4 4 #ifndef INCL_CF_DEFS_H … … 37 37 const int SW_USE_NTL=8; 38 38 const int SW_USE_NTL_GCD=9; 39 const int SW_USE_NTL_SORT=10; 39 40 //}}} 40 41 -
factory/templates/ftmpl_list.cc
r2d5452 r9d3636 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: ftmpl_list.cc,v 1. 7 1998-03-10 14:51:32 schmidtExp $ */2 /* $Id: ftmpl_list.cc,v 1.8 2003-02-11 16:28:51 Singular Exp $ */ 3 3 4 4 #include <factoryconf.h> … … 311 311 { 312 312 if ( first != last ) { 313 int swap = 1;314 while ( swap ){313 int swap; 314 do { 315 315 swap = 0; 316 316 ListItem<T> *cur = first; … … 324 324 cur = cur->next; 325 325 } 326 } 326 } while (swap); 327 327 } 328 328 }
Note: See TracChangeset
for help on using the changeset viewer.