Commit 54343c54 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[Minor] adding type signature

parent 1851c3ee
...@@ -118,6 +118,7 @@ step (p, v, l, s) cgr = cgr ...@@ -118,6 +118,7 @@ step (p, v, l, s) cgr = cgr
where where
mNc = nodeCommunity v cgr mNc = nodeCommunity v cgr
ncs = nodeNeighbours v cgr ncs = nodeNeighbours v cgr
-- We move node from community nc into ncs -- We move node from community nc into ncs
moves :: Maybe (LNode Community, [LNode Community]) moves :: Maybe (LNode Community, [LNode Community])
moves = case mNc of moves = case mNc of
...@@ -177,11 +178,12 @@ moveNodeWithNeighbours :: Adj FEdge -> Node -> Direction -> Community -> Communi ...@@ -177,11 +178,12 @@ moveNodeWithNeighbours :: Adj FEdge -> Node -> Direction -> Community -> Communi
moveNodeWithNeighbours lnNeighbors n direction (Community (ns, inwsum, totwsum)) = moveNodeWithNeighbours lnNeighbors n direction (Community (ns, inwsum, totwsum)) =
Community (newNs, newInWsum, newTotWsum) Community (newNs, newInWsum, newTotWsum)
where where
newNs :: [Node]
newNs = case direction of newNs = case direction of
Into -> n:ns Into -> n:ns
OutOf -> DL.delete n ns OutOf -> DL.delete n ns
newInWsum, newTotWsum :: Double
newInWsum = inwsum + directionN * sumN newInWsum = inwsum + directionN * sumN
newTotWsum = totwsum + directionN * (sumN - sumNonCom) newTotWsum = totwsum + directionN * (sumN - sumNonCom)
......
Markdown is supported
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