Changeset a60b8b in git for factory/facFqBivar.h
 Timestamp:
 Jan 9, 2013, 5:43:20 PM (10 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
 Children:
 ce41efa65fbc644059a89e4c50fddaa477d9877d
 Parents:
 bbcc98f3a145ea12750c79cdc791d485911ab3e3
 gitauthor:
 Martin Lee <martinlee84@web.de>20130109 17:43:20+01:00
 gitcommitter:
 Martin Lee <martinlee84@web.de>20130218 15:03:49+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/facFqBivar.h
rbbcc98 ra60b8b 49 49 ); 50 50 51 /// factorize a squarefree bivariate polynomial over \f$ F_{p} \f$. 52 /// 53 /// @return @a FpBiSqrfFactorize returns a list of monic factors, the first 54 /// element is the leading coefficient. 55 /// @sa FqBiSqrfFactorize(), GFBiSqrfFactorize() 56 inline 57 CFList FpBiSqrfFactorize (const CanonicalForm & G ///< [in] a bivariate poly 58 ) 51 inline CFList 52 biSqrfFactorizeHelper (const CanonicalForm& G, ExtensionInfo& info) 59 53 { 60 ExtensionInfo info= ExtensionInfo (false);61 54 CFMap N; 62 55 CanonicalForm F= compress (G, N); … … 65 58 F /= (contentX*contentY); 66 59 CFFList contentXFactors, contentYFactors; 67 contentXFactors= factorize (contentX); 68 contentYFactors= factorize (contentY); 60 if (info.getAlpha().level() != 1) 61 { 62 contentXFactors= factorize (contentX, info.getAlpha()); 63 contentYFactors= factorize (contentY, info.getAlpha()); 64 } 65 else if (info.getAlpha().level() == 1 && info.getGFDegree() == 1) 66 { 67 contentXFactors= factorize (contentX); 68 contentYFactors= factorize (contentY); 69 } 70 else if (info.getAlpha().level() == 1 && info.getGFDegree() != 1) 71 { 72 CFList bufContentX, bufContentY; 73 bufContentX= biFactorize (contentX, info); 74 bufContentY= biFactorize (contentY, info); 75 for (CFListIterator iter= bufContentX; iter.hasItem(); iter++) 76 contentXFactors.append (CFFactor (iter.getItem(), 1)); 77 for (CFListIterator iter= bufContentY; iter.hasItem(); iter++) 78 contentYFactors.append (CFFactor (iter.getItem(), 1)); 79 } 80 69 81 if (contentXFactors.getFirst().factor().inCoeffDomain()) 70 82 contentXFactors.removeFirst(); … … 97 109 } 98 110 111 /// factorize a squarefree bivariate polynomial over \f$ F_{p} \f$. 112 /// 113 /// @return @a FpBiSqrfFactorize returns a list of monic factors, the first 114 /// element is the leading coefficient. 115 /// @sa FqBiSqrfFactorize(), GFBiSqrfFactorize() 116 inline 117 CFList FpBiSqrfFactorize (const CanonicalForm & G ///< [in] a bivariate poly 118 ) 119 { 120 ExtensionInfo info= ExtensionInfo (false); 121 return biSqrfFactorizeHelper (G, info); 122 } 123 99 124 /// factorize a squarefree bivariate polynomial over \f$ F_{p}(\alpha ) \f$. 100 125 /// … … 108 133 { 109 134 ExtensionInfo info= ExtensionInfo (alpha, false); 110 CFMap N; 111 CanonicalForm F= compress (G, N); 112 CanonicalForm contentX= content (F, 1); 113 CanonicalForm contentY= content (F, 2); 114 F /= (contentX*contentY); 115 CFFList contentXFactors, contentYFactors; 116 contentXFactors= factorize (contentX, alpha); 117 contentYFactors= factorize (contentY, alpha); 118 if (contentXFactors.getFirst().factor().inCoeffDomain()) 119 contentXFactors.removeFirst(); 120 if (contentYFactors.getFirst().factor().inCoeffDomain()) 121 contentYFactors.removeFirst(); 122 if (F.inCoeffDomain()) 123 { 124 CFList result; 125 for (CFFListIterator i= contentXFactors; i.hasItem(); i++) 126 result.append (N (i.getItem().factor())); 127 for (CFFListIterator i= contentYFactors; i.hasItem(); i++) 128 result.append (N (i.getItem().factor())); 129 normalize (result); 130 result.insert (Lc (G)); 131 return result; 132 } 133 mat_ZZ M; 134 vec_ZZ S; 135 F= compress (F, M, S); 136 CFList result= biFactorize (F, info); 137 for (CFListIterator i= result; i.hasItem(); i++) 138 i.getItem()= N (decompress (i.getItem(), M, S)); 139 for (CFFListIterator i= contentXFactors; i.hasItem(); i++) 140 result.append (N(i.getItem().factor())); 141 for (CFFListIterator i= contentYFactors; i.hasItem(); i++) 142 result.append (N (i.getItem().factor())); 143 normalize (result); 144 result.insert (Lc(G)); 145 return result; 135 return biSqrfFactorizeHelper (G, info); 146 136 } 147 137 … … 158 148 "GF as base field expected"); 159 149 ExtensionInfo info= ExtensionInfo (getGFDegree(), gf_name, false); 160 CFMap N; 161 CanonicalForm F= compress (G, N); 162 CanonicalForm contentX= content (F, 1); 163 CanonicalForm contentY= content (F, 2); 164 F /= (contentX*contentY); 165 CFList contentXFactors, contentYFactors; 166 contentXFactors= biFactorize (contentX, info); 167 contentYFactors= biFactorize (contentY, info); 168 if (contentXFactors.getFirst().inCoeffDomain()) 169 contentXFactors.removeFirst(); 170 if (contentYFactors.getFirst().inCoeffDomain()) 171 contentYFactors.removeFirst(); 172 if (F.inCoeffDomain()) 173 { 174 CFList result; 175 for (CFListIterator i= contentXFactors; i.hasItem(); i++) 176 result.append (N (i.getItem())); 177 for (CFListIterator i= contentYFactors; i.hasItem(); i++) 178 result.append (N (i.getItem())); 179 normalize (result); 180 result.insert (Lc (G)); 181 return result; 182 } 183 mat_ZZ M; 184 vec_ZZ S; 185 F= compress (F, M, S); 186 CFList result= biFactorize (F, info); 187 for (CFListIterator i= result; i.hasItem(); i++) 188 i.getItem()= N (decompress (i.getItem(), M, S)); 189 for (CFListIterator i= contentXFactors; i.hasItem(); i++) 190 result.append (N(i.getItem())); 191 for (CFListIterator i= contentYFactors; i.hasItem(); i++) 192 result.append (N (i.getItem())); 193 normalize (result); 194 result.insert (Lc(G)); 195 return result; 150 return biSqrfFactorizeHelper (G, info); 196 151 } 197 152
Note: See TracChangeset
for help on using the changeset viewer.