Changeset 8336c9 in git
- Timestamp:
- Aug 15, 2012, 4:47:03 PM (11 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 5b390eae2a5015d099e164e415bf9de0df375fd5
- Parents:
- c7b56e2b570482a60737ec1d6e4bf209156c36fa
- git-author:
- Martin Lee <martinlee84@web.de>2012-08-15 16:47:03+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-09-04 18:01:18+02:00
- Location:
- factory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqFactorize.cc
rc7b56e2 r8336c9 1278 1278 } 1279 1279 1280 CFList evaluateAtZero (const CanonicalForm& F)1281 {1282 CFList result;1283 CanonicalForm buf= F;1284 result.insert (buf);1285 for (int i= F.level(); i > 2; i--)1286 {1287 buf= buf (0, i);1288 result.insert (buf);1289 }1290 return result;1291 }1292 1293 CFList evaluateAtEval (const CanonicalForm& F, const CFArray& eval)1294 {1295 CFList result;1296 CanonicalForm buf= F;1297 result.insert (buf);1298 int k= eval.size();1299 for (int i= 1; i < k; i++)1300 {1301 buf= buf (eval[i], i + 2);1302 result.insert (buf);1303 }1304 return result;1305 }1306 1307 CFList evaluateAtEval (const CanonicalForm& F, const CFList& evaluation, int l)1308 {1309 CFList result;1310 CanonicalForm buf= F;1311 result.insert (buf);1312 int k= evaluation.length() + l - 1;1313 CFListIterator j= evaluation;1314 for (int i= k; j.hasItem() && i > l; i--, j++)1315 {1316 if (F.level() < i)1317 continue;1318 buf= buf (j.getItem(), i);1319 result.insert (buf);1320 }1321 return result;1322 }1323 1324 1280 int 1325 1281 testFactors (const CanonicalForm& G, const CFList& uniFactors, … … 2072 2028 j.getItem() *= ii.getItem(); 2073 2029 } 2074 }2075 2076 CFList recoverFactors (const CanonicalForm& F, const CFList& factors)2077 {2078 CFList result;2079 CanonicalForm tmp, tmp2;2080 CanonicalForm G= F;2081 for (CFListIterator i= factors; i.hasItem(); i++)2082 {2083 tmp= i.getItem()/content (i.getItem(), 1);2084 if (fdivides (tmp, G, tmp2))2085 {2086 G= tmp2;2087 result.append (tmp);2088 }2089 }2090 return result;2091 }2092 2093 CFList recoverFactors (const CanonicalForm& F, const CFList& factors,2094 const CFList& evaluation)2095 {2096 CFList result;2097 CanonicalForm tmp, tmp2;2098 CanonicalForm G= F;2099 for (CFListIterator i= factors; i.hasItem(); i++)2100 {2101 tmp= reverseShift (i.getItem(), evaluation);2102 tmp /= content (tmp, 1);2103 if (fdivides (tmp, G, tmp2))2104 {2105 G= tmp2;2106 result.append (tmp);2107 }2108 }2109 return result;2110 }2111 2112 CFList recoverFactors (CanonicalForm& F, const CFList& factors, int* index)2113 {2114 CFList result;2115 CanonicalForm tmp, tmp2;2116 CanonicalForm G= F;2117 int j= 0;2118 for (CFListIterator i= factors; i.hasItem(); i++, j++)2119 {2120 if (i.getItem().isZero())2121 {2122 index[j]= 0;2123 continue;2124 }2125 tmp= i.getItem();2126 if (fdivides (tmp, G, tmp2))2127 {2128 G= tmp2;2129 tmp /=content (tmp, 1);2130 result.append (tmp);2131 index[j]= 1;2132 }2133 else2134 index[j]= 0;2135 }2136 F= G;2137 return result;2138 2030 } 2139 2031 -
factory/facFqFactorize.h
rc7b56e2 r8336c9 547 547 ); 548 548 549 /// evaluate F successively n-2 at 0550 ///551 /// @return returns a list of successive evaluations of F, ending with F552 CFList evaluateAtZero (const CanonicalForm& F ///< [in] some poly553 );554 555 /// divides factors by their content wrt. Variable(1) and checks if these polys556 /// divide F557 ///558 /// @return returns factors of F559 CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F560 const CFList& factors ///< [in] some list of561 ///< factor candidates562 );563 564 /// divides factors shifted by evaluation by their content wrt. Variable(1) and565 /// checks if these polys divide F566 ///567 /// @return returns factors of F568 CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F569 const CFList& factors, ///< [in] some list of570 ///< factor candidates571 const CFList& evaluation ///< [in] evaluation point572 );573 574 /// checks if factors divide F, if so F is divided by this factor and the factor575 /// is divided by its content wrt. Variable(1) and the entry in index at the576 /// position of the factor is set to 1, otherwise the entry in index is set to 0577 ///578 /// @return returns factors of F579 CFList recoverFactors (CanonicalForm& F, ///< [in,out] some poly F580 const CFList& factors,///< [in] some list of581 ///< factor candidates582 int* index ///< [in] position of real factors583 );584 585 549 /// refine a bivariate factorization of A with l factors to one with 586 550 /// minFactorsLength … … 676 640 ); 677 641 678 /// evaluate @a F at @a evaluation679 ///680 /// @return @a evaluateAtEval returns a list containing the successive681 /// evaluations of @a F, last entry is @a F again682 CFList683 evaluateAtEval (const CanonicalForm& F, ///<[in] some poly684 const CFArray& evaluation ///<[in] some evaluation point685 );686 687 /// evaluate @a F at @a evaluation688 ///689 /// @return @a evaluateAtEval returns a list containing the successive690 /// evaluations of @a F starting at level @a l, last entry is @a F again691 CFList692 evaluateAtEval (const CanonicalForm& F, ///<[in] some poly693 const CFList& evaluation,///<[in] some evaluation point694 int l ///<[in] level to start at695 );696 697 642 #endif 698 643 /* FAC_FQ_FACTORIZE_H */ -
factory/facFqFactorizeUtil.cc
rc7b56e2 r8336c9 15 15 #include "canonicalform.h" 16 16 #include "cf_map.h" 17 #include "cf_algorithm.h" 17 18 18 19 static inline … … 188 189 } 189 190 190 191 CFList evaluateAtZero (const CanonicalForm& F) 192 { 193 CFList result; 194 CanonicalForm buf= F; 195 result.insert (buf); 196 for (int i= F.level(); i > 2; i--) 197 { 198 buf= buf (0, i); 199 result.insert (buf); 200 } 201 return result; 202 } 203 204 CFList evaluateAtEval (const CanonicalForm& F, const CFArray& eval) 205 { 206 CFList result; 207 CanonicalForm buf= F; 208 result.insert (buf); 209 int k= eval.size(); 210 for (int i= 1; i < k; i++) 211 { 212 buf= buf (eval[i], i + 2); 213 result.insert (buf); 214 } 215 return result; 216 } 217 218 CFList evaluateAtEval (const CanonicalForm& F, const CFList& evaluation, int l) 219 { 220 CFList result; 221 CanonicalForm buf= F; 222 result.insert (buf); 223 int k= evaluation.length() + l - 1; 224 CFListIterator j= evaluation; 225 for (int i= k; j.hasItem() && i > l; i--, j++) 226 { 227 if (F.level() < i) 228 continue; 229 buf= buf (j.getItem(), i); 230 result.insert (buf); 231 } 232 return result; 233 } 234 235 236 CFList recoverFactors (const CanonicalForm& F, const CFList& factors) 237 { 238 CFList result; 239 CanonicalForm tmp, tmp2; 240 CanonicalForm G= F; 241 for (CFListIterator i= factors; i.hasItem(); i++) 242 { 243 tmp= i.getItem()/content (i.getItem(), 1); 244 if (fdivides (tmp, G, tmp2)) 245 { 246 G= tmp2; 247 result.append (tmp); 248 } 249 } 250 return result; 251 } 252 253 CFList recoverFactors (const CanonicalForm& F, const CFList& factors, 254 const CFList& evaluation) 255 { 256 CFList result; 257 CanonicalForm tmp, tmp2; 258 CanonicalForm G= F; 259 for (CFListIterator i= factors; i.hasItem(); i++) 260 { 261 tmp= reverseShift (i.getItem(), evaluation, 2); 262 tmp /= content (tmp, 1); 263 if (fdivides (tmp, G, tmp2)) 264 { 265 G= tmp2; 266 result.append (tmp); 267 } 268 } 269 return result; 270 } 271 272 CFList recoverFactors (CanonicalForm& F, const CFList& factors, int* index) 273 { 274 CFList result; 275 CanonicalForm tmp, tmp2; 276 CanonicalForm G= F; 277 int j= 0; 278 for (CFListIterator i= factors; i.hasItem(); i++, j++) 279 { 280 if (i.getItem().isZero()) 281 { 282 index[j]= 0; 283 continue; 284 } 285 tmp= i.getItem(); 286 if (fdivides (tmp, G, tmp2)) 287 { 288 G= tmp2; 289 tmp /=content (tmp, 1); 290 result.append (tmp); 291 index[j]= 1; 292 } 293 else 294 index[j]= 0; 295 } 296 F= G; 297 return result; 298 } -
factory/facFqFactorizeUtil.h
rc7b56e2 r8336c9 135 135 ); 136 136 137 /// evaluate @a F at @a evaluation 138 /// 139 /// @return @a evaluateAtEval returns a list containing the successive 140 /// evaluations of @a F, last entry is @a F again 141 CFList 142 evaluateAtEval (const CanonicalForm& F, ///<[in] some poly 143 const CFArray& evaluation ///<[in] some evaluation point 144 ); 145 146 /// evaluate @a F at @a evaluation 147 /// 148 /// @return @a evaluateAtEval returns a list containing the successive 149 /// evaluations of @a F starting at level @a l, last entry is @a F again 150 CFList 151 evaluateAtEval (const CanonicalForm& F, ///<[in] some poly 152 const CFList& evaluation,///<[in] some evaluation point 153 int l ///<[in] level to start at 154 ); 155 156 /// evaluate F successively n-2 at 0 157 /// 158 /// @return returns a list of successive evaluations of F, ending with F 159 CFList evaluateAtZero (const CanonicalForm& F ///< [in] some poly 160 ); 161 162 /// divides factors by their content wrt. Variable(1) and checks if these polys 163 /// divide F 164 /// 165 /// @return returns factors of F 166 CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F 167 const CFList& factors ///< [in] some list of 168 ///< factor candidates 169 ); 170 171 /// divides factors shifted by evaluation by their content wrt. Variable(1) and 172 /// checks if these polys divide F 173 /// 174 /// @return returns factors of F 175 CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F 176 const CFList& factors, ///< [in] some list of 177 ///< factor candidates 178 const CFList& evaluation ///< [in] evaluation point 179 ); 180 181 /// checks if factors divide F, if so F is divided by this factor and the factor 182 /// is divided by its content wrt. Variable(1) and the entry in index at the 183 /// position of the factor is set to 1, otherwise the entry in index is set to 0 184 /// 185 /// @return returns factors of F 186 CFList recoverFactors (CanonicalForm& F, ///< [in,out] some poly F 187 const CFList& factors,///< [in] some list of 188 ///< factor candidates 189 int* index ///< [in] position of real factors 190 ); 191 137 192 #endif 138 193 /* FAC_FQ_FACTORIZE_UTIL_H */
Note: See TracChangeset
for help on using the changeset viewer.