Add a caching module.
[tatoo.git] / src / utils / cache.mli
diff --git a/src/utils/cache.mli b/src/utils/cache.mli
new file mode 100644 (file)
index 0000000..dba9917
--- /dev/null
@@ -0,0 +1,71 @@
+(***********************************************************************)
+(*                                                                     *)
+(*                               TAToo                                 *)
+(*                                                                     *)
+(*                     Kim Nguyen, LRI UMR8623                         *)
+(*                   Université Paris-Sud & CNRS                       *)
+(*                                                                     *)
+(*  Copyright 2010-2013 Université Paris-Sud and Centre National de la *)
+(*  Recherche Scientifique. All rights reserved.  This file is         *)
+(*  distributed under the terms of the GNU Lesser General Public       *)
+(*  License, with the special exception on linking described in file   *)
+(*  ../LICENSE.                                                        *)
+(*                                                                     *)
+(***********************************************************************)
+
+(*
+  Time-stamp: <Last modified on 2013-03-13 16:01:55 CET by Kim Nguyen>
+*)
+
+(** N-dimentional caches *)
+
+module N1 :
+sig
+
+  type 'a t
+  val create : int -> 'a -> 'a t
+  val find : 'a t -> int -> 'a
+  val add : 'a t -> int -> 'a -> unit
+  val dummy : 'a t -> 'a
+  val iteri : (int -> 'a -> bool -> unit) -> 'a t -> unit
+end
+
+module N2:
+sig
+    type 'a t
+    val create : int -> 'a -> 'a t
+    val find : 'a t -> int -> int -> 'a
+    val add : 'a t -> int -> int -> 'a -> unit
+    val dummy : 'a t -> 'a
+    val iteri : (int -> int -> 'a -> bool -> unit) -> 'a t -> unit
+end
+
+module N3 :
+  sig
+    type 'a t
+    val create : int -> 'a -> 'a t
+    val find : 'a t -> int -> int -> int -> 'a
+    val add : 'a t -> int -> int -> int -> 'a -> unit
+    val dummy : 'a t -> 'a
+    val iteri : (int -> int -> int -> 'a -> bool -> unit) -> 'a t -> unit
+  end
+
+module N4 :
+  sig
+    type 'a t
+    val create : int -> 'a -> 'a t
+    val find : 'a t -> int -> int -> int -> int -> 'a
+    val add : 'a t -> int -> int -> int -> int -> 'a -> unit
+    val dummy : 'a t -> 'a
+    val iteri : (int -> int -> int -> int -> 'a -> bool -> unit) -> 'a t -> unit
+  end
+
+module N5 :
+  sig
+    type 'a t
+    val create : int -> 'a -> 'a t
+    val find : 'a t -> int -> int -> int -> int -> int -> 'a
+    val add : 'a t -> int -> int -> int -> int -> int -> 'a -> unit
+    val dummy : 'a t -> 'a
+    val iteri : (int -> int -> int -> int -> int -> 'a -> bool -> unit) -> 'a t -> unit
+  end