Commit 28cfe091 authored by Alexandre Delanoë's avatar Alexandre Delanoë

fix tests + dep + FIXME

parent 7664c2ef
......@@ -35,7 +35,7 @@ import Data.Proxy (Proxy(Proxy))
import Data.Reflection
import Eigen.Internal (CTriplet(..), Elem(..), toC, fromC, C(..), natToInt, Row(..), Col(..))
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 Graph.FGL
import Prelude (String, readLn)
......@@ -117,6 +117,7 @@ data Clustering a = Clustering { parts :: Dict (Set a)
, index :: Dict Int
, score :: Double
}
deriving (Show)
-- TODO
data ClusteringMode = Part | Over | Both
......@@ -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)])
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)
in (prox_y_x_length - prox_y_x_length)
......@@ -313,10 +315,10 @@ make_clust_over = undefined
---------------------------------------------------------------
clusteringOptim :: forall n a b. KnownNat n
=> Length
-> FiniteGraph n a b
-> Similarity
-> FiniteGraph n a b
-> 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
adj = adjacent fg True
tra = transition adj
......
......@@ -32,7 +32,7 @@ allow-newer: true
# - wai
packages:
- .
- '../eigen/'
#- '../eigen/'
# Dependency packages to be pulled from upstream that are not in the resolver.
# These entries can reference officially published versions as well as
# forks / in-progress versions pinned to a git hash. For example:
......@@ -45,7 +45,7 @@ extra-deps:
- git: https://gitlab.iscpif.fr/anoe/accelerate-utility.git
commit: 83ada76e78ac10d9559af8ed6bd4064ec81308e4
- 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
......
......@@ -28,4 +28,4 @@ main_test = do
a :: KnownNat n => AdjacencyMatrix n
a = adjacent g' False
-}
print $ withG g Prelude.show -- a -- $ SMatrix.getRows a
print $ withG g (Prelude.show . (clusteringOptim 3 Conf))
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