From c4ce4ce8d2dff5817b7caa758655465e34456368 Mon Sep 17 00:00:00 2001 From: WANG Date: Thu, 1 Aug 2013 18:01:05 +0200 Subject: [PATCH] Refactoring faustine in beam.ml -> method output. --- interpretor/beam.ml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/interpretor/beam.ml b/interpretor/beam.ml index cf5c003..0468e42 100644 --- a/interpretor/beam.ml +++ b/interpretor/beam.ml @@ -16,7 +16,7 @@ class beam : signal_type array -> beam_type = val signals = signals_init method get = signals - method length = Array.length signals + method width = Array.length signals method sub : int -> int -> beam_type = fun start -> @@ -37,16 +37,16 @@ class beam : signal_type array -> beam_type = method matching : int -> beam_type = fun size -> - if size = self#length then new beam self#get + if size = self#width then new beam self#get - else if (size > self#length) && (size mod self#length = 0) then + else if (size > self#width) && (size mod self#width = 0) then let () = self#add_memory 1 in let split_signals = Array.concat (Array.to_list - (Array.make (size/self#length) self#get)) in + (Array.make (size/self#width) self#get)) in new beam split_signals - else if (size < self#length) && (self#length mod size = 0) then + else if (size < self#width) && (self#width mod size = 0) then let rec merge_rec = fun (sa : signal_type array) -> fun (l : int) -> @@ -64,6 +64,7 @@ class beam : signal_type array -> beam_type = let signal_at = fun (t : time) -> fun (s : signal_type) -> s#at t in Array.map (signal_at t) self#get - method output : int -> (int list) * (float array list) = - + method output : int -> (int array) * (float array array) = + fun (length_max : int) -> + end -- 2.20.1