Commit 7c694a3d authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢
Browse files

Clarify documentation for BlockQueue wrt. multisortednes

parent 55880f19
......@@ -3,7 +3,7 @@
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE StrictData #-}
-- | A queue for blocks that can be used in the lumping algorithm.
-- | A queue for sorted blocks that can be used in the lumping algorithm.
--
-- Has O(1) operations for everything including membership test, which is
-- required by the algorithm mentioned above.
......@@ -33,9 +33,10 @@ import Lens.Micro.Platform ()
import Data.RefinablePartition (Block(..))
import Data.Sort (Sorted)
-- | A mutable fifo queue specialized for blocks
-- | A mutable fifo queue specialized for sorted blocks
data BlockQueue s = Q
{ _queue :: MutVar s (Seq (Sorted Block))
-- This vector has one entry for each sort
, _presence :: V.Vector (UnboxedV.MVector s Bool)
}
......@@ -43,7 +44,11 @@ makeLenses ''BlockQueue
-- | Create an empty queue
--
-- Runtime: O(n)
-- `@empty vec@` creates an empty queue for blocks from `@length vec@` sorts,
-- where the maximum block id that will be inserted per sort (probably the
-- number of states) is given in `@vec[sort]@`.
--
-- Runtime: O(total number of possible blocks)
empty :: V.Vector Int -- ^ The maximum block id that will be added for each sort
-> ST s (BlockQueue s)
empty sortSizes = do
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment