Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
195
Issues
195
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
5c5f0bc4
Commit
5c5f0bc4
authored
Jul 01, 2020
by
Alexandre Delanoë
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIX] fun + papers read for our purpose
parent
884666c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
19 deletions
+10
-19
Matrice.hs
src/Gargantext/Viz/Graph/Distances/Matrice.hs
+10
-19
No files found.
src/Gargantext/Viz/Graph/Distances/Matrice.hs
View file @
5c5f0bc4
...
...
@@ -17,14 +17,6 @@ Implementation use Accelerate library which enables GPU and CPU computation:
[Accelerating Haskell Array Codes with Multicore GPUs][CKLM+11].
In _DAMP '11: Declarative Aspects of Multicore Programming_, ACM, 2011.
* Trevor L. McDonell, Manuel M. T. Chakravarty, Gabriele Keller, and Ben Lippmeier.
[Optimising Purely Functional GPU Programs][MCKL13].
In _ICFP '13: The 18th ACM SIGPLAN International Conference on Functional Programming_, ACM, 2013.
* Robert Clifton-Everest, Trevor L. McDonell, Manuel M. T. Chakravarty, and Gabriele Keller.
[Embedding Foreign Code][CMCK14].
In _PADL '14: The 16th International Symposium on Practical Aspects of Declarative Languages_, Springer-Verlag, LNCS, 2014.
* Trevor L. McDonell, Manuel M. T. Chakravarty, Vinod Grover, and Ryan R. Newton.
[Type-safe Runtime Code Generation: Accelerate to LLVM][MCGN15].
In _Haskell '15: The 8th ACM SIGPLAN Symposium on Haskell_, ACM, 2015.
...
...
@@ -50,8 +42,8 @@ import qualified Gargantext.Prelude as P
--
-- >>> vector 3
-- Vector (Z :. 3) [0,1,2]
vector
::
Int
->
(
Array
(
Z
:.
Int
)
Int
)
vector
n
=
fromList
(
Z
:.
n
)
[
0
..
n
]
vector
::
Elt
c
=>
Int
->
[
c
]
->
(
Array
(
Z
:.
Int
)
c
)
vector
n
l
=
fromList
(
Z
:.
n
)
l
-- | Define a matrix
--
...
...
@@ -248,7 +240,7 @@ distributional m = run -- $ matMiniMax
-- $ myMin
$
filter'
0
$
s_mi
-- $ diag2null
$
diag2null
n
$
map
fromIntegral
-- ^ from Int to Double
$
use
m
-- ^ push matrix in Accelerate type
where
...
...
@@ -286,20 +278,19 @@ identityMatrix n =
permute
const
zeros
(
\
(
unindex1
->
i
)
->
index2
i
i
)
ones
eyeMatrix
::
Num
a
=>
(
Matrix
a
)
->
Acc
(
Matrix
a
)
eyeMatrix
m
=
eyeMatrix
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
->
Acc
(
Matrix
a
)
eyeMatrix
n'
m
=
let
zeros
=
fill
(
index2
n
n
)
1
ones
=
fill
(
index1
n
)
0
n
=
constant
$
dim
m
n
=
constant
n'
in
permute
const
zeros
(
\
(
unindex1
->
i
)
->
index2
i
i
)
ones
diag2null
::
Num
a
=>
(
Matrix
a
)
->
Acc
(
Matrix
a
)
diag2null
m'
=
zipWith
(
*
)
m
eye
where
m
=
use
m'
eye
=
eyeMatrix
m'
diag2null
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
->
Acc
(
Matrix
a
)
diag2null
n
m
=
zipWith
(
*
)
m
eye
where
eye
=
eyeMatrix
n
m
crossProduct
::
Dim
->
Acc
(
Matrix
Double
)
->
Acc
(
Matrix
Double
)
...
...
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