halg-matrices-0.6.0.0: Abstraction layer ror various matrix libraries, part of halg computational algebra suite.
Safe HaskellNone
LanguageHaskell2010

Algebra.Matrix.Generic.Mutable

Synopsis

Documentation

class (Vector (Column mat) a, Vector (Row mat) a) => MMatrix mat a where Source #

Mutable, row-based 0-origin matrix

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (mat (PrimState m) a) Source #

basicUnsafeNew n m creates a mutable matrix with n rows and m columns, without initialisation. This method should not be used directly, use unsafeNew instead.

basicInitialise :: PrimMonad m => mat (PrimState m) a -> m () Source #

basicRowCount :: mat s a -> Size Source #

basicColumnCount :: mat s a -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> mat (PrimState m) a -> m (Row mat a) Source #

unsafeGetColumn :: PrimMonad m => Index -> mat (PrimState m) a -> m (Column mat a) Source #

unsafeFill :: PrimMonad m => Size -> Size -> a -> m (mat (PrimState m) a) Source #

unsafeFromRow :: PrimMonad m => Row mat a -> m (mat (PrimState m) a) Source #

Construct a mutable matrix consisting of a single row, perhaps without any copy.

unsafeFromRows :: PrimMonad m => [Row mat a] -> m (mat (PrimState m) a) Source #

Construct a mutable matrix consisting a single column, perhaps without any copy.

unsafeFromColumn :: PrimMonad m => Column mat a -> m (mat (PrimState m) a) Source #

Construct a mutable matrix consisting a single column, perhaps without any copy.

unsafeFromColumns :: PrimMonad m => [Column mat a] -> m (mat (PrimState m) a) Source #

unsafeCopy :: PrimMonad m => mat (PrimState m) a -> mat (PrimState m) a -> m () Source #

usnafeCopy target source copies the content of source to target, without boundary check.

unsafeRead :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> m a Source #

unsafeRead i j m reads the value at ith row in jth column in m, without boundary check.

N.B. Rows and columns are regarded as zero-origin, not 1!.

unsafeWrite :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> a -> m () Source #

basicSet :: PrimMonad m => mat (PrimState m) a -> a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => mat (PrimState m) a -> Index -> (Index -> a -> m a) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => mat (PrimState m) a -> Index -> (Index -> a -> a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative a) => mat (PrimState m) a -> Index -> a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> a) -> m (mat (PrimState m) a) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m a) -> m (mat (PrimState m) a) Source #

toRows :: PrimMonad m => mat (PrimState m) a -> m [Row mat a] Source #

toColumns :: PrimMonad m => mat (PrimState m) a -> m [Column mat a] Source #

combineRows :: (Semiring a, Commutative a, PrimMonad m) => Index -> a -> Index -> mat (PrimState m) a -> m () Source #

combineRows i c j mat adds scalar multiple of jth row by c to ith.

Instances

Instances details
DecidableZero a => MMatrix MIMMatrix a Source # 
Instance details

Defined in Algebra.Matrix.IntMap

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (MIMMatrix (PrimState m) a) Source #

basicInitialise :: PrimMonad m => MIMMatrix (PrimState m) a -> m () Source #

basicRowCount :: MIMMatrix s a -> Size Source #

basicColumnCount :: MIMMatrix s a -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> MIMMatrix (PrimState m) a -> m (Row MIMMatrix a) Source #

unsafeGetColumn :: PrimMonad m => Index -> MIMMatrix (PrimState m) a -> m (Column MIMMatrix a) Source #

unsafeFill :: PrimMonad m => Size -> Size -> a -> m (MIMMatrix (PrimState m) a) Source #

unsafeFromRow :: PrimMonad m => Row MIMMatrix a -> m (MIMMatrix (PrimState m) a) Source #

unsafeFromRows :: PrimMonad m => [Row MIMMatrix a] -> m (MIMMatrix (PrimState m) a) Source #

unsafeFromColumn :: PrimMonad m => Column MIMMatrix a -> m (MIMMatrix (PrimState m) a) Source #

