module Sundials_RealArray2:sig..end
type t
A two-dimensional matrix. The underlying data can be accessed as
a Bigarray via Sundials_RealArray2.unwrap,
but note that the first index specifies the column.
typedata =(float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array2.t
An alias for two-dimensional Bigarrays of floating-point numbers.
val make : int -> int -> float -> tmake nr nc v returns an array with nr rows and nc columns, and
with elements set to v.
val create : int -> int -> tcreate nr nc returns an uninitialized array with nr rows and nc
columns.
val of_lists : float list list -> tof_lists xxs constructs an array from lists of rows. The inner lists
must all have the same length.
val of_arrays : float array array -> tof_lists xxs constructs an array from an array of rows. The inner arrays
must all have the same length.
val empty : tAn array with no elements.
val get : t -> int -> int -> floatget a i j returns the value at row i and column j of a.
val col : t -> int -> Sundials.RealArray.tcol a j returns the jth column of a. The slice shares storage
with a.
val set : t -> int -> int -> float -> unitset a i j v sets the value at row i and column j of a to v.
val size : t -> int * intnr, nc = size a returns the numbers of rows nr and columns nc
of a
val pp : Stdlib.Format.formatter -> t -> unitPretty-print an array using the Format module.
val ppi : ?start:string ->
?rowstart:string ->
?stop:string ->
?rowstop:string ->
?sep:string ->
?rowsep:string ->
?item:(Stdlib.Format.formatter -> int -> int -> float -> unit) ->
unit -> Stdlib.Format.formatter -> t -> unitval copy : t -> tCreates a new array with the same contents as an existing one.
val blit : src:t -> dst:t -> unitCopy the first array into the second one.
See
Bigarray.Genarray.blit for more details.
val fill : t -> float -> unitfill a c sets all elements of a to the constant c.
val make_data : int -> int -> datamake m n returns an uninitialized m by n array.
val wrap : data -> tCreates a new matrix from an existing Sundials_RealArray2.data array. Changes to
one affect the other since they share the same underlying storage.
val unwrap : t -> dataReturns the Sundials_RealArray2.data array behind a matrix. Changes to one affect
the other since they share the same underlying storage. Note that the
array is accessed column-first, that is,
get a i j = (unwrap a).{j, i}.