Library
Module
Module type
Parameter
Class
Class type
include Vector with type atom = V.atom with type t = V.t
type atom = V.atom
The type of vector element.
type t = V.t
The type of vector.
val length : t -> int
Length of vector.
set v i e
updates the element at position i
in v
to e
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v - 1
.
get v i
returns the element at position i
in v
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v - 1
.
insert v i e
inserts the element e
at position i
in v
.
Raise Invalid_argument "index out of bounds"
if i
is outside the range 0 to length v
.
diff a b
returns a patch p
such that apply a p = b
. The difference is computed by Wagner-Fischer algorithm. O(length(a) * length(b)) time and space.
apply a p
applies the compatibe patch p
on a
.
Raise Invalid_argument "incompatible patch"
if the patch cannot be applied.