package unionFind
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=73e94e8ad901ac52624ed9a910520a79
sha512=ab33c508632ef024a7974af428c737f1b0654d074f302615d395382b756c080d15b8903828bbe987de218c8ea2ab01c4c665b2c6c7512cb1c273e3bbf44307bf
doc/unionFind/UnionFind/StoreVector/index.html
Module UnionFind.StoreVectorSource
This module offers mutable stores based on mutable extensible arrays. These stores support copying, but copy is not cheap; its cost is linear in the size of the store.
A store can be thought of as a region of memory in which objects, known as references, can be dynamically allocated, read, and written. Stores are homogeneous: all references in a store of type 'a store have the content type, namely 'a. In general, a store should be thought of as a mutable object. Some stores support a cheap copy operation, because the underlying data structure allows it: for instance, a store implemented as a reference to a persistent map supports cheap copies. Some stores do not support copy at all: for instance, a store implemented using primitive references does not support copies.
copy s returns a copy of the store s. Every reference that is valid in the store s is also valid in the new store, and has the same content in both stores. The two stores are independent of one another: updating one of them does not affect the other. When supported, copy is cheap: it can be expected to run in constant time. However, some stores does not support copy; in that case, an unspecified exception is raised.
A reference of type 'a rref can be thought of as (a pointer to) an object that exists in some store.
make s v creates a fresh reference in the store s and sets its content to v. It updates the store in place and returns the newly-created reference.
get s x reads the current content of the reference x in the store s. It may update the store in place, and returns the current content of the reference.
set s x v updates the store s so as to set the content of the reference x to v. It updates the store in place.