Copyright | Copyright (c) 2015 Birte Wagner Sebastian Philipp Copyright (c) 2022 Oleksii Divak |
---|---|
License | MIT |
Maintainer | Oleksii Divak |
Stability | experimental |
Portability | not portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Data.R2Tree.Float
Description
This module (and every module below it) is a duplicate of Data.R2Tree.Double,
defined for Float
s instead of Double
s.
Synopsis
- data MBR where
- data R2Tree a
- empty :: R2Tree a
- singleton :: MBR -> a -> R2Tree a
- doubleton :: MBR -> a -> MBR -> a -> R2Tree a
- tripleton :: MBR -> a -> MBR -> a -> MBR -> a -> R2Tree a
- quadrupleton :: MBR -> a -> MBR -> a -> MBR -> a -> MBR -> a -> R2Tree a
- bulkSTR :: [(MBR, a)] -> R2Tree a
- insert :: MBR -> a -> R2Tree a -> R2Tree a
- insertGut :: MBR -> a -> R2Tree a -> R2Tree a
- delete :: MBR -> R2Tree a -> R2Tree a
- data Predicate
- equals :: MBR -> Predicate
- intersects :: MBR -> Predicate
- intersects' :: MBR -> Predicate
- contains :: MBR -> Predicate
- contains' :: MBR -> Predicate
- containedBy :: MBR -> Predicate
- containedBy' :: MBR -> Predicate
- adjustRangeWithKey :: Predicate -> (MBR -> a -> a) -> R2Tree a -> R2Tree a
- adjustRangeWithKey' :: Predicate -> (MBR -> a -> a) -> R2Tree a -> R2Tree a
- foldlRangeWithKey :: Predicate -> (b -> MBR -> a -> b) -> b -> R2Tree a -> b
- foldrRangeWithKey :: Predicate -> (MBR -> a -> b -> b) -> b -> R2Tree a -> b
- foldMapRangeWithKey :: Monoid m => Predicate -> (MBR -> a -> m) -> R2Tree a -> m
- foldlRangeWithKey' :: Predicate -> (b -> MBR -> a -> b) -> b -> R2Tree a -> b
- foldrRangeWithKey' :: Predicate -> (MBR -> a -> b -> b) -> b -> R2Tree a -> b
- traverseRangeWithKey :: Applicative f => Predicate -> (MBR -> a -> f a) -> R2Tree a -> f (R2Tree a)
- null :: R2Tree a -> Bool
- size :: R2Tree a -> Int
- map :: (a -> b) -> R2Tree a -> R2Tree b
- map' :: (a -> b) -> R2Tree a -> R2Tree b
- mapWithKey :: (MBR -> a -> b) -> R2Tree a -> R2Tree b
- mapWithKey' :: (MBR -> a -> b) -> R2Tree a -> R2Tree b
- foldl :: (b -> a -> b) -> b -> R2Tree a -> b
- foldl' :: (b -> a -> b) -> b -> R2Tree a -> b
- foldlWithKey :: (b -> MBR -> a -> b) -> b -> R2Tree a -> b
- foldlWithKey' :: (b -> MBR -> a -> b) -> b -> R2Tree a -> b
- foldr :: (a -> b -> b) -> b -> R2Tree a -> b
- foldr' :: (a -> b -> b) -> b -> R2Tree a -> b
- foldrWithKey :: (MBR -> a -> b -> b) -> b -> R2Tree a -> b
- foldrWithKey' :: (MBR -> a -> b -> b) -> b -> R2Tree a -> b
- foldMap :: Monoid m => (a -> m) -> R2Tree a -> m
- foldMapWithKey :: Monoid m => (MBR -> a -> m) -> R2Tree a -> m
- traverse :: Applicative f => (a -> f b) -> R2Tree a -> f (R2Tree b)
- traverseWithKey :: Applicative f => (MBR -> a -> f b) -> R2Tree a -> f (R2Tree b)
Documentation
Two-dimensional minimum bounding rectangle is defined as two intervals, each along a separate axis, where every endpoint is either bounded and closed (i.e. \( [a, b] \)), or infinity (i.e. \((\pm \infty, b]\)).
Degenerate intervals (i.e. \([a,a]\)) are permitted.
Bundled Patterns
pattern MBR | Reorders coordinates to fit internal invariants. Pattern matching guarantees \( x_{0} \le x_{1}, y_{0} \le y_{1} \). |
Spine-strict two-dimensional R-tree.
Instances
Foldable R2Tree Source # | |
Defined in Data.R2Tree.Float.Internal Methods fold :: Monoid m => R2Tree m -> m # foldMap :: Monoid m => (a -> m) -> R2Tree a -> m # foldMap' :: Monoid m => (a -> m) -> R2Tree a -> m # foldr :: (a -> b -> b) -> b -> R2Tree a -> b # foldr' :: (a -> b -> b) -> b -> R2Tree a -> b # foldl :: (b -> a -> b) -> b -> R2Tree a -> b # foldl' :: (b -> a -> b) -> b -> R2Tree a -> b # foldr1 :: (a -> a -> a) -> R2Tree a -> a # foldl1 :: (a -> a -> a) -> R2Tree a -> a # elem :: Eq a => a -> R2Tree a -> Bool # maximum :: Ord a => R2Tree a -> a # minimum :: Ord a => R2Tree a -> a # | |
Eq1 R2Tree Source # | |
Show1 R2Tree Source # | |
Traversable R2Tree Source # | |
Functor R2Tree Source # | Uses |
NFData1 R2Tree Source # | |
Defined in Data.R2Tree.Float.Internal | |
Show a => Show (R2Tree a) Source # | |
NFData a => NFData (R2Tree a) Source # | |
Defined in Data.R2Tree.Float.Internal | |
Eq a => Eq (R2Tree a) Source # | |
Construct
tripleton :: MBR -> a -> MBR -> a -> MBR -> a -> R2Tree a Source #
\(\mathcal{O}(1)\). Tree with three entries.
quadrupleton :: MBR -> a -> MBR -> a -> MBR -> a -> MBR -> a -> R2Tree a Source #
\(\mathcal{O}(1)\). Tree with four entries.
Bulk-loading
bulkSTR :: [(MBR, a)] -> R2Tree a Source #
\(\mathcal{O}(n \log n)\). Bulk-load a tree.
bulkSTR
uses the Sort-Tile-Recursive algorithm.
Single-key
Insert
insert :: MBR -> a -> R2Tree a -> R2Tree a Source #
\(\mathcal{O}(\log n)\). Insert a value into the tree.
insert
uses the R*-tree insertion algorithm.
insertGut :: MBR -> a -> R2Tree a -> R2Tree a Source #
\(\mathcal{O}(\log n)\). Insert a value into the tree.
insertGut
uses the R-tree insertion algorithm with quadratic-cost splits.
Compared to insert
the resulting trees are of lower quality (see the
Wikipedia article
for a graphic example).
Delete
Range
intersects' :: MBR -> Predicate Source #
Matches any MBR
that intersects the provided one, if the
intersection is not a line or a point.
contains' :: MBR -> Predicate Source #
Matches any MBR
that contains the provided one,
excluding ones that touch it on one or more sides.
containedBy' :: MBR -> Predicate Source #
Matches any MBR
that is contained within the provided one,
excluding ones that touch it on one or more sides.
Map
Fold
Traverse
traverseRangeWithKey :: Applicative f => Predicate -> (MBR -> a -> f a) -> R2Tree a -> f (R2Tree a) Source #
Full tree
Size
size :: R2Tree a -> Int Source #
\(\mathcal{O}(n)\). Calculate the number of elements stored in the tree. The returned number is guaranteed to be non-negative.
Map
map' :: (a -> b) -> R2Tree a -> R2Tree b Source #
\(\mathcal{O}(n)\). Map a function over all values and evaluate the results to WHNF.
mapWithKey :: (MBR -> a -> b) -> R2Tree a -> R2Tree b Source #
\(\mathcal{O}(n)\).
Map a function over all MBR
s and their respective values.
mapWithKey' :: (MBR -> a -> b) -> R2Tree a -> R2Tree b Source #
\(\mathcal{O}(n)\).
Map a function over all MBR
s and their respective values
and evaluate the results to WHNF.
Fold
Left-to-right
foldl :: (b -> a -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n_R)\). Fold left-to-right over all values.
foldl' :: (b -> a -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n)\). Fold left-to-right over all values, applying the operator function strictly.
foldlWithKey :: (b -> MBR -> a -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n_R)\).
Fold left-to-right over all MBR
s and their respective values.
foldlWithKey' :: (b -> MBR -> a -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n)\).
Fold left-to-right over all MBR
s and their respective values,
applying the operator function strictly.
Right-to-left
foldr :: (a -> b -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n_L)\). Fold right-to-left over all values.
foldr' :: (a -> b -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n)\). Fold right-to-left over all values, applying the operator function strictly.
foldrWithKey :: (MBR -> a -> b -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n_L)\).
Fold right-to-left over all MBR
s and their respective values.
foldrWithKey' :: (MBR -> a -> b -> b) -> b -> R2Tree a -> b Source #
\(\mathcal{O}(n)\).
Fold right-to-left over all MBR
s and their respective values,
applying the operator function strictly.
Monoid
foldMap :: Monoid m => (a -> m) -> R2Tree a -> m Source #
\(\mathcal{O}(n_M)\). Map each value to a monoid and combine the results.
foldMapWithKey :: Monoid m => (MBR -> a -> m) -> R2Tree a -> m Source #
\(\mathcal{O}(n_M)\).
Map each MBR
and its respective value to a monoid and combine the results.
Traverse
traverse :: Applicative f => (a -> f b) -> R2Tree a -> f (R2Tree b) Source #
\(\mathcal{O}(n)\). Map each value to an action, evaluate the actions left-to-right and collect the results.
traverseWithKey :: Applicative f => (MBR -> a -> f b) -> R2Tree a -> f (R2Tree b) Source #
\(\mathcal{O}(n)\).
Map each MBR
and its respective value to an action,
evaluate the actions left-to-right and collect the results.