package gsl

  1. Overview
  2. Docs

Vector of floats implemented with a float array

type double_vector_flat = private {
  1. data : float array;
  2. off : int;
  3. len : int;
  4. stride : int;
}
type vector = double_vector_flat
val check : vector -> vector
  • raises Failure

    if off, len or stride designate an invalid subvector of data

Operations

val create : ?init:float -> int -> vector
val of_array : float array -> vector
val to_array : vector -> float array
val length : vector -> int
val get : vector -> int -> float
val set : vector -> int -> float -> unit
val set_all : vector -> float -> unit
val set_zero : vector -> unit
val set_basis : vector -> int -> unit
val memcpy : src:vector -> dst:vector -> unit
val copy : vector -> vector
val swap_element : vector -> int -> int -> unit
val reverse : vector -> unit
val add : vector -> vector -> unit
val sub : vector -> vector -> unit
val mul : vector -> vector -> unit
val div : vector -> vector -> unit
val scale : vector -> float -> unit
val add_constant : vector -> float -> unit
val is_null : vector -> bool
val max : vector -> float
val min : vector -> float
val minmax : vector -> float * float
val max_index : vector -> int
val min_index : vector -> int
val minmax_index : vector -> int * int

No-copy operations

val subvector : ?stride:int -> vector -> off:int -> len:int -> vector
val view_array : ?stride:int -> ?off:int -> ?len:int -> float array -> vector
OCaml

Innovation. Community. Security.