blas-0.7.2: Bindings to the BLAS library

Stabilityexperimental
MaintainerPatrick Perry <patperry@stanford.edu>

Data.Matrix.Class.MSolve

Contents

Description

An overloaded interface for solving matrix systems in a monad. The matrices can operate via inverse multiplication on immutable dense vectors and matrices.

Synopsis

The MSolve type class

class (MatrixShaped a, BLAS3 e, Monad m) => MSolve a e m Source

A type class for mutable matrices with inverses. The member functions of the type class do not perform any checks on the validity of shapes or indices, so in general their safe counterparts should be preferred.

Instances

BLAS3 e => MSolve (Tri IOMatrix) e IO 
BLAS3 e => MSolve (Tri Matrix) e IO 
BLAS3 e => MSolve (Tri IOBanded) e IO 
BLAS3 e => MSolve (Tri Banded) e IO 
BLAS3 e => MSolve (Tri Matrix) e (ST s) 
BLAS3 e => MSolve (Tri (STMatrix s)) e (ST s) 
BLAS3 e => MSolve (Tri Banded) e (ST s) 
BLAS3 e => MSolve (Tri (STBanded s)) e (ST s) 

Solving linear systems

getSolve :: (MSolve a e m, ReadVector y e m, WriteVector x e m) => a (k, l) e -> y k e -> m (x l e)Source

Return x such that a x = y.

getSolveMat :: (MSolve a e m, ReadMatrix c e m, WriteMatrix b e m) => a (r, s) e -> c (r, t) e -> m (b (s, t) e)Source

Return b such that a b = c.

getSSolve :: (MSolve a e m, ReadVector y e m, WriteVector x e m) => e -> a (k, l) e -> y k e -> m (x l e)Source

Return x such that a x = alpha y.

getSSolveMat :: (MSolve a e m, ReadMatrix c e m, WriteMatrix b e m) => e -> a (r, s) e -> c (r, t) e -> m (b (s, t) e)Source

Return b such that a b = alpha c.

In-place operations

doSolve :: (MSolve a e m, ReadVector y e m, WriteVector x e m) => a (r, s) e -> y r e -> x s e -> m ()Source

Set x := a^{-1} y.

doSolveMat :: (MSolve a e m, ReadMatrix c e m, WriteMatrix b e m) => a (r, s) e -> c (r, t) e -> b (s, t) e -> m ()Source

Set b := a^{-1} c.

doSSolve :: (MSolve a e m, ReadVector y e m, WriteVector x e m) => e -> a (k, l) e -> y k e -> x l e -> m ()Source

Set x := a^{-1} (alpha y).

doSSolveMat :: (MSolve a e m, ReadMatrix c e m, WriteMatrix b e m) => e -> a (r, s) e -> c (r, t) e -> b (s, t) e -> m ()Source

Set b := a^{-1} (alpha c).

doSolve_ :: (MSolve a e m, ReadVector y e m, WriteVector x e m) => a (k, k) e -> x k e -> m ()Source

Set x := a^{-1} x.

doSolveMat_ :: (MSolve a e m, WriteMatrix b e m) => a (k, k) e -> b (k, l) e -> m ()Source

Set b := a^{-1} b.

doSSolve_ :: (MSolve a e m, WriteVector x e m) => e -> a (k, k) e -> x k e -> m ()Source

Set x := a^{-1} (alpha x).

doSSolveMat_ :: (MSolve a e m, WriteMatrix b e m) => e -> a (k, k) e -> b (k, l) e -> m ()Source

Set b := a^{-1} (alpha b).