Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
145
Issues
145
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
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
haskell-gargantext
Commits
9a6c8946
Unverified
Commit
9a6c8946
authored
May 30, 2018
by
Nicolas Pouillard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New cooc2mat
parent
30757cfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
Index.hs
src/Gargantext/Viz/Graph/Index.hs
+1
-3
No files found.
src/Gargantext/Viz/Graph/Index.hs
View file @
9a6c8946
...
@@ -71,12 +71,10 @@ map'' m = cooc2mat toI m
...
@@ -71,12 +71,10 @@ map'' m = cooc2mat toI m
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
cooc2mat
::
Ord
t
=>
Map
t
Index
->
Map
(
t
,
t
)
Int
->
Matrix
Int
cooc2mat
::
Ord
t
=>
Map
t
Index
->
Map
(
t
,
t
)
Int
->
Matrix
Int
cooc2mat
ti
m
=
A
.
fromFunction
shape
(
\
(
Z
:.
x
:.
y
)
->
lookup'
x
y
)
cooc2mat
ti
m
=
map2mat
0
n
idx
where
where
shape
=
(
A
.
Z
A
.:.
n
A
.:.
n
)
n
=
M
.
size
ti
n
=
M
.
size
ti
idx
=
toIndex
ti
m
-- it is important to make sure that toIndex is ran only once.
idx
=
toIndex
ti
m
-- it is important to make sure that toIndex is ran only once.
lookup'
x
y
=
fromMaybe
0
$
M
.
lookup
(
x
,
y
)
idx
map2mat
::
Elt
a
=>
a
->
Int
->
Map
(
Index
,
Index
)
a
->
Matrix
a
map2mat
::
Elt
a
=>
a
->
Int
->
Map
(
Index
,
Index
)
a
->
Matrix
a
map2mat
def
n
m
=
A
.
fromFunction
shape
(
\
(
Z
:.
x
:.
y
)
->
fromMaybe
def
$
M
.
lookup
(
x
,
y
)
m
)
map2mat
def
n
m
=
A
.
fromFunction
shape
(
\
(
Z
:.
x
:.
y
)
->
fromMaybe
def
$
M
.
lookup
(
x
,
y
)
m
)
...
...
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