Commit 8dd49407 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FEAT] Proxemy somes types as doc.

parent 9be98fd3
......@@ -79,8 +79,12 @@ graphTest= mkGraphUfromEdges [(0,1),(0,2),(0,4),(0,5),(1,0),(1,3),(1,8),(2,0),(2
--{-
--runTest_prox :: [Bool
runTest_prox_is_ok :: Bool
runTest_prox_is_ok = List.null (List.filter (not . List.null) $ map runTest_prox' [0..3])
runTest_prox' :: Node -> [((Node, (Node, Node)), Bool)]
runTest_prox' l = List.filter (\t -> snd t == False)
[ ((l,(x,y)), abs ((look (y,x) test) - (look (y,x) temoin)) < 0.0001)
| y <- nodes graphTest
......@@ -90,12 +94,11 @@ runTest_prox' l = List.filter (\t -> snd t == False)
look :: (Node,Node) -> Map Node (Map Node Double) -> Double
look (x,y) m = look' x $ look' y m
where
look' x m = maybe (panic "nokey") identity $ Map.lookup x m
look' x' m' = maybe (panic "nokey") identity $ Map.lookup x' m'
test = Map.map Map.fromList $ Map.fromList $ test_proxs_y l
temoin = Map.map Map.fromList $ Map.fromList $ test_prox l
test_proxs_y :: Length -> [(Node, [(Node, Double)])]
test_proxs_y l = map (\n -> test_proxs_x l n) (nodes graphTest)
......
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