Module

Data.Matrix.Operations

#consRowVec

consRowVec :: forall h h' w a. Succ h h' => Nat w => Vec w a -> Matrix h w a -> Matrix h' w a

#(⤓)

Operator alias for Data.Matrix.Operations.consRowVec (right-associative / precedence 4)

> (vec2 1 2) ⤓ (matrix22 0 2 3 5)
 [1,2]
 [0,2]
 [3,5]

#consColVec

consColVec :: forall h w w' a. Succ w w' => Nat h => Vec h a -> Matrix h w a -> Matrix h w' a

#(⇥)

Operator alias for Data.Matrix.Operations.consColVec (right-associative / precedence 5)

> (Vec.vec2 1 2) ⇥ (matrix22 0 2 3 5)
  [2,3,5]
  [1,0,2]

#consSingle

consSingle :: forall a s s'. Succ s s' => a -> Matrix D1 s a -> Matrix D1 s' a

#(&)

Operator alias for Data.Matrix.Operations.consSingle (right-associative / precedence 4)

> 1 & 2 & 3 & empty
   [1, 2, 3]

#unconsV

unconsV :: forall h w h' a. Pred h h' => Pos h => Pos w => Matrix h w a -> { head :: Vec w a, tail :: Matrix h' w a }
> unconsV $ matrix22 1 2 3 4
{ head: [1,2], tail: 
  [3,4] }

#unconsH

unconsH :: forall h w w' a. Pred w w' => Pos h => Pos w => Matrix h w a -> { head :: Vec h a, tail :: Matrix h w' a }
> unconsH $ matrix22 1 2 3 4
{ head: [1,3], tail: 
  [2]
  [4] }

#snocRowVec

snocRowVec :: forall h h' w a. Succ h h' => Nat w => Vec w a -> Matrix h w a -> Matrix h' w a

#snocColVec

snocColVec :: forall h w w' a. Succ w w' => Nat h => Vec h a -> Matrix h w a -> Matrix h w' a

#findMaxIndex

findMaxIndex :: forall s a. Ord a => Pos s => Vec s a -> Int

#removeRow

removeRow :: forall w w' h a. Nat h => Nat w' => Nat w => Pred w w' => Int -> Matrix h w a -> Matrix h w' a

remove row at index. If index is out of bounds, there will be no change

> m
 [1,2]
 [3,4]

> removeRow 0 m
 [2]
 [4]

#removeColumn

removeColumn :: forall w h h' a. Nat w => Nat h => Nat h' => Pred h h' => Int -> Matrix h w a -> Matrix h' w a

remove column at index. If index is out of bounds, there will be no change

> m
  [1,2]
  [3,4]

> removeColumn 1 m
  [1,2]

#removeCross

removeCross :: forall w w' h h' a. Nat w => Nat w' => Nat h => Nat h' => Pred w w' => Pred h h' => Int -> Int -> Matrix h w a -> Matrix h' w' a

#replaceWithIdBlock

replaceWithIdBlock :: forall h w a. CommutativeRing a => Nat w => Nat h => Int -> Int -> Matrix h w a -> Matrix h w a

Modules