]> AND Private Git Repository - canny.git/blob - stc/exp/python/complexityDisplay.py
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
ajout style
[canny.git] / stc / exp / python / complexityDisplay.py
1 import math as m 
2 import numpy as np
3 import matplotlib.pyplot as plt
4
5
6 tb = 512
7 rhugo,rwow,runiw,rcanny=[],[],[],[]
8 T=3
9
10 for k in range(1,7):
11     n = tb*k
12     rhugo +=[2*(n**2)*(343**2+m.log(n))]
13     rwow  +=[6*(n**4)*m.log(n)+n**2]
14     rcanny +=[(n**2)*(5**3+4*T+1)]
15
16
17 print rhugo
18 print rwow
19 print rcanny
20
21
22
23 n=np.linspace(512,4096,10)
24 phugo, = plt.plot(n,2*pow(n,2)*(343**2+np.log(n)),marker='o',label="L1")  
25 pwow,  =  plt.plot(n,6*pow(n,4)*np.log(n)+pow(n,2),marker='v',label="L2")
26 pcanny, = plt.plot(n,pow(n,2)*(5**3+4*T+1),marker='x',label="L3")
27 plt.yscale('log')
28 plt.ylabel('nb. of primary operations')
29 plt.xlabel("nb of lines and of rows in each image")
30 #plt.legend(handles=[phugo], loc=1)
31 #plt.legend([phugo, pwow], ["Hugo", "Wow/Uniward"])
32 l1 = plt.legend([pwow,phugo,pcanny], ["Wow/Uniward","Hugo","Stabylo"], loc=0)
33 plt.gca().add_artist(l1)
34 #plt.gca().add_artist(l2)
35 #plt.gca().add_artist(l3)
36 plt.savefig("complexity.eps")
37 #plt.show()