package smol

  1. Overview
  2. Docs

Module Make.Make_RSource

Define arithmetic operations on vectors with values in a ring.

Parameters

module K : Algebra.Ring_S

Signature

include sig ... end
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

Sourceval neg : t -> t

Negation

Sourceval sub : t -> t -> t

Substraction

  • raises [Vector_incompatible

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

Sourcemodule Infix : sig ... end