24 lines
764 B
Python
24 lines
764 B
Python
import sqlite3
|
|
import numpy as np
|
|
|
|
con = sqlite3.connect('data.db')
|
|
cur = con.cursor()
|
|
|
|
|
|
orders = np.array(cur.execute('select distinct ord from results').fetchall())[:,0]
|
|
eps = np.array(cur.execute('select distinct ep from results').fetchall())[:,0]
|
|
print "#", orders, eps
|
|
|
|
with open('time.out', 'w') as time_file:
|
|
for ep in eps:
|
|
time_file.write("%d " % ep)
|
|
for order in orders:
|
|
cur_results = cur.execute('select time from results where res = 1 and ep = ? and ord = ?',
|
|
(int(ep),int(order)))
|
|
cur_time = np.array(cur_results.fetchall()).mean()
|
|
time_file.write("%e " % cur_time)
|
|
time_file.write("\n")
|
|
|
|
|
|
print "%e" % np.array(cur.execute('select abs(exact - final) from results').fetchall()).mean()
|