unsafeFromColumns :: PrimMonad m => [Column MIMMatrix a] -> m (MIMMatrix (PrimState m) a) Source #

unsafeCopy :: PrimMonad m => MIMMatrix (PrimState m) a -> MIMMatrix (PrimState m) a -> m () Source #

unsafeRead :: PrimMonad m => MIMMatrix (PrimState m) a -> Index -> Index -> m a Source #

unsafeWrite :: PrimMonad m => MIMMatrix (PrimState m) a -> Index -> Index -> a -> m () Source #

basicSet :: PrimMonad m => MIMMatrix (PrimState m) a -> a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => MIMMatrix (PrimState m) a -> Index -> (Index -> a -> m a) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => MIMMatrix (PrimState m) a -> Index -> (Index -> a -> a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => MIMMatrix (PrimState m) a -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative a) => MIMMatrix (PrimState m) a -> Index -> a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> a) -> m (MIMMatrix (PrimState m) a) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m a) -> m (MIMMatrix (PrimState m) a) Source #

toRows :: PrimMonad m => MIMMatrix (PrimState m) a -> m [Row MIMMatrix a] Source #

toColumns :: PrimMonad m => MIMMatrix (PrimState m) a -> m [Column MIMMatrix a] Source #

combineRows :: (Semiring a, Commutative a, PrimMonad m) => Index -> a -> Index -> MIMMatrix (PrimState m) a -> m () Source #

(Num a, Container Matrix a) => MMatrix STMatrix (WrapNum a) Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (STMatrix (PrimState m) (WrapNum a)) Source #

basicInitialise :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> m () Source #

basicRowCount :: STMatrix s (WrapNum a) -> Size Source #

basicColumnCount :: STMatrix s (WrapNum a) -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapNum a) -> m (Row STMatrix (WrapNum a)) Source #

unsafeGetColumn :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapNum a) -> m (Column STMatrix (WrapNum a)) Source #

unsafeFill :: PrimMonad m => Size -> Size -> WrapNum a -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeFromRow :: PrimMonad m => Row STMatrix (WrapNum a) -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeFromRows :: PrimMonad m => [Row STMatrix (WrapNum a)] -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeFromColumn :: PrimMonad m => Column STMatrix (WrapNum a) -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeFromColumns :: PrimMonad m => [Column STMatrix (WrapNum a)] -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeCopy :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> STMatrix (PrimState m) (WrapNum a) -> m () Source #

unsafeRead :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> Index -> Index -> m (WrapNum a) Source #

unsafeWrite :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> Index -> Index -> WrapNum a -> m () Source #

basicSet :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> WrapNum a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> Index -> (Index -> WrapNum a -> m (WrapNum a)) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> Index -> (Index -> WrapNum a -> WrapNum a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative (WrapNum a)) => STMatrix (PrimState m) (WrapNum a) -> Index -> WrapNum a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> WrapNum a) -> m (STMatrix (PrimState m) (WrapNum a)) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m (WrapNum a)) -> m (STMatrix (PrimState m) (WrapNum a)) Source #

toRows :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> m [Row STMatrix (WrapNum a)] Source #

toColumns :: PrimMonad m => STMatrix (PrimState m) (WrapNum a) -> m [Column STMatrix (WrapNum a)] Source #

combineRows :: (Semiring (WrapNum a), Commutative (WrapNum a), PrimMonad m) => Index -> WrapNum a -> Index -> STMatrix (PrimState m) (WrapNum a) -> m () Source #

(Fractional a, Container Matrix a) => MMatrix STMatrix (WrapFractional a) Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

basicInitialise :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> m () Source #

basicRowCount :: STMatrix s (WrapFractional a) -> Size Source #

basicColumnCount :: STMatrix s (WrapFractional a) -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapFractional a) -> m (Row STMatrix (WrapFractional a)) Source #

unsafeGetColumn :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapFractional a) -> m (Column STMatrix (WrapFractional a)) Source #

