package gsl

  1. Overview
  2. Docs

Module Gsl.VectmatSource

Generic variant types for vectors and matrices

Real values

Sourcetype vec = [
  1. | `V of Vector.vector
  2. | `VF of Vector_flat.vector
]
Sourceval vec_convert : ?protect:bool -> [< `A of float array | `VF of Vector_flat.vector | `V of Vector.vector ] -> [> vec ]
Sourcetype mat = [
  1. | `M of Matrix.matrix
  2. | `MF of Matrix_flat.matrix
]
Sourceval mat_convert : ?protect:bool -> [< `M of Matrix.matrix | `MF of Matrix_flat.matrix | `A of float array * int * int | `AA of float array array ] -> [> mat ]
Sourceval mat_flat : ?protect:bool -> [< `M of Matrix.matrix | `MF of Matrix_flat.matrix | `A of float array * int * int | `AA of float array array ] -> Matrix_flat.matrix

Complex values

Sourceval cmat_convert : ?protect:bool -> [< `CM of Matrix_complex.matrix | `CMF of Matrix_complex_flat.matrix | `CA of Gsl_complex.complex_array * int * int ] -> [> cmat ]

Generic vector operations

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

Generic matrix operations

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

Other generic operations

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

Innovation. Community. Security.