package modelkit

  1. Overview
  2. Docs

Module Modelkit.MatrixSource

Immutable two-dimensional float64 data in row-major C layout.

Sourcetype t
Sourceval create : rows:int -> columns:int -> float -> (t, Data_error.t) result
Sourceval init : rows:int -> columns:int -> (int -> int -> float) -> (t, Data_error.t) result
Sourceval of_arrays : float array array -> (t, Data_error.t) result
Sourceval of_bigarray : bigarray -> t
Sourceval rows : t -> int
Sourceval columns : t -> int
Sourceval shape : t -> int * int
Sourceval get : t -> int -> int -> float

get matrix row column returns one matrix element.

Raises Invalid_argument if either index is outside the matrix.

Sourceval row : t -> int -> Vector.t

row matrix index returns a zero-copy immutable view of one row.

Raises Invalid_argument if index is outside the matrix.

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