Changeset dd8047 in git
- Timestamp:
- Apr 6, 2011, 12:51:16 PM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 09cb44379e8060a8d2ac1b71d07ebab1fd9e46e6
- Parents:
- 1b8e048f850c69dc6881f43dc67b980d46ee540b
- Location:
- factory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqBivar.cc
r1b8e048 rdd8047 946 946 if (factorNums < (int) logarithm) 947 947 factorNums= (int) logarithm; 948 int subCheck1= substituteCheck (A, x); 949 int subCheck2= substituteCheck (A, y); 948 950 for (int i= 0; i < factorNums; i++) 949 951 { … … 966 968 if (!fail) 967 969 { 970 int dummy= subCheck2; 971 subCheck2= subCheck1; 972 subCheck1= dummy; 968 973 A= buf; 969 974 swap2= true; … … 1026 1031 if (i == 0) 1027 1032 { 1028 int subCheck= substituteCheck (bufUniFactors); 1029 1030 if (subCheck > 1) 1031 { 1032 CanonicalForm bufA= A; 1033 subst (bufA, bufA, subCheck, x); 1034 factors= biFactorize (bufA, info); 1035 reverseSubst (factors, subCheck, x); 1036 appendSwapDecompress (factors, contentAxFactors, contentAyFactors, 1037 swap, swap2, N); 1038 normalize (factors); 1039 return factors; 1040 } 1041 1042 if (!derivXZero && !fail2) 1043 { 1044 subCheck= substituteCheck (bufUniFactors2); 1045 if (subCheck > 1) 1033 if (subCheck1 > 0) 1034 { 1035 int subCheck= substituteCheck (bufUniFactors); 1036 1037 if (subCheck > 1 && (subCheck1%subCheck == 0)) 1038 { 1039 CanonicalForm bufA= A; 1040 subst (bufA, bufA, subCheck, x); 1041 factors= biFactorize (bufA, info); 1042 reverseSubst (factors, subCheck, x); 1043 appendSwapDecompress (factors, contentAxFactors, contentAyFactors, 1044 swap, swap2, N); 1045 normalize (factors); 1046 return factors; 1047 } 1048 } 1049 1050 if (!derivXZero && !fail2 && subCheck2 > 0) 1051 { 1052 int subCheck= substituteCheck (bufUniFactors2); 1053 1054 if (subCheck > 1 && (subCheck2%subCheck == 0)) 1046 1055 { 1047 1056 CanonicalForm bufA= A; -
factory/facFqBivarUtil.cc
r1b8e048 rdd8047 389 389 } 390 390 391 int 392 substituteCheck (const CanonicalForm& F, const Variable& x) 393 { 394 if (F.inCoeffDomain()) 395 return 0; 396 if (degree (F, x) < 0) 397 return 0; 398 CanonicalForm f= swapvar (F, F.mvar(), x); 399 int sizef= 0; 400 for (CFIterator i= f; i.hasTerms(); i++, sizef++) 401 { 402 if (i.exp() == 1) 403 return 0; 404 } 405 int * expf= new int [sizef]; 406 int j= 0; 407 for (CFIterator i= f; i.hasTerms(); i++, j++) 408 expf [j]= i.exp(); 409 410 int indf= sizef - 1; 411 if (expf[indf] == 0) 412 indf--; 413 414 int result= expf[indf]; 415 for (int i= indf - 1; i >= 0; i--) 416 { 417 if (expf [i]%result != 0) 418 { 419 delete [] expf; 420 return 0; 421 } 422 } 423 424 delete [] expf; 425 return result; 426 } 427 391 428 static int 392 429 substituteCheck (const CanonicalForm& F, const CanonicalForm& G) -
factory/facFqBivarUtil.h
r1b8e048 rdd8047 191 191 ); 192 192 193 /// check if a substitution x^n->x is possible 194 /// 195 /// @return an integer n > 1, if a substitution described as above is possible 196 /// else n <= 1 197 int 198 substituteCheck (const CanonicalForm& F, ///<[in] a polynomial 199 const Variable& x ///<[in] some variable 200 ); 201 193 202 #endif 194 203 /* FAC_FQ_BIVAR_UTIL_H */
Note: See TracChangeset
for help on using the changeset viewer.