Portability | portable |
---|---|
Stability | experimental |
Maintainer | Sebastian Fischer (sebf@informatik.uni-kiel.de) |
This Haskell library provides an implementation of parallel search based on the search tree provided by the package tree-monad.
- class SearchQueue q where
- emptyQ :: q a
- addQ :: SearchTree a -> q a -> q a
- viewQ :: q a -> SearchView q a
- data SearchView q a
- = EmptyQ
- | (SearchTree a) :~ (q a)
- newtype LIFO a = LIFO [SearchTree a]
- newtype FIFO a = FIFO (Seq (SearchTree a))
- parallelTreeSearch :: SearchQueue q => Int -> Int -> q a -> IO [a]
Documentation
class SearchQueue q whereSource
Search queues store multiple search trees.
Constructs an empty search queue.
addQ :: SearchTree a -> q a -> q aSource
Adds a search tree to asearch queue.
viewQ :: q a -> SearchView q aSource
creates a view on a search queue for pattern matching.
data SearchView q a Source
A SearchView
is used for pattern matching a search queue.
EmptyQ | |
(SearchTree a) :~ (q a) |
LIFO search queues can be used to implement parallel depth-first search.
LIFO [SearchTree a] |
FIFO search queues can be used to implement parallel breadth-first search.
FIFO (Seq (SearchTree a)) |
:: SearchQueue q | |
=> Int | thread limit |
-> Int | work limit |
-> q a | queue with search trees |
-> IO [a] |
This function enumerates the results stored in the queue of
SearchTree
s in parallel. It is parameterised by the maximum
number of threads to use and the maximum amount of work to perform
by each thread before communicating the results.