Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Coord (d :: Nat) = Coord {}
- data Split d r = Split !(Coord d) !r !(Box d () r)
- type Split' d r = SP (Coord d) r
- newtype KDTree' d p r = KDT {
- unKDT :: BinLeafTree (Split d r) (Point d r :+ p)
- data KDTree d p r
- toMaybe :: KDTree d p r -> Maybe (KDTree' d p r)
- buildKDTree :: (Arity d, 1 <= d, Ord r) => [Point d r :+ p] -> KDTree d p r
- buildKDTree' :: (Arity d, 1 <= d, Ord r) => NonEmpty (Point d r :+ p) -> KDTree' d p r
- ordNub :: Ord a => NonEmpty a -> NonEmpty a
- toPointSet :: (Arity d, Ord r) => LSeq n (Point d r :+ p) -> PointSet (LSeq n) d p r
- compareOn :: (Ord r, Arity d) => Int -> (Point d r :+ e) -> (Point d r :+ e) -> Ordering
- build :: (1 <= d, Arity d, Ord r) => Coord d -> PointSet (LSeq 1) d p r -> BinLeafTree (Split' d r) (Point d r :+ p)
- reportSubTree :: KDTree' d p r -> NonEmpty (Point d r :+ p)
- searchKDTree :: (Arity d, Ord r) => Box d q r -> KDTree d p r -> [Point d r :+ p]
- searchKDTree' :: (Arity d, Ord r) => Box d q r -> KDTree' d p r -> [Point d r :+ p]
- boxOf :: (Arity d, Ord r) => BinLeafTree (Split d r) (Point d r :+ p) -> Box d () r
- containedIn :: (Arity d, Ord r) => Box d q r -> Box d p r -> Bool
- type PointSet seq d p r = Vector d (seq (Point d r :+ p))
- splitOn :: (Arity d, KnownNat d, Ord r) => Coord d -> PointSet (LSeq 2) d p r -> (PointSet (LSeq 1) d p r, Split' d r, PointSet (LSeq 1) d p r)
- asSingleton :: (1 <= d, Arity d) => PointSet (LSeq 1) d p r -> Either (Point d r :+ p) (PointSet (LSeq 2) d p r)
Documentation
newtype Coord (d :: Nat) Source #
Instances
KnownNat d => Enum (Coord d) Source # | |
KnownNat d => Eq (Coord d) Source # | |
KnownNat d => Show (Coord d) Source # | |
buildKDTree :: (Arity d, 1 <= d, Ord r) => [Point d r :+ p] -> KDTree d p r Source #
Expects the input to be a set, i.e. no duplicates
running time: \(O(n \log n)\)
build :: (1 <= d, Arity d, Ord r) => Coord d -> PointSet (LSeq 1) d p r -> BinLeafTree (Split' d r) (Point d r :+ p) Source #
searchKDTree :: (Arity d, Ord r) => Box d q r -> KDTree d p r -> [Point d r :+ p] Source #
Searches in a KDTree
running time: \(O(n^{(d-1)/d} + k)\)