tabs to space, replace non-ascii [ci skip]

This commit is contained in:
Hans Dembinski
2019-02-11 22:30:41 +01:00
parent 39b7afe2bf
commit 3b110fc2a5
3 changed files with 49 additions and 49 deletions

View File

@@ -13,55 +13,55 @@ mpl.rcParams.update(mpl.rcParamsDefault)
data = defaultdict(lambda:[])
for line in open(sys.argv[1]):
if line.startswith("baseline"):
continue
descr, time = [x for x in line.split() if x]
dim, label, dist = descr.split("-")
data[int(dim[0])].append((label, dist, float(time)))
if line.startswith("baseline"):
continue
descr, time = [x for x in line.split() if x]
dim, label, dist = descr.split("-")
data[int(dim[0])].append((label, dist, float(time)))
plt.figure()
if os.path.exists("/proc/cpuinfo"):
cpuinfo = open("/proc/cpuinfo").read()
m = re.search("model name\s*:\s*(.+)\n", cpuinfo)
if m:
plt.title(m.group(1))
cpuinfo = open("/proc/cpuinfo").read()
m = re.search("model name\s*:\s*(.+)\n", cpuinfo)
if m:
plt.title(m.group(1))
i = 0
for dim in sorted(data):
v = data[dim]
labels = OrderedDict()
for label, dist, time in v:
if label in labels:
labels[label][dist] = time
else:
labels[label] = {dist: time}
j = 0
for label, d in labels.items():
t1 = d["uniform"]
t2 = d["normal"]
i -= 1
z = float(j) / len(labels)
col = ((1.0-z) * np.array((1.0, 0.0, 0.0))
+ z * np.array((1.0, 1.0, 0.0)))
if label == "root":
col = "k"
if "numpy" in label:
col = "0.6"
if "gsl" in label:
col = "0.3"
r1 = Rectangle((0, i), t1, 0.5, facecolor=col)
r2 = Rectangle((0, i+0.5), t2, 0.5, facecolor=col)
plt.gca().add_artist(r1)
plt.gca().add_artist(r2)
tx = Text(-0.1, i+0.5, "%s" % label,
va="center", ha="right", clip_on=False)
plt.gca().add_artist(tx)
j += 1
i -= 1
font0 = FontProperties()
font0.set_weight("bold")
tx = Text(-0.1, i+0.6, "%iD" % dim,
fontproperties=font0, va="center", ha="right", clip_on=False)
plt.gca().add_artist(tx)
v = data[dim]
labels = OrderedDict()
for label, dist, time in v:
if label in labels:
labels[label][dist] = time
else:
labels[label] = {dist: time}
j = 0
for label, d in labels.items():
t1 = d["uniform"]
t2 = d["normal"]
i -= 1
z = float(j) / len(labels)
col = ((1.0-z) * np.array((1.0, 0.0, 0.0))
+ z * np.array((1.0, 1.0, 0.0)))
if label == "root":
col = "k"
if "numpy" in label:
col = "0.6"
if "gsl" in label:
col = "0.3"
r1 = Rectangle((0, i), t1, 0.5, facecolor=col)
r2 = Rectangle((0, i+0.5), t2, 0.5, facecolor=col)
plt.gca().add_artist(r1)
plt.gca().add_artist(r2)
tx = Text(-0.1, i+0.5, "%s" % label,
va="center", ha="right", clip_on=False)
plt.gca().add_artist(tx)
j += 1
i -= 1
font0 = FontProperties()
font0.set_weight("bold")
tx = Text(-0.1, i+0.6, "%iD" % dim,
fontproperties=font0, va="center", ha="right", clip_on=False)
plt.gca().add_artist(tx)
plt.ylim(0, i)
plt.xlim(0, 30)

View File

@@ -24,10 +24,10 @@ for iline, line in enumerate(open(sys.argv[1])):
fig, ax = plt.subplots(1, 3, figsize=(10, 5), sharex=True, sharey=True)
if os.path.exists("/proc/cpuinfo"):
cpuinfo = open("/proc/cpuinfo").read()
m = re.search("model name\s*:\s*(.+)\n", cpuinfo)
if m:
plt.suptitle(m.group(1))
cpuinfo = open("/proc/cpuinfo").read()
m = re.search("model name\s*:\s*(.+)\n", cpuinfo)
if m:
plt.suptitle(m.group(1))
plt.subplots_adjust(bottom=0.18, wspace=0, top=0.85, right=0.98, left=0.07)
for iaxis, axis_type in enumerate(("tuple", "vector", "vector_of_variant")):
plt.sca(ax[iaxis])

View File

@@ -25,7 +25,7 @@ namespace accumulators {
independent of the number of samples.
A. Neumaier, Zeitschrift fuer Angewandte Mathematik
und Mechanik 54 (1974) 3951.
und Mechanik 54 (1974) 39-51.
*/
template <typename RealType>
class sum {