mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-11-13 01:23:41 +01:00
47 lines
1.1 KiB
OCaml
47 lines
1.1 KiB
OCaml
|
(** Encodes the powers of x, y, z in a compact form, suitable for being
|
||
|
used in a hash table.
|
||
|
*)
|
||
|
|
||
|
type t
|
||
|
|
||
|
val to_string : t -> string
|
||
|
(** Pretty printing *)
|
||
|
|
||
|
val of_powers_three : Powers.t -> t
|
||
|
(** Create from a {!Powers.t}. *)
|
||
|
|
||
|
val of_powers_six : Powers.t -> Powers.t -> t
|
||
|
(** Create from two {!Powers.t}. *)
|
||
|
|
||
|
val of_powers_nine : Powers.t -> Powers.t -> Powers.t -> t
|
||
|
(** Create from three {!Powers.t}. *)
|
||
|
|
||
|
val of_powers_twelve : Powers.t -> Powers.t -> Powers.t -> Powers.t -> t
|
||
|
(** Create from four {!Powers.t}. *)
|
||
|
|
||
|
type kind =
|
||
|
| Three of Powers.t
|
||
|
| Six of (Powers.t * Powers.t)
|
||
|
| Nine of (Powers.t * Powers.t * Powers.t)
|
||
|
| Twelve of (Powers.t * Powers.t * Powers.t * Powers.t)
|
||
|
|
||
|
val of_powers : kind -> t
|
||
|
(** Create using the [kind] type *)
|
||
|
|
||
|
val to_int_array : t -> int array
|
||
|
(** Convert to an int array. *)
|
||
|
|
||
|
val to_powers : t -> kind
|
||
|
|
||
|
(** {1 Functions for hash tables} *)
|
||
|
|
||
|
val hash : t -> int
|
||
|
(** Associates a nonnegative integer to any Zkey. *)
|
||
|
|
||
|
val equal : t -> t -> bool
|
||
|
(** The equal function. True if two Zkeys are equal. *)
|
||
|
|
||
|
val compare : t -> t -> int
|
||
|
(** Comparison function, used for sorting. *)
|
||
|
|