feat (exm): sincos example
This commit is contained in:
parent
9a0d22e880
commit
d398989ece
6 changed files with 87 additions and 58 deletions
|
|
@ -1,7 +1,4 @@
|
|||
|
||||
let debug = ref false
|
||||
|
||||
let fmt () = if !debug then Format.std_formatter
|
||||
else Format.make_formatter (fun _ _ _ -> ()) (fun () -> ())
|
||||
|
||||
let print = Format.fprintf (fmt ()) "%s"
|
||||
let print s = if !debug then Format.printf "%s\n" s else ()
|
||||
|
|
|
|||
|
|
@ -82,8 +82,6 @@ module LazySim (S : SimState) =
|
|||
(** Run the model on multiple inputs. *)
|
||||
let run_on_n model solver inputs use =
|
||||
ignore @@ List.fold_left (fun (DNode sim) i ->
|
||||
Common.Debug.print
|
||||
(Format.sprintf "New input: %.10e\t%.10e\n" i.start i.length);
|
||||
let state = match sim.step sim.state (Some i) with
|
||||
| None, s -> s | _ -> assert false in
|
||||
let rec loop (DNode s) =
|
||||
|
|
@ -185,8 +183,6 @@ module GreedySim (S : SimState) =
|
|||
(** Run the model on multiple inputs. *)
|
||||
let run_on_n model solver inputs use =
|
||||
let o, _ = List.fold_left (fun (acc, DNode sim) i ->
|
||||
Common.Debug.print
|
||||
(Format.sprintf "new input: %.10e\t%.10e\n" i.start i.length);
|
||||
let o, state = sim.step sim.state i in
|
||||
o::acc, DNode { sim with state }) ([], run model solver) inputs in
|
||||
List.iter use (List.concat (List.rev o))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue