Changeset 001cc15 in git for factory/facSparseHensel.cc
- Timestamp:
- Sep 6, 2012, 7:11:17 PM (12 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 0b27942997f2964b33d7b6fb15f97e372d54fc5f
- Parents:
- 24a77fb14c59fc78cc67eb5f6934a45d8862d99e107aac1a78fd9b689a33a864d23b7cfb1caa5bdf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facSparseHensel.cc
r24a77fb r001cc15 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()); 111 result= CFList(); 106 112 do 107 113 { … … 112 118 { 113 119 delete [] stripped2; 114 return false;120 return 0; 115 121 } 116 122 if (isZero (newSolution)) 117 { 118 delete [] stripped2; 119 return false; 120 } 123 break; 121 124 if (!merge (solution, newSolution)) 122 { 123 delete [] stripped2; 124 return false; 125 } 125 break; 126 126 } while (1); 127 127 128 129 result= CFList(); 128 if (isEqual (startingSolution, solution)) 129 { 130 delete [] stripped2; 131 return 0; 132 } 130 133 CanonicalForm factor; 131 134 num= 0; … … 135 138 factor= 0; 136 139 for (j= 0; j < k; j++, num++) 140 { 141 if (solution [num].isZero()) 142 continue; 137 143 factor += solution [num]*stripped2[i][j]; 144 } 138 145 result.append (factor); 139 146 } 140 147 141 148 delete [] stripped2; 142 return true; 149 if (result.length() > 0) 150 return 1; 151 return 0; 143 152 } 144 153
Note: See TracChangeset
for help on using the changeset viewer.