package phylogenetics

  1. Overview
  2. Docs
type t = vec
val length : t -> int
val init : int -> f:(int -> float) -> t

Initialises a vector from a int->float function.

val map : t -> f:(float -> float) -> t
val inplace_scal_mul : float -> t -> unit

Scalar-vector product (in-place).

val scal_mul : float -> t -> t

Scalar-vector product

val scal_add : float -> t -> t

Scalar-vector addition.

val add : t -> t -> t

Vector addition.

val mul : t -> t -> t

Element-wise product of two vectors.

val sum : t -> float

Sum of the elements of a vector.

val log : t -> t

Element-wise logarithm of vector

val exp : t -> t

Element-wise exponential of matrix

val min : t -> float

Minimum element in a vector.

val max : t -> float

Maximum element in a vector.

val get : t -> int -> float

Access a specific element of a vector.

val set : t -> int -> float -> unit

Set a specific element of a vector.

val robust_equal : tol:float -> t -> t -> bool
val of_array : float array -> t
val to_array : t -> float array
val pp : Stdlib.Format.formatter -> t -> unit

Prints a vector to the standard output.

OCaml

Innovation. Community. Security.