BNFC-2.6.0.3: A compiler front-end generator.

Safe HaskellNone

Data.Matrix.Quad

Synopsis

Documentation

data Shape

Constructors

Bin Shape Shape 
Leaf 

data Shape' where

Constructors

Bin' :: !Int -> Shape' s -> Shape' s' -> Shape' (Bin s s') 
Leaf' :: Shape' Leaf 

data SomeShape where

Constructors

S :: Shape' s -> SomeShape 

data Mat where

Constructors

Quad :: !(Mat x1 y1 a) -> !(Mat x2 y1 a) -> !(Mat x1 y2 a) -> !(Mat x2 y2 a) -> Mat (Bin x1 x2) (Bin y1 y2) a 
Zero :: Mat x y a 
One :: !a -> Mat Leaf Leaf a 
Row :: Mat x1 Leaf a -> Mat x2 Leaf a -> Mat (Bin x1 x2) Leaf a 
Col :: Mat Leaf y1 a -> Mat Leaf y2 a -> Mat Leaf (Bin y1 y2) a 

Instances

data Vec where

Constructors

Z :: Vec s a 
O :: a -> Vec Leaf a 
:! :: Vec s a -> Vec s' a -> Vec (Bin s s') a 

Instances

row :: Mat x1 Leaf a -> Mat x2 Leaf a -> Mat (Bin x1 x2) Leaf a

col :: Mat Leaf y1 a -> Mat Leaf y2 a -> Mat Leaf (Bin y1 y2) a

quad :: Mat x1 y1 a -> Mat x2 y1 a -> Mat x1 y2 a -> Mat x2 y2 a -> Mat (Bin x1 x2) (Bin y1 y2) a

one :: AbelianGroupZ a => a -> Mat Leaf Leaf a

(.+.) :: AbelianGroupZ a => Mat x y a -> Mat x y a -> Mat x y a

mult :: RingP a => Bool -> Mat x y a -> Mat z x a -> Mat z y (Pair a)

trav :: AbelianGroupZ a => Mat y x (Pair a) -> Pair (Mat y x a)

q0 :: Mat (Bin x x') (Bin y y') a

closeDisjointP :: RingP a => Bool -> Mat x x a -> Mat y x (Pair a) -> Mat y y a -> Pair (Mat y x a)

showR :: Mat x y a -> String

bin' :: Shape' s -> Shape' s' -> Shape' (Bin s s')

mkSing :: AbelianGroupZ a => Shape' x -> Shape' y -> a -> Mat x y a

data SomeTri a where

Constructors

T :: Shape' s -> Pair (Mat s s a) -> SomeTri a 

type Q a = SomeTri a

mkUpDiag :: AbelianGroupZ a => [a] -> Shape' s -> Mat s s a

close :: RingP a => Bool -> Mat s s (Pair a) -> Pair (Mat s s a)

mkTree :: RingP a => [Pair a] -> SomeTri a

quad' :: Applicative f => f (Mat x1 y1 a) -> f (Mat x2 y1 a) -> f (Mat x1 y2 a) -> f (Mat x2 y2 a) -> f (Mat (Bin x1 x2) (Bin y1 y2) a)

mergein :: RingP a => Bool -> SomeTri a -> Pair a -> SomeTri a -> SomeTri a

zw :: (AbelianGroup a, AbelianGroup b) => (a -> b -> c) -> Vec y a -> Vec y b -> Vec y c

A variant of zipWith on vectors

lk :: AbelianGroup a => Int -> Shape' x -> Vec x a -> a

Lookup in a vector

lin' :: AbelianGroup a => Mat x y a -> Vec y (Vec x a)

Linearize a matrix

contents :: Shape' x -> Vec x a -> [(Int, a)]

Contents of a vector

first :: (t -> t1) -> (t, t2) -> (t1, t2)

second :: (t -> t2) -> (t1, t) -> (t1, t2)

data Path where

Constructors

Here :: Path Leaf 
Low :: Path s -> Path (Bin s s') 
High :: Path s -> Path (Bin s' s) 

(<||>) :: Maybe (a, Path x) -> Maybe (a, Path x') -> Maybe (a, Path (Bin x x'))

rightmostOnLine :: Path y -> Mat x y a -> Maybe (a, Path x)

What is, and where is the rightmost non-zero element on a given line of the matrix?

isRightmost :: Path x -> Bool

Is this the rightmost path?

results' :: AbelianGroup a => Mat y y a -> Path y -> [(Path y, a, Path y)]

results :: AbelianGroupZ a => SomeTri a -> [(Int, a, Int)]

leftMost :: Shape' s -> Path s

fromPath :: Shape' y -> Path y -> Int

root' :: AbelianGroup a => Mat x y a -> a

root :: AbelianGroup t => SomeTri t -> t

square3 :: RingP a => Bool -> Pair a -> Pair a -> SomeTri a

sz' :: Shape' s -> Int

(|+|) :: [[a]] -> [[a]] -> [[a]]

(-+-) :: [a] -> [a] -> [a]

lin :: AbelianGroup a => Shape' x -> Shape' y -> Mat x y a -> [[a]]