Changeset 7993ad in git
- Timestamp:
- Nov 15, 2010, 11:55:28 AM (13 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- d77a70e48aa5be934ca92380ce7754a935ae2aec
- Parents:
- 8eb6da1cea8ad61c747aa7cebf16cdde3c452b1b
- Location:
- libfac/factor
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libfac/factor/helpstuff.cc
r8eb6da r7993ad 11 11 12 12 bool 13 mydivremt ( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ){ 13 mydivremt ( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ) 14 { 14 15 bool retvalue; 15 16 CanonicalForm aa,bb; … … 19 20 else { b=aa; } 20 21 return retvalue; 21 }22 23 void24 mydivrem( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b ){25 bool retvalue;26 CanonicalForm aa,bb;27 retvalue = divremt(f,g,a,bb);28 aa= f-g*a;29 if ( aa==bb ) { b=bb; }30 else { b=aa; }31 22 } 32 23 … … 40 31 /////////////////////////////////////////////////////////////// 41 32 CFFList 42 myappend( const CFFList & Inputlist, const CFFactor & TheFactor){ 33 myappend( const CFFList & Inputlist, const CFFactor & TheFactor) 34 { 43 35 CFFList Outputlist ; 44 36 CFFactor copy; … … 46 38 int exp=0; 47 39 48 for ( i=Inputlist ; i.hasItem() ; i++ ){ 40 for ( i=Inputlist ; i.hasItem() ; i++ ) 41 { 49 42 copy = i.getItem(); 50 43 if ( copy.factor() == TheFactor.factor() ) … … 58 51 59 52 CFFList 60 myUnion(const CFFList & Inputlist1,const CFFList & Inputlist2){ 53 myUnion(const CFFList & Inputlist1,const CFFList & Inputlist2) 54 { 61 55 CFFList Outputlist; 62 56 CFFListIterator i; … … 71 65 72 66 int 73 Powerup( const int base , const int exp){ 67 Powerup( const int base , const int exp) 68 { 74 69 int retvalue=1; 75 70 if ( exp == 0 ) return retvalue ; … … 91 86 static void 92 87 modpower( const CanonicalForm & f, int k , int td, 93 const CanonicalForm & t, CanonicalForm & result){ 88 const CanonicalForm & t, CanonicalForm & result) 89 { 94 90 95 91 if ( td >= k ) return; … … 103 99 104 100 CanonicalForm 105 mod_power( const CanonicalForm & f, int k, int levelU){ 101 mod_power( const CanonicalForm & f, int k, int levelU) 102 { 106 103 CanonicalForm result,dummy; 107 104 Variable x(levelU); … … 109 106 if ( levelU > level(f) ) 110 107 modpower(f,k,0,1,result); 111 else{ 112 for ( CFIterator i=f; i.hasTerms(); i++){ 108 else 109 { 110 for ( CFIterator i=f; i.hasTerms(); i++) 111 { 113 112 dummy = 0; 114 113 modpower(i.coeff(),k,0,1,dummy); … … 128 127 /////////////////////////////////////////////////////////////// 129 128 int 130 subvardegree( const CanonicalForm & F, int levelF ){ 129 subvardegree( const CanonicalForm & F, int levelF ) 130 { 131 131 int n=0,m=degree(F,levelF),newn=0; 132 132 133 for ( int k=0; k<=m; k++ ){ 133 for ( int k=0; k<=m; k++ ) 134 { 134 135 newn = totaldegree( F[k] ); 135 136 if ( newn > n ) n=newn; … … 142 143 /////////////////////////////////////////////////////////////// 143 144 CanonicalForm 144 change_poly( const CanonicalForm & f , const SFormList & Substitutionlist ,int directionback ){ 145 change_poly( const CanonicalForm & f , const SFormList & Substitutionlist ,int directionback ) 146 { 145 147 CanonicalForm F=f,g,k; 146 148 int level_i; 147 149 // Variable x; 148 150 149 for ( SFormListIterator i=Substitutionlist; i.hasItem(); i++){ 151 for ( SFormListIterator i=Substitutionlist; i.hasItem(); i++) 152 { 150 153 // now we can access: i.getItem().factor() -> level(~) gives x_i 151 154 // i.getItem().exp() -> gives a_i -
libfac/factor/helpstuff.h
r8eb6da r7993ad 6 6 #define HELPSTUFF_H 7 7 bool mydivremt ( const CanonicalForm&, const CanonicalForm&, CanonicalForm&, CanonicalForm& ); 8 void mydivrem( const CanonicalForm& f, const CanonicalForm& g, CanonicalForm& a, CanonicalForm& b );9 8 /////////////////////////////////////////////////////////////// 10 9 // Now some procedures used in MVMultiHensel and in Truefactors
Note: See TracChangeset
for help on using the changeset viewer.