Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Matrix mat where
- type Elem mat a :: Constraint
- cmap :: (Elem mat a, Elem mat b) => (a -> b) -> mat a -> mat b
- empty :: Elem mat b => mat b
- fromLists :: Elem mat a => [[a]] -> mat a
- fromCols :: Elem mat a => [Vector a] -> mat a
- fromRows :: Elem mat a => [Vector a] -> mat a
- toCols :: Elem mat a => mat a -> [Vector a]
- toRows :: Elem mat a => mat a -> [Vector a]
- ncols :: mat a -> Int
- nrows :: mat a -> Int
- identity :: Elem mat a => Int -> mat a
- diag :: Elem mat a => Vector a -> mat a
- getDiag :: Elem mat a => mat a -> Vector a
- trace :: Elem mat a => mat a -> a
- diagProd :: Elem mat a => mat a -> a
- zero :: Elem mat a => Int -> Int -> mat a
- colVector :: Elem mat a => Vector a -> mat a
- rowVector :: Elem mat a => Vector a -> mat a
- getCol :: Elem mat a => Int -> mat a -> Vector a
- getRow :: Elem mat a => Int -> mat a -> Vector a
- switchRows :: Elem mat a => Int -> Int -> mat a -> mat a
- scaleRow :: Elem mat a => a -> Int -> mat a -> mat a
- combineRows :: Elem mat a => Int -> a -> Int -> mat a -> mat a
- trans :: Elem mat a => mat a -> mat a
- buildMatrix :: Elem mat a => Int -> Int -> ((Int, Int) -> a) -> mat a
- index :: Elem mat a => Int -> Int -> mat a -> Maybe a
- (!) :: Elem mat a => mat a -> (Int, Int) -> a
- (<||>) :: Elem mat a => mat a -> mat a -> mat a
- (<-->) :: Elem mat a => mat a -> mat a -> mat a
- nonZeroRows :: (DecidableZero a, Elem mat a) => mat a -> [Int]
- nonZeroCols :: (DecidableZero a, Elem mat a) => mat a -> [Int]
- delta :: (Monoidal r, Unital r) => Int -> Int -> r
- companion :: (KnownNat n, CoeffRing r, Matrix mat, Elem mat r, IsMonomialOrder n ord) => Ordinal n -> OrderedPolynomial r ord n -> mat r
- gaussReduction :: (Matrix mat, Elem mat a, Normed a, Eq a, Field a) => mat a -> (mat a, mat a)
- maxNorm :: (Elem mat a, Normed a, Matrix mat) => mat a -> Norm a
- rankWith :: (Elem mat r, CoeffRing r, Matrix mat) => (mat r -> mat r) -> mat r -> Int
- det :: (Elem mat a, Eq a, Field a, Normed a, Matrix mat) => mat a -> a
- inverse :: (Elem mat a, Eq a, Field a, Normed a, Matrix mat) => mat a -> mat a
- inverseWith :: (mat a -> (mat a, mat a)) -> mat a -> mat a
Documentation
class Matrix mat where Source #
cmap, empty, fromLists, ncols, nrows, identity, diag, getDiag, trace, diagProd, zero, colVector, rowVector, getCol, getRow, switchRows, scaleRow, combineRows, trans, buildMatrix, (!), (<||>), (<-->)
type Elem mat a :: Constraint Source #
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
Matrix Matrix Source # | |
Defined in Algebra.Matrix 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 # | |
Defined in Algebra.Matrix 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 # | |
Defined in Algebra.Matrix 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 # |
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.
inverseWith :: (mat a -> (mat a, mat a)) -> mat a -> mat a Source #