Changeset 9899df in git
- Timestamp:
- Nov 11, 2010, 5:26:41 PM (13 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 8b2ef529c04c7b3517f5001ff6c69e582bb9fd09
- Parents:
- c73520d5d0c7a156ce1ef3256417b5157e57cc61
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/fac_cantzass.cc
rc73520d r9899df 62 62 n = getMipo( alpha ).degree() * getMipo( beta ).degree(); 63 63 mpz_init( &qq ); 64 mpz_ mypow_ui( &qq, q, n );64 mpz_ui_pow_ui ( &qq, q, n ); 65 65 } 66 66 if ( LC( f ).isOne() ) … … 235 235 236 236 mpz_init( &m ); 237 mpz_ mypow_ui( &m, p, s );237 mpz_ui_pow_ui ( &m, p, s ); 238 238 while ( mpz_cmp_si( &m, 0 ) != 0 ) 239 239 { … … 257 257 258 258 mpz_init( &m ); 259 mpz_ mypow_ui( &m, p, s );259 mpz_ui_pow_ui ( &m, p, s ); 260 260 mpz_sub_ui( &m, &m, 1 ); 261 261 mpz_fdiv_q_ui( &m, &m, 2 ); … … 281 281 282 282 mpz_init( &m ); 283 mpz_ mypow( &m, q, s );283 mpz_pow_ui( &m, q, s ); 284 284 mpz_sub_ui( &m, &m, 1 ); 285 285 mpz_fdiv_q_ui( &m, &m, 2 ); -
factory/gmpext.h
rc73520d r9899df 20 20 } 21 21 22 inline void23 mpz_mypow_ui( MP_INT * result, int p, int n )24 {25 if ( p == 0 )26 mpz_set_ui( result, 0 );27 else if ( n == 0 )28 mpz_set_ui( result, 1 );29 else {30 mpz_set_ui( result, p );31 n--;32 while ( n > 0 ) {33 mpz_mul_ui( result, result, p );34 n--;35 }36 }37 }38 39 inline void40 mpz_mypow( MP_INT * result, MP_INT * p, int n )41 {42 // p == 0 && n == 0 should not happen since this function is only used43 // in the factorizing algorithm44 mpz_set( result, p );45 n--;46 while ( n > 0 ) {47 mpz_mul( result, result, p );48 n--;49 }50 }51 52 22 #endif /* ! INCL_GMPEXT_H */
Note: See TracChangeset
for help on using the changeset viewer.