data-r-tree-0.0.1.0: R-Tree is a spartial data structure similar to Quadtrees or B-Trees.

Portabilitynot portable
Stabilityexperimental
MaintainerBirte Wagner, Sebastian Philipp (sebastian@spawnhost.de)
Safe HaskellNone

Data.RTree.Base

Description

Internal implementations. Use Data.RTree instead

Synopsis

Documentation

data RTree a Source

Instances

Functor RTree 
Typeable1 RTree 
Eq a => Eq (RTree a) 
Show a => Show (RTree a) 
Generic (RTree a) 
Binary a => Binary (RTree a) 
NFData a => NFData (RTree a) 

empty :: RTree aSource

creates an empty tree

singleton :: MBB -> a -> RTree aSource

creates a single element tree

insert :: MBB -> a -> RTree a -> RTree aSource

inserts an element whith the given MBB and a value in a tree

union :: RTree a -> RTree a -> RTree aSource

unifies the first and the second tree into one.

lookup :: MBB -> RTree a -> Maybe aSource

returns the value if it exists in the tree

lookupRange :: MBB -> RTree a -> [a]Source

returns all values, which are located in the given bounding box.

fromList :: [(MBB, a)] -> RTree aSource

creates a tree out of pairs

toList :: RTree a -> [(MBB, a)]Source

creates a list of pairs out of a tree

toList t = zip (keys t) (values t)

delete :: MBB -> RTree a -> RTree aSource

Delete a key and its value from the RTree. When the key is not a member of the tree, the original tree is returned.

length :: RTree a -> IntSource

returns the number of elements in a tree

null :: RTree a -> BoolSource

returns True, if empty

null empty = True

keys :: RTree a -> [MBB]Source

returns all keys in this tree

toList t = zip (keys t) (values t)

values :: RTree a -> [a]Source

returns all values in this tree

toList t = zip (keys t) (values t)

mapMaybe :: (a -> Maybe b) -> RTree a -> RTree bSource

map, which also filters Nothing values

foldWithMBB :: (MBB -> a -> b) -> (MBB -> [b] -> b) -> b -> RTree a -> bSource

testing

pp :: Show a => RTree a -> IO ()Source

isValid :: Show b => b -> RTree a -> BoolSource

unionDistinct :: RTree a -> RTree a -> RTree aSource

unifies left and right RTeee. Works only, if they don't contain common keys. Much faster than union, though.