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

Algebra.Matrix

Synopsis

Documentation

class Matrix mat where Source #

Associated Types

type Elem mat a :: Constraint Source #

Methods

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

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

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

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

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

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

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

ncols :: mat a -> Int Source #

nrows :: mat a -> Int Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

nonZeroCols :: (DecidableZero a, Elem mat a) => mat a -> [Int] 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 #

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 #

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 #

delta :: (Monoidal r, Unital r) => Int -> Int -> r Source #

companion :: (KnownNat n, CoeffRing r, Matrix mat, Elem mat r, IsMonomialOrder n ord) => Ordinal n -> OrderedPolynomial r ord n -> mat r Source #

gaussReduction :: (Matrix mat, Elem mat a, Normed a, Eq a, Field a) => mat a -> (mat a, mat a) Source #

gaussReduction a = (a', p) where a' is row echelon form and p is pivoting matrix.

maxNorm :: (Elem mat a, Normed a, Matrix mat) => mat a -> Norm a Source #

rankWith :: (Elem mat r, CoeffRing r, Matrix mat) => (mat r -> mat r) -> mat r -> Int Source #

det :: (Elem mat a, Eq a, Field a, Normed a, Matrix mat) => mat a -> a Source #

inverse :: (Elem mat a, Eq a, Field a, Normed a, Matrix mat) => mat a -> mat a Source #

inverseWith :: (mat a -> (mat a, mat a)) -> mat a -> mat a Source #