closed_intervals v0.5.0 ClosedIntervals.Tree View Source

Functions to manipulate a tree of closed intervals.

Library users will often use the ClosedIntervals struct, which contains a tree together with matching order and equality comparison functions. This module contains utilities for direct manipulations on the tree structure, many of which are reexported in ClosedIntervals.

Link to this section Summary

Link to this section Types

Link to this type

t(data)

View Source
t(data) ::
  {:tree, left :: nil | t(data), right :: nil | t(data),
   left_bound :: data, right_bound :: data, cut :: nil | data}

Link to this section Functions

Construct a tree from a sorted list of data.

See ClosedIntervals.from/2.

Link to this function

from_bounds(arg)

View Source
from_bounds({data, data}) :: t(data) when data: var

Create a tree with two leaves from the left and right bounds.

Link to this function

from_leaf_intervals(leafs)

View Source

See ClosedIntervals.from_leaf_intervals/1.

Link to this function

get_all_intervals(tree, value, eq, order)

View Source

See ClosedIntervals.get_all_intervals/2.

See ClosedIntervals.leaf_intervals/1.

See ClosedIntervals.left_bound/1.

Link to this function

map(tree, mapper)

View Source
map(t(data1), (data1 -> data2)) :: t(data2) when data1: var, data2: var

See ClosedIntervals.map/2.

See ClosedIntervals.right_bound/1.

See ClosedIntervals.to_list/1.

Link to this macro

tree(args \\ [])

View Source (macro)

This is the internal tree representation. It is not intended to be used publicly.

Link to this macro

tree(record, args)

View Source (macro)