Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides the core mathematical definitions used by the rest of
Goal. In Goal, all mathematical structures are Manifold
s, even when they are
not especially complicated ones; Manifold
s may indicate highly articulated
structures, but may also indicate simpler concepts such as (vector) spaces.
Manifold
s are sets of points which can be described locally as Euclidean
spaces. In geometry, a point is typically a member of the actual Manifold
.
However, arbitrary types of points will often be difficult to represent
directly, and so points in Goal are always represented in terms of their
Coordinates
in terms of a given chart.
Charts are in turn represented by phantom types. Mathematically, charts are
maps between the Manifold
and the relevant Cartesian
coordinate system.
However, since we do not represent the points of a Manifold
explicility,
we also cannot represent Charts explicitly. As such, Atlases merely index a
point so as to indicate how to interpret its particular Coordinates
.
- class Eq m => Manifold m where
- class Transition c d m where
- transition :: (c :#: m) -> d :#: m
- data Embedded m c = Embedded {
- disembed :: m
- type Coordinates = Vector Double
- data c :#: m
- coordinate :: Int -> (c :#: m) -> Double
- chart :: Manifold m => c -> (c :#: m) -> c :#: m
- breakChart :: Manifold m => (c :#: m) -> d :#: m
- alterChart :: Manifold m => d -> (c :#: m) -> d :#: m
- listCoordinates :: (c :#: m) -> [Double]
- alterCoordinates :: Manifold m => (Double -> Double) -> (c :#: m) -> c :#: m
- toPair :: (c :#: m) -> (Double, Double)
- data Cartesian = Cartesian
- data Polar = Polar
- fromList :: Manifold m => m -> [Double] -> c :#: m
- fromCoordinates :: Manifold m => m -> Coordinates -> c :#: m
- euclideanPoint :: [Double] -> Cartesian :#: Euclidean
- realNumber :: Double -> Cartesian :#: Continuum
- mapReplicated :: Manifold m => ((c :#: m) -> x) -> (c :#: Replicated m) -> [x]
- joinReplicated :: Manifold m => [c :#: m] -> c :#: Replicated m
- concatReplicated :: (c :#: Replicated m) -> (c :#: Replicated m) -> c :#: Replicated m
- joinPair :: (Manifold m, Manifold n) => (c :#: m) -> (d :#: n) -> (c, d) :#: (m, n)
- splitPair :: (Manifold m, Manifold n) => ((c, d) :#: (m, n)) -> (c :#: m, d :#: n)
- joinPair' :: (Manifold m, Manifold n) => (c :#: m) -> (c :#: n) -> c :#: (m, n)
- splitPair' :: (Manifold m, Manifold n) => (c :#: (m, n)) -> (c :#: m, c :#: n)
- joinTriple :: (Manifold m, Manifold n, Manifold o) => (c :#: m) -> (d :#: n) -> (e :#: o) -> (c, d, e) :#: (m, n, o)
- splitTriple :: (Manifold m, Manifold n, Manifold o) => ((c, d, e) :#: (m, n, o)) -> (c :#: m, d :#: n, e :#: o)
- joinTriple' :: (Manifold m, Manifold n, Manifold o) => (c :#: m) -> (c :#: n) -> (c :#: o) -> c :#: (m, n, o)
- splitTriple' :: (Manifold m, Manifold n, Manifold o) => (c :#: (m, n, o)) -> (c :#: m, c :#: n, c :#: o)
Manifolds
class Eq m => Manifold m where Source
A geometric object with a certain dimension
. We assume that a Manifold
somehow represents all the geometric, coordinate independent structure under
consideration. Manifold
s should satisfy
dimension m = length $ coordinates (Point m cs)
Manifold Continuum Source | |
Manifold Euclidean Source | |
Manifold m => Manifold (Replicated m) Source | |
(Manifold m, Manifold n) => Manifold (m, n) Source | |
(Manifold m, Manifold n) => Manifold (Tensor n m) Source | |
(Manifold m, Manifold n) => Manifold (Affine m n) Source | |
Manifold m => Manifold (Bundle c m) Source | |
Manifold m => Manifold (Tangent c m) Source | |
(Manifold m, Manifold n, Manifold o) => Manifold (m, n, o) Source |
class Transition c d m where Source
A transition
involves taking a point represented by the chart c
,
and re-representing in terms of the chart d
. This will usually require
recomputation of the Coordinates
. Transition
s should satisfy the law
transition $ transition p = p
transition :: (c :#: m) -> d :#: m Source
Sets
Points
type Coordinates = Vector Double Source
Element
s of Euclidean
spaces are referred to as Coordinates
.
A point is an element of a Manifold
m
in terms of a particular
chart c
.
coordinate :: Int -> (c :#: m) -> Double Source
chart :: Manifold m => c -> (c :#: m) -> c :#: m Source
chart
allows one to specify the Atlas of a new point. This is often
necessary when typeclass methods are used to generate points under a
variety of coordinate systems.
breakChart :: Manifold m => (c :#: m) -> d :#: m Source
alterChart :: Manifold m => d -> (c :#: m) -> d :#: m Source
Combines breakChart
and chart
.
listCoordinates :: (c :#: m) -> [Double] Source
Returns the Coordinates
of the point in list form.
alterCoordinates :: Manifold m => (Double -> Double) -> (c :#: m) -> c :#: m Source
alterCoordinates
allows one to map a function over the coordinates
of a
point without changing the chart.
Charts
The Cartesian
coordinate system.
The Polar
coordinate system.
Constructors
fromList :: Manifold m => m -> [Double] -> c :#: m Source
fromList
builds points without the need to work with vectors.
fromCoordinates :: Manifold m => m -> Coordinates -> c :#: m Source
euclideanPoint :: [Double] -> Cartesian :#: Euclidean Source
A convenience function for building Euclidean
vectors.
realNumber :: Double -> Cartesian :#: Continuum Source
A convenience function for building elements of a Continuum
.
Direct Sums
Replicated
mapReplicated :: Manifold m => ((c :#: m) -> x) -> (c :#: Replicated m) -> [x] Source
A function to map functions over a point on a Replicated
Manifold
.
joinReplicated :: Manifold m => [c :#: m] -> c :#: Replicated m Source
Joins a list of distributions into a Replicated
Manifold
. Be advised that this function assumes
that the families of the individual distributions are equal.
concatReplicated :: (c :#: Replicated m) -> (c :#: Replicated m) -> c :#: Replicated m Source
Joins two Replicated
Manifold
s.
DirectSum
joinPair :: (Manifold m, Manifold n) => (c :#: m) -> (d :#: n) -> (c, d) :#: (m, n) Source
Joins a pair of Points into a Point on the the direct sum of the underlying Charts and Manifold
s.
splitPair :: (Manifold m, Manifold n) => ((c, d) :#: (m, n)) -> (c :#: m, d :#: n) Source
Splits a direct sum pair.
joinPair' :: (Manifold m, Manifold n) => (c :#: m) -> (c :#: n) -> c :#: (m, n) Source
Alternative version where we assume that the Charts are shared.
splitPair' :: (Manifold m, Manifold n) => (c :#: (m, n)) -> (c :#: m, c :#: n) Source
Alternative version where we assume that the Charts are shared.
joinTriple :: (Manifold m, Manifold n, Manifold o) => (c :#: m) -> (d :#: n) -> (e :#: o) -> (c, d, e) :#: (m, n, o) Source
Joins a triple of Points into a Point on the the direct sum of the underlying Charts and Manifold
s.
splitTriple :: (Manifold m, Manifold n, Manifold o) => ((c, d, e) :#: (m, n, o)) -> (c :#: m, d :#: n, e :#: o) Source
Splits a direct sum triple.