Skip to content

Commit 545c4b9

Browse files
authored
Merge pull request #63 from lehins/master
Fix fast matrix mutiplication implementation
2 parents 6c850b4 + 54b2fc1 commit 545c4b9

File tree

1 file changed

+2
-2
lines changed
  • dense-linear-algebra/src/Statistics/Matrix

1 file changed

+2
-2
lines changed

dense-linear-algebra/src/Statistics/Matrix/Fast.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ multiply m1@(Matrix r1 _ _) m2@(Matrix _ c2 _) = runST $ do
3030
unsafeFreeze m3
3131

3232
accum :: Int -> Matrix -> Int -> Matrix -> Double
33-
accum ithrow (Matrix r1 c1 v1) jthcol (Matrix _ c2 v2) = sub 0 0
34-
where sub !acc !ij | ij == r1 = acc
33+
accum ithrow (Matrix _ c1 v1) jthcol (Matrix _ c2 v2) = sub 0 0
34+
where sub !acc !ij | ij == c1 = acc
3535
| otherwise = sub ( valRow*valCol + acc ) (ij+1)
3636
where
3737
valRow = U.unsafeIndex v1 (ithrow*c1 + ij)

0 commit comments

Comments
 (0)