module Gargantext.Core.Methods.Distances
where
+import Debug.Trace (trace)
import Data.Aeson
import Data.Array.Accelerate (Matrix)
import Data.Swagger
import GHC.Generics (Generic)
-import Gargantext.Prelude (Ord, Eq, Int, Double)
-import Gargantext.Prelude (Show)
import Gargantext.Core.Methods.Distances.Accelerate.Conditional (measureConditional)
-import Gargantext.Core.Methods.Distances.Accelerate.Distributional (distributional)
+import Gargantext.Core.Methods.Distances.Accelerate.Distributional (logDistributional)
+import Gargantext.Prelude (Ord, Eq, Int, Double, Show, ($), show)
import Prelude (Enum, Bounded, minBound, maxBound)
import Test.QuickCheck (elements)
import Test.QuickCheck.Arbitrary
------------------------------------------------------------------------
data Distance = Conditional | Distributional
- deriving (Show)
+ deriving (Show, Eq)
measure :: Distance -> Matrix Int -> Matrix Double
-measure Conditional = measureConditional
-measure Distributional = distributional
-------------------------------------------------------------------------
+measure Conditional x = measureConditional x
+measure Distributional x = trace (show y) $ y
+ where
+ y = logDistributional x
-withMetric :: GraphMetric -> Matrix Int -> Matrix Double
-withMetric Order1 = measureConditional
-withMetric Order2 = distributional
+------------------------------------------------------------------------
+withMetric :: GraphMetric -> Distance
+withMetric Order1 = Conditional
+withMetric Order2 = Distributional
------------------------------------------------------------------------
data GraphMetric = Order1 | Order2
arbitrary = elements [ minBound .. maxBound ]
------------------------------------------------------------------------
+
+
+