| 231 | |
| 232 | |
| 233 | static bool |
| 234 | liftStep ( CFArray & P, int k, int r, int t, const modpk & b, const Evaluation & A, const CFArray & lcG, const CanonicalForm & Uk, int * n, int h ) |
| 235 | { |
| 236 | DEBINCLEVEL( cerr, "liftStep" ); |
| 237 | CFArray K( 1, r ), Q( 1, r ), Q0( 1, r ), P0( 1, r ), S( 1, r ), T( 1, r ), alpha( 1, r ); |
| 238 | CanonicalForm Rm, C, D, xa = Variable(k) - A[k]; |
| 239 | CanonicalForm xa1 = xa, xa2 = xa*xa; |
| 240 | CanonicalForm dummy; |
| 241 | int i, m; |
| 242 | |
| 243 | DEBOUTLN( cerr, "we are now performing the liftstep to reach " << Variable(k) ); |
| 244 | DEBOUTLN( cerr, "the factors so far are " << P ); |
| 245 | DEBOUTLN( cerr, "modulus p^k= " << b.getpk() << "=" << b.getp() <<"^"<< b.getk() ); |
| 246 | |
| 247 | for ( i = 1; i <= r; i++ ) |
| 248 | { |
| 249 | Variable vm = Variable( t + 1 ); |
| 250 | Variable v1 = Variable(1); |
| 251 | K[i] = swapvar( replaceLc( swapvar( P[i], v1, vm ), swapvar( A( lcG[i], k+1, t ), v1, vm ) ), v1, vm ); |
| 252 | P[i] = A( K[i], k, t ); |
| 253 | } |
| 254 | DEBOUTLN( cerr, "lift K = " << K ); |
| 255 | |
| 256 | // d = degree( Uk, Variable( k ) ); |
| 257 | |
| 258 | TIMING_START(fac_extgcd); |
| 259 | Q[r] = 1; |
| 260 | for ( i = r; i > 1; i-- ) |
| 261 | { |
| 262 | Q[i-1] = Q[i] * P[i]; |
| 263 | P0[i] = A( P[i], 2, k-1 ); |
| 264 | Q0[i] = A( Q[i], 2, k-1 ); |
| 265 | extgcd( P0[i], Q0[i], S[i], T[i], b ); |
| 266 | } |
| 267 | P0[1] = A( P[1], 2, k-1 ); |
| 268 | Q0[1] = A( Q[1], 2, k-1 ); |
| 269 | extgcd( P0[1], Q0[1], S[1], T[1], b ); |
| 270 | TIMING_END(fac_extgcd); |
| 271 | |
| 272 | for ( m = 1; m <= n[k]+1; m++ ) |
| 273 | { |
| 274 | TIMING_START(fac_modpk); |
| 275 | Rm = modDeltak( prod( K ) - Uk, A, k, n ); |
| 276 | TIMING_END(fac_modpk); |
| 277 | #ifdef DEBUGOUTPUT |
| 278 | if ( mod( Rm, xa1 ) != 0 ) |
| 279 | { |
| 280 | DEBOUTLN( cerr, "something seems not to be ok with Rm which is " << Rm ); |
| 281 | DEBOUTLN( cerr, "and should reduce to zero modulo " << xa1 ); |
| 282 | } |
| 283 | #endif |
| 284 | if ( mod( Rm, xa2 ) != 0 ) |
| 285 | { |
| 286 | C = derivAndEval( Rm, m, Variable( k ), A[k] ); |
| 287 | D = 1; |
| 288 | for ( i = 2; i <= m; i++ ) D *= i; |
| 289 | C /= D; |
| 290 |
no test coverage detected