Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 1c37e833 authored by POTTIER Francois's avatar POTTIER Francois
Browse files

New compact encoding of the table of items in [lr0_items2].

According to the tiny test, the two encodings are equivalent.
parent 25b1f37d
...@@ -931,6 +931,18 @@ let lr0_items () = ...@@ -931,6 +931,18 @@ let lr0_items () =
physically shared. Or perhaps we could use some form of packed physically shared. Or perhaps we could use some form of packed
array? *) array? *)
let lr0_items2 () =
assert Settings.inspection;
let items : int array array =
Array.init Lr0.n (fun node ->
Array.map Item.marshal (Array.of_list (Item.Set.elements (Lr0.items node)))
)
in
define_and_measure (
"lr0_items2",
linearize_and_marshal1 items
)
(* ------------------------------------------------------------------------ *) (* ------------------------------------------------------------------------ *)
(* Let's put everything together. *) (* Let's put everything together. *)
...@@ -1039,6 +1051,7 @@ let program = ...@@ -1039,6 +1051,7 @@ let program =
rhs() :: rhs() ::
lr0_core() :: lr0_core() ::
lr0_items() :: lr0_items() ::
lr0_items2() ::
[] []
) :: ) ::
[] []
......
...@@ -153,5 +153,7 @@ module type INSPECTION_TABLES = sig ...@@ -153,5 +153,7 @@ module type INSPECTION_TABLES = sig
val lr0_items: int list array val lr0_items: int list array
val lr0_items2: PackedIntArray.t * PackedIntArray.t
end end
...@@ -197,8 +197,23 @@ module MakeInspection (T : TableFormat.INSPECTION_TABLES) = struct ...@@ -197,8 +197,23 @@ module MakeInspection (T : TableFormat.INSPECTION_TABLES) = struct
let export t = let export t =
(t lsr 7, t mod 128) (t lsr 7, t mod 128)
let items2 s =
let core = PackedIntArray.get T.lr0_core s in
(* TEMPORARY share code with [rhs] above *)
let (data, entry) = T.lr0_items2 in
let items : int list =
LinearizedArray.read_row_via
(PackedIntArray.get data)
(PackedIntArray.get entry)
core
in
List.map export items
let items s = let items s =
let core = PackedIntArray.get T.lr0_core s in let core = PackedIntArray.get T.lr0_core s in
List.map export T.lr0_items.(core) let answer1 = List.map export T.lr0_items.(core) in
let answer2 = items2 s in
assert (answer1 = answer2);
answer1
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment