# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1362043925 -3600
# Node ID 2680bf71581021a93f1203177e51c25e5288e476
# Parent 61eb27ccc8c70911bf7fa464028c2c26f7045726
Fix # optional tags (manually)
diff --git a/sage/interfaces/qsieve.py b/sage/interfaces/qsieve.py
a
|
b
|
|
4 | 4 | |
5 | 5 | import os |
6 | 6 | |
7 | | cygwin = os.uname()[0][:6]=="CYGWIN" |
8 | | |
9 | 7 | import sage.rings.integer |
10 | 8 | |
11 | 9 | from sage.misc.all import tmp_dir |
… |
… |
|
56 | 54 | by the command line time command. (If time is False, |
57 | 55 | this is always an empty string.) |
58 | 56 | |
59 | | EXAMPLES: |
| 57 | EXAMPLES:: |
| 58 | |
60 | 59 | sage: k = 19; n = next_prime(10^k)*next_prime(10^(k+1)) |
61 | 60 | sage: factor(n) # (currently) uses PARI |
62 | 61 | 10000000000000000051 * 100000000000000000039 |
63 | | sage: v, t = qsieve(n, time=True) # uses the sieve (optional: time doesn't work on cygwin) |
64 | | sage: v # optional |
| 62 | sage: v, t = qsieve(n, time=True) # uses qsieve; optional - time |
| 63 | sage: v # optional - time |
65 | 64 | [10000000000000000051, 100000000000000000039] |
66 | | sage: t # random; optional |
| 65 | sage: t # random; optional - time |
67 | 66 | '0.36 real 0.19 user 0.00 sys' |
68 | 67 | """ |
69 | 68 | Z = sage.rings.integer.Integer |
… |
… |
|
81 | 80 | blocking until complete. |
82 | 81 | """ |
83 | 82 | if time: |
84 | | if cygwin: |
85 | | raise ValueError, "qsieve time not supported on Cygwin" |
86 | 83 | t = 'time ' |
87 | 84 | else: |
88 | 85 | t = '' |
… |
… |
|
137 | 134 | A non-blocking version of Hart's quadratic sieve. |
138 | 135 | |
139 | 136 | The sieve starts running when you create the object, but you can |
140 | | still use Sage in parallel: |
| 137 | still use Sage in parallel. |
| 138 | |
| 139 | EXAMPLES:: |
141 | 140 | |
142 | 141 | sage: k = 19; n = next_prime(10^k)*next_prime(10^(k+1)) |
143 | | sage: q = qsieve(n, block=False, time=True) # optional - time |
144 | | sage: q # random output # optional |
| 142 | sage: q = qsieve(n, block=False, time=True) # optional - time |
| 143 | sage: q # random output; optional - time |
145 | 144 | Proper factors so far: [] |
146 | | sage: q # random output # optional |
| 145 | sage: q # random output; optional - time |
147 | 146 | ([10000000000000000051, 100000000000000000039], '0.21') |
148 | | sage: q.list() # random output # optional |
| 147 | sage: q.list() # random output; optional - time |
149 | 148 | [10000000000000000051, 100000000000000000039] |
150 | | sage: q.time() # random output (optional -- requires time command) |
| 149 | sage: q.time() # random output; optional - time |
151 | 150 | '0.21' |
152 | 151 | |
153 | 152 | sage: q = qsieve(next_prime(10^20)*next_prime(10^21), block=False) |
… |
… |
|
159 | 158 | def __init__(self, n, time): |
160 | 159 | self._n = n |
161 | 160 | if time: |
162 | | if cygwin: |
163 | | raise ValueError, "qsieve time not supported on Cygwin" |
164 | 161 | cmd = 'time QuadraticSieve' |
165 | 162 | else: |
166 | 163 | cmd = 'QuadraticSieve' |
… |
… |
|
255 | 252 | Terminate the QuadraticSieve process, in case you want |
256 | 253 | to give up on computing this factorization. |
257 | 254 | |
258 | | EXAMPLES: |
| 255 | EXAMPLES:: |
| 256 | |
259 | 257 | sage: n = next_prime(2^110)*next_prime(2^100) |
260 | 258 | sage: qs = qsieve(n, block=False) |
261 | 259 | sage: qs |
diff --git a/sage/lfunctions/sympow.py b/sage/lfunctions/sympow.py
a
|
b
|
|
122 | 122 | If you would like to see the extensive output sympow prints when |
123 | 123 | running this function, just type ``set_verbose(2)``. |
124 | 124 | |
125 | | EXAMPLES:: |
| 125 | EXAMPLES: |
| 126 | |
| 127 | These examples only work if you run ``sympow -new_data 2`` in a |
| 128 | Sage shell first. Alternatively, within Sage, execute:: |
| 129 | |
| 130 | sage: sympow('-new_data 2') # not tested |
| 131 | |
| 132 | This command precomputes some data needed for the following |
| 133 | examples. :: |
126 | 134 | |
127 | | sage: a = sympow.L(EllipticCurve('11a'), 2, 16); a # optional |
| 135 | sage: a = sympow.L(EllipticCurve('11a'), 2, 16) # not tested |
| 136 | sage: a # not tested |
128 | 137 | '1.057599244590958E+00' |
129 | | sage: RR(a) # optional - precomputations |
| 138 | sage: RR(a) # not tested |
130 | 139 | 1.05759924459096 |
131 | 140 | """ |
132 | 141 | if n % 2 == 1: |