Changeset 8acd267 in git


Ignore:
Timestamp:
Sep 29, 2010, 12:10:12 PM (13 years ago)
Author:
Frank Seelisch <seelisch@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
ed65b8ac2bdf0cef1353911cef4a1aa9dfd599f4
Parents:
08076474d5b872058ae014f8e1e6d95434bc7f29
Message:
re-established old ordering in result list of command 'primefactors' (kernel code, LIB code, docu)

git-svn-id: file:///usr/local/Singular/svn/trunk@13321 2c84dea3-7e68-4137-9b89-c4e89433aadc
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    r080764 r8acd267  
    12171217   {
    12181218     l = primefactors(number(id[ii]),q);
    1219      list jdl=l[2];
    1220      jd = jd,jdl[1..size(jdl)]; 
     1219     list jdl=l[1];
     1220     jd = jd,jdl[1..size(jdl)];
    12211221     kill jdl;
    1222      rest=rest, l[1];
     1222     rest=rest, l[3];
    12231223   }
    12241224   jd = simplify(jd,6);
  • Singular/LIB/primdecint.lib

    r080764 r8acd267  
    112112      ideal J = imap(R,J);
    113113
    114       for(j=1;j<=size(L[3]);j++)
    115       {
    116          if(L[3][j] > 1){ ex = 1; break; }
     114      for(j=1;j<=size(L[2]);j++)
     115      {
     116         if(L[2][j] > 1){ ex = 1; break; }
    117117      }
    118118
     
    120120      {
    121121         "n = "+string(n);
    122          "size(L[3]) = "+string(size(L[3]));
     122         "size(L[2]) = "+string(size(L[2]));
    123123      }
    124124
    125125      int RT = rtimer;
    126       if((n > 1) && (n < size(L[3])))
     126      if((n > 1) && (n < size(L[2])))
    127127      {
    128128
    129129//-----  Create n1 links l(1),...,l(n1), open all of them and compute  ---------
    130 //-----  standard basis for the primes L[2],...,L[n + 1].              ---------
     130//-----  standard basis for the primes L[1][2],...,L[1][n + 1].              ---------
    131131
    132132         for(i = 1; i <= n; i++)
    133133         {
    134             p=int(L[2][i + 1]);
    135             nu=int(L[3][i + 1]);
     134            p=int(L[1][i + 1]);
     135            nu=int(L[2][i + 1]);
    136136            link l(i) = "MPtcp:fork";
    137137//            link l(i) = "ssi:fork";
     
    140140         }
    141141
    142          p = int(L[2][1]);
    143          nu = int(L[3][1]);
     142         p = int(L[1][1]);
     143         nu = int(L[2][1]);
    144144         int t = timer;
    145145         A[size(A)+1] = modp(J, p, nu);
     
    150150         j = n + 2;
    151151
    152          while(j <= size(L[3]) + 1)
     152         while(j <= size(L[2]) + 1)
    153153         {
    154154            for(i = 1; i <= n; i++)
     
    160160                  A[size(A)+1] = read(l(i));                             
    161161
    162                   if(j <= size(L[3]))
     162                  if(j <= size(L[2]))
    163163                  {
    164                      p=int(L[2][j]);
    165                      nu=int(L[3][j]);
     164                     p=int(L[1][j]);
     165                     nu=int(L[2][j]);
    166166                     write(l(i), quote(modp(eval(J), eval(p), eval(nu))));
    167167                     j++;
     
    185185      else
    186186      {
    187          for(j=1;j<=size(L[3]);j++)
    188          {
    189             A[size(A)+1] = modp(J, L[2][j], L[3][j]);
     187         for(j=1;j<=size(L[2]);j++)
     188         {
     189            A[size(A)+1] = modp(J, L[1][j], L[2][j]);
    190190         }
    191191      }
  • Singular/misc_ip.cc

    r080764 r8acd267  
    193193  lists primes = (lists)omAllocBin(slists_bin); primes->Init(1000);
    194194  int* multiplicities = new int[1000];
    195   int positive=1;
     195  int positive=1; int probTest = 0;
    196196
    197197  if (!nlIsZero(n))
     
    282282      mpz_set_ui(nn, 1);
    283283    }
     284    if ((mpz_cmp_ui(nn, 1) > 0) && (mpz_probab_prime_p(nn, 25) != 0))
     285      probTest = 1;
    284286  }
    285287
     
    306308  L->Init(4);
    307309  if (positive==-1) mpz_neg(nn,nn);
    308   setListEntry(L, 0, nn);
    309   L->m[1].rtyp = LIST_CMD; L->m[1].data = (void*)primesL;
    310   L->m[2].rtyp = LIST_CMD; L->m[2].data = (void*)multiplicitiesL;
    311   int probTest = 0;
    312   if (mpz_probab_prime_p(nn, 25) != 0) probTest = 1;
     310  L->m[0].rtyp = LIST_CMD; L->m[0].data = (void*)primesL;
     311  L->m[1].rtyp = LIST_CMD; L->m[1].data = (void*)multiplicitiesL;
     312  setListEntry(L, 2, nn);
    313313  L->m[3].rtyp =  INT_CMD; L->m[3].data = (void*)probTest;
    314314  mpz_clear(nn); mpz_clear(pb); mpz_clear(b); mpz_clear(p); mpz_clear(sr);
  • Singular/misc_ip.h

    r080764 r8acd267  
    6060
    6161/**
    62  * Factorises a given positive bigint number n into its prime factors less
     62 * Factorises a given bigint number n into its prime factors less
    6363 * than or equal to a given bound, with corresponding multiplicities.
    6464 *
    65  * The method finds all prime factors with multiplicities. If a non-zero
     65 * The method finds all prime factors with multiplicities. If a positive
    6666 * bound is given, then only the prime factors <= pBound are being found.
    6767 * In this case, there may remain an unfactored portion m of n.
     68 * Also, when n is negative, m will contain the sign. If n is zero, m will
     69 * be zero.
    6870 * The method returns a list L filled with four entries:
    69  * L[1] contains the remainder m as int or bigint, depending on the size,
    70  * L[2] a list; L[2][i] contains the i-th prime factor as int or bigint
    71  *                     (sorted in ascending order),
    72  * L[3] a list; L[3][i] contains the multiplicity of L[2, i] in n as int
    73  * L[4] 1 iff the remainder m is probably a prime, 0 otherwise
     71 * L[1] a list; L[1][i] contains the i-th prime factor of |n| as int or
     72 *                      bigint (sorted in ascending order),
     73 * L[2] a list; L[2][i] contains the multiplicity of L[1, i] in |n| as int
     74 * L[3] contains the remainder m as int or bigint, depending on the size,
     75 * L[4] 1 iff |m| is probably a prime, 0 otherwise
    7476 *
    75  * We thus have: n = L[1] * L[2][1]^L[3][1] * ... * L[2][k]^L[3][k], where
     77 * We thus have: n = L[1][1]^L[2][1] * ... * L[1][k]^L[2][k] * L[1], where
    7678 * k is the number of mutually distinct prime factors (<= a provided non-
    7779 * zero bound).
     80 * Note that for n = 0, L[2] and L[3] will be emtpy lists and L[4] will be
     81 * zero.
    7882 *
    7983 * @return the factorisation data in a SINGULAR-internal list
Note: See TracChangeset for help on using the changeset viewer.