Skip to content

Commit e8deb81

Browse files
committed
Improved picture
1 parent 4015984 commit e8deb81

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

agregation-option-calcul-formel/tris_et_complexite.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,10 @@ Quelques courbes de complexité
145145

146146
sage: var('n')
147147
sage: xmax=10^9
148+
sage: ymin=10^-9
148149
sage: ymax=10^19
149150
sage: op_per_seconds=10^9
150-
sage: funs = [n^0, log(n), sqrt(n), n, 1000*n, n*(log(n)), n^log(3,2), n^2, n^(2.3727.n(digits=5)), n^log(7,2), n^3, 2^n, 5^n, factorial(n), n^n]
151+
sage: funs = [n^0, log(n), sqrt(n), n, 1000*n, n*(log(n)), n^log(3,2), n^2, n^(2.3727.n(digits=5)), n^log(7,2), n^3, 2^n, 5^n, gamma(n), n^n]
151152
sage: colors = rainbow(len(funs))
152153
sage: def time_label(s, t): return text(s, (1,t), horizontal_alignment = "left")
153154
sage: time_labels = sum(time_label(t,s)
@@ -160,9 +161,9 @@ Quelques courbes de complexité
160161
....: xshift=1.3^(len(funs)-2-funs.index(f))
161162
....: return text(label, ((f/op_per_seconds-ymax).find_root(1,100)*xshift, 3*ymax), horizontal_alignment="center", **options)
162163
....: return text(label, (1.1*xmax, f(n=xmax)/10^9), horizontal_alignment="left", **options)
163-
sage: p = sum( plot(f/op_per_seconds,
164+
sage: p = sum( plot((f+1.0)/op_per_seconds,
164165
....: xmin=1, xmax=(100 if f(n=100)>ymax else xmax),
165-
....: ymax=ymax,
166+
....: ymin=ymin, ymax=ymax,
166167
....: scale="loglog", gridlines=True, gridlinesstyle = {"color":'LightGray'},
167168
....: color=color) + legend(f, color=color)
168169
....: for f,color in zip(funs, colors)) + time_labels

0 commit comments

Comments
 (0)