package m_tree

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module M_tree.PrivateSource

Sourcetype 'a obj = {
  1. value : 'a;
  2. mutable parent_dist : float;
  3. mutable radius : float;
  4. mutable tree : 'a node option;
}
Sourceand 'a node = {
  1. is_leaf : bool;
  2. mutable objects : 'a obj list;
  3. mutable parent : ('a obj * 'a node) option;
}
Sourcetype 'a t = {
  1. mutable root : 'a node;
  2. branching_factor : int;
  3. distance : 'a -> 'a -> float;
  4. eq : 'a -> 'a -> bool;
}
include T with type 'a t := 'a t
Sourceval create : ?branching_factor:int -> ?eq:('a -> 'a -> bool) -> ('a -> 'a -> float) -> 'a t

Create an M-tree.

  • parameter branching_factor

    The branching factor of the tree (default: 32).

  • parameter eq

    An optional equality function for tree elements. If none is provided, then the distance function will be used.

Sourceval iter : 'a t -> 'a Iter.t

Iterate over the contents of the tree.

Sourceval insert : 'a t -> 'a -> unit

Insert a new point into the tree.

Sourceval range : 'a t -> 'a -> radius:float -> 'a Iter.t

Find all points that are within some radius of a query point.

Sourceval invariant : 'a t -> unit
Sourceval mk_obj : ?parent_dist:float -> ?radius:float -> ?tree:'a node option -> 'a -> 'a obj
Sourceval promote : 'a obj list -> 'a obj * 'a obj
Sourceval partition : ('a -> 'a -> float) -> 'a obj -> 'a obj -> 'a obj list -> unit
Sourceval split : 'a t -> 'a node -> 'a obj -> unit
Sourceval iter_obj : 'a obj -> 'a Iter.t
Sourceval iter_node : 'a node -> 'a Iter.t
OCaml

Innovation. Community. Security.