Commits

Anonymous committed 5796865

cosme

Comments (0)

Files changed (1)

   { pos_pos = 0; pos_neg = 0; neg_pos = 0; neg_neg = 0; };;
 
 let update_result r y_bar sign = match y_bar, sign with
-  | 1,1 ->
-    let i = r.pos_pos in r.pos_pos <- i + 1;
-  | 1,-1 ->
-    let i = r.pos_neg in r.pos_neg <- i + 1;
-  | -1,1 ->
-    let i = r.neg_pos in r.neg_pos <- i + 1;
-  | -1,-1 ->
-    let i = r.neg_neg in r.neg_neg <- i + 1;
-  | _,_ ->
-    raise Unknown;;
+  | 1,1 ->    let i = r.pos_pos in r.pos_pos <- i + 1;
+  | 1,-1 ->   let i = r.pos_neg in r.pos_neg <- i + 1;
+  | -1,1 ->   let i = r.neg_pos in r.neg_pos <- i + 1;
+  | -1,-1 ->  let i = r.neg_neg in r.neg_neg <- i + 1;
+  | _,_ ->    raise (Invalid_argument "only 1 or -1 is accepted as result");;
 
 let print_result r =
   let hit = r.pos_pos + r.neg_neg in