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

Algebra.LinkedMatrix

Synopsis

Documentation

data Matrix a Source #

Instances

Instances details
Matrix Matrix Source # 
Instance details

Defined in Algebra.Matrix

Associated Types

type Elem Matrix a Source #

Methods

cmap :: (Elem Matrix a, Elem Matrix b) => (a -> b) -> Matrix a -> Matrix b Source #

empty :: Elem Matrix b => Matrix b Source #

fromLists :: Elem Matrix a => [[a]] -> Matrix a Source #

fromCols :: Elem Matrix a => [Vector a] -> Matrix a Source #

fromRows :: Elem Matrix a => [Vector a] -> Matrix a Source #

toCols :: Elem Matrix a => Matrix a -> [Vector a] Source #

toRows :: Elem Matrix a => Matrix a -> [Vector a] Source #

ncols :: Matrix a -> Int Source #

nrows :: Matrix a -> Int Source #

identity :: Elem Matrix a => Int -> Matrix a Source #

diag :: Elem Matrix a => Vector a -> Matrix a Source #

getDiag :: Elem Matrix a => Matrix a -> Vector a Source #

trace :: Elem Matrix a => Matrix a -> a Source #

diagProd :: Elem Matrix a => Matrix a -> a Source #

zero :: Elem Matrix a => Int -> Int -> Matrix a Source #

colVector :: Elem Matrix a => Vector a -> Matrix a Source #

rowVector :: Elem Matrix a => Vector a -> Matrix a Source #

getCol :: Elem Matrix a => Int -> Matrix a -> Vector a Source #

getRow :: Elem Matrix a => Int -> Matrix a -> Vector a Source #

switchRows :: Elem Matrix a => Int -> Int -> Matrix a -> Matrix a Source #

scaleRow :: Elem Matrix a => a -> Int -> Matrix a -> Matrix a Source #

combineRows :: Elem Matrix a => Int -> a -> Int -> Matrix a -> Matrix a Source #

trans :: Elem Matrix a => Matrix a -> Matrix a Source #

buildMatrix :: Elem Matrix a => Int -> Int -> ((Int, Int) -> a) -> Matrix a Source #

index :: Elem Matrix a => Int -> Int -> Matrix a -> Maybe a Source #

(!) :: Elem Matrix a => Matrix a -> (Int, Int) -> a Source #

(<||>) :: Elem Matrix a => Matrix a -> Matrix a -> Matrix a Source #

(<-->) :: Elem Matrix a => Matrix a -> Matrix a -> Matrix a Source #

nonZeroRows :: (DecidableZero a, Elem Matrix a) => Matrix a -> [Int] Source #

nonZeroCols :: (DecidableZero a, Elem Matrix a) => Matrix a -> [Int] Source #

