Changeset 38f32d in git for Singular/misc_ip.cc
 Timestamp:
 Jul 13, 2010, 4:08:38 PM (13 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 512f05c5a1ab245e49d1b2471320fe775eba0d43
 Parents:
 2545e05be20341593d047f69dc1f2f4d599ec80f
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/misc_ip.cc
r2545e0 r38f32d 282 282 { 283 283 mpz_tdiv_qr_ui (q, r, t, 3); 284 if (mpz_cmp_ui (r, 0) != 0) break;284 if (mpz_cmp_ui (r, 0) != 0) break; 285 285 mpz_set (t, q); 286 286 if ((L_ind>0) && (L[L_ind1]==3)) ex[L_ind1]++; … … 323 323 { 324 324 mpz_swap (t, q); 325 //gmp_printf("%d: %Zd\n",f,t); 325 326 // here: f in 0,,2^281: 326 327 if ((L_ind>0) && (L[L_ind1]==(int)f)) ex[L_ind1]++; … … 463 464 if (mpz_cmp_ui (t, 1) != 0) 464 465 { 465 if (mpz_probab_prime_p (t, 3)) 466 { 467 if ((L_ind>0) && (mpz_cmp_si(t,L[L_ind1])==0)) 468 { 469 ex[L_ind1]++; 470 } 471 else 466 if (mpz_probab_prime_p (t, 10)) 467 { 468 int tt=mpz_get_si(t); 469 // check if t fits into int: 470 if ((mpz_size1(t)==1)&&(mpz_cmp_si(t,tt)==0)) 472 471 { 473 472 L[L_ind]=mpz_get_si(t); 474 473 L_ind++; 475 }476 mpz_set_si(t,1);474 mpz_set_si(t,1); 475 } 477 476 } 478 477 else … … 496 495 else 497 496 { 498 mpz_init_set(t,(mpz_ptr)nn );497 mpz_init_set(t,(mpz_ptr)nn>z); 499 498 } 500 499 int *LL=(int*)omAlloc0(1000*sizeof(int)); … … 504 503 505 504 nnAsInt = mpz_get_si(t); 506 nlDelete(&nn,NULL);507 if (mpz_cmp_si(t,nnAsInt)==0)508 {505 if ((mpz_size1(t)==1) && (mpz_cmp_si(t,nnAsInt)==0)) 506 { 507 nlDelete(&nn,NULL); 509 508 L>m[0].rtyp = INT_CMD; 510 509 L>m[0].data = (void *)nnAsInt; … … 512 511 else 513 512 { 513 mpz_set(nn>z,t); 514 514 L>m[0].rtyp = BIGINT_CMD; 515 L>m[0].data = (void *)t; 516 } 515 L>m[0].data = (void *)nn; 516 } 517 mpz_clear(t); 517 518 int i; 518 519 for(i=0;i<L_ind;i++) ex[i]++;
Note: See TracChangeset
for help on using the changeset viewer.