package smol

  1. Overview
  2. Docs

Module Make.Make_SRSource

Define arithmetic operations on vectors with values in a semiring.

Parameters

Signature

Sourcetype t = K.t v
Sourceexception Vector_incompatible of t * t
Sourceval zero : Literal.t list -> t

The zero vector for the given basis

Sourceval is_zero : t -> bool
Sourceval equal : t -> t -> bool

Equality of vectors

Sourceval neq : t -> t -> bool

Not equal

Sourceval add : t -> t -> t

Addition

  • raises [Vector_incompatible

    (a,b)] if the vectors do not have the same basis.

Sourceval mul_dot : t -> t -> K.t

Dot product, used for the matrix product.

  • raises [Vector_incompatible

    (a,b)] if the vectors do not have the same basis.

Sourceval mul_scalar : K.t -> t -> t

Multiplies every entry in a vector with the given scalar

Sourceval to_string : t -> string

Returns the string representation of a given vector

Sourcemodule Infix : sig ... end
OCaml

Innovation. Community. Security.