Changeset 8acd267 in git
- Timestamp:
- Sep 29, 2010, 12:10:12 PM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- ed65b8ac2bdf0cef1353911cef4a1aa9dfd599f4
- Parents:
- 08076474d5b872058ae014f8e1e6d95434bc7f29
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/general.lib
r080764 r8acd267 1217 1217 { 1218 1218 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)]; 1221 1221 kill jdl; 1222 rest=rest, l[ 1];1222 rest=rest, l[3]; 1223 1223 } 1224 1224 jd = simplify(jd,6); -
Singular/LIB/primdecint.lib
r080764 r8acd267 112 112 ideal J = imap(R,J); 113 113 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; } 117 117 } 118 118 … … 120 120 { 121 121 "n = "+string(n); 122 "size(L[ 3]) = "+string(size(L[3]));122 "size(L[2]) = "+string(size(L[2])); 123 123 } 124 124 125 125 int RT = rtimer; 126 if((n > 1) && (n < size(L[ 3])))126 if((n > 1) && (n < size(L[2]))) 127 127 { 128 128 129 129 //----- 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]. --------- 131 131 132 132 for(i = 1; i <= n; i++) 133 133 { 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]); 136 136 link l(i) = "MPtcp:fork"; 137 137 // link l(i) = "ssi:fork"; … … 140 140 } 141 141 142 p = int(L[ 2][1]);143 nu = int(L[ 3][1]);142 p = int(L[1][1]); 143 nu = int(L[2][1]); 144 144 int t = timer; 145 145 A[size(A)+1] = modp(J, p, nu); … … 150 150 j = n + 2; 151 151 152 while(j <= size(L[ 3]) + 1)152 while(j <= size(L[2]) + 1) 153 153 { 154 154 for(i = 1; i <= n; i++) … … 160 160 A[size(A)+1] = read(l(i)); 161 161 162 if(j <= size(L[ 3]))162 if(j <= size(L[2])) 163 163 { 164 p=int(L[ 2][j]);165 nu=int(L[ 3][j]);164 p=int(L[1][j]); 165 nu=int(L[2][j]); 166 166 write(l(i), quote(modp(eval(J), eval(p), eval(nu)))); 167 167 j++; … … 185 185 else 186 186 { 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]); 190 190 } 191 191 } -
Singular/misc_ip.cc
r080764 r8acd267 193 193 lists primes = (lists)omAllocBin(slists_bin); primes->Init(1000); 194 194 int* multiplicities = new int[1000]; 195 int positive=1; 195 int positive=1; int probTest = 0; 196 196 197 197 if (!nlIsZero(n)) … … 282 282 mpz_set_ui(nn, 1); 283 283 } 284 if ((mpz_cmp_ui(nn, 1) > 0) && (mpz_probab_prime_p(nn, 25) != 0)) 285 probTest = 1; 284 286 } 285 287 … … 306 308 L->Init(4); 307 309 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); 313 313 L->m[3].rtyp = INT_CMD; L->m[3].data = (void*)probTest; 314 314 mpz_clear(nn); mpz_clear(pb); mpz_clear(b); mpz_clear(p); mpz_clear(sr); -
Singular/misc_ip.h
r080764 r8acd267 60 60 61 61 /** 62 * Factorises a given positivebigint number n into its prime factors less62 * Factorises a given bigint number n into its prime factors less 63 63 * than or equal to a given bound, with corresponding multiplicities. 64 64 * 65 * The method finds all prime factors with multiplicities. If a non-zero65 * The method finds all prime factors with multiplicities. If a positive 66 66 * bound is given, then only the prime factors <= pBound are being found. 67 67 * 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. 68 70 * 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 bigint71 * (sorted in ascending order),72 * L[3] a list; L[3][i] contains the multiplicity of L[2, i] in n as int73 * L[4] 1 iff the remainder mis probably a prime, 0 otherwise71 * 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 74 76 * 75 * We thus have: n = L[1] * L[2][1]^L[3][1] * ... * L[2][k]^L[3][k], where77 * We thus have: n = L[1][1]^L[2][1] * ... * L[1][k]^L[2][k] * L[1], where 76 78 * k is the number of mutually distinct prime factors (<= a provided non- 77 79 * zero bound). 80 * Note that for n = 0, L[2] and L[3] will be emtpy lists and L[4] will be 81 * zero. 78 82 * 79 83 * @return the factorisation data in a SINGULAR-internal list
Note: See TracChangeset
for help on using the changeset viewer.