Page
Library
Module
Module type
Parameter
Class
Class type
Source
Lacaml_D.Vecval random :
?rnd_state:Random.State.t ->
?from:float ->
?range:float ->
int ->
Lacaml_float64.vecrandom ?rnd_state ?from ?range n
val sqr :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecsqr ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the square of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val sqrt :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecsqrt ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the square root of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val exp :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecexp ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the exponential of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val log :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.veclog ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the logarithm of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val sin :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecsin ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the sine of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val cos :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.veccos ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the cosine of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val create : int -> Lacaml_float64.veccreate n
val make : int -> Lacaml_float64.num_type -> Lacaml_float64.vecmake n x
val make0 : int -> Lacaml_float64.vecmake0 n x
val init : int -> (int -> Lacaml_float64.num_type) -> Lacaml_float64.vecinit n f
val of_array : Lacaml_float64.num_type array -> Lacaml_float64.vecof_array ar
val to_array : Lacaml_float64.vec -> Lacaml_float64.num_type arrayto_array v
val of_list : Lacaml_float64.num_type list -> Lacaml_float64.vecof_list l
val to_list : Lacaml_float64.vec -> Lacaml_float64.num_type listto_list v
val append : Lacaml_float64.vec -> Lacaml_float64.vec -> Lacaml_float64.vecappend v1 v2
val concat : Lacaml_float64.vec list -> Lacaml_float64.vecconcat vs
val empty : Lacaml_float64.vecempty, the empty vector.
val linspace :
?y:Lacaml_float64.vec ->
Lacaml_float64.num_type ->
Lacaml_float64.num_type ->
int ->
Lacaml_float64.veclinspace ?z a b n
val logspace :
?y:Lacaml_float64.vec ->
Lacaml_float64.num_type ->
Lacaml_float64.num_type ->
?base:float ->
int ->
Lacaml_float64.veclogspace ?z a b base n
val dim : Lacaml_float64.vec -> intdim x
val map :
(Lacaml_float64.num_type -> Lacaml_float64.num_type) ->
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecmap f ?n ?ofsx ?incx x
val iter :
(Lacaml_float64.num_type -> unit) ->
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
unititer ?n ?ofsx ?incx f x applies function f in turn to all elements of vector x.
val iteri :
(int -> Lacaml_float64.num_type -> unit) ->
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
unititeri ?n ?ofsx ?incx f x same as iter but additionally passes the index of the element as first argument and the element itself as second argument.
val fold :
('a -> Lacaml_float64.num_type -> 'a) ->
'a ->
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
'afold f a ?n ?ofsx ?incx x is f (... (f (f a x.{ofsx}) x.{ofsx + incx}) ...) x.{ofsx + (n-1)*incx} if incx > 0 and the same in the reverse order of appearance of the x values if incx < 0.
val fill :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_type ->
unitfill ?n ?ofsx ?incx x a fills vector x with value a in the designated range.
val rev : Lacaml_float64.vec -> Lacaml_float64.vecrev x reverses vector x (non-destructive).
val max :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typemax ?n ?ofsx ?incx x computes the greater of the n elements in vector x (2-norm), separated by incx incremental steps. NaNs are ignored. If only NaNs are encountered, the negative infinity value will be returned.
val min :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typemin ?n ?ofsx ?incx x computes the smaller of the n elements in vector x (2-norm), separated by incx incremental steps. NaNs are ignored. If only NaNs are encountered, the infinity value will be returned.
val sum :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typesum ?n ?ofsx ?incx x computes the sum of the n elements in vector x, separated by incx incremental steps.
val prod :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typeprod ?n ?ofsx ?incx x computes the product of the n elements in vector x, separated by incx incremental steps.
val add_const :
Lacaml_float64.num_type ->
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecadd_const c ?n ?ofsy ?incy ?y ?ofsx ?incx x adds constant c to the n elements of vector x and stores the result in y, using incx and incy as incremental steps respectively. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val sqr_nrm2 :
?stable:bool ->
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
floatsqr_nrm2 ?stable ?n ?c ?ofsx ?incx x computes the square of the 2-norm (Euclidean norm) of vector x separated by incx incremental steps. If stable is true, this is equivalent to squaring the result of calling the BLAS-function nrm2, which avoids over- and underflow if possible. If stable is false (default), dot will be called instead for greatly improved performance.
val ssqr :
?n:int ->
?c:Lacaml_float64.num_type ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typessqr ?n ?c ?ofsx ?incx x computes the sum of squared differences of the n elements in vector x from constant c, separated by incx incremental steps. Please do not confuse with sqr_nrm2! The current function behaves differently with complex numbers when zero is passed in for c. It computes the square for each entry then, whereas sqr_nrm2 uses the conjugate transpose in the product. The latter will therefore always return a real number.
val sort :
?cmp:(Lacaml_float64.num_type -> Lacaml_float64.num_type -> int) ->
?decr:bool ->
?n:int ->
?ofsp:int ->
?incp:int ->
?p:Lacaml_common.int_vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
unitsort ?cmp ?n ?ofsx ?incx x sorts the array x in increasing order according to the comparison function cmp.
val neg :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecneg ?n ?ofsy ?incy ?y ?ofsx ?incx x negates n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val reci :
?n:int ->
?ofsy:int ->
?incy:int ->
?y:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecreci ?n ?ofsy ?incy ?y ?ofsx ?incx x computes the reciprocal value of n elements of the vector x using incx as incremental steps. If y is given, the result will be stored in there using increments of incy, otherwise a fresh vector will be used. The resulting vector is returned.
val add :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecadd ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y adds n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used. The resulting vector is returned.
val sub :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecsub ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y subtracts n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used. The resulting vector is returned.
val mul :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecmul ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y multiplies n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used. The resulting vector is returned.
val div :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.vecdiv ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y divides n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used. The resulting vector is returned.
val zpxy :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.veczpxy ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y multiplies n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively, and adds the result to and stores it in the specified range in z if provided. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used and assumed to be zero. The resulting vector is returned. This function is useful for convolutions.
val zmxy :
?n:int ->
?ofsz:int ->
?incz:int ->
?z:Lacaml_float64.vec ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.veczmxy ?n ?ofsz ?incz ?z ?ofsx ?incx x ?ofsy ?incy y multiplies n elements of vectors x and y elementwise, using incx and incy as incremental steps respectively, and substracts the result from and stores it in the specified range in z if provided. If z is given, the result will be stored in there using increments of incz, otherwise a fresh vector will be used and assumed to be zero. The resulting vector is returned. This function is useful for convolutions.
val ssqr_diff :
?n:int ->
?ofsx:int ->
?incx:int ->
Lacaml_float64.vec ->
?ofsy:int ->
?incy:int ->
Lacaml_float64.vec ->
Lacaml_float64.num_typessqr_diff ?n ?ofsx ?incx x ?ofsy ?incy y returns the sum of squared differences of n elements of vectors x and y, using incx and incy as incremental steps respectively.