unsafeFill :: PrimMonad m => Size -> Size -> WrapFractional a -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeFromRow :: PrimMonad m => Row STMatrix (WrapFractional a) -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeFromRows :: PrimMonad m => [Row STMatrix (WrapFractional a)] -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeFromColumn :: PrimMonad m => Column STMatrix (WrapFractional a) -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeFromColumns :: PrimMonad m => [Column STMatrix (WrapFractional a)] -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeCopy :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> STMatrix (PrimState m) (WrapFractional a) -> m () Source #

unsafeRead :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> Index -> Index -> m (WrapFractional a) Source #

unsafeWrite :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> Index -> Index -> WrapFractional a -> m () Source #

basicSet :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> WrapFractional a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> Index -> (Index -> WrapFractional a -> m (WrapFractional a)) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> Index -> (Index -> WrapFractional a -> WrapFractional a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative (WrapFractional a)) => STMatrix (PrimState m) (WrapFractional a) -> Index -> WrapFractional a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> WrapFractional a) -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m (WrapFractional a)) -> m (STMatrix (PrimState m) (WrapFractional a)) Source #

toRows :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> m [Row STMatrix (WrapFractional a)] Source #

toColumns :: PrimMonad m => STMatrix (PrimState m) (WrapFractional a) -> m [Column STMatrix (WrapFractional a)] Source #

combineRows :: (Semiring (WrapFractional a), Commutative (WrapFractional a), PrimMonad m) => Index -> WrapFractional a -> Index -> STMatrix (PrimState m) (WrapFractional a) -> m () Source #

(Integral a, Container Matrix a) => MMatrix STMatrix (WrapIntegral a) Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

basicInitialise :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> m () Source #

basicRowCount :: STMatrix s (WrapIntegral a) -> Size Source #

basicColumnCount :: STMatrix s (WrapIntegral a) -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapIntegral a) -> m (Row STMatrix (WrapIntegral a)) Source #

unsafeGetColumn :: PrimMonad m => Index -> STMatrix (PrimState m) (WrapIntegral a) -> m (Column STMatrix (WrapIntegral a)) Source #

unsafeFill :: PrimMonad m => Size -> Size -> WrapIntegral a -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeFromRow :: PrimMonad m => Row STMatrix (WrapIntegral a) -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeFromRows :: PrimMonad m => [Row STMatrix (WrapIntegral a)] -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeFromColumn :: PrimMonad m => Column STMatrix (WrapIntegral a) -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeFromColumns :: PrimMonad m => [Column STMatrix (WrapIntegral a)] -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeCopy :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> STMatrix (PrimState m) (WrapIntegral a) -> m () Source #

unsafeRead :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> Index -> Index -> m (WrapIntegral a) Source #

unsafeWrite :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> Index -> Index -> WrapIntegral a -> m () Source #

basicSet :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> WrapIntegral a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> Index -> (Index -> WrapIntegral a -> m (WrapIntegral a)) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> Index -> (Index -> WrapIntegral a -> WrapIntegral a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative (WrapIntegral a)) => STMatrix (PrimState m) (WrapIntegral a) -> Index -> WrapIntegral a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> WrapIntegral a) -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m (WrapIntegral a)) -> m (STMatrix (PrimState m) (WrapIntegral a)) Source #

toRows :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> m [Row STMatrix (WrapIntegral a)] Source #

toColumns :: PrimMonad m => STMatrix (PrimState m) (WrapIntegral a) -> m [Column STMatrix (WrapIntegral a)] Source #

combineRows :: (Semiring (WrapIntegral a), Commutative (WrapIntegral a), PrimMonad m) => Index -> WrapIntegral a -> Index -> STMatrix (PrimState m) (WrapIntegral a) -> m () Source #

(Monoidal a, Matrix mat a) => MMatrix (WrapImmutable mat) a Source # 
Instance details

Defined in Algebra.Matrix.Generic

Methods

basicUnsafeNew :: PrimMonad m => Size -> Size -> m (WrapImmutable mat (PrimState m) a) Source #

basicInitialise :: PrimMonad m => WrapImmutable mat (PrimState m) a -> m () Source #

