Copyright | Copyright © 2018 Kadena LLC. |
---|---|
License | MIT |
Maintainer | Lars Kuhtz <lars@kadena.io> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Numeric.AffineSpace
Contents
Description
Synopsis
- class AdditiveGroup (Diff t) => LeftTorsor t where
- (.+^) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> Diff t -> t
- (^+.) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => Diff t -> t -> t
- (.-.) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> t -> Diff t
- (.-^) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> Diff t -> t
- class (AdditiveAbelianGroup v, Fractional (Scalar v)) => FractionalVectorSpace v where
- type AffineSpace t = (FractionalVectorSpace (Diff t), LeftTorsor t)
Torsor
class AdditiveGroup (Diff t) => LeftTorsor t where Source #
A torsor is a generalization of affine spaces. It doesn't require the underlying structure to be vector space, but an additive group suffices. This means that it doesn't support scalar multiplication. In particular it doesn't require an inverse operation to multiplication, which would add unneeded complexity to the formal definition of the operational semantics.
A Torsor is also called principal homogeous space.
zero `add` a == a
(a `plus` b) `add` t == a `add` (b `add` t)
(s `diff` t) `add` t == s
The last property is states that add
is a bijection.
Instances
(.+^) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> Diff t -> t infixl 6 Source #
(^+.) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => Diff t -> t -> t infixl 6 Source #
(.-.) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> t -> Diff t infix 6 Source #
(.-^) :: AdditiveAbelianGroup (Diff t) => LeftTorsor t => t -> Diff t -> t infixl 6 Source #
Vector Space
class (AdditiveAbelianGroup v, Fractional (Scalar v)) => FractionalVectorSpace v where Source #
Vector Space over Fractional Numbers
A real vector space is an additive abelian group that forms an module with the field of real numbers.
a * (b `scale` c) == (a * b) `scale` c
1 `scale` a == a
a `scale` (b `plus` c) == (a `scale` b) `plus` (a `scale` c)
(a + b) `scale` c == (a `scale` c) `plus` (b `scale` c)
AfficeSpace
type AffineSpace t = (FractionalVectorSpace (Diff t), LeftTorsor t) Source #
An affine space is a torsor for the action of the additive group of a vector space.