Changeset 7b5cb2 in git for factory/facSparseHensel.cc
- Timestamp:
- Aug 8, 2012, 1:31:30 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- 8267b8f9ab43170a4026e7e570df48db4601a748
- Parents:
- 97686ecde8614d72ee9d26e96dc9344df8a7da32
- git-author:
- Martin Lee <martinlee84@web.de>2012-08-08 13:31:30+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-09-04 18:01:07+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facSparseHensel.cc
r97686e r7b5cb2 21 21 #include "facFqFactorize.h" 22 22 23 bool 23 int 24 24 LucksWangSparseHeuristic (const CanonicalForm& F, const CFList& factors, 25 25 int level, const CFList& leadingCoeffs, CFList& result) … … 66 66 delete [] monomsLead; 67 67 68 CFArray termsF= getTerms (F); 69 sort (termsF); 68 CFArray termsF= getBiTerms (F); 69 if (termsF.size() > 450) 70 { 71 delete [] monoms; 72 return 0; 73 } 74 sort (termsF, level); 70 75 71 76 CFList tmp; … … 80 85 CanonicalForm H= prod (tmp); 81 86 CFArray monomsH= getMonoms (H); 82 sort (monomsH); 83 84 groupTogether (termsF, level); 87 sort (monomsH,F.level()); 88 85 89 groupTogether (monomsH, F.level()); 86 90 … … 88 92 { 89 93 delete [] stripped2; 90 return false;94 return 0; 91 95 } 92 96 … … 99 103 { 100 104 delete [] stripped2; 101 return false;105 return 0; 102 106 } 103 107 104 108 CFArray A= getEquations (monomsH, termsF); 109 CFArray startingSolution= solution; 105 110 CFArray newSolution= CFArray (solution.size()); 106 111 do … … 110 115 break; 111 116 if (!simplify (A, newSolution, F.level() + 1)) 112 { 113 delete [] stripped2; 114 return false; 115 } 117 break; 116 118 if (isZero (newSolution)) 117 { 118 delete [] stripped2; 119 return false; 120 } 119 break; 121 120 if (!merge (solution, newSolution)) 122 { 123 delete [] stripped2; 124 return false; 125 } 121 break; 126 122 } while (1); 127 123 128 124 129 125 result= CFList(); 126 if (isEqual (startingSolution, solution)) 127 { 128 delete [] stripped2; 129 return 0; 130 } 130 131 CanonicalForm factor; 131 132 num= 0; … … 135 136 factor= 0; 136 137 for (j= 0; j < k; j++, num++) 138 { 139 if (solution [num].isZero()) 140 continue; 137 141 factor += solution [num]*stripped2[i][j]; 142 } 138 143 result.append (factor); 139 144 } 140 145 141 146 delete [] stripped2; 142 return true; 147 if (result.length() > 0) 148 return 1; 149 return 0; 143 150 } 144 151
Note: See TracChangeset
for help on using the changeset viewer.