pact-time-0.3.0.1: Time Library for Pact
CopyrightCopyright © 2018 Kadena LLC.
LicenseMIT
MaintainerLars Kuhtz <lars@kadena.io>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.AffineSpace

Description

 
Synopsis

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.

Associated Types

type Diff t Source #

Methods

add :: Diff t -> t -> t Source #

diff :: t -> t -> Diff t Source #

Instances

Instances details
LeftTorsor Rational Source # 
Instance details

Defined in Numeric.AffineSpace

Associated Types

type Diff Rational Source #

LeftTorsor Integer Source # 
Instance details

Defined in Numeric.AffineSpace

Associated Types

type Diff Integer Source #

(.+^) :: 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)

Associated Types

type Scalar v Source #

Methods

scale :: Scalar v -> v -> v Source #

Instances

Instances details
FractionalVectorSpace Rational Source # 
Instance details

Defined in Numeric.AffineSpace

Associated Types

type Scalar Rational Source #

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.