BNFC-2.6.0.3: A compiler front-end generator.

Safe HaskellNone

Data.Matrix.Quad

Synopsis

Documentation

data Shape Source

Constructors

Bin Shape Shape 
Leaf 

data Shape' whereSource

Constructors

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

data SomeShape whereSource

Constructors

S :: Shape' s -> SomeShape 

data Mat whereSource

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 whereSource

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 aSource

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

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

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

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

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

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

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

showR :: Mat x y a -> StringSource

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

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

data SomeTri a whereSource

Constructors

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

type Q a = SomeTri aSource

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

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

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

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)Source

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

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

A variant of zipWith on vectors

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

Lookup in a vector

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

Linearize a matrix

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

Contents of a vector

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

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

data Path whereSource

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'))Source

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

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

isRightmost :: Path x -> BoolSource

Is this the rightmost path?

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

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

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

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

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

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