#12925: Thematic tutorial on combinatorics
--------------------------------------------------+-------------------------
Reporter: nthiery | Owner:
sage-combinat
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-5.1
Component: combinatorics | Resolution:
Keywords: thematic tutorial | Work issues:
Report Upstream: N/A | Reviewers: Hugh
Thomas, Nicolas M. Thiéry, Timothy Walsh
Authors: Nicolas M. Thiéry, Hugh Thomas | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------------+-------------------------
Comment (by nthiery):
Replying to [comment:25 jdemeyer]:
> This takes a really long time to --long doctest (180 seconds on
sage.math).
>
> Can you either simplify some doctests or split up this file?
In the upcoming updated patch, I have fixed the tutorial to not test at
all one of the longest tests (it was marked random anyway), and to avoid a
recomputation in another long test. I used the occasion to record the time
needed for the other long tests. On my machine running the tests with
-long goes from 65s down to 35s. I guess that should do the job.
Jeroen: since the change is essentially trivial and is only about doctests
(see diff below), do you mind reviewing it, just to make the merge cycle
faster?
Thanks!
Nicolas
{{{
#!diff
diff --git a/sage/combinat/tutorial.py b/sage/combinat/tutorial.py
--- a/sage/combinat/tutorial.py
+++ b/sage/combinat/tutorial.py
@@ -661,17 +661,17 @@ calculate its cardinality (`2^{2^{2^4}}`
sage: E = Set([1,2,3,4])
sage: S = Subsets(Subsets(Subsets(E)))
- sage: S.cardinality() # long time
+ sage: n = S.cardinality(); n # long time (10s, 2012)
2003529930406846464979072351560255750447825475569751419265016973...
which is roughly `2\cdot 10^{19728}`::
- sage: S.cardinality().ndigits() # long time
+ sage: n.ndigits() # long time
19729
or ask for its `237102124`-th element::
- sage: S.unrank(237102123) # long time # random
+ sage: S.unrank(237102123) # not tested (20s, 2012)
{{{2}, {3}, {1, 2, 3, 4}, {1, 2}, {1, 4}, {}, {2, 3, 4},
{1, 2, 4}, {3, 4}, {4}, {2, 3}, {1, 2, 3}}, {{2}, {3},
{1, 2, 3, 4}, {1, 2}, {1, 4}, {2, 3, 4}, {3, 4},
@@ -1143,10 +1143,10 @@ Alternatively, we could construct an int
::
sage: cubes = [t**3 for t in range(-999,1000)]
- sage: exists([(x,y) for x in cubes for y in cubes], # long time
+ sage: exists([(x,y) for x in cubes for y in cubes], # long time
(3s, 2012)
... lambda (x,y): x+y == 218)
(True, (-125, 343))
- sage: exists(((x,y) for x in cubes for y in cubes), # long time
+ sage: exists(((x,y) for x in cubes for y in cubes), # long time
(2s, 2012)
... lambda (x,y): x+y == 218)
(True, (-125, 343))
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12925#comment:28>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.