basicRowCount :: WrapImmutable mat s a -> Size Source #

basicColumnCount :: WrapImmutable mat s a -> Size Source #

unsafeGetRow :: PrimMonad m => Index -> WrapImmutable mat (PrimState m) a -> m (Row (WrapImmutable mat) a) Source #

unsafeGetColumn :: PrimMonad m => Index -> WrapImmutable mat (PrimState m) a -> m (Column (WrapImmutable mat) a) Source #

unsafeFill :: PrimMonad m => Size -> Size -> a -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeFromRow :: PrimMonad m => Row (WrapImmutable mat) a -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeFromRows :: PrimMonad m => [Row (WrapImmutable mat) a] -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeFromColumn :: PrimMonad m => Column (WrapImmutable mat) a -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeFromColumns :: PrimMonad m => [Column (WrapImmutable mat) a] -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeCopy :: PrimMonad m => WrapImmutable mat (PrimState m) a -> WrapImmutable mat (PrimState m) a -> m () Source #

unsafeRead :: PrimMonad m => WrapImmutable mat (PrimState m) a -> Index -> Index -> m a Source #

unsafeWrite :: PrimMonad m => WrapImmutable mat (PrimState m) a -> Index -> Index -> a -> m () Source #

basicSet :: PrimMonad m => WrapImmutable mat (PrimState m) a -> a -> m () Source #

basicUnsafeIMapRowM :: PrimMonad m => WrapImmutable mat (PrimState m) a -> Index -> (Index -> a -> m a) -> m () Source #

basicUnsafeIMapRow :: PrimMonad m => WrapImmutable mat (PrimState m) a -> Index -> (Index -> a -> a) -> m () Source #

basicUnsafeSwapRows :: PrimMonad m => WrapImmutable mat (PrimState m) a -> Index -> Index -> m () Source #

unsafeScaleRow :: (PrimMonad m, Commutative a) => WrapImmutable mat (PrimState m) a -> Index -> a -> m () Source #

unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> a) -> m (WrapImmutable mat (PrimState m) a) Source #

unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m a) -> m (WrapImmutable mat (PrimState m) a) Source #

toRows :: PrimMonad m => WrapImmutable mat (PrimState m) a -> m [Row (WrapImmutable mat) a] Source #

toColumns :: PrimMonad m => WrapImmutable mat (PrimState m) a -> m [Column (WrapImmutable mat) a] Source #

combineRows :: (Semiring a, Commutative a, PrimMonad m) => Index -> a -> Index -> WrapImmutable mat (PrimState m) a -> m () Source #

type Index = Int Source #

type Size = Int Source #

type family Column (mat :: k) :: Type -> Type Source #

Instances

Instances details
type Column STMatrix Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

type Column STMatrix = Vector
type Column MIMMatrix Source # 
Instance details

Defined in Algebra.Matrix.IntMap

type Column Matrix Source # 
Instance details

Defined in Algebra.Matrix.DataMatrix

type Column Matrix = Vector
type Column Matrix Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

type Column Matrix = Vector
type Column IMMatrix Source # 
Instance details

Defined in Algebra.Matrix.IntMap

type Column (WrapImmutable mat :: Type -> k -> Type) Source # 
Instance details

Defined in Algebra.Matrix.Generic

type Column (WrapImmutable mat :: Type -> k -> Type) = Column mat

type family Row (mat :: k) :: Type -> Type Source #

Instances

Instances details
type Row STMatrix Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

type Row STMatrix = Vector
type Row MIMMatrix Source # 
Instance details

Defined in Algebra.Matrix.IntMap

type Row Matrix Source # 
Instance details

Defined in Algebra.Matrix.DataMatrix

type Row Matrix = Vector
type Row Matrix Source # 
Instance details

Defined in Algebra.Matrix.HMatrix

type Row Matrix = Vector
type Row IMMatrix Source # 
Instance details

Defined in Algebra.Matrix.IntMap

type Row (WrapImmutable mat :: Type -> k -> Type) Source # 
Instance details

Defined in Algebra.Matrix.Generic

