Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (Vector (Column mat) a, Vector (Row mat) a) => MMatrix mat a where
- basicUnsafeNew :: PrimMonad m => Size -> Size -> m (mat (PrimState m) a)
- basicInitialise :: PrimMonad m => mat (PrimState m) a -> m ()
- basicRowCount :: mat s a -> Size
- basicColumnCount :: mat s a -> Size
- unsafeGetRow :: PrimMonad m => Index -> mat (PrimState m) a -> m (Row mat a)
- unsafeGetColumn :: PrimMonad m => Index -> mat (PrimState m) a -> m (Column mat a)
- unsafeFill :: PrimMonad m => Size -> Size -> a -> m (mat (PrimState m) a)
- unsafeFromRow :: PrimMonad m => Row mat a -> m (mat (PrimState m) a)
- unsafeFromRows :: PrimMonad m => [Row mat a] -> m (mat (PrimState m) a)
- unsafeFromColumn :: PrimMonad m => Column mat a -> m (mat (PrimState m) a)
- unsafeFromColumns :: PrimMonad m => [Column mat a] -> m (mat (PrimState m) a)
- unsafeCopy :: PrimMonad m => mat (PrimState m) a -> mat (PrimState m) a -> m ()
- unsafeRead :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> m a
- unsafeWrite :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> a -> m ()
- basicSet :: PrimMonad m => mat (PrimState m) a -> a -> m ()
- basicUnsafeIMapRowM :: PrimMonad m => mat (PrimState m) a -> Index -> (Index -> a -> m a) -> m ()
- basicUnsafeIMapRow :: PrimMonad m => mat (PrimState m) a -> Index -> (Index -> a -> a) -> m ()
- basicUnsafeSwapRows :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> m ()
- unsafeScaleRow :: (PrimMonad m, Commutative a) => mat (PrimState m) a -> Index -> a -> m ()
- unsafeGenerate :: PrimMonad m => Size -> Size -> (Index -> Index -> a) -> m (mat (PrimState m) a)
- unsafeGenerateM :: PrimMonad m => Size -> Size -> (Index -> Index -> m a) -> m (mat (PrimState m) a)
- toRows :: PrimMonad m => mat (PrimState m) a -> m [Row mat a]
- toColumns :: PrimMonad m => mat (PrimState m) a -> m [Column mat a]
- combineRows :: (Semiring a, Commutative a, PrimMonad m) => Index -> a -> Index -> mat (PrimState m) a -> m ()
- type Index = Int
- type Size = Int
- type family Column (mat :: k) :: Type -> Type
- type family Row (mat :: k) :: Type -> Type
- new :: (MMatrix mat a, PrimMonad m) => Size -> Size -> m (mat (PrimState m) a)
- unsafeNew :: (MMatrix mat a, PrimMonad m) => Size -> Size -> m (mat (PrimState m) a)
- copy :: (PrimMonad m, MMatrix mat a) => mat (PrimState m) a -> mat (PrimState m) a -> m ()
- clone :: (PrimMonad m, MMatrix mat a) => mat (PrimState m) a -> m (mat (PrimState m) a)
- generate :: (PrimMonad m, MMatrix mat a) => Int -> Int -> (Index -> Index -> a) -> m (mat (PrimState m) a)
- generateM :: (PrimMonad m, MMatrix mat a) => Int -> Int -> (Index -> Index -> m a) -> m (mat (PrimState m) a)
- fromRow :: (PrimMonad m, MMatrix mat a) => Row mat a -> m (mat (PrimState m) a)
- fromColumn :: (PrimMonad m, MMatrix mat a) => Column mat a -> m (mat (PrimState m) a)
- getRow :: (MMatrix mat a, PrimMonad m) => Index -> mat (PrimState m) a -> m (Row mat a)
- getColumn :: (MMatrix mat a, PrimMonad m) => Index -> mat (PrimState m) a -> m (Column mat a)
- imapRow :: (PrimMonad m, MMatrix mat a) => Index -> (Index -> a -> a) -> mat (PrimState m) a -> m ()
- mapRow :: (PrimMonad m, MMatrix mat a) => Index -> (a -> a) -> mat (PrimState m) a -> m ()
- fill :: (PrimMonad m, MMatrix mat a) => Size -> Size -> a -> m (mat (PrimState m) a)
- read :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m a
- write :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> a -> m ()
- scaleRow :: (Multiplicative a, Commutative a, MMatrix mat a, PrimMonad m) => Index -> a -> mat (PrimState m) a -> m ()
- unsafeSwapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m ()
- swapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m ()
- 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)
- unsafeGaussReduction :: (MMatrix mat a, Normed a, Eq a, Field a, PrimMonad m) => mat (PrimState m) a -> m (mat (PrimState m) a, a)
Documentation
class (Vector (Column mat) a, Vector (Row mat) a) => MMatrix mat a where Source #
Mutable, row-based 0
-origin matrix
basicUnsafeNew, basicInitialise, basicRowCount, basicColumnCount, unsafeGetRow, unsafeGetColumn, unsafeFromRows, unsafeCopy, unsafeRead, unsafeWrite, basicSet, basicUnsafeIMapRowM, unsafeScaleRow
basicUnsafeNew :: PrimMonad m => Size -> Size -> m (mat (PrimState m) a) Source #
creates a mutable matrix with basicUnsafeNew
n mn
rows and m
columns,
without initialisation.
This method should not be used directly, use
instead.unsafeNew
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 #
copies the content of usnafeCopy
target sourcesource
to target
, without boundary check.
unsafeRead :: PrimMonad m => mat (PrimState m) a -> Index -> Index -> m a Source #
reads the value at unsafeRead
i j mi
th row in j
th 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 #
adds scalar multiple of combineRows
i c j matj
th row by c
to i
th.
Instances
DecidableZero a => MMatrix MIMMatrix a Source # | |
Defined in Algebra.Matrix.IntMap 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 # | |
Defined in Algebra.Matrix.HMatrix 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 # | |
Defined in Algebra.Matrix.HMatrix 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 # | |
Defined in Algebra.Matrix.HMatrix 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 # | |
Defined in Algebra.Matrix.Generic 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 family Column (mat :: k) :: Type -> Type Source #
Instances
type Column STMatrix Source # | |
Defined in Algebra.Matrix.HMatrix | |
type Column MIMMatrix Source # | |
Defined in Algebra.Matrix.IntMap | |
type Column Matrix Source # | |
Defined in Algebra.Matrix.DataMatrix | |
type Column Matrix Source # | |
Defined in Algebra.Matrix.HMatrix type Column Matrix = Vector | |
type Column IMMatrix Source # | |
Defined in Algebra.Matrix.IntMap | |
type Column (WrapImmutable mat :: Type -> k -> Type) Source # | |
Defined in Algebra.Matrix.Generic |
type family Row (mat :: k) :: Type -> Type Source #
Instances
type Row STMatrix Source # | |
Defined in Algebra.Matrix.HMatrix | |
type Row MIMMatrix Source # | |
Defined in Algebra.Matrix.IntMap | |
type Row Matrix Source # | |
Defined in Algebra.Matrix.DataMatrix | |
type Row Matrix Source # | |
Defined in Algebra.Matrix.HMatrix type Row Matrix = Vector | |
type Row IMMatrix Source # | |
Defined in Algebra.Matrix.IntMap | |
type Row (WrapImmutable mat :: Type -> k -> Type) Source # | |
Defined in Algebra.Matrix.Generic |
new :: (MMatrix mat a, PrimMonad m) => Size -> Size -> m (mat (PrimState m) a) Source #
creates a mutable matrix with new
n mn
rows and m
columns.
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 #
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 #
retrieves getRow
n matn
th 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 #
retrieves getColumn
n matn
th 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 #
fill :: (PrimMonad m, MMatrix mat a) => Size -> Size -> a -> m (mat (PrimState m) a) Source #
creates a mutable constant matrix with fill
n m cn
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 #
reads the value at read
i j mi
th row in j
th 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 #
writes the value at read
i j mi
th row in j
th 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 #
multiplies every element in scaleRowL
i c mi
th row in m
by c
, from right.
See also:
and scaleRowL
scaleRow
unsafeSwapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m () Source #
swaps unsafeSwapRows
n m matn
th and m
th rows in m
, without boundary check.
See also:
.swapRows
swapRows :: (PrimMonad m, MMatrix mat a) => Index -> Index -> mat (PrimState m) a -> m () Source #
swaps swapRows
n m matn
th and m
th rows in m
.
See also:
.unsafeSwapRows