camfort-0.804: CamFort - Cambridge Fortran infrastructure

Safe HaskellNone
LanguageHaskell2010

Camfort.Specification.Stencils.InferenceBackend

Synopsis

Documentation

type Span a = (a, a) Source #

mkTrivialSpan :: t -> (t, t) Source #

reducor :: [a] -> ([a] -> [a]) -> ([a] -> Int) -> [a] Source #

composeConsecutiveSpans :: Span (Vec n Int) -> Span (Vec n Int) -> [Span (Vec n Int)] Source #

Given two spans, if they are consecutive (i.e., (lower1, upper1) (lower2, upper2) where lower2 = upper1 + 1) then compose together returning Just of the new span. Otherwise Nothing

inferMinimalVectorRegions :: Permutable n => [Vec n Int] -> [Span (Vec n Int)] Source #

|inferMinimalVectorRegions| a key part of the algorithm, from a list of n-dimensional relative indices it infers a list of (possibly overlapping) 1-dimensional spans (vectors) within the n-dimensional space. Built from |minimalise| and |allRegionPermutations|

allRegionPermutations :: Permutable n => [Span (Vec n Int)] -> [Span (Vec n Int)] Source #

Map from a lists of n-dimensional spans of relative indices into all possible contiguous spans within the n-dimensional space (individual pass)

foldL :: (a -> a -> [a]) -> [a] -> [a] Source #

minimaliseRegions :: [Span (Vec n Int)] -> [Span (Vec n Int)] Source #

Collapses the regions into a small set by looking for potential overlaps and eliminating those that overlap

containedWithin :: Span (Vec n Int) -> Span (Vec n Int) -> Bool Source #

Binary predicate on whether the first region containedWithin the second

class Permutable n where Source #

Defines the (total) class of vector sizes which are permutable, along with the permutation function which pairs permutations with the unpermute operation

Minimal complete definition

selectionsV, permutationsV

Methods

selectionsV :: Vec n a -> [Selection n a] Source #

permutationsV :: Vec n a -> [(Vec n a, Vec n a -> Vec n a)] Source #

Instances

Permutable Z Source # 

Methods

selectionsV :: Vec Z a -> [Selection Z a] Source #

permutationsV :: Vec Z a -> [(Vec Z a, Vec Z a -> Vec Z a)] Source #

Permutable (S Z) Source # 

Methods

selectionsV :: Vec (S Z) a -> [Selection (S Z) a] Source #

permutationsV :: Vec (S Z) a -> [(Vec (S Z) a, Vec (S Z) a -> Vec (S Z) a)] Source #

Permutable (S n) => Permutable (S (S n)) Source # 

Methods

selectionsV :: Vec (S (S n)) a -> [Selection (S (S n)) a] Source #

permutationsV :: Vec (S (S n)) a -> [(Vec (S (S n)) a, Vec (S (S n)) a -> Vec (S (S n)) a)] Source #

type family Selection n a where ... Source #

Equations

Selection Z a = a 
Selection (S n) a = (a, Vec n a, a -> Vec n a -> Vec (S n) a) 

data VecList a where Source #

Constructors

VL :: (IsNatural n, Permutable n) => [Vec n a] -> VecList a 

data List a where Source #

Constructors

List :: (IsNatural n, Permutable n) => Vec n a -> List a 

lcons :: a -> List a -> List a Source #

fromList :: [a] -> List a Source #

data EqT a b where Source #

Constructors

ReflEq :: EqT a a