packages feed

data-r-tree 0.0.2.0 → 0.0.3.0

raw patch · 4 files changed

+11/−12 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Data.RTree.MBB: instance Monoid MBB

Files

Data/RTree/Base.hs view
@@ -82,6 +82,7 @@     | Empty     deriving (Show, Eq, Functor, Typeable, Generic) +-- | It is possible, to change these constants, but the tree won't be space optimal anymore. m, n :: Int m = 2 n = 4@@ -361,7 +362,8 @@  -- | Unifies the first and the second tree into one. The combining function is used for elemets which exists in both trees. unionWith :: (a -> a -> a) -> RTree a -> RTree a -> RTree a-unionWith _ Empty Empty = Empty+unionWith _ l     Empty    = l+unionWith _ Empty r        = r unionWith f t1 t2     | depth t1 <= depth t2 = foldr (uncurry (insertWith f)) t2 (toList t1)     | otherwise            = unionWith f t2 t1@@ -384,6 +386,7 @@ -- ---------------  isValid :: Show b => b -> RTree a -> Bool+isValid _ Empty = True isValid _ Leaf{} = True isValid context x = case L.length c >= m && L.length c <= n && (and $ (isValid context) <$> c) && (isBalanced x) of     True -> True@@ -422,7 +425,8 @@ -- ----------------------  depth :: RTree a -> Int-depth (Leaf _ _ ) = 0+depth Empty = 0+depth (Leaf _ _ ) = 1 depth t = 1 + (depth $ head $ getChildren t)  -- | returns the number of elements in a tree
Data/RTree/MBB.hs view
@@ -28,7 +28,6 @@ where  import Data.Binary-import Data.Monoid  import GHC.Generics (Generic)   @@ -78,9 +77,3 @@   show (MBB ulx uly brx bry) = concat ["mbb ", show ulx, " ", show uly, " ", show brx, " ", show bry]  instance Binary MBB---- | mconcat will fail for empty lists. -instance Monoid MBB where-  mempty = MBB 0.0 0.0 0.0 0.0-  mappend = unionMBB-  mconcat = unionsMBB
data-r-tree.cabal view
@@ -1,5 +1,5 @@ name:                data-r-tree-version:             0.0.2.0+version:             0.0.3.0 synopsis:            R-Tree is a spatial data structure similar to Quadtrees or B-Trees. description:         R-Tree is a spatial data structure similar to Quadtrees or B-Trees.   @@ -11,7 +11,7 @@ author:              Sebastian Philipp, Birte Wagner maintainer:          sebastian@spawnhost.de copyright:           Sebastian Philipp, Birte Wagner-category:            Data+category:            Data Structures build-type:          Simple  -- extra-source-files:  
test/RTreeProperties.hs view
@@ -143,7 +143,9 @@ test_union :: Assertion test_union = do     union empty empty `eqRt` (empty :: RTree ())-    union tu_2 tu_1 `eqRt` tu_2+    union tu_2 tu_1   `eqRt` tu_2+    union t_1 empty   `eqRt` t_1+    union empty t_1   `eqRt` t_1  test_unionWith :: Assertion test_unionWith = do