Update from HH
[Flyspeck/.git] / glpk / tame_archive / build_lp.hl
1 (* ========================================================================== *)
2 (* FLYSPECK - CODE FORMALIZATION                                              *)
3 (*                                                                            *)
4 (* Program: Linear Programs                                                   *)
5 (* Author: Thomas C. Hales                                                    *)
6 (* Date: 2010-08-01                                                           *)
7 (* ========================================================================== *)
8
9
10 (*
11 Local build file for linear programs.
12 *)
13
14 flyspeck_needs "nonlinear/ineq.hl";;
15 flyspeck_needs   "nonlinear/parse_ineq.hl";;
16 flyspeck_needs "../glpk/glpk_link.ml";;
17 flyspeck_needs "../glpk/tame_archive/lpproc.ml";;
18 flyspeck_needs "../glpk/sphere.ml";;
19 flyspeck_needs "../glpk/tame_archive/hard_lp.ml";;
20 flyspeck_needs "../glpk/tame_archive/scaffolding.hl";;
21
22 module Build_lp = struct
23
24 let test_nonlinear_lp() = let lpineq = Ineq.getfield Lp in
25   Parse_ineq.execute_cfsqp_list lpineq;;
26
27 let rebuild_body_mod() =
28   let _ = Parse_ineq.output_filestring "/tmp/body.mod" (Parse_ineq.lpstring()) in
29   let _ = Sys.command("diff /tmp/body.mod "^flyspeck_dir^"/../glpk/tame_archive/body.mod") in
30     "--end of diff--  To install, move /tmp/body.mod to glpk/tame_archive/body.mod";;
31
32 (*
33 test_nonlinear_lp();;
34 rebuild_body_mod();;
35 *)
36
37
38 let execute() = 
39   let _ = Sys.command("date") in
40   let startdate = process_to_string  "date" in
41   let lpdata = Lpproc.execute() in
42   let  (tame_bb,feasible_bb,hard_bb,easy_bb,
43         remaining_easy_bb) = lpdata in
44   let output = 
45     if (remaining_easy_bb=[]) then (([],[],[],[],[]),Hard_lp.execute(),"finished output")
46     else (lpdata,[[]],"easy cases remain- aborted") in
47   let _ = Sys.command("date") in
48   let enddate = process_to_string "date" in
49     (startdate,!Glpk_link.solve_counter,output,enddate);;
50
51 end;;
52
53
54 (* LOG OF RUNS:
55
56
57 run_all();; 
58 !Glpk_link.solve_counter;;
59
60 Run of Hard_lp.execute();;
61 started at Thu Aug  5 16:58:26 ICT 2010
62 finished Aug  5 23:20.
63 STACK 1 15413 (so about 30K linear programs)
64 val it : Lpproc.branchnbound list list =
65   [[]; []; []; []; []; []; []; []; []; []; []; []]
66
67 retested Sep 22 on Thackmac, identical results, svn 1978.
68
69 retested Oct 22, 2010 on Malt, 2026, some weakened ineqs.
70
71
72 All retested svn 2402 on Malt
73 May 10, 2011, eliminated ineq 7676202716 from body.mod.
74 Still passes. So this inequality can be eliminated entirely!
75 STACK 1 16604
76 val it : Lpproc.branchnbound list list =
77   [[]; []; []; []; []; []; []; []; []; []; []; []]
78
79
80 May 18, svn 2411 on malt,
81 experiment 0.696 -> 0.616, and moved 3 more cases to hardid. 
82
83 let run_output = run_all();;
84
85 STACK 1 18925
86 val hard_out : Lpproc.branchnbound list list =
87   [[]; []; []; []; []; []; []; []; []; []; []; []; []; []; []]
88 I also ran the new hex cases (at least those with a pent), and they all pass easily.
89
90
91 svn 2412 on malt, May 22, 2011,
92 tameTableD[6,0]->0.712, tameTableD[4,1]->0.616.
93 This only affects the hexagon cases.  Graph generator for hexagons was rerun.
94
95 Lpproc.archiveraw :=  (Filename.concat archive_dir "string_hex_may2011.txt");;
96 !Lpproc.archiveraw;;
97 let lpdata = Lpproc.execute();;
98 let  (tame_bb,feasible_bb,hard_bb,easy_bb,remaining_easy_bb) = lpdata;;
99 (no hexagons in the hardid list)
100
101 April 14, 2012. Preparing new run. Seems to be running fine on Thackmac.
102
103
104 Quad Inequalities "6944699408 a" and "7043724150 a" have been removed.
105 Everything still goes through.
106 val build_lp_out :
107   string * int *
108   ((Lpproc.branchnbound list * Lpproc.branchnbound list *
109     Lpproc.branchnbound list * Lpproc.branchnbound list *
110     Lpproc.branchnbound list) *
111    Lpproc.branchnbound list list * string) *
112   string =
113   ("Mon Jul 29 14:50:39 EDT 2013\n", 62748,
114    (([], [], [], [], []),
115     [[]; []; []; []; []; []; []; []; []; []; []; []; []; []; []],
116     "finished output"),
117    "Mon Jul 29 20:31:03 EDT 2013\n")
118
119 *)
120