From c510c045815ff146a860dd6108f1983891a03218 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Fri, 9 Sep 2016 00:03:04 +0200 Subject: [PATCH] Bug in verification of Zmatrix corrected --- ocaml/Zmatrix.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ocaml/Zmatrix.ml b/ocaml/Zmatrix.ml index 294b1112..0aae3441 100644 --- a/ocaml/Zmatrix.ml +++ b/ocaml/Zmatrix.ml @@ -133,6 +133,7 @@ let of_string t = let l = match l with | First _ :: Second _ :: Third _ :: _ + | First _ :: Second _ :: Coord _ :: [] | First _ :: Second _ :: [] | First _ :: [] -> l | _ -> failwith "Syntax error" @@ -312,15 +313,14 @@ let to_xyz (z,map) = | Some x -> x | None -> failwith "Some atoms were not defined" ) result in - result + Array.to_list result let to_xyz_string (l,map) = String.concat "\n" ( to_xyz (l,map) - |> Array.map (fun (e,x,y,z) -> - Printf.sprintf "%s %f %f %f\n" (Element.to_string e) x y z) - |> Array.to_list ) + |> List.map (fun (e,x,y,z) -> + Printf.sprintf "%s %f %f %f\n" (Element.to_string e) x y z) )