1 | |
---|
2 | from benchmark_least_squares import BenchmarkLeastSquares |
---|
3 | |
---|
4 | ben = BenchmarkLeastSquares() |
---|
5 | |
---|
6 | ofile = 'lbm_results.txt' |
---|
7 | delimiter = ',' |
---|
8 | |
---|
9 | use_least_squares_list = [True,False] |
---|
10 | is_fit_list = [True] |
---|
11 | #num_of_points_list = [10] |
---|
12 | #maxArea_list = [0.1, 0.001] |
---|
13 | num_of_points_list = [10, 100, 10000, 100000] #, 10000000] |
---|
14 | maxArea_list = [0.1, 0.001, 0.00001, 0.0000001] |
---|
15 | max_points_per_cell_list = [8] |
---|
16 | |
---|
17 | fd = open(ofile,'a') |
---|
18 | # write the title line |
---|
19 | |
---|
20 | fd.write("use_least_squares" + delimiter + |
---|
21 | "num_of_points" + delimiter + |
---|
22 | "maxArea" + delimiter + |
---|
23 | "num_of_triangles" + delimiter + |
---|
24 | "max_points_per_cell" + delimiter + |
---|
25 | "is_fit" + delimiter + |
---|
26 | "mem" + delimiter + |
---|
27 | "time" + delimiter + "\n") |
---|
28 | |
---|
29 | |
---|
30 | for use_least_squares in use_least_squares_list: |
---|
31 | for is_fit in is_fit_list: |
---|
32 | for num_of_points in num_of_points_list: |
---|
33 | for maxArea in maxArea_list: |
---|
34 | for max_points_per_cell in max_points_per_cell_list: |
---|
35 | |
---|
36 | time, mem, num_tri = ben.trial(num_of_points=num_of_points |
---|
37 | ,maxArea=maxArea |
---|
38 | ,max_points_per_cell=max_points_per_cell |
---|
39 | ,is_fit=is_fit |
---|
40 | ,use_least_squares=use_least_squares |
---|
41 | ) |
---|
42 | print "time",time |
---|
43 | print "mem", mem |
---|
44 | fd.write(str(use_least_squares) + delimiter + |
---|
45 | str(is_fit) + delimiter + |
---|
46 | str(num_of_points) + delimiter + |
---|
47 | str(maxArea) + delimiter + |
---|
48 | str(num_tri) + delimiter + |
---|
49 | str(max_points_per_cell) + delimiter + |
---|
50 | str(mem) + delimiter + |
---|
51 | str(time) + delimiter + "\n") |
---|
52 | fd.close() |
---|