Changeset 8c1a84 in git
- Timestamp:
- Jun 21, 2011, 9:33:39 AM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 50a2aa95106a901b7b3b189d3724a19e186db0f7
- Parents:
- 2d0f7d3bc1abfb71f9873d236dbbea3cf7a7860f
- Location:
- factory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqBivar.cc
r2d0f7d3 r8c1a84 8 8 * Algebra, Chapter 15" by J. von zur Gathen & J. Gerhard and "Factoring 9 9 * multivariate polynomials over a finite field" by L. Bernardin. 10 * Factor Recombination is described in "Factoring polynomials over global 11 * fields" by K. Belabas, M. van Hoeij, J. Klueners, A. Steel 10 12 * 11 * ABSTRACT: In contrast to biFactorizer() in facFqFactorice.cc we evaluate and12 * factorize the polynomial in both variables. So far factor recombination is13 * done naive!14 13 * 15 14 * @author Martin Lee -
factory/facFqBivar.h
r2d0f7d3 r8c1a84 6 6 * This file provides functions for factorizing a bivariate polynomial over 7 7 * \f$ F_{p} \f$ , \f$ F_{p}(\alpha ) \f$ or GF. 8 *9 * ABSTRACT: In contrast to biFactorizer() in facFqFactorice.cc we evaluate and10 * factorize the polynomial in both variables. So far factor recombination is11 * done naive!12 8 * 13 9 * @author Martin Lee -
factory/facFqFactorize.cc
r2d0f7d3 r8c1a84 8 8 * 9 9 * ABSTRACT: "Efficient Multivariate Factorization over Finite Fields" by 10 * L. Bernardin & M. Monagon. 10 * L. Bernardin & M. Monagon. Precomputation of leading coefficients is 11 * described in "Sparse Hensel lifting" by E. Kaltofen 11 12 * 12 13 * @author Martin Lee … … 117 118 } 118 119 119 static inline120 120 CanonicalForm myCompress (const CanonicalForm& F, CFMap& N) 121 121 { … … 865 865 } 866 866 867 static inline868 867 CanonicalForm lcmContent (const CanonicalForm& A, CFList& contentAi) 869 868 { … … 1217 1216 CFList 1218 1217 distributeContent (const CFList& L, const CFList* differentSecondVarFactors, 1219 int length , const CFList& factors1218 int length 1220 1219 ) 1221 1220 { … … 1289 1288 } 1290 1289 1291 static inline1292 1290 CFList evaluateAtZero (const CanonicalForm& F) 1293 1291 { … … 1606 1604 result.insert (N (F)); 1607 1605 1608 result= distributeContent (result, differentSecondVarLCs, length , bufFactors);1606 result= distributeContent (result, differentSecondVarLCs, length); 1609 1607 1610 1608 if (!result.getFirst().inCoeffDomain()) -
factory/facFqFactorize.h
r2d0f7d3 r8c1a84 6 6 * This file provides functions for factorizing a multivariate polynomial over 7 7 * \f$ F_{p} \f$ , \f$ F_{p}(\alpha ) \f$ or GF. 8 *9 * ABSTRACT: So far factor recombination is done naive!10 8 * 11 9 * @author Martin Lee … … 233 231 } 234 232 235 /// naive factor recombination for bivariate factorization.236 /// Uses precomputed data to exclude combinations that are not possible.237 ///238 /// @return @a monicFactorRecombi returns a list of factors of F, that are239 /// monic wrt Variable (1).240 /// @sa extFactorRecombination(), factorRecombination(), biFactorizer()241 CFList242 monicFactorRecombi (243 const CFList& factors, ///< [in] list of lifted factors244 ///< that are monic wrt Variable (1)245 const CanonicalForm& F, ///< [in] bivariate poly246 const CanonicalForm& M, ///< [in] Variable (2)^liftBound247 const DegreePattern& degs ///< [in] degree pattern248 );249 250 /// detects factors of @a F at stage @a deg of Hensel lifting.251 /// No combinations of more than one factor are tested. Lift bound and possible252 /// degree pattern are updated.253 ///254 /// @return @a earlyMonicFactorDetect returns a list of factors of F (possibly255 /// incomplete) that are monic wrt Variable (1)256 /// @sa monicFactorRecombi(), earlyFactorDetection(), monicFactorDetect(),257 /// biFactorizer()258 CFList259 earlyMonicFactorDetect (260 CanonicalForm& F, ///< [in,out] poly to be factored, returns261 ///< poly divided by detected factors in case262 ///< of success263 CFList& factors, ///< [in,out] list of factors lifted up to264 ///< @a deg, returns a list of factors265 ///< without detected factors266 int& adaptedLiftBound, ///< [in,out] adapted lift bound267 DegreePattern& degs, ///< [in,out] degree pattern, is updated268 ///< whenever we find a factor269 bool& success, ///< [in,out] indicating success270 int deg, ///< [in] stage of Hensel lifting271 const int bound ///< [in] degree (A, 2) + 1 +272 ///< degree (LC (A, 1), 2), where A is the273 ///< multivariate polynomial corresponding to274 ///< F.275 );276 277 /// Bivariate factorization. In contrast to biFactorize() the factors returned278 /// are monic wrt Variable (1), if @a F is not irreducible. And no factorization279 /// wrt Variable (2) are performed. However,280 ///281 /// @return @a biFactorizer returns a list of factors that are monic wrt282 /// Variable (1), if @a F is irreducible @a F is returned283 /// @sa multiFactorize(), biFactorize()284 CFList biFactorizer (const CanonicalForm& F, ///< [in] a bivariate poly285 const Variable& alpha, ///< [in] algebraic variable286 CanonicalForm& bivarEval, ///< [in,out] a valid evaluation287 ///< point288 int& liftBound ///< [in,out] lift bound, may be289 ///< adapted during Hensel290 ///< lifting291 );292 293 233 /// Naive factor recombination for multivariate factorization over an extension 294 234 /// of the initial field. No precomputed is used to exclude combinations. … … 407 347 /// evaluation point search for multivariate factorization, 408 348 /// looks for a (F.level() - 1)-tuple such that the resulting univariate 409 /// polynomial has main variable F.mvar(), is squarefree and its degree349 /// polynomial has main variable Variable (1), is squarefree and its degree 410 350 /// coincides with degree(F) and the bivariate one is primitive wrt. 411 /// Variable(1), fails if there are no valid evaluation points, eval contains 412 /// the intermediate evaluated polynomials. 351 /// Variable(1), and successively evaluated polynomials have the same degree in 352 /// their main variable as F has, fails if there are no valid evaluation points, 353 /// eval contains the intermediate evaluated polynomials. 413 354 /// 414 355 /// @return @a evalPoints returns an evaluation point, which is valid if and … … 460 401 ); 461 402 403 /// compute the LCM of the contents of @a A wrt to each variable occuring in @a 404 /// A. 405 /// 406 /// @return @a lcmContent returns the LCM of the contents of @a A wrt to each 407 /// variable occuring in @a A. 408 CanonicalForm 409 lcmContent (const CanonicalForm& A, ///< [in] a compressed multivariate poly 410 CFList& contentAi ///< [in,out] an empty list, returns a list 411 ///< of the contents of @a A wrt to each 412 ///< variable occuring in @a A starting from 413 ///< @a A.mvar(). 414 ); 415 416 /// compress a polynomial s.t. \f$ deg_{x_{i}} (F) >= deg_{x_{i+1}} (F) \f$ and 417 /// no gaps between the variables occur 418 /// 419 /// @return a compressed poly with the above properties 420 CanonicalForm myCompress (const CanonicalForm& F, ///< [in] a poly 421 CFMap& N ///< [in,out] a map to 422 ///< decompress 423 ); 424 425 /// evaluate a poly A with main variable at level 1 at an evaluation point in 426 /// K^(n-1) wrt different second variables. If this evaluation is valid (see 427 /// evalPoints) then Aeval contains A successively evaluated at this point, 428 /// otherwise this entry is empty 429 void 430 evaluationWRTDifferentSecondVars ( 431 CFList*& Aeval, ///<[in,out] an array of length n-2 432 ///< if variable at level i > 2 433 ///< admits a valid evaluation 434 ///< this entry contains A 435 ///< successively evaluated at this 436 ///< point otherwise an empty list 437 const CFList& evaluation,///<[in] a valid evaluation point 438 ///< for main variable at level 1 439 ///< and second variable at level 2 440 const CanonicalForm& A ///<[in] some poly 441 ); 442 443 /// evaluate F successively n-2 at 0 444 /// 445 /// @return returns a list of successive evaluations of F, ending with F 446 CFList evaluateAtZero (const CanonicalForm& F ///< [in] some poly 447 ); 448 449 /// divides factors by their content wrt. Variable(1) and checks if these polys 450 /// divide F 451 /// 452 /// @return returns factors of F 453 CFList recoverFactors (const CanonicalForm& F, ///< [in] some poly F 454 const CFList& factors ///< [in] some list of 455 ///< factor candidates 456 ); 457 458 /// refine a bivariate factorization of A with l factors to one with 459 /// minFactorsLength 460 void 461 refineBiFactors (const CanonicalForm& A, ///< [in] some poly 462 CFList& biFactors, ///< [in,out] list of bivariate to be 463 ///< refined, returns refined factors 464 CFList* const& factors, ///< [in] list of bivariate 465 ///< factorizations of A wrt different 466 ///< second variables 467 const CFList& evaluation,///< [in] the evaluation point 468 int minFactorsLength ///< [in] the minimal number of factors 469 ); 470 471 /// plug in evalPoint for y in a list of polys 472 /// 473 /// @return returns a list of the evaluated polys, these evaluated polys are 474 /// made monic 475 CFList 476 buildUniFactors (const CFList& biFactors, ///< [in] a list of polys 477 const CanonicalForm& evalPoint,///< [in] some evaluation point 478 const Variable& y ///< [in] some variable 479 ); 480 481 /// extract leading coefficients wrt Variable(1) from bivariate factors obtained 482 /// from factorizations of A wrt different second variables 483 void 484 getLeadingCoeffs (const CanonicalForm& A, ///< [in] some poly 485 CFList*& Aeval, ///< [in,out] array of bivariate 486 ///< factors, returns the leading 487 ///< coefficients of these factors 488 const CFList& uniFactors,///< [in] univariate factors of A 489 const CFList& evaluation ///< [in] evaluation point 490 ); 491 492 /// normalize precomputed leading coefficients such that leading coefficients 493 /// evaluated at 0 in K^(n-2) equal the leading coeffs wrt Variable(1) of 494 /// bivariate factors 495 void 496 prepareLeadingCoeffs (CFList*& LCs, ///<[in,out] 497 int n, ///<[in] level of poly to be 498 ///< factored 499 const CFList& leadingCoeffs,///<[in] precomputed leading 500 ///< coeffs 501 const CFList& biFactors ///<[in] bivariate factors 502 ); 503 504 /// obtain factors of F by reconstructing their leading coeffs 505 /// 506 /// @return returns the reconstructed factors 507 /// @sa factorRecombination() 508 CFList 509 leadingCoeffReconstruction (const CanonicalForm& F,///<[in] poly to be factored 510 const CFList& factors, ///<[in] factors of f monic 511 ///< wrt Variable (1) 512 const CFList& M ///<[in] a list of powers of 513 ///< Variables 514 ); 515 516 /// distribute content 517 /// 518 /// @return returns a list result of polys such that prod (result)= prod (L) 519 /// but the first entry of L may be (partially) factorized and these factors 520 /// are distributed onto other entries in L 521 CFList 522 distributeContent ( 523 const CFList& L, ///<[in] list of polys, first 524 ///< entry the content to be 525 ///< distributed 526 const CFList* differentSecondVarFactors,///<[in] factorization wrt 527 ///< different second vars 528 int length ///<[in] length of 529 ///<differentSecondVarFactors 530 ); 531 532 /// gcd free basis of two lists of factors 533 void 534 gcdFreeBasis (CFFList& factors1, ///< [in,out] list of factors, returns gcd free 535 ///< factors 536 CFFList& factors2 ///< [in,out] list of factors, returns gcd free 537 ///< factors 538 ); 539 462 540 #endif 463 541 /* FAC_FQ_FACTORIZE_H */
Note: See TracChangeset
for help on using the changeset viewer.