Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Scalable isntalce for dense matrices

  • Loading branch information...
commit d2cab6e0defe8a5a46f9f7a8e431554c0c983c2f 1 parent 189615d
@Shimuuar authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 Numeric/BLAS/Expression.hs
View
6 Numeric/BLAS/Expression.hs
@@ -26,6 +26,7 @@ module Numeric.BLAS.Expression (
, AddM(..)
) where
+import Control.Monad
import Control.Monad.ST
import qualified Data.Vector.Generic as G
@@ -582,6 +583,11 @@ instance BLAS1 a => Scalable MV.MVector a where
scale = scaleVector
instance BLAS1 a => Scalable MS.MVector a where
scale = scaleVector
+instance BLAS1 a => Scalable MMatD.MMatrix a where
+ scale α m = do
+ forM_ [0 .. MMat.cols m - 1] $ \i -> do
+ scaleVector α $ MMatD.unsafeGetCol m i
+
instance BLAS1 a => AddM MV.MVector a where
addM x y = addVecScaled 1 y x
Please sign in to comment.
Something went wrong with that request. Please try again.