Commit 34d68dc4 authored by Alfredo Di Napoli's avatar Alfredo Di Napoli

Split the project in 3

This commit splits the project in 3 sub-projects:

1. `gargantext-graph-core`: it contains the plain algorithms on graphs;
2. `gargantext-graph-accelerate`: accelerate utilities on graphs;
3. `gargantext-graph-eigin`: eigen utilities on graphs;
parent 02333f45
Pipeline #7352 failed with stages
...@@ -2,3 +2,5 @@ ...@@ -2,3 +2,5 @@
*~ *~
*lock *lock
dist-newstyle dist-newstyle
.DS_Store**
cabal.project.local
packages: . packages: gargantext-graph-core
gargantext-graph-accelerate
gargantext-graph-eigen
index-state: 2025-02-17T10:13:39Z index-state: 2025-02-17T10:13:39Z
...@@ -26,16 +28,6 @@ source-repository-package ...@@ -26,16 +28,6 @@ source-repository-package
location: https://github.com/AccelerateHS/accelerate.git location: https://github.com/AccelerateHS/accelerate.git
tag: 334d05519436bb7f20f9926ec76418f5b8afa359 tag: 334d05519436bb7f20f9926ec76418f5b8afa359
source-repository-package
type: git
location: https://github.com/alpmestan/accelerate-arithmetic.git
tag: a110807651036ca2228a76507ee35bbf7aedf87a
source-repository-package
type: git
location: https://gitlab.iscpif.fr/amestanogullari/accelerate-utility.git
tag: a3875fe652d3bb5acb522674c22c6c814c1b4ad0
source-repository-package source-repository-package
type: git type: git
location: https://github.com/alpmestan/hmatrix.git location: https://github.com/alpmestan/hmatrix.git
......
...@@ -10,8 +10,6 @@ constraints: any.Cabal ==3.10.3.0, ...@@ -10,8 +10,6 @@ constraints: any.Cabal ==3.10.3.0,
any.StateVar ==1.2.2, any.StateVar ==1.2.2,
any.accelerate ==1.3.0.0, any.accelerate ==1.3.0.0,
accelerate +bounds-checks -debug -internal-checks -nofib -unsafe-checks, accelerate +bounds-checks -debug -internal-checks -nofib -unsafe-checks,
any.accelerate-arithmetic ==1.0.0.1,
any.accelerate-utility ==1.0.0.1,
any.adjunctions ==4.4.2, any.adjunctions ==4.4.2,
any.aeson ==2.2.3.0, any.aeson ==2.2.3.0,
aeson +ordered-keymap, aeson +ordered-keymap,
......
cabal-version: 1.12
-- This file has been generated from package.yaml by hpack version 0.34.7.
--
-- see: https://github.com/sol/hpack
name: gargantext-graph-accelerate
version: 0.1.0.0
description: Please see the README on GitHub at <https://github.com/githubuser/gargantext-graph#readme>
homepage: https://github.com/gargantext/gargantext-graph#readme
bug-reports: https://github.com/gargantext/gargantext-graph/issues
author: Alexandre Delanoë
maintainer: alexandre+dev@delanoe.org
copyright: 2021 CNRS / Alexandre Delanoë
license: AGPL
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
source-repository head
type: git
location: https://github.com/gargantext/gargantext-graph
library
exposed-modules:
Data.Array.Accelerate.Utils
other-modules:
Paths_gargantext_graph_accelerate
hs-source-dirs:
src
default-extensions:
DataKinds
FlexibleInstances
OverloadedStrings
build-depends:
accelerate
, base >=4.7 && <5
, protolude
default-language: Haskell2010
...@@ -33,7 +33,6 @@ module Data.Array.Accelerate.Utils ...@@ -33,7 +33,6 @@ module Data.Array.Accelerate.Utils
where where
import qualified Data.Foldable as P (foldl1) import qualified Data.Foldable as P (foldl1)
import Debug.Trace (trace)
import Data.Array.Accelerate import Data.Array.Accelerate
import Data.Array.Accelerate.Interpreter (run) import Data.Array.Accelerate.Interpreter (run)
import qualified Protolude as P import qualified Protolude as P
...@@ -417,14 +416,7 @@ theMatrixInt n = matrix n (dataMatrix n) ...@@ -417,14 +416,7 @@ theMatrixInt n = matrix n (dataMatrix n)
] ]
| P.otherwise = P.undefined | P.otherwise = error "undefined"
{-
theResult :: Int -> Matrix Double
theResult n | (P.==) n 2 = let r = 1.6094379124341003 in [ 0, r, r, 0]
| P.otherwise = [ 1, 1 ]
-}
colMatrix :: Elt e colMatrix :: Elt e
=> Int -> [e] -> Acc (Array ((Z :. Int) :. Int) e) => Int -> [e] -> Acc (Array ((Z :. Int) :. Int) e)
......
...@@ -25,8 +25,6 @@ source-repository head ...@@ -25,8 +25,6 @@ source-repository head
library library
exposed-modules: exposed-modules:
Data.Array.Accelerate.Utils
Data.Eigen.Coeff
Graph.BAC.Clustering Graph.BAC.Clustering
Graph.BAC.Proxemy Graph.BAC.Proxemy
Graph.BAC.ProxemyOptim Graph.BAC.ProxemyOptim
...@@ -48,15 +46,11 @@ library ...@@ -48,15 +46,11 @@ library
FlexibleInstances FlexibleInstances
OverloadedStrings OverloadedStrings
build-depends: build-depends:
accelerate base >=4.7 && <5
, accelerate-arithmetic
, accelerate-utility
, base >=4.7 && <5
, bytestring , bytestring
, cassava , cassava
, cereal , cereal
, containers , containers
, eigen
, fgl , fgl
, haskell-igraph >=0.6.0 , haskell-igraph >=0.6.0
, hmatrix , hmatrix
...@@ -85,15 +79,11 @@ test-suite gargantext-graph-test ...@@ -85,15 +79,11 @@ test-suite gargantext-graph-test
ghc-options: -threaded -rtsopts -with-rtsopts=-N ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends: build-depends:
QuickCheck QuickCheck
, accelerate
, accelerate-arithmetic
, accelerate-utility
, base >=4.7 && <5 , base >=4.7 && <5
, bytestring , bytestring
, cassava , cassava
, cereal , cereal
, containers , containers
, eigen
, fgl , fgl
, gargantext-graph , gargantext-graph
, haskell-igraph >=0.10.4 , haskell-igraph >=0.10.4
......
...@@ -157,10 +157,10 @@ csvDecodeOptions x = defaultDecodeOptions {decDelimiter = delimiter} ...@@ -157,10 +157,10 @@ csvDecodeOptions x = defaultDecodeOptions {decDelimiter = delimiter}
delimiter = fromIntegral $ ord x delimiter = fromIntegral $ ord x
------------------------------------------------------------------------ ------------------------------------------------------------------------
data SnapCsv = data SnapCsv =
SnapCsv { sc_fromNodeId :: Int SnapCsv { sc_fromNodeId :: Int
, sc_toNodeId :: Int , sc_toNodeId :: Int
} }
deriving (Show) deriving (Show)
instance FromNamedRecord SnapCsv where instance FromNamedRecord SnapCsv where
......
...@@ -21,8 +21,6 @@ import Data.Vector hiding (map, uniq) ...@@ -21,8 +21,6 @@ import Data.Vector hiding (map, uniq)
import Prelude (read) import Prelude (read)
import Protolude import Protolude
import Graph.Types import Graph.Types
-- import qualified Eigen.SparseMatrix as SMatrix
-- import qualified Eigen.Matrix as DMatrix
import qualified Data.Graph.Inductive.PatriciaTree as DGIP import qualified Data.Graph.Inductive.PatriciaTree as DGIP
import qualified Data.Set as Set import qualified Data.Set as Set
import qualified Data.Vector as Vector import qualified Data.Vector as Vector
......
...@@ -15,8 +15,6 @@ module Graph.Types where ...@@ -15,8 +15,6 @@ module Graph.Types where
import qualified Data.Graph.Inductive.PatriciaTree as DGIP import qualified Data.Graph.Inductive.PatriciaTree as DGIP
import Data.IntMap (IntMap) import Data.IntMap (IntMap)
-- import qualified Eigen.Matrix as DenseMatrix
-- import Eigen.SparseMatrix (SparseMatrix)
import qualified Data.Matrix.Sparse.Static as Sparse import qualified Data.Matrix.Sparse.Static as Sparse
import qualified Data.Vector.Unboxed as VU import qualified Data.Vector.Unboxed as VU
...@@ -30,7 +28,7 @@ type Dict = IntMap ...@@ -30,7 +28,7 @@ type Dict = IntMap
-- | Use the optimized version of Graph -- | Use the optimized version of Graph
type Graph a b = DGIP.Gr a b type Graph a b = DGIP.Gr a b
-- | Type for Matrix computation optimizations (with Eigen) -- | Type for Matrix computation optimizations
type MatrixD n = Dense.L n n type MatrixD n = Dense.L n n
type MatrixS n = Sparse.Matrix n n Double type MatrixS n = Sparse.Matrix n n Double
......
cabal-version: 1.12
name: gargantext-graph-eigen
version: 0.1.0.0
description: Please see the README on GitHub at <https://github.com/githubuser/gargantext-graph#readme>
homepage: https://github.com/gargantext/gargantext-graph#readme
bug-reports: https://github.com/gargantext/gargantext-graph/issues
author: Alexandre Delanoë
maintainer: alexandre+dev@delanoe.org
copyright: 2021 CNRS / Alexandre Delanoë
license: AGPL
license-file: LICENSE
build-type: Simple
extra-source-files:
README.md
ChangeLog.md
source-repository head
type: git
location: https://github.com/gargantext/gargantext-graph
library
exposed-modules:
Data.Eigen.Coeff
other-modules:
Paths_gargantext_graph_eigen
hs-source-dirs:
src
default-extensions:
DataKinds
FlexibleInstances
OverloadedStrings
build-depends:
base >=4.7 && <5
, eigen
, reflection
default-language: Haskell2010
...@@ -16,7 +16,9 @@ Author: Alp Mestanogullari (Well Typed) ...@@ -16,7 +16,9 @@ Author: Alp Mestanogullari (Well Typed)
module Data.Eigen.Coeff (coeffSM, coeffDM) module Data.Eigen.Coeff (coeffSM, coeffDM)
where where
import Eigen.Internal (Row(..), Col(..), Elem(..)) import Prelude hiding (pi)
import Eigen.Internal (Row(..), Col(..), Elem)
import Data.Maybe (fromMaybe) import Data.Maybe (fromMaybe)
import Data.Proxy import Data.Proxy
import Data.Reflection import Data.Reflection
......
This source diff could not be displayed because it is too large. You can view the blob instead.
name: gargantext-graph
version: 0.1.0.0
github: gargantext/gargantext-graph
license: AGPL
author: "Alexandre Delanoë"
maintainer: "alexandre+dev@delanoe.org"
copyright: "2021 CNRS / Alexandre Delanoë"
extra-source-files:
- README.md
- ChangeLog.md
# Metadata used when publishing your package
# synopsis: Short description of your package
# category: Web
# To avoid duplicated efforts in documentation and dealing with the
# complications of embedding Haddock markup inside cabal files, it is
# common to point users to the README.md file.
description: Please see the README on GitHub at <https://github.com/githubuser/gargantext-graph#readme>
dependencies:
- accelerate
- accelerate-arithmetic
- accelerate-utility
- base >= 4.7 && < 5
- bytestring
- cassava
- cereal # (IGraph)
- containers
- eigen
- fgl
- haskell-igraph >= 0.6.0
- hmatrix
- lens
- pretty-simple
- protolude
- reflection
- sparse-linear
- singletons
- string-conversions
- text
- vector
default-extensions:
- DataKinds
- FlexibleInstances
- OverloadedStrings
library:
source-dirs: src
# executables:
# gargantext-graph-exe:
# main: Main.hs
# source-dirs: app
# ghc-options:
# - -O2
# - -threaded
# - -rtsopts
# - -with-rtsopts=-N
# - -fprof-auto
# - -Wmissing-signatures
# - -Wcompat
# dependencies:
# - gargantext-graph
# - criterion
tests:
gargantext-graph-test:
main: Main.hs
source-dirs: test
ghc-options:
- -threaded
- -rtsopts
- -with-rtsopts=-N
dependencies:
- gargantext-graph
- hspec
- QuickCheck
#!/bin/bash
#~/.local/bin/gargantext-graph-exe $1 +RTS -p # -sstderr
#time ~/.local/bin/gargantext-graph-exe +RTS -p # -sstderr
#for beta in -0.6 -0.5 -0.3 -0.2 -0.1 0.0 0.3 0.4 0.5 0.6 0.7; do
for beta in 0.0 O.5 1.0 ; do
for gc in "gc" ; do
echo "$beta,$gc";
OUTPUT1=${1%csv}_${beta}_${gc}.txt;
OUTPUT2=${1%csv}_${beta}_${gc}.clusters.txt;
touch $OUTPUT1;
time ~/.local/bin/gargantext-graph-exe $1 $OUTPUT2 $gc $beta >> $OUTPUT1 ;
done
done
...@@ -38,9 +38,6 @@ extra-deps: ...@@ -38,9 +38,6 @@ extra-deps:
commit: b9fca8beee0f23c17a6b2001ec834d071709e6e7 commit: b9fca8beee0f23c17a6b2001ec834d071709e6e7
subdirs: subdirs:
- packages/base - packages/base
- git: https://github.com/alpmestan/accelerate-arithmetic.git
commit: a110807651036ca2228a76507ee35bbf7aedf87a
- eigen-3.3.7.0@sha256:7c24a86426b238e02ba0ac2179cc44997518b443a13828ed7a791fe49a6dffa5,82060
- vector-0.12.3.0 - vector-0.12.3.0
ghc-options: ghc-options:
......
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