Changeset 587f72 in git


Ignore:
Timestamp:
Jul 23, 2010, 11:18:37 AM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
562b0c9545c1092666922dfc0979b71a2c7dd225
Parents:
40e810dce492e702bf0e751809ae911eaf670a12
Message:
primefactors

git-svn-id: file:///usr/local/Singular/svn/trunk@13058 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/misc_ip.cc

    r40e810d r587f72  
    400400    mpz_div (n, n, g);        /* divide by g, before g is overwritten */
    401401
    402     if (!mpz_probab_prime_p (g, 3))
     402    if (!mpz_probab_prime_p (g, 10))
    403403    {
    404404      do
     
    424424    mpz_mod (x1, x1, n);
    425425    mpz_mod (y, y, n);
    426     if (mpz_probab_prime_p (n, 3))
    427     {
    428       if ((L_ind>0) && (mpz_cmp_si(n,L[L_ind-1])==0)) ex[L_ind-1]++;
    429       else
    430       {
    431         L[L_ind]=mpz_get_si(n);
    432         L_ind++;
     426    if (mpz_probab_prime_p (n, 10))
     427    {
     428      int te=mpz_get_si(n);
     429      if (mpz_cmp_si(n,te)==0) /* does it fit into an int ? */
     430      {
     431        if ((L_ind>0) && (mpz_cmp_si(n,L[L_ind-1])==0)) ex[L_ind-1]++;
     432        else
     433        {
     434          L[L_ind]=mpz_get_si(n);
     435          L_ind++;
     436        }
     437        mpz_set_si(n,1); // add n itself the list of divisors, rest is 1
    433438      }
    434439      break;
Note: See TracChangeset for help on using the changeset viewer.