Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-graph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Julien Moutinho
gargantext-graph
Commits
13131f51
Commit
13131f51
authored
Jul 09, 2022
by
Alp Mestanogullari
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update for accelerate 1.3
parent
f68f9e78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Utils.hs
src/Data/Array/Accelerate/Utils.hs
+6
-6
No files found.
src/Data/Array/Accelerate/Utils.hs
View file @
13131f51
...
...
@@ -110,7 +110,7 @@ matrixIdentity n' =
ones
=
fill
(
index1
n
)
1
n
=
constant
n'
in
permute
const
zeros
(
\
(
unindex1
->
i
)
->
index2
i
i
)
ones
permute
const
zeros
(
\
(
unindex1
->
i
)
->
Just_
$
index2
i
i
)
ones
matrixEye
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
...
...
@@ -119,7 +119,7 @@ matrixEye n' =
zeros
=
fill
(
index1
n
)
0
n
=
constant
n'
in
permute
const
ones
(
\
(
unindex1
->
i
)
->
index2
i
i
)
zeros
permute
const
ones
(
\
(
unindex1
->
i
)
->
Just_
$
index2
i
i
)
zeros
diagNull
::
Num
a
=>
Dim
->
Acc
(
Matrix
a
)
->
Acc
(
Matrix
a
)
...
...
@@ -134,7 +134,7 @@ condOrDefault
condOrDefault
theCond
def
x
=
permute
const
zeros
filterInd
x
where
zeros
=
fill
(
shape
x
)
(
def
)
filterInd
ix
=
(
cond
(
theCond
ix
))
ix
ignore
filterInd
ix
=
(
cond
(
theCond
ix
))
(
Just_
ix
)
Nothing_
-----------------------------------------------------------------------
_runExp
::
Elt
e
=>
Exp
e
->
e
...
...
@@ -163,7 +163,7 @@ matrix n l = fromList (Z :. n :. n) l
-- >>> rank (matrix 3 ([1..] :: [Int]))
-- 2
rank
::
(
Matrix
a
)
->
Int
rank
m
=
arrayRank
$
arrayShape
m
rank
m
=
arrayRank
m
-----------------------------------------------------------------------
-- | Dimension of a square Matrix
...
...
@@ -278,7 +278,7 @@ nullOf n' dir =
zeros
=
fill
(
index2
n
n
)
0
n
=
constant
n'
in
permute
const
ones
(
lift1
(
\
(
Z
:.
(
i
::
Exp
Int
)
:.
(
_j
::
Exp
Int
))
permute
const
ones
(
Just_
.
lift1
(
\
(
Z
:.
(
i
::
Exp
Int
)
:.
(
_j
::
Exp
Int
))
->
case
dir
of
MatCol
m
->
(
Z
:.
i
:.
m
)
MatRow
m
->
(
Z
:.
m
:.
i
)
...
...
@@ -308,7 +308,7 @@ sumRowMin n m = {-trace (P.show $ run m') $-} m'
$
P
.
map
(
\
z
->
sumRowMin1
n
(
constant
z
)
m
)
[
0
..
n
-
1
]
sumRowMin1
::
(
Num
a
,
Ord
a
)
=>
Dim
->
Exp
Int
->
Acc
(
Matrix
a
)
->
Acc
(
Vector
a
)
sumRowMin1
n
x
m
=
trace
(
P
.
show
(
run
m
,
run
$
transpose
m
))
$
m''
sumRowMin1
n
x
m
=
{- trace (P.show (run m,run $ transpose m)) $ -}
m''
where
m''
=
sum
$
zipWith
min
(
transpose
m
)
m
_m'
=
zipWith
(
*
)
(
zipWith
(
*
)
(
nullOf
n
(
MatCol
x
))
$
nullOfWithDiag
n
(
MatRow
x
))
m
...
...
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