package smol

  1. Overview
  2. Docs

Module Vector.MakeSource

Parameters

Signature

Sourcetype 'a v = private 'a Map.Make(Literal).t

The type of vectors. Their basis is the set of literals.

Sourceval singleton : Literal.t -> 'a -> 'a v

Make a vector with a single entry

Sourceval of_map : 'a Map.Make(Literal).t -> 'a v
Sourceval to_map : 'a v -> 'a Map.Make(Literal).t
Sourceval to_seq : 'a v -> (Literal.t * 'a) Seq.t
Sourceval add_seq : (Literal.t * 'a) Seq.t -> 'a v -> 'a v
Sourceval of_seq : (Literal.t * 'a) Seq.t -> 'a v
Sourceval mem : Literal.t -> 'a v -> bool
Sourceval get_entry : Literal.t -> 'a v -> 'a option
Sourceval add_entry : Literal.t -> 'a -> 'a v -> 'a v

Adds an entry to the vector. If the literal was already in the basis, updates the value instead.

Sourceval remove_entry : Literal.t -> 'a v -> 'a v
Sourceval update_entry : Literal.t -> ('a option -> 'a option) -> 'a v -> 'a v
Sourceval merge : (Literal.t -> 'a option -> 'b option -> 'c option) -> 'a v -> 'b v -> 'c v
Sourceval union : (Literal.t -> 'a -> 'a -> 'a option) -> 'a v -> 'a v -> 'a v
Sourceval iter : (Literal.t -> 'a -> unit) -> 'a v -> unit
Sourceval fold : (Literal.t -> 'a -> 'b -> 'b) -> 'a v -> 'b -> 'b
Sourceval for_all : (Literal.t -> 'a -> bool) -> 'a v -> bool
Sourceval exists : (Literal.t -> 'a -> bool) -> 'a v -> bool
Sourceval filter : (Literal.t -> 'a -> bool) -> 'a v -> 'a v
Sourceval partition : (Literal.t -> 'a -> bool) -> 'a v -> 'a v * 'a v
Sourceval cardinal : 'a v -> int
Sourceval bindings : 'a v -> (Literal.t * 'a) list
Sourceval map : ('a -> 'b) -> 'a v -> 'b v
Sourceval mapi : (Literal.t -> 'a -> 'b) -> 'a v -> 'b v
Sourceval get_support : 'a v -> Literal.t list

Returns the support of the vector

Sourcemodule Make_SR (K : Algebra.Semiring_S) : sig ... end

Define arithmetic operations on vectors with values in a semiring.

Sourcemodule Make_R (K : Algebra.Ring_S) : sig ... end

Define arithmetic operations on vectors with values in a ring.

Sourceval make_monoid : (module Algebra.Semiring_S with type t = 'a) -> Literal.t list -> (module Algebra.Add_Monoid_S with type t = 'a v)

Create an additive monoid on vectors from a semiring of values and a finite support

Sourceval make_group : (module Algebra.Ring_S with type t = 'a) -> Literal.t list -> (module Algebra.Add_Group_S with type t = 'a v)

Create an additive group on vectors from a ring of values and a finite support

OCaml

Innovation. Community. Security.