Module Sundials.RootDirs

module RootDirs: sig .. end

Vectors of root (zero-crossing) directions.


type t 

Arrays that communicate which zero-crossings are sought. The underlying representation is hidden to isolate compatability issues related to integers.

type d = 
| Increasing (*

Only look for rising zero-crossings.

*)
| Decreasing (*

Only look for falling zero-crossings.

*)
| IncreasingOrDecreasing (*

Look for any zero-crossing.

*)

Values indicating which types of roots are sought.

val make : int -> d -> t

make n x returns an array with n elements each set to x.

val create : int -> t

create n returns an array with n elements each set to IncreasingOrDecreasing.

val init : int -> (int -> d) -> t

init n f returns an array with n elements, with element i set to f i.

val pp : Stdlib.Format.formatter -> t -> unit

Pretty-print a root direction array using the Format module.

val ppi : ?start:string ->
?stop:string ->
?sep:string ->
?item:(Stdlib.Format.formatter -> int -> d -> unit) ->
unit -> Stdlib.Format.formatter -> t -> unit

Pretty-print a root direction array using the Format module. The defaults are: start="[", stop="]", sep="; ", and item prints 'R' for Increasing, 'F' for Decreasing, and 'E' (either) for IncreasingOrDecreasing.

val copy : int -> d array -> t

copy n a returns an array with n elements, initialized from the contents of a. If n > Array.length a then the extra space is initialized to IncreasingOrDecreasing.

val length : t -> int

Returns the length of an array

val get : t -> int -> d

get r i returns the ith element of r.

val set : t -> int -> d -> unit

set r i v sets the ith element of r to v.

val fill : t -> d -> unit

fill_all a x sets the values of a to x everywhere.

val blitn : src:t ->
?spos:int -> dst:t -> ?dpos:int -> int -> unit

blitn ~src ?spos ~dst ?dpos len copies len elements of src at offset spos to dst at offset dpos. The spos and dpos arguments are optional and default to zero.

val blit : src:t -> dst:t -> unit

Copy the first array into the second one. See Bigarray.Genarray.blit for more details.

val of_list : d list -> t

Creates an array by copying the contents of a d list.

val to_list : t -> d list

Copies into a list.

val of_array : d array -> t

Creates a new value from the contents of an array.

val to_array : t -> d array

Creates a new array from the contents of a given value.