package gsl

  1. Overview
  2. Docs

Generic variant types for vectors and matrices

Real values

type vec = [
  1. | `V of Gsl_vector.vector
  2. | `VF of Gsl_vector_flat.vector
]
val vec_convert : ?protect:bool -> [< `A of float array | `VF of Gsl_vector_flat.vector | `V of Gsl_vector.vector ] -> [> vec ]
type mat = [
  1. | `M of Gsl_matrix.matrix
  2. | `MF of Gsl_matrix_flat.matrix
]
val mat_convert : ?protect:bool -> [< `M of Gsl_matrix.matrix | `MF of Gsl_matrix_flat.matrix | `A of float array * int * int | `AA of float array array ] -> [> mat ]
val mat_flat : ?protect:bool -> [< `M of Gsl_matrix.matrix | `MF of Gsl_matrix_flat.matrix | `A of float array * int * int | `AA of float array array ] -> Gsl_matrix_flat.matrix

Complex values

val cmat_convert : ?protect:bool -> [< `CM of Gsl_matrix_complex.matrix | `CMF of Gsl_matrix_complex_flat.matrix | `CA of Gsl_complex.complex_array * int * int ] -> [> cmat ]

Generic vector operations

val length : [< vec | cvec ] -> int
val to_array : [< vec ] -> float array
val v_copy : [< vec ] -> [> vec ]
val subvector : [< vec ] -> off:int -> len:int -> [> vec ]
val v_memcpy : [< vec ] -> [< vec ] -> unit
val v_add : [< vec ] -> [< vec ] -> unit
val v_sub : [< vec ] -> [< vec ] -> unit
val v_mul : [< vec ] -> [< vec ] -> unit
val v_div : [< vec ] -> [< vec ] -> unit
val v_max : [< vec ] -> float
val v_min : [< vec ] -> float
val v_minmax : [< vec ] -> float * float
val v_max_index : [< vec ] -> int
val v_min_index : [< vec ] -> int
val v_minmax_index : [< vec ] -> int * int

Generic matrix operations

val dims : [< mat | cmat ] -> int * int
val tmp : [< mat ] -> [> `M of Gsl_matrix.matrix ]
val to_arrays : [< mat ] -> float array array
val m_copy : [< mat ] -> [> mat ]
val m_memcpy : [< mat ] -> [< mat ] -> unit
val m_add : [< mat ] -> [< mat ] -> unit
val m_sub : [< mat ] -> [< mat ] -> unit
val m_mul : [< mat ] -> [< mat ] -> unit
val m_div : [< mat ] -> [< mat ] -> unit
val m_add_diagonal : [< mat ] -> float -> unit
val swap_rows : [< mat ] -> int -> int -> unit
val swap_columns : [< mat ] -> int -> int -> unit
val swap_rowcol : [< mat ] -> int -> int -> unit
val transpose : [< mat ] -> [< mat ] -> unit
val transpose_in_place : [< mat ] -> unit

Other generic operations

val is_null : [< vec | mat ] -> bool
val scale : [< vec | mat ] -> float -> unit
val add_constant : [< vec | mat ] -> float -> unit
OCaml

Innovation. Community. Security.