Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removal of all comments

  • Loading branch information...
commit b6c27c432473e8a705f48761d5db94ee957b7736 1 parent a0fcc73
@MarwanG MarwanG authored
View
4 src/CombSys.ml
@@ -54,14 +54,10 @@ let evaluation (phi:combsys) (z:float) (y:float array):float array =
let u = Array.create (Array.length y) 0.0 in
for i=0 to ((Array.length y) - 1)
do
- (*print_string ("i=" ^ (string_of_int i)) ;*)
let vali = eval_eq z y phi.(i)
in
- (* print_endline (" vali=" ^ (string_of_float vali)) ;*)
u.(i) <- vali
done;
- (*print_endline ("u = " ^ (Util.string_of_array string_of_float u)) ;*)
- (*print_endline (string_of_float u.(0));*)
u ;;
(* conversion from grammar *)
View
10 src/GParser.ml
@@ -115,7 +115,6 @@ let next_word str i =
else aux (i+1) (ch::word)
in
let (word,i') = aux (skip str i) [] in
- (* print_endline ("next word = " ^ (string_of_list word)) ; *)
(string_of_list word,i') ;;
let advance str i expect =
@@ -127,7 +126,6 @@ let advance str i expect =
let parse_component str i =
let rec aux i weight refs =
let (componentName,i') = next_word str i in
- (* print_endline ("Component name = " ^ componentName) ; *)
if componentName="<z>" then
let (next,i'') = next_word str i' in
(if next="*" then
@@ -152,7 +150,6 @@ let parse_component str i =
else raise (Parse_Error "Expecting '+', ';' or '*'")
else (* component Name is ok *)
let (next,i'') = next_word str i' in
- (* print_endline ("Next = " ^ next) ; *)
if next="+" or next =";" then
((weight,List.rev ((ELEM componentName)::refs)),i')
else if next="*" then
@@ -311,10 +308,3 @@ let parse_from_file fname =
if Options.global_options.verbosity >= 3
then printf "[GEN]: Parsed grammar = %s\n%!" (Grammar.string_of_grammar (List.map (fun (n,l) -> (ELEM n,l)) grm)) ;
grm ;;
-
-(*
-let gram = parse_from_file "examples/binary.arb"
-in
-(print_endline "Grammar parsed = ") ;
-(print_endline (string_of_grammar gram));;
-*)
View
47 src/Gen.ml
@@ -112,7 +112,6 @@ let rec gen_stack_tree
(fun (l,n) elt ->
match elt with
| SEQ(rul) -> let (_,rdm) = StringMap.find rul map in
-(* print_endline (string_of_float rdm);*)
let n' = int_of_float (floor((log( Random.float 1.)) /. (log rdm))) in
((List.append (concat_n [rul] n') l),(n'+n-1))
| ELEM(rul) -> if(List.exists (fun x -> x = rul) leafs) then
@@ -161,51 +160,7 @@ let gen_tree_of_stack
| 0 -> (None,0)
| _ -> gen_tree_of_stack_rec (stack,size) queue with_prefix idprefix;
(Some(Queue.pop queue),size)
-(*
-let rec gen_tree_rec
- (size:int)
- (next_rule:string)
- wmap gmap sizemax with_prefix idprefix
- : (tree option * int) =
- if sizemax-size<=0 then
- (None,sizemax)
- else
- (* On génère la suite de l'arbre *)
- if StringMap.find next_rule wmap = 1.
- (* On doit générer une feuille *)
- then
- let prefix =
- if with_prefix then idprefix ^ (string_of_int (size))
- else (string_of_int (size))
- in
- (Some (Leaf((name_of_elem next_rule),prefix)),size+1)
- else
- (* On doit générer des sous arbres *)
- let prefix =
- if with_prefix then idprefix ^ (string_of_int (size+1))
- else (string_of_int (size+1))
- in
- let rdm_float = Random.float (StringMap.find next_rule wmap) in
- let (_,_,next_rules_list) =
- List.fold_left
- (fun (limit,stop,temp) (l,f) -> if limit-.f<=0. && stop then (limit,false,l) else (limit-.f,stop,temp))
- (rdm_float,true,[])
- (StringMap.find next_rule gmap)
- in
- let aux opt next =
- match opt with
- |None -> None
- |Some(l,s) ->
- match gen_tree_rec s next wmap gmap sizemax with_prefix idprefix with
- |(None,_) -> None
- |(Some sub_tree,new_size) -> Some(l@[sub_tree],new_size)
- in
- let suite = List.fold_left aux (Some([],size+1)) next_rules_list in
- match suite with
- |None -> (None,sizemax)
- |Some([Leaf(a,b)],s) -> (Some(Leaf(a,b)),s-1)
- |Some(sons,s) -> (Some(Node((name_of_elem next_rule),prefix,sons)),s)
-*)
+
let gen_tree
(g:grammar)
(with_prefix:bool) (idprefix:string)
View
1  src/Grammar.ml
@@ -93,4 +93,3 @@ let rec string_of_grammar = function
| [] -> ""
| rul::rules -> (string_of_rule rul) ^ "\n" ^ (string_of_grammar rules) ;;
-(* print_endline (string_of_grammar bintree);; *)
View
5 src/OracleSimple.ml
@@ -22,7 +22,6 @@ let iterationSimple (phi:combsys) (z:float) (epsilon:float):float array =
let rec iterate (y:float array): float array =
let y' = evaluation phi z y
in
-(* print_endline (string_of_float (normInf_diff y y'));*)
if (Array.fold_left (fun pred x -> pred or (x > 1.)) false y')
then (Array.make (Array.length y') (-1.0))
else
@@ -37,7 +36,6 @@ let iterationSimple (phi:combsys) (z:float) (epsilon:float):float array =
let diverge (y:float array) (epsilon:float):bool =
let tooBig = 1.0/.epsilon in
let rec dvgi (i:int) (s:int):bool =
- (*print_endline ("element = " ^ (string_of_float ele));*)
if i <= s then
(if (y.(i) < 0.0) || (y.(i) > tooBig) then true
else dvgi (i+1) s)
@@ -47,14 +45,11 @@ let diverge (y:float array) (epsilon:float):bool =
(* output:zmin,zmax,vectorY *)
let rec searchSingularity phi (zmin:float) (zmax:float) (epsilon1:float) (epsilon2:float)(zstart:float):float *float* float array =
- (*print_endline ((string_of_float zmin)^" "^(string_of_float zmax));*)
if zmax -. zmin < epsilon1 then
(zmin,zmax,iterationSimple phi zmin epsilon2)
else
let z = zstart in
- (*print_float z;*)
let y = iterationSimple phi z epsilon2 in
- (*print_endline ("singularite= " ^ (string_of_float zmin) ^ "moyenne= " ^ (string_of_float z));*)
if diverge y epsilon2 = true then
searchSingularity phi zmin zstart epsilon1 epsilon2 ((zmin+.zstart)/.2.)
else
View
29 src/Util.ml
@@ -177,35 +177,6 @@ let ifAtLeast8Smallerin10OthersBigger (p1:int) (p2:int) (tab:int array) : bool
false
-(*
-let bernoulli (z:float) : bool =
- let rd = Random.float 1.0 in
- let afrd = string_of_float rd in
- if rd < z then
- true
- else
- false
- let r = bernoulli 0.5;;
-
-let af = string_of_bool r ;;
-
-print_endline af ;;
-
-"false"
-
-
-let r2 = bernoulli 0.5;;
-
-let af2 = string_of_bool r2 ;;
-
-print_endline af2 ;;
-
-"true" *)
-
-(*let gra_first ((st,ru):string*rule): string = st; *)
-
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.