type Row (WrapImmutable mat :: Type -> k -> Type) = Row mat

new :: (MMatrix mat a, PrimMonad m) => Size -> Size -> m (mat (PrimState m) a) Source #

new n m creates a mutable matrix with n rows and m columns.

unsafeNew :: (MMatrix mat a, PrimMonad m) => Size -> Size -> m (mat (PrimState m) a) Source #

unsafeNew n m creates a mutable matrix with n rows and m columns, without memory initialisation.

See also: new.

copy :: (PrimMonad m, MMatrix mat a) => mat (PrimState m) a -> mat (PrimState m) a -> m () Source #

clone :: (PrimMonad m, MMatrix mat a) => mat (PrimState m) a -> m (mat (PrimState m) a) Source #

generate :: (PrimMonad m, MMatrix mat a) => Int -> Int -> (Index -> Index -> a) -> m (mat (PrimState m) a) Source #

generateM :: (PrimMonad m, MMatrix mat a) => Int -> Int -> (Index -> Index -> m a) -> m (mat (PrimState m) a) Source #

fromRow :: (PrimMonad m, MMatrix mat a) => Row mat a -> m (mat (PrimState m) a) Source #

fromColumn :: (PrimMonad m, MMatrix mat a) => Column mat a -> m (mat (PrimState m) a) Source #

getRow :: (MMatrix mat a, PrimMonad m) => Index -> mat (PrimState m) a -> m (Row mat a) Source #

getRow n mat retrieves nth row in mat

N.B. Index is considered as 0-origin, NOT 1!

getColumn :: (MMatrix mat a, PrimMonad m) => Index -> mat (PrimState m) a -> m (Column mat a) Source #

getColumn n mat retrieves nth colun in mat

N.B. Index is considered as 0-origin, NOT 1!

imapRow :: (PrimMonad m, MMatrix mat a) => Index -> (Index -> a -> a) -> mat (PrimState m) a -> m () Source #

imapRow i f m mutates ith row in the matrix m by applying f with column index.

See also: mapRow, imapColumn, mapColumn.

N.B. Index is considered as 0-origin, NOT 1!

mapRow :: (PrimMonad m, MMatrix mat a) => Index -> (a -> a) -> mat (PrimState m) a -> m () Source #

mapRow i f m mutates ith row in the matrix m by applying f.

See also: imapRow, imapColumn, mapColumn.

N.B. Index is considered as 0-origin, NOT 1!

fill :: (PrimMonad m, MMatrix mat a) => Size -> Size -> a -> m (mat (PrimState m) a) Source #

fill n m c creates a mutable constant matrix with n rows and m columns.

N.B. Index is considered as 0-origin, NOT 1!

read :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m a Source #

read i j m reads the value at ith row in jth column in m

N.B. Index is considered as 0-origin, NOT 1!

write :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> a -> m () Source #

read i j m writes the value at ith row in jth column in m

N.B. Index is considered as 0-origin, NOT 1!

scaleRow :: (Multiplicative a, Commutative a, MMatrix mat a, PrimMonad m) => Index -> a -> mat (PrimState m) a -> m () Source #

scaleRowL i c m multiplies every element in ith row in m by c, from right.

See also: scaleRowL and scaleRow

unsafeSwapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m () Source #

unsafeSwapRows n m mat swaps nth and mth rows in m, without boundary check.

See also: swapRows.

swapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m () Source #

swapRows n m mat swaps nth and mth rows in m.

See also: unsafeSwapRows.

gaussReduction :: (Eq a, PrimMonad m, Field a, Normed a, MMatrix mat a) => mat (PrimState m) a -> m (mat (PrimState m) a, mat (PrimState m) a, a) Source #

Performs Gaussian reduction to given matrix, returns the pair of triangulated matrix, pivot matrix and determinant.

unsafeGaussReduction :: (MMatrix mat a, Normed a, Eq a, Field a, PrimMonad m) => mat (PrimState m) a -> m (mat (PrimState m) a, a) Source #

Performs in-place gaussian reduction to the mutable matrix, and returns the pivoting matrix and determinant.