(DecidableZero r, RightModule Integer r) => RightModule Integer (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(*.) :: Matrix r -> Integer -> Matrix r #

(DecidableZero r, RightModule Natural r) => RightModule Natural (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(*.) :: Matrix r -> Natural -> Matrix r #

(DecidableZero r, LeftModule Integer r) => LeftModule Integer (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(.*) :: Integer -> Matrix r -> Matrix r #

(DecidableZero r, LeftModule Natural r) => LeftModule Natural (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(.*) :: Natural -> Matrix r -> Matrix r #

Eq a => Eq (Matrix a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(==) :: Matrix a -> Matrix a -> Bool #

(/=) :: Matrix a -> Matrix a -> Bool #

Read a => Read (Matrix a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Show a => Show (Matrix a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

showsPrec :: Int -> Matrix a -> ShowS #

show :: Matrix a -> String #

showList :: [Matrix a] -> ShowS #

(DecidableZero r, Semiring r) => Semiring (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

(DecidableZero r, Multiplicative r) => Multiplicative (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(*) :: Matrix r -> Matrix r -> Matrix r #

pow1p :: Matrix r -> Natural -> Matrix r #

productWith1 :: Foldable1 f => (a -> Matrix r) -> f a -> Matrix r #

DecidableZero r => Monoidal (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

zero :: Matrix r #

sinnum :: Natural -> Matrix r -> Matrix r #

sumWith :: Foldable f => (a -> Matrix r) -> f a -> Matrix r #

(DecidableZero r, Group r) => Group (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(-) :: Matrix r -> Matrix r -> Matrix r #

negate :: Matrix r -> Matrix r #

subtract :: Matrix r -> Matrix r -> Matrix r #

times :: Integral n => n -> Matrix r -> Matrix r #

DecidableZero r => Additive (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(+) :: Matrix r -> Matrix r -> Matrix r #

sinnum1p :: Natural -> Matrix r -> Matrix r #

sumWith1 :: Foldable1 f => (a -> Matrix r) -> f a -> Matrix r #

(DecidableZero r, Abelian r) => Abelian (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

(DecidableZero r, Semiring r, Multiplicative r) => RightModule (Scalar r) (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(*.) :: Matrix r -> Scalar r -> Matrix r #

(DecidableZero r, Semiring r, Multiplicative r) => LeftModule (Scalar r) (Matrix r) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(.*) :: Scalar r -> Matrix r -> Matrix r #

type Elem Matrix a Source # 
Instance details

Defined in Algebra.Matrix

toLists :: forall a. Monoidal a => Matrix a -> [[a]] Source #

fromList :: DecidableZero a => [((Int, Int), a)] -> Matrix a Source #

swapRows :: Int -> Int -> Matrix a -> Matrix a Source #

swapCols :: Int -> Int -> Matrix a -> Matrix a Source #

getRow :: Monoidal a => Int -> Matrix a -> Vector a Source #

getCol :: Monoidal a => Int -> Matrix a -> Vector a Source #

inBound :: (Int, Int) -> Matrix a -> Bool Source #

height :: forall a. Lens' (Matrix a) Int Source #

width :: forall a. Lens' (Matrix a) Int Source #

cmap :: DecidableZero a => (a1 -> a) -> Matrix a1 -> Matrix a Source #

traverseRow :: b -> (b -> Int -> Entry a -> b) -> Int -> Matrix a -> b Source #

traverseCol :: b -> (b -> Int -> Entry a -> b) -> Int -> Matrix a -> b Source #

data Entry a Source #

Instances

Instances details
Eq a => Eq (Entry a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

(==) :: Entry a -> Entry a -> Bool #

(/=) :: Entry a -> Entry a -> Bool #

Ord a => Ord (Entry a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

compare :: Entry a -> Entry a -> Ordering #

(<) :: Entry a -> Entry a -> Bool #

(<=) :: Entry a -> Entry a -> Bool #

(>) :: Entry a -> Entry a -> Bool #

(>=) :: Entry a -> Entry a -> Bool #

max :: Entry a -> Entry a -> Entry a #

min :: Entry a -> Entry a -> Entry a #

Read a => Read (Entry a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Show a => Show (Entry a) Source # 
Instance details

Defined in Algebra.LinkedMatrix

Methods

showsPrec :: Int -> Entry a -> ShowS #

show :: Entry a -> String #

showList :: [Entry a] -> ShowS #

idx :: forall a. Lens' (Entry a) (Int, Int) Source #

value :: forall a a. Lens (Entry a) (Entry a) a a Source #

toRows :: Monoidal a => Matrix a -> [Vector a] Source #

toCols :: Monoidal a => Matrix a -> [Vector a] Source #

trace :: Monoidal c => Matrix c -> c Source #

diagProd :: (Unital c, Monoidal c) => Matrix c -> c Source #

index :: Monoidal a => Key -> Int -> Matrix a -> Maybe a Source #

(!) :: Monoidal a => Matrix a -> (Int, Int) -> a Source #

splitIndependentDirs Source #

Arguments

:: (DecidableZero a, Field a) 
=> Direction 
-> Matrix a 
-> (Matrix a, [Int], [Int])

(m', bs, as) with m is full-rank submatrix, bs are independent and as are dependent.

solveWiedemann :: (Eq a, Field a, DecidableZero a, DecidableUnits a, ZeroProductSemiring a, Random a, MonadRandom m) => Matrix a -> Vector a -> m (Either (Vector a) (Vector a)) Source #

Solving linear equation using linearly recurrent sequence (Wiedemann algorithm).

henselLift Source #

Arguments

:: Integer

prime number p

-> Matrix Integer

original matrix M

-> Matrix Integer

inverse matrix of M mod p

-> Vector Integer

coefficient vector v

-> [Vector Integer]

vector x with Mx = b mod p