# HG changeset patch
# User Jeroen Demeyer <jdemeyer@cage.ugent.be>
# Date 1360957832 -3600
# Node ID e93a74429ba284fd1a8de375d12fd5b4914b8124
# Parent 5173e5d858897ac023e1fca0f8c8dcaec7fe1147
Further fixes for the new doctesting framework
diff --git a/doc/en/tutorial/interfaces.rst b/doc/en/tutorial/interfaces.rst
a
|
b
|
|
304 | 304 | Finally, we give an example of using Sage to plot using ``openmath``. |
305 | 305 | Many of these were modified from the Maxima reference manual. |
306 | 306 | |
307 | | A 2D plot of several functions (do not type the ``...``): |
| 307 | A 2D plot of several functions (do not type the ``...``):: |
308 | 308 | |
309 | | :: |
310 | | |
311 | | sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]',\ |
312 | | ... '[plot_format,openmath]') # not tested |
| 309 | sage: maxima.plot2d('[cos(7*x),cos(23*x)^4,sin(13*x)^3]','[x,0,1]', # not tested |
| 310 | ....: '[plot_format,openmath]') |
313 | 311 | |
314 | 312 | A "live" 3D plot which you can move with your mouse (do not type |
315 | | the ``...``): |
| 313 | the ``...``):: |
316 | 314 | |
317 | | :: |
| 315 | sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]", # not tested |
| 316 | ....: '[plot_format, openmath]') |
| 317 | sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]", # not tested |
| 318 | ....: "[grid, 50, 50]",'[plot_format, openmath]') |
318 | 319 | |
319 | | sage: maxima.plot3d ("2^(-u^2 + v^2)", "[u, -3, 3]", "[v, -2, 2]",\ |
320 | | ... '[plot_format, openmath]') # not tested |
321 | | sage: maxima.plot3d("atan(-x^2 + y^3/4)", "[x, -4, 4]", "[y, -4, 4]",\ |
322 | | ... "[grid, 50, 50]",'[plot_format, openmath]') # not tested |
| 320 | The next plot is the famous Möbius strip (do not type the ``...``):: |
323 | 321 | |
324 | | The next plot is the famous Möbius strip (do not type the ``...``): |
| 322 | sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)), y*sin(x/2)]", # not tested |
| 323 | ....: "[x, -4, 4]", "[y, -4, 4]", '[plot_format, openmath]') |
325 | 324 | |
326 | | :: |
| 325 | The next plot is the famous Klein bottle (do not type the ``...``):: |
327 | 326 | |
328 | | sage: maxima.plot3d("[cos(x)*(3 + y*cos(x/2)), sin(x)*(3 + y*cos(x/2)),\ |
329 | | ... y*sin(x/2)]", "[x, -4, 4]", "[y, -4, 4]",\ |
330 | | ... '[plot_format, openmath]') # not tested |
331 | | |
332 | | The next plot is the famous Klein bottle (do not type the ``...``): |
333 | | |
334 | | :: |
335 | | |
336 | | sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)\ |
337 | | ... - 10.0") |
| 327 | sage: maxima("expr_1: 5*cos(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0) - 10.0") |
338 | 328 | 5*cos(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0)-10.0 |
339 | 329 | sage: maxima("expr_2: -5*sin(x)*(cos(x/2)*cos(y) + sin(x/2)*sin(2*y)+ 3.0)") |
340 | 330 | -5*sin(x)*(sin(x/2)*sin(2*y)+cos(x/2)*cos(y)+3.0) |
341 | 331 | sage: maxima("expr_3: 5*(-sin(x/2)*cos(y) + cos(x/2)*sin(2*y))") |
342 | 332 | 5*(cos(x/2)*sin(2*y)-sin(x/2)*cos(y)) |
343 | | sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]",\ |
344 | | ... "[y, -%pi, %pi]", "['grid, 40, 40]",\ |
345 | | ... '[plot_format, openmath]') # not tested |
| 333 | sage: maxima.plot3d ("[expr_1, expr_2, expr_3]", "[x, -%pi, %pi]", # not tested |
| 334 | ....: "[y, -%pi, %pi]", "['grid, 40, 40]", '[plot_format, openmath]') |
diff --git a/sage/calculus/test_sympy.py b/sage/calculus/test_sympy.py
a
|
b
|
|
112 | 112 | sage: f = e.series(x, 0, 10); f |
113 | 113 | 1 + 3*x**2/2 + 11*x**4/8 + 241*x**6/240 + 8651*x**8/13440 + O(x**10) |
114 | 114 | |
115 | | And the pretty-printer:: |
| 115 | And the pretty-printer. Since unicode characters aren't working on |
| 116 | some archictures, we disable it:: |
116 | 117 | |
| 118 | sage: from sympy.printing import pprint_use_unicode |
| 119 | sage: prev_use = pprint_use_unicode(False) |
117 | 120 | sage: pprint(e) |
118 | | 1 |
119 | | ─────── |
120 | | 3 |
| 121 | 1 |
| 122 | ------- |
| 123 | 3 |
121 | 124 | cos (x) |
122 | 125 | |
123 | 126 | sage: pprint(f) |
124 | | 2 4 6 8 |
125 | | 3⋅x 11⋅x 241⋅x 8651⋅x |
126 | | 1 + ──── + ───── + ────── + ─────── + O(x**10) |
127 | | 2 8 240 13440 |
| 127 | 2 4 6 8 |
| 128 | 3*x 11*x 241*x 8651*x |
| 129 | 1 + ---- + ----- + ------ + ------- + O(x**10) |
| 130 | 2 8 240 13440 |
| 131 | sage: pprint_use_unicode(prev_use) |
| 132 | False |
128 | 133 | |
129 | 134 | And the functionality to convert from sympy format to Sage format:: |
130 | 135 | |
diff --git a/sage/categories/groups.py b/sage/categories/groups.py
a
|
b
|
|
50 | 50 | sage: Groups().example() |
51 | 51 | General Linear Group of degree 4 over Rational Field |
52 | 52 | """ |
53 | | from sage.rings.rational_field import QQ |
| 53 | from sage.rings.rational_field import QQ |
54 | 54 | from sage.groups.matrix_gps.general_linear import GL |
55 | 55 | return GL(4,QQ) |
56 | 56 | |
diff --git a/sage/combinat/partition_algebra.py b/sage/combinat/partition_algebra.py
a
|
b
|
|
757 | 757 | 132 |
758 | 758 | |
759 | 759 | sage: P3.first() #random |
760 | | {{1, 2, 3, -1, -3, -2}} |
| 760 | {{1, 2, 3, -1, -3, -2}} |
761 | 761 | sage: P3.last() #random |
762 | 762 | {{-1}, {-2}, {3}, {1}, {-3}, {2}} |
763 | 763 | sage: P3.random_element() #random |
diff --git a/sage/interfaces/tachyon.py b/sage/interfaces/tachyon.py
a
|
b
|
|
6 | 6 | - John E. Stone |
7 | 7 | """ |
8 | 8 | |
| 9 | #***************************************************************************** |
| 10 | # Copyright (C) 2006 John E. Stone |
| 11 | # |
| 12 | # Distributed under the terms of the GNU General Public License (GPL) |
| 13 | # as published by the Free Software Foundation; either version 2 of |
| 14 | # the License, or (at your option) any later version. |
| 15 | # http://www.gnu.org/licenses/ |
| 16 | #***************************************************************************** |
9 | 17 | |
10 | 18 | from sage.misc.pager import pager |
11 | 19 | from sage.misc.misc import tmp_filename |
12 | 20 | from sage.misc.sagedoc import format |
13 | 21 | import os |
| 22 | import sys |
14 | 23 | |
15 | 24 | class TachyonRT: |
16 | 25 | """ |
… |
… |
|
98 | 107 | sage: import os |
99 | 108 | sage: t(tgen.str(), outfile = os.devnull) |
100 | 109 | tachyon ... |
| 110 | Tachyon Parallel/Multiprocessor Ray Tracer... |
101 | 111 | """ |
102 | 112 | modelfile = tmp_filename(ext='.dat') |
103 | 113 | open(modelfile,'w').write(model) |
… |
… |
|
130 | 140 | |
131 | 141 | if verbose: |
132 | 142 | print cmd |
| 143 | # One should always flush before system() |
| 144 | sys.stdout.flush() |
| 145 | sys.stderr.flush() |
133 | 146 | os.system(cmd) |
134 | 147 | |
135 | 148 | def usage(self, use_pager=True): |
diff --git a/sage/libs/lcalc/lcalc_Lfunction.pyx b/sage/libs/lcalc/lcalc_Lfunction.pyx
a
|
b
|
|
404 | 404 | sage: L._print_data_to_standard_output() # tol 1e-15 |
405 | 405 | ----------------------------------------------- |
406 | 406 | <BLANKLINE> |
407 | | Name of L_function: |
| 407 | Name of L_function: |
408 | 408 | number of dirichlet coefficients = 5 |
409 | 409 | coefficients are periodic |
410 | 410 | b[1] = 1 |
… |
… |
|
532 | 532 | sage: L._print_data_to_standard_output() # tol 1e-15 |
533 | 533 | ----------------------------------------------- |
534 | 534 | <BLANKLINE> |
535 | | Name of L_function: |
| 535 | Name of L_function: |
536 | 536 | number of dirichlet coefficients = 5 |
537 | 537 | coefficients are periodic |
538 | 538 | b[1] = 1 |
… |
… |
|
666 | 666 | sage: L._print_data_to_standard_output() # tol 1e-15 |
667 | 667 | ----------------------------------------------- |
668 | 668 | <BLANKLINE> |
669 | | Name of L_function: |
| 669 | Name of L_function: |
670 | 670 | number of dirichlet coefficients = 5 |
671 | 671 | coefficients are periodic |
672 | 672 | b[1] = (1,0) |
diff --git a/sage/libs/mwrank/interface.py b/sage/libs/mwrank/interface.py
a
|
b
|
|
218 | 218 | Looking for quartics with I = 48, J = -432 |
219 | 219 | Looking for Type 2 quartics: |
220 | 220 | Trying positive a from 1 up to 1 (square a first...) |
221 | | (1,0,-6,4,1) --trivial |
| 221 | (1,0,-6,4,1) --trivial |
222 | 222 | Trying positive a from 1 up to 1 (...then non-square a) |
223 | 223 | Finished looking for Type 2 quartics. |
224 | 224 | Looking for Type 1 quartics: |
225 | 225 | Trying positive a from 1 up to 2 (square a first...) |
226 | | (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0) |
| 226 | (1,0,0,4,4) --nontrivial...(x:y:z) = (1 : 1 : 0) |
227 | 227 | Point = [0:0:1] |
228 | | height = 0.051111408239968840235886099756942021609538202280854 |
| 228 | height = 0.0511114082399688402358 |
229 | 229 | Rank of B=im(eps) increases to 1 (The previous point is on the egg) |
230 | 230 | Exiting search for Type 1 quartics after finding one which is globally soluble. |
231 | 231 | Mordell rank contribution from B=im(eps) = 1 |
… |
… |
|
235 | 235 | Selmer rank contribution from A=ker(eps) = 0 |
236 | 236 | Sha rank contribution from A=ker(eps) = 0 |
237 | 237 | Searching for points (bound = 8)...done: |
238 | | found points of rank 1 |
239 | | and regulator 0.051111408239968840235886099756942021609538202280854 |
| 238 | found points which generate a subgroup of rank 1 |
| 239 | and regulator 0.0511114082399688402358 |
240 | 240 | Processing points found during 2-descent...done: |
241 | | now regulator = 0.051111408239968840235886099756942021609538202280854 |
242 | | Saturating (bound = -1)...done: |
243 | | points were already saturated. |
| 241 | now regulator = 0.0511114082399688402358 |
| 242 | Saturating (with bound = -1)...done: |
| 243 | points were already saturated. |
244 | 244 | """ |
245 | 245 | self.__verbose = verbose |
246 | 246 | |
… |
… |
|
999 | 999 | 375.42919921875 |
1000 | 1000 | sage: EQ.saturate(2) # points were not 2-saturated |
1001 | 1001 | saturating basis...Saturation index bound = 93 |
1002 | | WARNING: saturation at primes p > 2 will not be done; |
| 1002 | WARNING: saturation at primes p > 2 will not be done; |
1003 | 1003 | ... |
1004 | 1004 | Gained index 2 |
1005 | 1005 | New regulator = 93.857300720636393209 |
… |
… |
|
1010 | 1010 | 93.8572998046875 |
1011 | 1011 | sage: EQ.saturate(3) # points were not 3-saturated |
1012 | 1012 | saturating basis...Saturation index bound = 46 |
1013 | | WARNING: saturation at primes p > 3 will not be done; |
| 1013 | WARNING: saturation at primes p > 3 will not be done; |
1014 | 1014 | ... |
1015 | 1015 | Gained index 3 |
1016 | 1016 | New regulator = 10.4285889689595992455 |
… |
… |
|
1021 | 1021 | 10.4285888671875 |
1022 | 1022 | sage: EQ.saturate(5) # points were not 5-saturated |
1023 | 1023 | saturating basis...Saturation index bound = 15 |
1024 | | WARNING: saturation at primes p > 5 will not be done; |
| 1024 | WARNING: saturation at primes p > 5 will not be done; |
1025 | 1025 | ... |
1026 | 1026 | Gained index 5 |
1027 | 1027 | New regulator = 0.417143558758383969818 |
… |
… |
|
1033 | 1033 | sage: EQ.saturate() # points are now saturated |
1034 | 1034 | saturating basis...Saturation index bound = 3 |
1035 | 1035 | Checking saturation at [ 2 3 ] |
1036 | | Checking 2-saturation |
| 1036 | Checking 2-saturation |
1037 | 1037 | Points were proved 2-saturated (max q used = 11) |
1038 | | Checking 3-saturation |
| 1038 | Checking 3-saturation |
1039 | 1039 | Points were proved 3-saturated (max q used = 13) |
1040 | 1040 | done |
1041 | 1041 | (True, 1, '[ ]') |
… |
… |
|
1206 | 1206 | |
1207 | 1207 | sage: EQ.saturate(2) # points were not 2-saturated |
1208 | 1208 | saturating basis...Saturation index bound = 93 |
1209 | | WARNING: saturation at primes p > 2 will not be done; |
| 1209 | WARNING: saturation at primes p > 2 will not be done; |
1210 | 1210 | ... |
1211 | 1211 | Gained index 2 |
1212 | 1212 | New regulator = 93.857300720636393209 |
… |
… |
|
1220 | 1220 | |
1221 | 1221 | sage: EQ.saturate(3) # points were not 3-saturated |
1222 | 1222 | saturating basis...Saturation index bound = 46 |
1223 | | WARNING: saturation at primes p > 3 will not be done; |
| 1223 | WARNING: saturation at primes p > 3 will not be done; |
1224 | 1224 | ... |
1225 | 1225 | Gained index 3 |
1226 | 1226 | New regulator = 10.4285889689595992455 |
… |
… |
|
1234 | 1234 | |
1235 | 1235 | sage: EQ.saturate(5) # points were not 5-saturated |
1236 | 1236 | saturating basis...Saturation index bound = 15 |
1237 | | WARNING: saturation at primes p > 5 will not be done; |
| 1237 | WARNING: saturation at primes p > 5 will not be done; |
1238 | 1238 | ... |
1239 | 1239 | Gained index 5 |
1240 | 1240 | New regulator = 0.417143558758383969818 |
… |
… |
|
1250 | 1250 | sage: EQ.saturate() # points are now saturated |
1251 | 1251 | saturating basis...Saturation index bound = 3 |
1252 | 1252 | Checking saturation at [ 2 3 ] |
1253 | | Checking 2-saturation |
| 1253 | Checking 2-saturation |
1254 | 1254 | Points were proved 2-saturated (max q used = 11) |
1255 | | Checking 3-saturation |
| 1255 | Checking 3-saturation |
1256 | 1256 | Points were proved 3-saturated (max q used = 13) |
1257 | 1257 | done |
1258 | 1258 | (True, 1, '[ ]') |
… |
… |
|
1277 | 1277 | sage: EQ.saturate() |
1278 | 1278 | saturating basis...Saturation index bound = 3 |
1279 | 1279 | Checking saturation at [ 2 3 ] |
1280 | | Checking 2-saturation |
| 1280 | Checking 2-saturation |
1281 | 1281 | Points were proved 2-saturated (max q used = 11) |
1282 | | Checking 3-saturation |
| 1282 | Checking 3-saturation |
1283 | 1283 | Points were proved 3-saturated (max q used = 13) |
1284 | 1284 | done |
1285 | 1285 | (True, 1, '[ ]') |
1286 | 1286 | |
1287 | | The preceding command produces the following output as a |
1288 | | side-effect. It proves that the index of the points in their |
1289 | | saturation is at most 3, then proves saturation at 2 and at 3, |
1290 | | by reducing the points modulo all primes of good reduction up |
1291 | | to 11, respectively 13:: |
1292 | | |
1293 | | saturating basis...Saturation index bound = 3 |
1294 | | Checking saturation at [ 2 3 ] |
1295 | | Checking 2-saturation |
1296 | | Points were proved 2-saturated (max q used = 11) |
1297 | | Checking 3-saturation |
1298 | | Points were proved 3-saturated (max q used = 13) |
1299 | | done |
| 1287 | Note the output of the preceding command: it proves that the |
| 1288 | index of the points in their saturation is at most 3, then |
| 1289 | proves saturation at 2 and at 3, by reducing the points modulo |
| 1290 | all primes of good reduction up to 11, respectively 13. |
1300 | 1291 | """ |
1301 | 1292 | ok, index, unsat = self.__mw.saturate(int(max_prime), odd_primes_only) |
1302 | 1293 | return bool(ok), int(str(index)), unsat |
diff --git a/sage/libs/mwrank/mwrank.pyx b/sage/libs/mwrank/mwrank.pyx
a
|
b
|
|
883 | 883 | sage: EQ.process([494, -5720, 6859]) # 3 times another point |
884 | 884 | sage: EQ.saturate(sat_bd=2) |
885 | 885 | Saturation index bound = 10 |
886 | | WARNING: saturation at primes p > 2 will not be done; |
| 886 | WARNING: saturation at primes p > 2 will not be done; |
887 | 887 | points may be unsaturated at primes between 2 and index bound |
888 | 888 | Failed to saturate MW basis at primes [ ] |
889 | 889 | (0, 1, '[ ]') |
… |
… |
|
1261 | 1261 | Sha rank contribution from A=ker(eps) = 0 |
1262 | 1262 | sage: D2.saturate() |
1263 | 1263 | Searching for points (bound = 8)...done: |
1264 | | found points of rank 3 |
| 1264 | found points which generate a subgroup of rank 3 |
1265 | 1265 | and regulator 0.417143558758383969817119544618093396749810106098479 |
1266 | 1266 | Processing points found during 2-descent...done: |
1267 | 1267 | now regulator = 0.417143558758383969817119544618093396749810106098479 |
… |
… |
|
1308 | 1308 | Sha rank contribution from A=ker(eps) = 0 |
1309 | 1309 | sage: D2.saturate() |
1310 | 1310 | Searching for points (bound = 8)...done: |
1311 | | found points of rank 3 |
| 1311 | found points which generate a subgroup of rank 3 |
1312 | 1312 | and regulator 0.417143558758383969817119544618093396749810106098479 |
1313 | 1313 | Processing points found during 2-descent...done: |
1314 | 1314 | now regulator = 0.417143558758383969817119544618093396749810106098479 |
… |
… |
|
1356 | 1356 | |
1357 | 1357 | sage: D2.saturate() |
1358 | 1358 | Searching for points (bound = 8)...done: |
1359 | | found points of rank 3 |
| 1359 | found points which generate a subgroup of rank 3 |
1360 | 1360 | and regulator 0.417143558758383969817119544618093396749810106098479 |
1361 | 1361 | Processing points found during 2-descent...done: |
1362 | 1362 | now regulator = 0.417143558758383969817119544618093396749810106098479 |
diff --git a/sage/misc/cython.py b/sage/misc/cython.py
a
|
b
|
|
693 | 693 | sage: f.write(s) |
694 | 694 | sage: f.close() |
695 | 695 | sage: cython_create_local_so('hello.spyx') |
| 696 | Compiling hello.spyx... |
696 | 697 | sage: sys.path.append('.') |
697 | 698 | sage: import hello |
698 | 699 | sage: hello.hello() |
diff --git a/sage/misc/interpreter.py b/sage/misc/interpreter.py
a
|
b
|
|
185 | 185 | sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) != 0 |
186 | 186 | True |
187 | 187 | sage: shell.system_raw('R --version') |
| 188 | R version ... |
188 | 189 | sage: status = shell.user_ns['_exit_code'] |
189 | 190 | sage: os.WIFEXITED(status) and os.WEXITSTATUS(status) == 0 |
190 | 191 | True |
diff --git a/sage/misc/preparser.py b/sage/misc/preparser.py
a
|
b
|
|
1671 | 1671 | |
1672 | 1672 | EXAMPLES: |
1673 | 1673 | |
1674 | | Note that .py files are *not* preparsed:: |
1675 | | |
1676 | | sage: t=tmp_filename(ext='.py'); open(t,'w').write("print 'hi',2/3; z=-2/9") |
1677 | | sage: sage.misc.preparser.load(t,globals()) |
| 1674 | Note that ``.py`` files are *not* preparsed:: |
| 1675 | |
| 1676 | sage: t = tmp_filename(ext='.py') |
| 1677 | sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") |
| 1678 | sage: z = 1 |
| 1679 | sage: sage.misc.preparser.load(t, globals()) |
1678 | 1680 | hi 0 |
1679 | 1681 | sage: z |
1680 | 1682 | -1 |
1681 | 1683 | |
1682 | | A .sage file *is* preparsed:: |
1683 | | |
1684 | | sage: t=tmp_filename(ext='.sage'); open(t,'w').write("print 'hi',2/3; s=-2/7") |
1685 | | sage: sage.misc.preparser.load(t,globals()) |
| 1684 | A ``.sage`` file *is* preparsed:: |
| 1685 | |
| 1686 | sage: t = tmp_filename(ext='.sage') |
| 1687 | sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") |
| 1688 | sage: z = 1 |
| 1689 | sage: sage.misc.preparser.load(t, globals()) |
1686 | 1690 | hi 2/3 |
1687 | | sage: s |
| 1691 | sage: z |
1688 | 1692 | -2/7 |
1689 | 1693 | |
1690 | 1694 | Cython files are *not* preparsed:: |
1691 | | |
1692 | | sage: t=tmp_filename(ext='.pyx'); open(t,'w').write("print 'hi',2/3; z=-2/9") |
1693 | | sage: z=0; sage.misc.preparser.load(t,globals()) |
| 1695 | |
| 1696 | sage: t = tmp_filename(ext='.pyx') |
| 1697 | sage: open(t,'w').write("print 'hi', 2/3; z = -2/7") |
| 1698 | sage: z = 1 |
| 1699 | sage: sage.misc.preparser.load(t, globals()) |
| 1700 | Compiling ... |
1694 | 1701 | hi 0 |
1695 | 1702 | sage: z |
1696 | 1703 | -1 |
diff --git a/sage/misc/session.pyx b/sage/misc/session.pyx
a
|
b
|
|
244 | 244 | - creates a file |
245 | 245 | |
246 | 246 | EXAMPLES: |
| 247 | |
247 | 248 | For testing, we use a temporary file, that will be removed as soon |
248 | 249 | as Sage is left. Of course, for permanently saving your session, |
249 | | you should choose a permanent file.:: |
| 250 | you should choose a permanent file. :: |
250 | 251 | |
251 | 252 | sage: a = 5 |
252 | 253 | sage: tmp_f = tmp_filename() |
… |
… |
|
257 | 258 | 5 |
258 | 259 | |
259 | 260 | We illustrate what happens when one of the variables is a function.:: |
| 261 | |
260 | 262 | sage: f = lambda x : x^2 |
261 | 263 | sage: save_session(tmp_f) |
262 | 264 | sage: save_session(tmp_f, verbose=True) |
… |
… |
|
268 | 270 | |
269 | 271 | sage: g = cython_lambda('double x', 'x*x + 1.5') |
270 | 272 | sage: save_session(tmp_f, verbose=True) |
271 | | Saving... |
272 | 273 | Not saving g: g is a function, method, class or type |
273 | 274 | ... |
274 | 275 | """ |
diff --git a/sage/modular/modform/cuspidal_submodule.py b/sage/modular/modform/cuspidal_submodule.py
a
|
b
|
|
359 | 359 | O(q^1) |
360 | 360 | """ |
361 | 361 | pass |
| 362 | |
362 | 363 | #def _repr_(self): |
363 | 364 | # A = self.ambient_module() |
364 | 365 | # return "Cuspidal subspace of dimension %s of Modular Forms space with character %s and weight %s over %s"%(self.dimension(), self.character(), self.weight(), self.base_ring()) |
365 | | |
366 | 366 | |
367 | 367 | |
368 | 368 | def _convert_matrix_from_modsyms(symbs, T): |
diff --git a/sage/numerical/backends/glpk_backend.pyx b/sage/numerical/backends/glpk_backend.pyx
a
|
b
|
|
1237 | 1237 | sage: p.add_linear_constraint([[0, 1], [1, 2]], None, 3) |
1238 | 1238 | sage: p.set_objective([2, 5]) |
1239 | 1239 | sage: p.write_mps(os.path.join(SAGE_TMP, "lp_problem.mps"), 2) |
| 1240 | Writing problem data to... |
| 1241 | 17 records were written |
1240 | 1242 | """ |
1241 | 1243 | glp_write_mps(self.lp, modern, NULL, filename) |
1242 | 1244 | |
… |
… |
|
1742 | 1744 | sage: import sage.numerical.backends.glpk_backend as backend |
1743 | 1745 | sage: p.solver_parameter(backend.glp_simplex_or_intopt, backend.glp_simplex_only) |
1744 | 1746 | sage: p.print_ranges() |
1745 | | ... |
| 1747 | glp_print_ranges: optimal basic solution required |
1746 | 1748 | 1 |
1747 | 1749 | sage: p.solve() |
1748 | 1750 | 0 |
1749 | 1751 | sage: p.print_ranges() |
| 1752 | Write sensitivity analysis report to... |
1750 | 1753 | GLPK ... - SENSITIVITY ANALYSIS REPORT Page 1 |
1751 | 1754 | <BLANKLINE> |
1752 | | Problem: |
| 1755 | Problem: |
1753 | 1756 | Objective: 7.5 (MAXimum) |
1754 | 1757 | <BLANKLINE> |
1755 | 1758 | No. Row name St Activity Slack Lower bound Activity Obj coef Obj value at Limiting |
1756 | 1759 | Marginal Upper bound range range break point variable |
1757 | 1760 | ------ ------------ -- ------------- ------------- ------------- ------------- ------------- ------------- ------------ |
1758 | | 1 NU 3.00000 . -Inf . -2.50000 . |
| 1761 | 1 NU 3.00000 . -Inf . -2.50000 . |
1759 | 1762 | 2.50000 3.00000 +Inf +Inf +Inf |
1760 | 1763 | <BLANKLINE> |
1761 | 1764 | GLPK ... - SENSITIVITY ANALYSIS REPORT Page 2 |
1762 | 1765 | <BLANKLINE> |
1763 | | Problem: |
| 1766 | Problem: |
1764 | 1767 | Objective: 7.5 (MAXimum) |
1765 | 1768 | <BLANKLINE> |
1766 | 1769 | No. Column name St Activity Obj coef Lower bound Activity Obj coef Obj value at Limiting |
… |
… |
|
1775 | 1778 | End of report |
1776 | 1779 | <BLANKLINE> |
1777 | 1780 | 0 |
1778 | | |
1779 | | |
1780 | 1781 | """ |
1781 | 1782 | |
1782 | 1783 | from sage.misc.all import SAGE_TMP |
diff --git a/sage/numerical/mip.pyx b/sage/numerical/mip.pyx
a
|
b
|
|
1856 | 1856 | sage: b = p.get_backend() |
1857 | 1857 | sage: b.solver_parameter("simplex_or_intopt", "simplex_only") |
1858 | 1858 | sage: b.solver_parameter("verbosity_simplex", "GLP_MSG_ALL") |
1859 | | sage: p.solve() # tol 0.00001 |
| 1859 | sage: p.solve() # tol 0.00001 |
| 1860 | GLPK Simplex Optimizer, v4.44 |
| 1861 | 2 rows, 2 columns, 4 non-zeros |
| 1862 | * 0: obj = 7.000000000e+00 infeas = 0.000e+00 (0) |
| 1863 | * 2: obj = 9.400000000e+00 infeas = 0.000e+00 (0) |
| 1864 | OPTIMAL SOLUTION FOUND |
1860 | 1865 | 9.4 |
1861 | | |
1862 | 1866 | """ |
1863 | 1867 | return self._backend |
1864 | 1868 | |
diff --git a/sage/schemes/toric/variety.py b/sage/schemes/toric/variety.py
a
|
b
|
|
| 1 | # -*- coding: utf-8 -*- |
1 | 2 | r""" |
2 | 3 | Toric varieties |
3 | 4 | |
diff --git a/sage/structure/parent_old.pyx b/sage/structure/parent_old.pyx
a
|
b
|
|
66 | 66 | sage: MatrixSpace(GF(3), 1, 1).list() |
67 | 67 | [[0], [1], [2]] |
68 | 68 | sage: DirichletGroup(3).list() |
69 | | [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1, |
| 69 | [Dirichlet character modulo 3 of conductor 1 mapping 2 |--> 1, |
70 | 70 | Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1] |
71 | 71 | sage: K = GF(7^6,'a') |
72 | 72 | sage: K.list()[:10] # long time |