Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-graph
Commits
28cfe091
Commit
28cfe091
authored
Jul 01, 2021
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests + dep + FIXME
parent
7664c2ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
7 deletions
+9
-7
ProxemyOptim.hs
src/Graph/BAC/ProxemyOptim.hs
+6
-4
stack.yaml
stack.yaml
+2
-2
Spec.hs
test/Spec.hs
+1
-1
No files found.
src/Graph/BAC/ProxemyOptim.hs
View file @
28cfe091
...
@@ -35,7 +35,7 @@ import Data.Proxy (Proxy(Proxy))
...
@@ -35,7 +35,7 @@ import Data.Proxy (Proxy(Proxy))
import
Data.Reflection
import
Data.Reflection
import
Eigen.Internal
(
CTriplet
(
..
),
Elem
(
..
),
toC
,
fromC
,
C
(
..
),
natToInt
,
Row
(
..
),
Col
(
..
))
import
Eigen.Internal
(
CTriplet
(
..
),
Elem
(
..
),
toC
,
fromC
,
C
(
..
),
natToInt
,
Row
(
..
),
Col
(
..
))
import
Eigen.Matrix
(
sum
,
unsafeCoeff
)
import
Eigen.Matrix
(
sum
,
unsafeCoeff
)
import
Eigen.SparseMatrix
(
SparseMatrix
,
SparseMatrixXd
,
(
!
),
toMatrix
,
_unsafeCoeff
)
import
Eigen.SparseMatrix
(
SparseMatrix
,
SparseMatrixXd
,
(
!
),
toMatrix
)
import
GHC.TypeLits
(
KnownNat
,
Nat
,
SomeNat
(
SomeNat
),
type
(
+
),
natVal
,
sameNat
,
someNatVal
)
import
GHC.TypeLits
(
KnownNat
,
Nat
,
SomeNat
(
SomeNat
),
type
(
+
),
natVal
,
sameNat
,
someNatVal
)
import
Graph.FGL
import
Graph.FGL
import
Prelude
(
String
,
readLn
)
import
Prelude
(
String
,
readLn
)
...
@@ -117,6 +117,7 @@ data Clustering a = Clustering { parts :: Dict (Set a)
...
@@ -117,6 +117,7 @@ data Clustering a = Clustering { parts :: Dict (Set a)
,
index
::
Dict
Int
,
index
::
Dict
Int
,
score
::
Double
,
score
::
Double
}
}
deriving
(
Show
)
-- TODO
-- TODO
data
ClusteringMode
=
Part
|
Over
|
Both
data
ClusteringMode
=
Part
|
Over
|
Both
...
@@ -232,7 +233,8 @@ edges_confluence l fg am tm = SMatrix.toList matconf
...
@@ -232,7 +233,8 @@ edges_confluence l fg am tm = SMatrix.toList matconf
matconf
=
SMatrix
.
imap
(
\
x
y
v
->
let
am'
=
SMatrix
.
add
am
(
SMatrix
.
fromList
[(
x
,
y
,
-
v
)])
matconf
=
SMatrix
.
imap
(
\
x
y
v
->
let
am'
=
SMatrix
.
add
am
(
SMatrix
.
fromList
[(
x
,
y
,
-
v
)])
v'
=
doProx
l
(
sparseVectorFromList
(
Proxy
@
n
)
[(
1
,
y
,
1
)])
am'
v'
=
doProx
l
(
sparseVectorFromList
(
Proxy
@
n
)
[(
1
,
y
,
1
)])
am'
prox_y_x_length
=
_unsafeCoeff
x
1
v'
prox_y_x_length
=
SMatrix
.
coeff
(
Row
x
)
(
Col
1
)
v'
-- FIXME
-- prox_y_x_length = _unsafeCoeff x 1 v'
prox_y_x_infini
=
((
VS
.!
)
degs
x
-
1
)
/
(
sumdeg
-
2
)
prox_y_x_infini
=
((
VS
.!
)
degs
x
-
1
)
/
(
sumdeg
-
2
)
in
(
prox_y_x_length
-
prox_y_x_length
)
in
(
prox_y_x_length
-
prox_y_x_length
)
...
@@ -313,10 +315,10 @@ make_clust_over = undefined
...
@@ -313,10 +315,10 @@ make_clust_over = undefined
---------------------------------------------------------------
---------------------------------------------------------------
clusteringOptim
::
forall
n
a
b
.
KnownNat
n
clusteringOptim
::
forall
n
a
b
.
KnownNat
n
=>
Length
=>
Length
->
FiniteGraph
n
a
b
->
Similarity
->
Similarity
->
FiniteGraph
n
a
b
->
Clustering
Node
->
Clustering
Node
clusteringOptim
l
fg
@
(
FiniteGraph
g
)
s
=
make_clust_part
sorted_edges
matq
clusteringOptim
l
s
fg
@
(
FiniteGraph
g
)
=
make_clust_part
sorted_edges
matq
where
where
adj
=
adjacent
fg
True
adj
=
adjacent
fg
True
tra
=
transition
adj
tra
=
transition
adj
...
...
stack.yaml
View file @
28cfe091
...
@@ -32,7 +32,7 @@ allow-newer: true
...
@@ -32,7 +32,7 @@ allow-newer: true
# - wai
# - wai
packages
:
packages
:
-
.
-
.
-
'
../eigen/'
#
- '../eigen/'
# Dependency packages to be pulled from upstream that are not in the resolver.
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
# forks / in-progress versions pinned to a git hash. For example:
...
@@ -45,7 +45,7 @@ extra-deps:
...
@@ -45,7 +45,7 @@ extra-deps:
-
git
:
https://gitlab.iscpif.fr/anoe/accelerate-utility.git
-
git
:
https://gitlab.iscpif.fr/anoe/accelerate-utility.git
commit
:
83ada76e78ac10d9559af8ed6bd4064ec81308e4
commit
:
83ada76e78ac10d9559af8ed6bd4064ec81308e4
-
accelerate-arithmetic-1.0.0.1@sha256:555639232aa5cad411e89247b27871d09352b987a754230a288c690b6de6d888,2096
-
accelerate-arithmetic-1.0.0.1@sha256:555639232aa5cad411e89247b27871d09352b987a754230a288c690b6de6d888,2096
#
- eigen-3.3.7.0@sha256:7c24a86426b238e02ba0ac2179cc44997518b443a13828ed7a791fe49a6dffa5,82060
-
eigen-3.3.7.0@sha256:7c24a86426b238e02ba0ac2179cc44997518b443a13828ed7a791fe49a6dffa5,82060
# Override default flag values for local packages and extra-deps
# Override default flag values for local packages and extra-deps
...
...
test/Spec.hs
View file @
28cfe091
...
@@ -28,4 +28,4 @@ main_test = do
...
@@ -28,4 +28,4 @@ main_test = do
a :: KnownNat n => AdjacencyMatrix n
a :: KnownNat n => AdjacencyMatrix n
a = adjacent g' False
a = adjacent g' False
-}
-}
print
$
withG
g
Prelude
.
show
-- a -- $ SMatrix.getRows a
print
$
withG
g
(
Prelude
.
show
.
(
clusteringOptim
3
Conf
))
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