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
640915a9
Commit
640915a9
authored
Mar 26, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ILouvain] inv mv almost done
parent
edfe388c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
ILouvain.hs
src/Data/Graph/Clustering/ILouvain.hs
+14
-6
No files found.
src/Data/Graph/Clustering/ILouvain.hs
View file @
640915a9
...
...
@@ -84,10 +84,18 @@ mv g [_] [ ] = g
mv
g
[ ]
[
_
]
=
g
mv
g
[
a
]
[
b
]
=
mv'
g
a
b
mv
g
[
a
,
b
]
[ ]
=
undefined
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
(
Nothing
,
_
)
->
panic
"mv: snd Node of Path does not exist"
(
Just
(
p'
,
n'
,
l'
,
s'
),
g2
)
->
(
p'
,
n'
,
g2
,
s'
)
-- & (p , n , empty, s )
&
g1
mv
g
(
x
:
xs
)
(
y
:
ys
)
=
panic
"mv: path too long"
----------------------------
-- | Start simple (without path)
mv'
::
HyperGraph
a
a
->
Node
->
Node
...
...
@@ -101,13 +109,13 @@ mvMContext :: Maybe (HyperContext a a)
->
Maybe
(
HyperContext
a
a
)
->
HyperContext
a
a
mvMContext
(
Just
(
a1
,
n
,
l
,
a2
))
(
Just
(
a1'
,
n'
,
l'
,
a2'
))
=
(
a1'
,
n'
,
merge
l
(
c'
&
l'
),
a2'
)
(
Just
(
a1'
,
n'
,
l'
,
a2'
))
=
(
a1'
,
n'
,
merge
l
'
(
c
&
l
),
a2'
)
where
c
'
=
(
a1
,
n
,
()
,
a2
)
c
=
(
a1
,
n
,
()
,
a2
)
mvMContext
_
(
Just
_
)
=
panic
"First Node does not exist"
mvMContext
(
Just
_
)
_
=
panic
"Snd Node does not exist"
mvMContext
_
_
=
panic
"Both Nodes do not exist"
mvMContext
_
(
Just
_
)
=
panic
"
mvmcontext:
First Node does not exist"
mvMContext
(
Just
_
)
_
=
panic
"
mvmcontext:
Snd Node does not exist"
mvMContext
_
_
=
panic
"
mvmcontext:
Both Nodes do not exist"
merge
::
(
Graph
gr
,
DynGraph
gr
)
=>
gr
a
b
->
gr
a
b
->
gr
a
b
...
...
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