blas-0.6: Bindings to the BLAS librarySource codeContentsIndex
BLAS.Matrix.Mutable
Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>
Contents
Getting rows and columns
Matrix and vector multiplication
In-place multiplication
The MMatrix type class
Unsafe operations
Description
Synopsis
getRow :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> Int -> m (x l e)
getCol :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> Int -> m (x k e)
getRows :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x l e]
getCols :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x k e]
getRows' :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x l e]
getCols' :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x k e]
getApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> m (y k e)
getSApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> m (y k e)
getApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> m (c (r, t) e)
getSApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> m (c (r, t) e)
doApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> y k e -> m ()
doSApplyAdd :: (MMatrix a e m, ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> e -> y k e -> m ()
doApply_ :: (MMatrix a e m, WriteVector y m) => a (n, n) e -> y n e -> m ()
doSApply_ :: (MMatrix a e m, WriteVector y m) => e -> a (n, n) e -> y n e -> m ()
doApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> c (r, t) e -> m ()
doSApplyAddMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> e -> c (r, t) e -> m ()
doApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => a (s, s) e -> b (s, t) e -> m ()
doSApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => e -> a (s, s) e -> b (s, t) e -> m ()
class (BaseMatrix a, BLAS1 e, Monad m) => MMatrix a e m where
unsafeGetSApply :: (ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> m (y k e)
unsafeGetSApplyMat :: (ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> m (c (r, t) e)
unsafeDoSApplyAdd :: (ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> e -> y k e -> m ()
unsafeDoSApplyAddMat :: (ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> e -> c (r, t) e -> m ()
unsafeDoSApply_ :: WriteVector y m => e -> a (n, n) e -> y n e -> m ()
unsafeDoSApplyMat_ :: WriteMatrix b y m => e -> a (k, k) e -> b (k, l) e -> m ()
unsafeGetRow :: WriteVector x m => a (k, l) e -> Int -> m (x l e)
unsafeGetCol :: WriteVector x m => a (k, l) e -> Int -> m (x k e)
unsafeGetApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> m (y k e)
unsafeDoApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> y k e -> m ()
unsafeDoApply_ :: (MMatrix a e m, WriteVector y m) => a (n, n) e -> y n e -> m ()
unsafeGetApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> m (c (r, t) e)
unsafeDoApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> c (r, t) e -> m ()
unsafeDoApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => a (s, s) e -> b (s, t) e -> m ()
Getting rows and columns
getRow :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> Int -> m (x l e)Source
Get the given row in a matrix.
getCol :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> Int -> m (x k e)Source
Get the given column in a matrix.
getRows :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x l e]Source
Get a lazy list the row vectors in the matrix. See also getRows'.
getCols :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x k e]Source
Get a lazy list of the column vectors in the matrix. See also getCols'.
getRows' :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x l e]Source
Get a strict list the row vectors in the matrix. See also getRows.
getCols' :: (MMatrix a e m, WriteVector x m) => a (k, l) e -> m [x k e]Source
Get a strict list of the column vectors in the matrix. See also getCols.
Matrix and vector multiplication
getApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> m (y k e)Source
Apply to a vector
getSApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> m (y k e)Source
Scale and apply to a vector
getApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> m (c (r, t) e)Source
Apply to a matrix
getSApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> m (c (r, t) e)Source
Scale and apply to a matrix
In-place multiplication
doApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> y k e -> m ()Source
Apply to a vector and store the result in another vector
doSApplyAdd :: (MMatrix a e m, ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> e -> y k e -> m ()Source
y := alpha a x + beta y
doApply_ :: (MMatrix a e m, WriteVector y m) => a (n, n) e -> y n e -> m ()Source
x := a x
doSApply_ :: (MMatrix a e m, WriteVector y m) => e -> a (n, n) e -> y n e -> m ()Source
 x := alpha a x
doApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> c (r, t) e -> m ()Source
Apply to a matrix and store the result in another matrix
doSApplyAddMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> e -> c (r, t) e -> m ()Source
c := alpha a b + beta c
doApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => a (s, s) e -> b (s, t) e -> m ()Source
 b := a b
doSApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => e -> a (s, s) e -> b (s, t) e -> m ()Source
 b := alpha a b
The MMatrix type class
class (BaseMatrix a, BLAS1 e, Monad m) => MMatrix a e m whereSource
Minimal complete definition: (unsafeDoSApplyAdd, unsafeDoSApplyAddMat)
Methods
unsafeGetSApply :: (ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> m (y k e)Source
unsafeGetSApplyMat :: (ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> m (c (r, t) e)Source
unsafeDoSApplyAdd :: (ReadVector x m, WriteVector y m) => e -> a (k, l) e -> x l e -> e -> y k e -> m ()Source
unsafeDoSApplyAddMat :: (ReadMatrix b x m, WriteMatrix c y m) => e -> a (r, s) e -> b (s, t) e -> e -> c (r, t) e -> m ()Source
unsafeDoSApply_ :: WriteVector y m => e -> a (n, n) e -> y n e -> m ()Source
unsafeDoSApplyMat_ :: WriteMatrix b y m => e -> a (k, k) e -> b (k, l) e -> m ()Source
unsafeGetRow :: WriteVector x m => a (k, l) e -> Int -> m (x l e)Source
unsafeGetCol :: WriteVector x m => a (k, l) e -> Int -> m (x k e)Source
show/hide Instances
BLAS3 e => MMatrix IOMatrix e IO
BLAS3 e => MMatrix IOMatrix e IO
(BLAS3 e, UnsafeIOToM m) => MMatrix Matrix e m
BLAS2 e => MMatrix IOBanded e IO
BLAS2 e => MMatrix IOBanded e IO
(BLAS2 e, UnsafeIOToM m) => MMatrix Banded e m
(BLAS1 e, UnsafeIOToM m) => MMatrix Perm e m
BLAS1 e => MMatrix (Diag IOVector) e IO
BLAS1 e => MMatrix (Diag IOVector) e IO
(BLAS1 e, UnsafeIOToM m) => MMatrix (Diag Vector) e m
BLAS3 e => MMatrix (Herm IOMatrix) e IO
BLAS3 e => MMatrix (Herm IOMatrix) e IO
(BLAS3 e, UnsafeIOToM m) => MMatrix (Herm Matrix) e m
BLAS3 e => MMatrix (Herm IOBanded) e IO
BLAS3 e => MMatrix (Herm IOBanded) e IO
(BLAS3 e, UnsafeIOToM m) => MMatrix (Herm Banded) e m
BLAS3 e => MMatrix (Tri IOMatrix) e IO
BLAS3 e => MMatrix (Tri IOMatrix) e IO
(BLAS3 e, UnsafeIOToM m) => MMatrix (Tri Matrix) e m
BLAS2 e => MMatrix (Tri IOBanded) e IO
BLAS2 e => MMatrix (Tri IOBanded) e IO
(BLAS2 e, UnsafeIOToM m) => MMatrix (Tri Banded) e m
BLAS3 e => MMatrix (STMatrix s) e (ST s)
BLAS3 e => MMatrix (STMatrix s) e (ST s)
BLAS2 e => MMatrix (STBanded s) e (ST s)
BLAS2 e => MMatrix (STBanded s) e (ST s)
BLAS1 e => MMatrix (Diag (STVector s)) e (ST s)
BLAS1 e => MMatrix (Diag (STVector s)) e (ST s)
BLAS3 e => MMatrix (Herm (STMatrix s)) e (ST s)
BLAS3 e => MMatrix (Herm (STMatrix s)) e (ST s)
BLAS3 e => MMatrix (Herm (STBanded s)) e (ST s)
BLAS3 e => MMatrix (Herm (STBanded s)) e (ST s)
BLAS3 e => MMatrix (Tri (STMatrix s)) e (ST s)
BLAS3 e => MMatrix (Tri (STMatrix s)) e (ST s)
BLAS2 e => MMatrix (Tri (STBanded s)) e (ST s)
BLAS2 e => MMatrix (Tri (STBanded s)) e (ST s)
Unsafe operations
unsafeGetApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> m (y k e)Source
unsafeDoApply :: (MMatrix a e m, ReadVector x m, WriteVector y m) => a (k, l) e -> x l e -> y k e -> m ()Source
unsafeDoApply_ :: (MMatrix a e m, WriteVector y m) => a (n, n) e -> y n e -> m ()Source
unsafeGetApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> m (c (r, t) e)Source
unsafeDoApplyMat :: (MMatrix a e m, ReadMatrix b x m, WriteMatrix c y m) => a (r, s) e -> b (s, t) e -> c (r, t) e -> m ()Source
unsafeDoApplyMat_ :: (MMatrix a e m, WriteMatrix b y m) => a (s, s) e -> b (s, t) e -> m ()Source
Produced by Haddock version 2.3.0