Changeset cacfb6 in git
 Timestamp:
 Apr 9, 2010, 10:11:55 AM (13 years ago)
 Branches:
 (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
 Children:
 8fc10886f09496df82af0116fe80edeeaeeaadc8
 Parents:
 f91fddc43db014d7355e8386a068d0a3772d2dcd
 Location:
 factory
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

factory/fac_cantzass.cc
rf91fddc rcacfb6 236 236 mpz_init( &m ); 237 237 mpz_mypow_ui( &m, p, s ); 238 while ( mpz_cmp_si( &m, 0 ) != 0 ) { 239 odd = mpz_mdivmod_ui( &m, 0, &m, 2 ); 238 while ( mpz_cmp_si( &m, 0 ) != 0 ) 239 { 240 odd = mpz_fdiv_q_ui( &m, &m, 2 ); 240 241 if ( odd != 0 ) 241 242 prod = (prod * b) % d; … … 258 259 mpz_mypow_ui( &m, p, s ); 259 260 mpz_sub_ui( &m, &m, 1 ); 260 mpz_div_ui( &m, &m, 2 ); 261 while ( mpz_cmp_si( &m, 0 ) != 0 ) { 262 odd = mpz_mdivmod_ui( &m, 0, &m, 2 ); 261 mpz_fdiv_q_ui( &m, &m, 2 ); 262 while ( mpz_cmp_si( &m, 0 ) != 0 ) 263 { 264 odd = mpz_fdiv_q_ui( &m, &m, 2 ); 263 265 if ( odd != 0 ) 264 266 prod = (prod * b) % d; … … 281 283 mpz_mypow( &m, q, s ); 282 284 mpz_sub_ui( &m, &m, 1 ); 283 mpz_div_ui( &m, &m, 2 ); 284 while ( mpz_cmp_si( &m, 0 ) != 0 ) { 285 odd = mpz_mdivmod_ui( &m, 0, &m, 2 ); 285 mpz_fdiv_q_ui( &m, &m, 2 ); 286 while ( mpz_cmp_si( &m, 0 ) != 0 ) 287 { 288 odd = mpz_fdiv_q_ui( &m, &m, 2 ); 286 289 if ( odd != 0 ) 287 290 prod = (prod * b) % d; 
factory/int_int.cc
rf91fddc rcacfb6 521 521 int InternalInteger::intmod( int p ) const 522 522 { 523 return (int)mpz_ mmod_ui( 0,&thempi, (unsigned long)p );523 return (int)mpz_fdiv_ui( &thempi, (unsigned long)p ); 524 524 } 525 525 
factory/int_pp.cc
rf91fddc rcacfb6 91 91 mpz_set_si( &primepow, p ); 92 92 mpz_pow_ui( &primepow, &primepow, (unsigned int)k ); 93 mpz_ div_ui( &primepowhalf, &primepow, 2 );93 mpz_fdiv_q_ui( &primepowhalf, &primepow, 2 ); 94 94 prime = p; 95 95 exp = k; … … 404 404 InternalPrimePower::intmod( int p ) const 405 405 { 406 return (int)mpz_ mmod_ui( 0,&thempi, (unsigned long)p );406 return (int)mpz_fdiv_ui( &thempi, (unsigned long)p ); 407 407 } 408 408 
factory/int_rat.cc
rf91fddc rcacfb6 210 210 MP_INT tmp2; 211 211 mpz_init( &tmp1 ); 212 mpz_ div( &tmp1, &_den, &g );212 mpz_fdiv_q( &tmp1, &_den, &g ); 213 213 mpz_init( &tmp2 ); 214 mpz_ div( &tmp2, &MPQDEN( c ), &g );214 mpz_fdiv_q( &tmp2, &MPQDEN( c ), &g ); 215 215 mpz_mul( &d, &tmp2, &_den ); 216 216 mpz_mul( &tmp2, &tmp2, &_num ); … … 220 220 if ( mpz_cmp_si( &g, 1 ) != 0 ) 221 221 { 222 mpz_ div( &n, &n, &g );223 mpz_ div( &d, &d, &g );222 mpz_fdiv_q( &n, &n, &g ); 223 mpz_fdiv_q( &d, &d, &g ); 224 224 } 225 225 mpz_clear( &tmp1 ); … … 266 266 MP_INT tmp2; 267 267 mpz_init( &tmp1 ); 268 mpz_ div( &tmp1, &_den, &g );268 mpz_fdiv_q( &tmp1, &_den, &g ); 269 269 mpz_init( &tmp2 ); 270 mpz_ div( &tmp2, &MPQDEN( c ), &g );270 mpz_fdiv_q( &tmp2, &MPQDEN( c ), &g ); 271 271 mpz_mul( &d, &tmp2, &_den ); 272 272 mpz_mul( &tmp2, &tmp2, &_num ); … … 276 276 if ( mpz_cmp_si( &g, 1 ) != 0 ) 277 277 { 278 mpz_ div( &n, &n, &g );279 mpz_ div( &d, &d, &g );278 mpz_fdiv_q( &n, &n, &g ); 279 mpz_fdiv_q( &d, &d, &g ); 280 280 } 281 281 mpz_clear( &tmp1 ); … … 324 324 mpz_init( &tmp1 ); mpz_init( &tmp2 ); 325 325 if ( ! g1is1 ) 326 mpz_ div( &tmp1, &_num, &g1 );326 mpz_fdiv_q( &tmp1, &_num, &g1 ); 327 327 else 328 328 mpz_set( &tmp1, &_num ); 329 329 if ( ! g2is1 ) 330 mpz_ div( &tmp2, &MPQNUM( c ), &g2 );330 mpz_fdiv_q( &tmp2, &MPQNUM( c ), &g2 ); 331 331 else 332 332 mpz_set( &tmp2, &MPQNUM( c ) ); 333 333 mpz_mul( &n, &tmp1, &tmp2 ); 334 334 if ( ! g1is1 ) 335 mpz_ div( &tmp1, &MPQDEN( c ), &g1 );335 mpz_fdiv_q( &tmp1, &MPQDEN( c ), &g1 ); 336 336 else 337 337 mpz_set( &tmp1, &MPQDEN( c ) ); 338 338 if ( ! g2is1 ) 339 mpz_ div( &tmp2, &_den, &g2 );339 mpz_fdiv_q( &tmp2, &_den, &g2 ); 340 340 else 341 341 mpz_set( &tmp2, &_den ); … … 384 384 mpz_init( &tmp1 ); mpz_init( &tmp2 ); 385 385 if ( ! g1is1 ) 386 mpz_ div( &tmp1, &_num, &g1 );386 mpz_fdiv_q( &tmp1, &_num, &g1 ); 387 387 else 388 388 mpz_set( &tmp1, &_num ); 389 389 if ( ! g2is1 ) 390 mpz_ div( &tmp2, &MPQDEN( c ), &g2 );390 mpz_fdiv_q( &tmp2, &MPQDEN( c ), &g2 ); 391 391 else 392 392 mpz_set( &tmp2, &MPQDEN( c ) ); 393 393 mpz_mul( &n, &tmp1, &tmp2 ); 394 394 if ( ! g1is1 ) 395 mpz_ div( &tmp1, &MPQNUM( c ), &g1 );395 mpz_fdiv_q( &tmp1, &MPQNUM( c ), &g1 ); 396 396 else 397 397 mpz_set( &tmp1, &MPQNUM( c ) ); 398 398 if ( ! g2is1 ) 399 mpz_ div( &tmp2, &_den, &g2 );399 mpz_fdiv_q( &tmp2, &_den, &g2 ); 400 400 else 401 401 mpz_set( &tmp2, &_den ); … … 632 632 else 633 633 { 634 mpz_ div( &n, &n, &g );634 mpz_fdiv_q( &n, &n, &g ); 635 635 mpz_mul( &n, &n, &_num ); 636 636 mpz_init( &d ); 637 mpz_ div( &d, &_den, &g );637 mpz_fdiv_q( &d, &_den, &g ); 638 638 } 639 639 mpz_clear( &g ); … … 709 709 if ( mpz_cmp_si( &g, 1 ) != 0 ) 710 710 { 711 mpz_ div( &d, &d, &g );712 mpz_ div( &n, &n, &g );711 mpz_fdiv_q( &d, &d, &g ); 712 mpz_fdiv_q( &n, &n, &g ); 713 713 } 714 714 mpz_clear( &g ); … … 808 808 if ( mpz_cmp_si( &g, 1 ) != 0 ) 809 809 { 810 mpz_ div( &_num, &_num, &g );811 mpz_ div( &_den, &_den, &g );810 mpz_fdiv_q( &_num, &_num, &g ); 811 mpz_fdiv_q( &_den, &_den, &g ); 812 812 } 813 813 // Hier brauchen wir ein mpz_clear, J.M.
Note: See TracChangeset
for help on using the changeset viewer.