Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
clustering-louvain
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
clustering-louvain
Commits
268b2ff0
Commit
268b2ff0
authored
Mar 27, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ILouvain] mv done (todo: tests)
parent
504d3cce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
ILouvain.hs
src/Data/Graph/Clustering/ILouvain.hs
+9
-5
No files found.
src/Data/Graph/Clustering/ILouvain.hs
View file @
268b2ff0
...
...
@@ -78,14 +78,16 @@ mv g [ ] [ ] = g
mv
g
[
_
]
[ ]
=
g
mv
g
[ ]
[
_
]
=
g
mv
g
[
a
]
[
b
]
=
mv'
g
a
b
mv
g
[
a
]
[
b
]
=
case
a
==
b
of
True
->
panic
"mv: same nodes, impossible mv"
False
->
mv'
g
a
b
mv
g
[
a
,
b
]
[ ]
=
case
match
a
g
of
(
Nothing
,
_
)
->
panic
"mv: fst Node of Path does not exist"
(
Just
(
p
,
n
,
l
,
s
),
g1
)
->
case
match
b
l
of
(
Just
(
p'
,
n'
,
l'
,
s'
),
g2
)
->
(
p'
,
n'
,
g2
,
s'
)
&
((
p
,
n
,
delNode
b
l
,
s
)
&
g1
)
(
Nothing
,
_
)
->
panic
"mv: snd Node of Path does not exist"
(
Just
(
p'
,
n'
,
l'
,
s'
),
g2
)
->
(
p'
,
n'
,
g2
,
s'
)
-- & (p , n , delNode b l, s )
&
g1
mv
g
(
x
:
xs
)
(
y
:
ys
)
=
panic
"mv: path too long"
...
...
@@ -116,7 +118,9 @@ merge :: (Graph gr, DynGraph gr)
=>
gr
a
b
->
gr
a
b
->
gr
a
b
merge
=
ufold
(
&
)
------------------------------------------------------------------------
test_mv
::
Ord
a
=>
HyperGraph
a
a
->
Node
->
Node
->
Bool
test_mv
g
a
b
=
(
mv
(
mv
g
[
a
]
[
b
])
[
b
,
a
]
[]
)
==
g
------------------------------------------------------------------------
-- | Recursive Node of Graph
{-
...
...
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