From 7bfbbe43d0eddfc43517a57ff312d04004906fc8 Mon Sep 17 00:00:00 2001 From: Michael Lin Date: Mon, 25 Oct 2010 17:17:06 -0400 Subject: [PATCH] CamlPaml.T.congruent: correct assert statements --- lib/CamlPaml/T.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/CamlPaml/T.ml b/lib/CamlPaml/T.ml index 4aa4441..d17bf6c 100644 --- a/lib/CamlPaml/T.ml +++ b/lib/CamlPaml/T.ml @@ -45,9 +45,9 @@ let congruent ?(tol=1e-6) ~labels ~branches t1 t2 = else try for i = 0 to size t1 - 1 do - if parent t1 i <> parent t2 i then raise False - assert (sibling t1 i = sibling t2 i) - assert (children t1 i = children t2 i) + if i < root t1 && parent t1 i <> parent t2 i then raise False + assert (i = root t1 || sibling t1 i = sibling t2 i) + assert (i < leaves t1 || children t1 i = children t2 i) if labels && label t1 i <> label t2 i then raise False if branches && abs_float (branch t1 i -. branch t2 i) > tol then raise False true