Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-orbit
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Katerina Roukounaki
cloud-orbit
Commits
c598399b
Commit
c598399b
authored
Nov 14, 2014
by
Aggelos Giantsios
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add type alias for the generators
parent
97b708ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
Sequential.hs
Sequential.hs
+7
-5
No files found.
Sequential.hs
View file @
c598399b
--
-- orbit-int sequential implementation
--
module
Sequential
(
orbit
)
where
module
Sequential
(
Generator
,
orbit
)
where
import
Table
(
Freq
,
Stats
,
VTable
,
Vertex
,
get_freq
,
freq_to_stat
,
is_member
,
insert
,
new
,
to_list
)
import
Data.Hashable
(
hash
)
import
Data.Dequeue
(
BankersDequeue
,
fromList
,
popFront
,
pushBack
)
import
OrbitUtils
(
now
)
type
Conf
=
([
Vertex
->
Vertex
],
Int
)
type
Generator
=
Vertex
->
Vertex
type
Conf
=
([
Generator
],
Int
)
-- DATA
-- Static Machine Configuration:
...
...
@@ -24,7 +26,7 @@ type Conf = ([Vertex -> Vertex], Int)
-- where the hash table is of size TableSize.
-- The function returns a pair consisting of the computed orbit and a singleton
-- list of statistics (mainly runtime and fill degree of the table).
orbit
::
[
Vertex
->
Vertex
]
->
[
Vertex
]
->
Int
->
([
Vertex
],
[
Stats
])
orbit
::
[
Generator
]
->
[
Vertex
]
->
Int
->
([
Vertex
],
[
Stats
])
orbit
gs
xs
tableSize
=
(
orbit
,
[
stat
])
-- assemble static configuration
where
staticMachConf
=
mk_static_mach_conf
gs
tableSize
...
...
@@ -81,10 +83,10 @@ hash_vertex staticMachConf x =
-- auxiliary functions
-- functions operating on the StaticMachConf
mk_static_mach_conf
::
[
Vertex
->
Vertex
]
->
Int
->
Conf
mk_static_mach_conf
::
[
Generator
]
->
Int
->
Conf
mk_static_mach_conf
gs
tableSize
=
(
gs
,
tableSize
)
get_gens
::
Conf
->
[
Vertex
->
Vertex
]
get_gens
::
Conf
->
[
Generator
]
get_gens
staticMachConf
=
fst
staticMachConf
get_table_size
::
Conf
->
Int
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment