Changeset 35eb6c in git
- Timestamp:
- Jun 20, 2011, 11:06:11 AM (12 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- fe2d4cb34f289f4b0611d2b5ac416c7bc1b2c60a
- Parents:
- 37cf8fb52819b7a47cb628349e0830bf986d039a
- Location:
- factory
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cfModResultant.cc
r37cf8f r35eb6c 242 242 return 0; 243 243 244 zz_pBak bak; 245 bak.save(); 244 246 zz_p::init (getCharacteristic()); 245 247 zz_pX NTLF= convertFacCF2NTLzzpX (F); … … 248 250 zz_p NTLResult= resultant (NTLF, NTLG); 249 251 252 bak.restore(); 250 253 return CanonicalForm (to_long (rep (NTLResult))); 251 254 #else -
factory/facAlgExt.cc
r37cf8f r35eb6c 29 29 #include "facFqBivarUtil.h" 30 30 #include "facAlgExt.h" 31 #include "cfModResultant.h" 31 32 32 33 // squarefree part of F 33 34 CanonicalForm 34 sqrfPart (const CanonicalForm& F)35 uniSqrfPart (const CanonicalForm& F) 35 36 { 36 37 ASSERT (F.isUnivariate(), "univariate input expected"); … … 50 51 mipo= mipo (x, alpha); 51 52 52 CanonicalForm norm= resultant (g, mipo, x); 53 int degg= degree (g); 54 int degmipo= degree (mipo); 55 CanonicalForm norm; 56 if (degg >= 8 || degmipo >= 8) 57 norm= resultantZ (g, mipo, x); 58 else 59 norm= resultant (g, mipo, x); 60 53 61 i= 0; 54 62 int k; … … 64 72 { 65 73 g= F (y - i*alpha, y); 66 norm= resultant (g (x, alpha), mipo, x); 74 if (degg >= 8 || degmipo >= 8) 75 norm= resultantZ (g (x, alpha), mipo, x); 76 else 77 norm= resultant (g (x, alpha), mipo, x); 67 78 } 68 79 else 69 80 { 70 81 g= F (y + i*alpha, y); 71 norm= resultant (g (x, alpha), mipo, x); 82 if (degg >= 8 || degmipo >= 8) 83 norm= resultantZ (g (x, alpha), mipo, x); 84 else 85 norm= resultant (g (x, alpha), mipo, x); 72 86 } 73 87 if (degree (gcd (deriv (norm, y), norm)) <= 0) … … 89 103 ASSERT (getCharacteristic() == 0, "characteristic 0 expected"); 90 104 91 On (SW_RATIONAL); 92 CanonicalForm f= F; 105 if (!isOn (SW_RATIONAL)) 106 On (SW_RATIONAL); 107 CanonicalForm f= F*bCommonDen (F); 93 108 int shift; 94 109 CanonicalForm norm= sqrfNorm (f, alpha, shift); … … 97 112 CFList factors; 98 113 if (normFactors.length() <= 2) 99 return CFList ( f);114 return CFList (F); 100 115 101 116 normFactors.removeFirst(); … … 116 131 } 117 132 ASSERT (degree (buf) <= 0, "incomplete factorization"); 118 Off (SW_RATIONAL);119 133 return factors; 120 134 } … … 126 140 ASSERT (getCharacteristic() == 0, "characteristic 0 expected"); 127 141 142 128 143 if (F.inCoeffDomain()) 129 144 return CFFList (CFFactor (F, 1)); 130 145 131 CanonicalForm sqrf= sqrfPart (F);146 CanonicalForm sqrf= uniSqrfPart (F); 132 147 CFList sqrfFactors= AlgExtSqrfFactorize (sqrf, alpha); 133 148 134 On (SW_RATIONAL); 149 if (!isOn (SW_RATIONAL)) 150 On (SW_RATIONAL); 135 151 CanonicalForm buf= F/Lc (F); 136 152 CFFList factors; … … 147 163 factors.append (CFFactor (i.getItem(), multi)); 148 164 } 149 Off (SW_RATIONAL);150 165 factors.insert (CFFactor (Lc(F), 1)); 151 166 ASSERT (degree (buf) <= 0, "bug in AlgExtFactorize"); -
factory/facAlgExt.h
r37cf8f r35eb6c 1 // -*- c++ -*- 2 //***************************************************************************** 1 /*****************************************************************************\ 2 * Computer Algebra System SINGULAR 3 \*****************************************************************************/ 3 4 /** @file facAlgExt.h 4 5 *
Note: See TracChangeset
for help on using the changeset viewer.