Changeset ba6139 in git for factory/libfac/charset/alg_factor.cc
- Timestamp:
- Mar 10, 2014, 3:20:56 PM (10 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- e0fbbebbddf89f036945fdc00a1659b1841bc7aa
- Parents:
- a199a3f1830dc111591517b077fb9391d8d27eb2
- git-author:
- Martin Lee <martinlee84@web.de>2014-03-10 15:20:56+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-03-17 18:31:53+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/libfac/charset/alg_factor.cc
ra199a3 rba6139 124 124 DEBOUTLN(CERR, "sqrf_norm_sub: f= ", f); 125 125 DEBOUTLN(CERR, "sqrf_norm_sub: Palpha= ", Palpha); 126 myrandom.reset(); s= f.mvar()-myrandom.item()*Palpha.mvar(); g=f;126 myrandom.reset(); s=myrandom.item(); g=f; 127 127 R= CanonicalForm(0); 128 128 DEBOUTLN(CERR, "sqrf_norm_sub: myrandom s= ", s); … … 139 139 temp= gcd(R, R.deriv(vf)); 140 140 DEBOUTLN(CERR, "sqrf_norm_sub: temp= ", temp); 141 if (degree(temp,vf) != 0 || temp == temp.genZero() ){ sqfreetest= 0; } 142 else { sqfreetest= 1; } 141 if (degree(temp,vf) != 0 || temp == temp.genZero() ) 142 sqfreetest= 0; 143 else 144 sqfreetest= 1; 143 145 DEBOUTLN(CERR, "sqrf_norm_sub: sqfreetest= ", sqfreetest); 144 146 } … … 152 154 Variable X; 153 155 if (getAlgVar(R,X)) 154 { 155 testlist=factorize( R, X ); 156 } 156 testlist=factorize( R, X ); 157 157 else 158 testlist= Factorize(R);158 testlist= factorize(R); 159 159 DEBOUTLN(CERR, "testlist= ", testlist); 160 160 testlist.removeFirst(); 161 161 sqfreetest=1; 162 162 for ( i=testlist; i.hasItem(); i++) 163 if ( i.getItem().exp() > 1 && degree(i.getItem().factor(), R.mvar()) > 0) { sqfreetest=0; break; } 163 { 164 if ( i.getItem().exp() > 1 && degree(i.getItem().factor(), R.mvar()) > 0) 165 { 166 sqfreetest=0; 167 break; 168 } 169 } 164 170 DEBOUTLN(CERR, "SqrFreeTest(R)= ", sqfreetest); 165 171 } … … 168 174 myrandom.next(); 169 175 DEBOUTLN(CERR, "sqrf_norm_sub generated new myrandom item: ", myrandom.item()); 170 if ( getCharacteristic() == 0 ) t= CanonicalForm(mapinto(myrandom.item())); 171 else t= CanonicalForm(myrandom.item()); 172 s= f.mvar()+t*Palpha.mvar(); // s defines backsubstitution 176 if ( getCharacteristic() == 0 ) 177 t= CanonicalForm(mapinto(myrandom.item())); 178 else 179 t= CanonicalForm(myrandom.item()); 180 s= t; 173 181 DEBOUTLN(CERR, "sqrf_norm_sub: testing s= ", s); 174 182 g= f(f.mvar()-t*Palpha.mvar(), f.mvar()); … … 190 198 DEBOUTLN(CERR, "sqrf_norm_sub: f= ", f); 191 199 DEBOUTLN(CERR, "sqrf_norm_sub: Palpha= ", Palpha); 192 myrandom.reset(); s= f.mvar()-myrandom.item()*Palpha.mvar(); g=f;200 myrandom.reset(); s=myrandom.item(); g=f; 193 201 R= CanonicalForm(0); 194 202 DEBOUTLN(CERR, "sqrf_norm_sub: myrandom s= ", s); … … 205 213 temp= gcd(R, R.deriv(vf)); 206 214 DEBOUTLN(CERR, "sqrf_norm_sub: temp= ", temp); 207 if (degree(temp,vf) != 0 || temp == temp.genZero() ){ sqfreetest= 0; } 208 else { sqfreetest= 1; } 215 if (degree(temp,vf) != 0 || temp == temp.genZero() ) 216 sqfreetest= 0; 217 else 218 sqfreetest= 1; 209 219 DEBOUTLN(CERR, "sqrf_norm_sub: sqfreetest= ", sqfreetest); 210 220 } … … 218 228 Variable X; 219 229 if (getAlgVar(R,X)) 220 { 221 testlist=factorize( R, X ); 222 } 230 testlist= factorize( R, X ); 223 231 else 224 testlist= Factorize(R);232 testlist= factorize(R); 225 233 DEBOUTLN(CERR, "testlist= ", testlist); 226 234 testlist.removeFirst(); 227 235 sqfreetest=1; 228 236 for ( i=testlist; i.hasItem(); i++) 229 if ( i.getItem().exp() > 1 && degree(i.getItem().factor(), R.mvar()) > 0) { sqfreetest=0; break; } 237 { 238 if ( i.getItem().exp() > 1 && degree(i.getItem().factor(), R.mvar()) > 0) 239 { 240 sqfreetest=0; 241 break; 242 } 243 } 230 244 DEBOUTLN(CERR, "SqrFreeTest(R)= ", sqfreetest); 231 245 } … … 234 248 myrandom.next(); 235 249 DEBOUTLN(CERR, "sqrf_norm_sub generated new myrandom item: ", myrandom.item()); 236 if ( getCharacteristic() == 0 ) t= CanonicalForm(mapinto(myrandom.item())); 237 else t= CanonicalForm(myrandom.item()); 238 s= f.mvar()+t*Palpha.mvar(); // s defines backsubstitution 250 if ( getCharacteristic() == 0 ) 251 t= CanonicalForm(mapinto(myrandom.item())); 252 else 253 t= CanonicalForm(myrandom.item()); 254 s= t; 239 255 DEBOUTLN(CERR, "sqrf_norm_sub: testing s= ", s); 240 256 g= f(f.mvar()-t*Palpha.mvar(), f.mvar());
Note: See TracChangeset
for help on using the changeset viewer.