package modelkit

  1. Overview
  2. Docs

Module Modelkit.VectorSource

Immutable one-dimensional float64 data.

Values use C-layout Bigarray storage. Admission from and export to a Bigarray copy the buffer so mutation outside ModelKit cannot change an admitted value.

Sourcetype t
Sourceval create : length:int -> float -> (t, Data_error.t) result
Sourceval init : length:int -> (int -> float) -> (t, Data_error.t) result
Sourceval of_array : float array -> t
Sourceval of_bigarray : bigarray -> t
Sourceval length : t -> int
Sourceval get : t -> int -> float

get vector index returns the value at index.

Raises Invalid_argument if index is outside the vector.

Sourceval to_array : t -> float array
Sourceval to_bigarray : t -> bigarray