mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
lra: better debug
This commit is contained in:
parent
8fb0152754
commit
8530c07c59
2 changed files with 13 additions and 5 deletions
|
|
@ -563,13 +563,15 @@ module Make(A : ARG) : S with module A = A = struct
|
||||||
|
|
||||||
(** Check satisfiability of simplex, and sets [self.last_res] *)
|
(** Check satisfiability of simplex, and sets [self.last_res] *)
|
||||||
let check_simplex_ self si acts : SimpSolver.Subst.t =
|
let check_simplex_ self si acts : SimpSolver.Subst.t =
|
||||||
Log.debug 5 "(lra.check-simplex)";
|
Log.debugf 5
|
||||||
|
(fun k->k "(@[lra.check-simplex@ :n-vars %d :n-rows %d@])"
|
||||||
|
(SimpSolver.n_vars self.simplex) (SimpSolver.n_rows self.simplex));
|
||||||
let res =
|
let res =
|
||||||
Profile.with_ "lra.simplex.solve"
|
Profile.with_ "lra.simplex.solve" @@ fun () ->
|
||||||
(fun () ->
|
|
||||||
SimpSolver.check self.simplex
|
SimpSolver.check self.simplex
|
||||||
~on_propagate:(on_propagate_ si acts))
|
~on_propagate:(on_propagate_ si acts)
|
||||||
in
|
in
|
||||||
|
Log.debug 5 "(lra.check-simplex.done)";
|
||||||
self.last_res <- Some res;
|
self.last_res <- Some res;
|
||||||
begin match res with
|
begin match res with
|
||||||
| SimpSolver.Sat m -> m
|
| SimpSolver.Sat m -> m
|
||||||
|
|
|
||||||
|
|
@ -152,6 +152,9 @@ module type S = sig
|
||||||
t -> result option
|
t -> result option
|
||||||
(** Try to solve and respect the integer constraints. *)
|
(** Try to solve and respect the integer constraints. *)
|
||||||
|
|
||||||
|
val n_vars: t -> int
|
||||||
|
val n_rows: t -> int
|
||||||
|
|
||||||
(**/**)
|
(**/**)
|
||||||
val _check_invariants : t -> unit
|
val _check_invariants : t -> unit
|
||||||
(* check internal invariants *)
|
(* check internal invariants *)
|
||||||
|
|
@ -470,6 +473,9 @@ module Make(Arg: ARG)
|
||||||
~f:(fun f -> f());
|
~f:(fun f -> f());
|
||||||
()
|
()
|
||||||
|
|
||||||
|
let n_vars self = Vec.size self.vars
|
||||||
|
let n_rows self = Matrix.n_rows self.matrix
|
||||||
|
|
||||||
let pp_stats out (self:t) : unit =
|
let pp_stats out (self:t) : unit =
|
||||||
Fmt.fprintf out "(@[simplex@ :n-vars %d@ :n-rows %d@])"
|
Fmt.fprintf out "(@[simplex@ :n-vars %d@ :n-rows %d@])"
|
||||||
(Vec.size self.vars) (Matrix.n_rows self.matrix)
|
(Vec.size self.vars) (Matrix.n_rows self.matrix)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue