diff options
author | barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-03-18 13:30:57 +0000 |
---|---|---|
committer | barras <barras@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-03-18 13:30:57 +0000 |
commit | 067aa9a444b7d13733c8ca1cf52d6d73e105dec0 (patch) | |
tree | efa8f52dccdd7eaa8fdc04de7366f840b9a70d86 /lib | |
parent | 242e810e149d19d9a6089e6af564acd884b61fc5 (diff) |
improved the implementation of rtree
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10691 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.ml | 5 | ||||
-rw-r--r-- | lib/util.mli | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index 29edaf307..ce336ac34 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -741,6 +741,11 @@ let array_map_left_pair f a g b = r, s end +let array_iter2 f v1 v2 = + let n = Array.length v1 in + if Array.length v2 <> n then invalid_arg "array_iter2" + else for i = 0 to n - 1 do f v1.(i) v2.(i) done + let pure_functional = false let array_fold_map' f v e = diff --git a/lib/util.mli b/lib/util.mli index 92822f770..befe844bc 100644 --- a/lib/util.mli +++ b/lib/util.mli @@ -198,6 +198,7 @@ val array_map3 : val array_map_left : ('a -> 'b) -> 'a array -> 'b array val array_map_left_pair : ('a -> 'b) -> 'a array -> ('c -> 'd) -> 'c array -> 'b array * 'd array +val array_iter2 : ('a -> 'b -> unit) -> 'a array -> 'b array -> unit val array_fold_map' : ('a -> 'c -> 'b * 'c) -> 'a array -> 'c -> 'b array * 'c val array_fold_map2' : ('a -> 'b -> 'c -> 'd * 'c) -> 'a array -> 'b array -> 'c -> 'd array * 'c |