3dcc10ea0e
--HG-- rename : bin/qhull-029.txt => data/qhull-029.txt rename : bin/qhull-029.txt.gv => data/qhull-029.txt.gv
36 lines
672 B
Python
Executable File
36 lines
672 B
Python
Executable File
#!/usr/bin/python2.6
|
|
|
|
import sys
|
|
from grid.DD import grid
|
|
from grid.qhull import parse_qhull_file
|
|
from baker import get_phis, run_baker
|
|
from baker.tools import exact_func, smberror, improved_answer
|
|
from glob import glob
|
|
from os import remove
|
|
|
|
FILE_PREFIX='/tmp/qhull-'
|
|
|
|
for g in glob('%s*' % FILE_PREFIX):
|
|
remove(g)
|
|
|
|
try:
|
|
verts = parse_qhull_file(sys.argv[1], verbose=True)
|
|
except:
|
|
print "usage: app.py qhullinputfile"
|
|
sys.exit(1)
|
|
|
|
|
|
q = [exact_func(i) for i in verts]
|
|
|
|
g = grid(verts,q)
|
|
|
|
X = [0.13206472640187261, 0.98644929172054607]
|
|
|
|
exact = exact_func(X)
|
|
|
|
try:
|
|
answer = g.run_baker(X)
|
|
d[improved_answer(answer, exact)] += 1
|
|
except smberror as e:
|
|
print e
|