Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Numeric.LAPACK.Matrix.Extent
Synopsis
- class C tag where
- data Small
- data Big
- class Measure meas where
- switchMeasure :: f Shape -> f Size -> f meas
- data Shape
- data Size
- class (Measure meas, C tag) => Measured meas tag where
- data Extent meas vert horiz height width
- data Map measA vertA horizA measB vertB horizB height width
- height :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> height
- width :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> width
- squareSize :: Square shape -> shape
- dimensions :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> (height, width)
- transpose :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> Extent meas horiz vert width height
- fuse :: (Measure meas, C vert, C horiz, Eq fuse) => Extent meas vert horiz height fuse -> Extent meas vert horiz fuse width -> Maybe (Extent meas vert horiz height width)
- type family MultiplyMeasure a b
- square :: sh -> Square sh
- toGeneral :: (Measure meas, C vert, C horiz) => Map meas vert horiz Size Big Big height width
- fromSquare :: (Measured meas vert, Measured meas horiz) => Map Shape Small Small meas vert horiz size size
- fromSquareLiberal :: (Measured meas vert, Measured meas horiz) => Map Shape Small Small meas vert horiz height width
- fromLiberalSquare :: (C vert, C horiz) => Map Size Small Small Size vert horiz height width
- generalizeTall :: (Measure meas, C vert, C horiz) => Map meas vert Small Size vert horiz height width
- generalizeWide :: (Measure meas, C vert, C horiz) => Map meas Small horiz Size vert horiz height width
- weakenTall :: (Measured meas horiz, C vert) => Map meas vert Small meas vert horiz height width
- weakenWide :: (Measured meas vert, C horiz) => Map meas Small horiz meas vert horiz height width
- data AppendMode vertA vertB vertC height widthA widthB
- appendSame :: C vert => AppendMode vert vert vert height widthA widthB
- appendLeft :: C vert => AppendMode vert Big vert height widthA widthB
- appendRight :: C vert => AppendMode Big vert vert height widthA widthB
- type family Append a b
- appendAny :: (C vertA, C vertB) => AppendMode vertA vertB (Append vertA vertB) height widthA widthB
Documentation
Instances
Instances
Instances
class (Measure meas, C tag) => Measured meas tag where Source #
Admissible tag combinations are:
meas vert horiz Shape Small Small - Square Size Small Small - LiberalSquare Size Big Small - Tall Size Small Big - Wide Size Big Big - General
We can enforce this set with the constraints
(Extent.Measured meas vert, Extent.Measured meas horiz)
However, in some cases it leads to constraints
like Measured meas Small
or Measured meas Big
.
The former one is morally equivalent to Measure meas
and the latter one is morally equivalent to meas ~ Size
.
However, in order to convince the compiler
you would have to go through switchMeasured
.
In order to circumvent this trouble we use internal functions with weaker constraints:
(Extent.Measure meas, Extent.C vert, Extent.C horiz)
This is typesafe whenever the input
is based on one of the five admissible extent types.
We only need the strict constraints
when constructing matrices of arbitrary extent type,
i.e. this almost only concerns fromSquare
.
data Extent meas vert horiz height width Source #
Instances
(Measure meas, C vert, C horiz, Show height, Show width) => Show (Extent meas vert horiz height width) Source # | |
(Measure measure, C vertical, C horizontal, NFData height, NFData width) => NFData (Extent measure vertical horizontal height width) Source # | |
Defined in Numeric.LAPACK.Matrix.Extent.Private | |
(Measure meas, C vert, C horiz, Eq height, Eq width) => Eq (Extent meas vert horiz height width) Source # | |
squareSize :: Square shape -> shape Source #
dimensions :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> (height, width) Source #
transpose :: (Measure meas, C vert, C horiz) => Extent meas vert horiz height width -> Extent meas horiz vert width height Source #
fuse :: (Measure meas, C vert, C horiz, Eq fuse) => Extent meas vert horiz height fuse -> Extent meas vert horiz fuse width -> Maybe (Extent meas vert horiz height width) Source #
type family MultiplyMeasure a b Source #
Instances
type MultiplyMeasure Shape b Source # | |
Defined in Numeric.LAPACK.Matrix.Extent.Private | |
type MultiplyMeasure Size b Source # | |
Defined in Numeric.LAPACK.Matrix.Extent.Private |
toGeneral :: (Measure meas, C vert, C horiz) => Map meas vert horiz Size Big Big height width Source #
fromSquare :: (Measured meas vert, Measured meas horiz) => Map Shape Small Small meas vert horiz size size Source #
fromSquareLiberal :: (Measured meas vert, Measured meas horiz) => Map Shape Small Small meas vert horiz height width Source #
fromLiberalSquare :: (C vert, C horiz) => Map Size Small Small Size vert horiz height width Source #
generalizeTall :: (Measure meas, C vert, C horiz) => Map meas vert Small Size vert horiz height width Source #
generalizeWide :: (Measure meas, C vert, C horiz) => Map meas Small horiz Size vert horiz height width Source #
weakenTall :: (Measured meas horiz, C vert) => Map meas vert Small meas vert horiz height width Source #
weakenWide :: (Measured meas vert, C horiz) => Map meas Small horiz meas vert horiz height width Source #
data AppendMode vertA vertB vertC height widthA widthB Source #
appendSame :: C vert => AppendMode vert vert vert height widthA widthB Source #
appendLeft :: C vert => AppendMode vert Big vert height widthA widthB Source #
appendRight :: C vert => AppendMode Big vert vert height widthA widthB Source #