module Roots:sig..end
Vectors of root (zero-crossing) statuses.
type t
Arrays that communicate the occurrence of zero-crossings. The underlying representation is hidden to isolate compatability issues related to integers.
type r =
| |
NoRoot |
(* | No root was found on the corresponding function (0). | *) |
| |
Rising |
(* | The corresponding root function is increasing (1). | *) |
| |
Falling |
(* | The corresponding root function is decreasing (-1). | *) |
Values indicating the status of root functions.
val create : int -> tcreate n returns an array with n elements each set to
NoRoot.
val make : int -> r -> tmake n x returns an array with n elements each set to x.
val init : int -> (int -> r) -> tinit n f returns an array with n elements, with element i set
to f i.
val length : t -> intReturns the length of an array.
val pp : Stdlib.Format.formatter -> t -> unitPretty-print a root array using the Format module.
val ppi : ?start:string ->
?stop:string ->
?sep:string ->
?item:(Stdlib.Format.formatter -> int -> r -> unit) ->
unit -> Stdlib.Format.formatter -> t -> unitval detected : t -> int -> bool
val rising : t -> int -> boolReturns true only if the specified element is Rising.
val falling : t -> int -> boolReturns true only if the specified element is Falling.
val get : t -> int -> rget r i returns the ith element of r.
val set : t -> int -> r -> unitset r i v sets the ith element of r to v.
val set_noroot : t -> int -> unitset_noroot r i sets the ith element of r to NoRoot.
val set_rising : t -> int -> unitset_rising r i sets the ith element of r to Rising.
val set_falling : t -> int -> unitset_falling r i sets the ith element of r to Falling.
val fill : t -> r -> unitfill a x sets all elements in a to x.
val copy : t -> tCreates a new array with the same contents as an existing one.
val int_of_root : r -> int
val reset : t -> unitResets all elements to NoRoot.
val exists : t -> bool
val iter : (r -> unit) -> t -> unititer f r successively applies f to each element in r.
val iteri : (int -> r -> unit) -> t -> unititeri f r successively applies f to the indexes and
elements of r.
val of_list : r list -> tCreates an array by copying the contents of a r list.
val to_list : t -> r listCopies into a list.
val of_array : r array -> tCreates a new value from the contents of an array.
val to_array : t -> r arrayCreates a new array from the contents of a given value.