diff --git a/src/Data/RefinablePartition.hs b/src/Data/RefinablePartition.hs index 8df84d527bca0ffaca7153e367eafe418d480656..555be03e82605ebb10ce8aff1ebad6860f0ad10d 100644 --- a/src/Data/RefinablePartition.hs +++ b/src/Data/RefinablePartition.hs @@ -162,6 +162,8 @@ blockOfState p s = getState p s >>= \state -> -- This is implemented in a way to efficiently split the block in marked and -- unmarked states. -- +-- Calling 'mark' on an already marked state results in data corruption. +-- -- Runtime: O(1) mark :: RefinablePartition s -> State -> ST s () mark partition s = do diff --git a/src/MA/Algorithm/Split.hs b/src/MA/Algorithm/Split.hs index 304294431f2e90adada394aed1e7a37e61985f0f..c915be462e3578d6dc751d3370df96917313f3d8 100644 --- a/src/MA/Algorithm/Split.hs +++ b/src/MA/Algorithm/Split.hs @@ -102,6 +102,11 @@ splitBlock b = ask >>= \(as, queue) -> lift $ do deleteLargestM (Partition.blockSize (partition as)) (maybeAdd b blocks) >>= mapM_ enqueue +-- | Returns a list of blocks that have at least one predecessor state of the +-- given block @S@. +-- +-- Such predecessor states are marked for subsequent splitting and their edges +-- into @S@ are added to @toSub@. collectTouchedBlocks :: forall s h. RefinementInterface h => Block -> SplitM s h [(Block, H3 h)] collectTouchedBlocks blockS = do (as, _) <- ask