hgeometry-0.10.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.RangeTree

Contents

Synopsis

Documentation

type RangeTree d = RT d d Source #

newtype RT i d v p r Source #

Constructors

RangeTree 

Fields

Instances
(Eq r, Eq (Assoc i d v p r), Eq (Leaf i d v p r)) => Eq (RT i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(==) :: RT i d v p r -> RT i d v p r -> Bool #

(/=) :: RT i d v p r -> RT i d v p r -> Bool #

(Show r, Show (Assoc i d v p r), Show (Leaf i d v p r)) => Show (RT i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

showsPrec :: Int -> RT i d v p r -> ShowS #

show :: RT i d v p r -> String #

showList :: [RT i d v p r] -> ShowS #

newtype Leaf i d v p r Source #

Constructors

Leaf 

Fields

Instances
RTMeasure v d p r => Measured (Assoc 1 d v p r) (Leaf 1 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

measure :: Leaf 1 d v p r -> Assoc 1 d v p r #

(RTMeasure v d p r, Ord r, 1 <= d, Arity d) => Measured (Assoc 2 d v p r) (Leaf 2 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

measure :: Leaf 2 d v p r -> Assoc 2 d v p r #

(Eq r, Eq p, Arity d) => Eq (Leaf i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(==) :: Leaf i d v p r -> Leaf i d v p r -> Bool #

(/=) :: Leaf i d v p r -> Leaf i d v p r -> Bool #

(Show r, Show p, Arity d) => Show (Leaf i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

showsPrec :: Int -> Leaf i d v p r -> ShowS #

show :: Leaf i d v p r -> String #

showList :: [Leaf i d v p r] -> ShowS #

Semigroup (Leaf i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(<>) :: Leaf i d v p r -> Leaf i d v p r -> Leaf i d v p r #

sconcat :: NonEmpty (Leaf i d v p r) -> Leaf i d v p r #

stimes :: Integral b => b -> Leaf i d v p r -> Leaf i d v p r #

Monoid (Leaf i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

mempty :: Leaf i d v p r #

mappend :: Leaf i d v p r -> Leaf i d v p r -> Leaf i d v p r #

mconcat :: [Leaf i d v p r] -> Leaf i d v p r #

type family AssocT i d v p r where ... Source #

Equations

AssocT 1 d v p r = v (Point d r :+ p) 
AssocT 2 d v p r = Maybe (RT 1 d v p r) 

newtype Assoc i d v p r Source #

Constructors

Assoc 

Fields

Instances
Eq (AssocT i d v p r) => Eq (Assoc i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(==) :: Assoc i d v p r -> Assoc i d v p r -> Bool #

(/=) :: Assoc i d v p r -> Assoc i d v p r -> Bool #

Show (AssocT i d v p r) => Show (Assoc i d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

showsPrec :: Int -> Assoc i d v p r -> ShowS #

show :: Assoc i d v p r -> String #

showList :: [Assoc i d v p r] -> ShowS #

RTMeasure v d p r => Semigroup (Assoc 1 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(<>) :: Assoc 1 d v p r -> Assoc 1 d v p r -> Assoc 1 d v p r #

sconcat :: NonEmpty (Assoc 1 d v p r) -> Assoc 1 d v p r #

stimes :: Integral b => b -> Assoc 1 d v p r -> Assoc 1 d v p r #

(RTMeasure v d p r, Ord r, 1 <= d, Arity d) => Semigroup (Assoc 2 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

(<>) :: Assoc 2 d v p r -> Assoc 2 d v p r -> Assoc 2 d v p r #

sconcat :: NonEmpty (Assoc 2 d v p r) -> Assoc 2 d v p r #

stimes :: Integral b => b -> Assoc 2 d v p r -> Assoc 2 d v p r #

(RTMeasure v d p r, Ord r, 1 <= d, Arity d) => Monoid (Assoc 2 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

mempty :: Assoc 2 d v p r #

mappend :: Assoc 2 d v p r -> Assoc 2 d v p r -> Assoc 2 d v p r #

mconcat :: [Assoc 2 d v p r] -> Assoc 2 d v p r #

RTMeasure v d p r => Measured (Assoc 1 d v p r) (Leaf 1 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

measure :: Leaf 1 d v p r -> Assoc 1 d v p r #

(RTMeasure v d p r, Ord r, 1 <= d, Arity d) => Measured (Assoc 2 d v p r) (Leaf 2 d v p r) Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

measure :: Leaf 2 d v p r -> Assoc 2 d v p r #

type RTMeasure v d p r = (LabeledMeasure v, Semigroup (v (Point d r :+ p))) Source #

createRangeTree' :: (Ord r, RTMeasure v d p r) => [Point d r :+ p] -> Maybe (RT i d v p r) Source #

createRangeTree :: (Ord r, RTMeasure v d p r) => NonEmpty (Point d r :+ p) -> RT i d v p r Source #

toAscList :: RT i d v p r -> [Point d r :+ p] Source #

Gets all points in the range tree

createRangeTree1 :: (Ord r, RTMeasure v d p r, 1 <= d, Arity d) => NonEmpty (Point d r :+ p) -> RT 1 d v p r Source #

createRangeTree2 :: forall v d r p. (Ord r, RTMeasure v d p r, Arity d, 2 <= d, 1 <= d) => NonEmpty (Point d r :+ p) -> RT 2 d v p r Source #

Querying

search :: (Ord r, Monoid (v (Point d r :+ p)), Query i d) => Vector d (Range r) -> RT i d v p r -> v (Point d r :+ p) Source #

class (i <= d, Arity d) => Query i d where Source #

Methods

search' :: Ord r => Vector d (Range r) -> RT i d v p r -> [v (Point d r :+ p)] Source #

Instances
(1 <= d, Arity d) => Query 1 d Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

search' :: Ord r => Vector d (Range r) -> RT 1 d v p r -> [v (Point d r :+ p)] Source #

(1 <= d, i <= d, Query (i - 1) d, Arity d, i ~ 2) => Query 2 d Source # 
Instance details

Defined in Data.Geometry.RangeTree

Methods

search' :: Ord r => Vector d (Range r) -> RT 2 d v p r -> [v (Point d r :+ p)] Source #