Changeset 55608a7 in git
 Timestamp:
 May 19, 2011, 3:44:04 PM (12 years ago)
 Branches:
 (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
 Children:
 20721265ad8d95578883f26318500530eacc7f96
 Parents:
 b4f7ebdb67074ac439d1df267fda83171f69d3b8
 Location:
 factory
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

factory/cf_map_ext.cc
rb4f7eb r55608a7 38 38 39 39 /// helper function 40 static inline41 40 int findItem (const CFList& list, const CanonicalForm& item) 42 41 { … … 51 50 52 51 /// helper function 53 static inline54 52 CanonicalForm getItem (const CFList& list, const int& pos) 55 53 { … … 115 113 if (pos == 0) 116 114 { 117 alpha_power= buf*power (alpha, counter);115 alpha_power= power (alpha, counter); 118 116 dest.append (alpha_power); 119 117 } … … 138 136 CanonicalForm GF2FalphaHelper (const CanonicalForm& F, const Variable& alpha) 139 137 { 138 if (F.isZero()) 139 return 0; 140 140 int exp; 141 141 CanonicalForm result= 0; … … 385 385 386 386 CanonicalForm 387 map (const CanonicalForm& primElem, const Variable& alpha, 388 const CanonicalForm& F, const Variable& beta) 389 { 390 CanonicalForm G= F; 391 int order= 0; 392 while (!G.isOne()) 393 { 394 G /= primElem; 395 order++; 396 } 397 int p= getCharacteristic (); 398 zz_p::init (p); 399 zz_pX NTL_mipo= convertFacCF2NTLzzpX (getMipo (beta)); 400 zz_pE::init (NTL_mipo); 401 zz_pEX NTL_alpha_mipo= convertFacCF2NTLzz_pEX (getMipo(alpha), NTL_mipo); 402 zz_pE NTLBeta= to_zz_pE (convertFacCF2NTLzzpX (beta)); 403 vec_zz_pE roots= FindRoots (NTL_alpha_mipo); 404 long ind; 405 for (long i= 0; i < roots.length(); i++) 406 { 407 if (power (roots [i], order)== NTLBeta) 408 { 409 ind= i; 410 break; 411 } 412 } 413 return (convertNTLzzpE2CF (roots[ind], beta)); 414 } 415 416 CanonicalForm 387 417 findMinPoly (const CanonicalForm& F, const Variable& alpha) 388 418 { 
factory/cf_map_ext.h
rb4f7eb r55608a7 20 20 21 21 #include <config.h> 22 23 int findItem (const CFList& list, const CanonicalForm& item); 24 25 CanonicalForm getItem (const CFList& list, const int& pos); 22 26 23 27 CanonicalForm GFMapUp (const CanonicalForm & F, int k); … … 46 50 CanonicalForm Falpha2GFRep (const CanonicalForm& F); 47 51 48 #ifdef HAVE_NTL 52 /// map from \f$ F_p(\alpha) \f$ to \f$ F_p(\beta) \f$ such that 53 /// \f$ F\in\F_p(\alpha) \f$ is mapped onto \f$ \beta \f$ 54 /// 55 /// @return @a map returns the image of @a primElem such that the above 56 /// described properties hold 57 CanonicalForm 58 map (const CanonicalForm& primElem,///< [in] primitive element of 59 ///< \f$ F_p (\alpha) \f$ 60 const Variable& alpha, ///< [in] algebraic variable 61 const CanonicalForm& F, ///< [in] an element of \f$ F_p (\alpha) \f$, 62 ///< whose minimal polynomial defines a field 63 ///< extension of \f$ F_p \f$ of degree 64 ///< \f$ \[F_p (\alpha):F_p\] \f$ 65 const Variable& beta ///< [in] algebraic variable, root of \a F's 66 ///< minimal polynomial 67 ); 68 49 69 /// compute minimal polynomial of \f$ F\in\F_p(\alpha)\backslash\F_p \f$ via NTL 50 70 /// … … 55 75 const Variable& alpha ///< [in] algebraic variable 56 76 ); 77 57 78 #endif 58 #endif
Note: See TracChangeset
for help on using the changeset viewer.