Documentation ¶
Index ¶
- type Generic
- func (tr *Generic[T]) Bounds() (min, max [2]float64)
- func (tr *Generic[T]) Children(parent interface{}, reuse []child.Child) []child.Child
- func (tr *Generic[T]) Delete(min, max [2]float64, data T)
- func (tr *Generic[T]) Insert(min, max [2]float64, value T)
- func (tr *Generic[T]) Len() int
- func (tr *Generic[T]) Replace(oldMin, oldMax [2]float64, oldData T, newMin, newMax [2]float64, newData T)
- func (tr *Generic[T]) Scan(iter func(min, max [2]float64, data T) bool)
- func (tr *Generic[T]) Search(min, max [2]float64, iter func(min, max [2]float64, value T) bool)
- type RTree
- func (tr *RTree) Bounds() (min, max [2]float64)
- func (tr *RTree) Children(parent interface{}, reuse []child.Child) (children []child.Child)
- func (tr *RTree) Delete(min, max [2]float64, data interface{})
- func (tr *RTree) Insert(min, max [2]float64, data interface{})
- func (tr *RTree) Len() int
- func (tr *RTree) Replace(oldMin, oldMax [2]float64, oldData interface{}, newMin, newMax [2]float64, ...)
- func (tr *RTree) Scan(iter func(min, max [2]float64, data interface{}) bool)
- func (tr *RTree) Search(min, max [2]float64, iter func(min, max [2]float64, data interface{}) bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generic ¶ added in v1.4.0
type Generic[T any] struct { // contains filtered or unexported fields }
func (*Generic[T]) Children ¶ added in v1.4.0
Children is a utility function that returns all children for parent node. If parent node is nil then the root nodes should be returned. The min, max, data, and items slices all must have the same lengths. And, each element from all slices must be associated. Returns true for `items` when the the item at the leaf level. The reuse buffers are empty length slices that can optionally be used to avoid extra allocations.
func (*Generic[T]) Replace ¶ added in v1.4.0
func (tr *Generic[T]) Replace( oldMin, oldMax [2]float64, oldData T, newMin, newMax [2]float64, newData T, )
Replace an item. If the old item does not exist then the new item is not inserted.
type RTree ¶
type RTree struct {
// contains filtered or unexported fields
}
func (*RTree) Children ¶ added in v1.0.0
Children returns all children for parent node. If parent node is nil then the root nodes should be returned. The reuse buffer is an empty length slice that can optionally be used to avoid extra allocations.
func (*RTree) Replace ¶ added in v1.2.0
func (tr *RTree) Replace( oldMin, oldMax [2]float64, oldData interface{}, newMin, newMax [2]float64, newData interface{}, )
Replace an item in the structure. This is effectively just a Delete followed by an Insert. But for some structures it may be possible to optimize the operation to avoid multiple passes