manifolds-0.6.1.0: Coordinate-free hypersurfaces
Copyright(c) Justus Sagemüller 2015
LicenseGPL v3
Maintainer(@) jsag $ hvl.no
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Manifold.PseudoAffine

Description

This is the second prototype of a manifold class. It appears to give considerable advantages over Manifold, so that class will probably soon be replaced with the one we define here (though PseudoAffine does not follow the standard notion of a manifold very closely, it should work quite equivalently for pretty much all Haskell types that qualify as manifolds).

Manifolds are interesting as objects of various categories, from continuous to diffeomorphic. At the moment, we mainly focus on region-wise differentiable functions, which are a promising compromise between flexibility of definition and provability of analytic properties. In particular, they are well-suited for visualisation purposes.

The classes in this module are mostly aimed at manifolds without boundary. Manifolds with boundary (which we call MWBound, never manifold!) are more or less treated as a disjoint sum of the interior and the boundary. To understand how this module works, best first forget about boundaries – in this case, Interior x ~ x, fromInterior and toInterior are trivial, and .+~|, |-~. and betweenBounds are irrelevant. The manifold structure of the boundary itself is not considered at all here.

Synopsis

Manifold class

class (OpenManifold m, ProjectableBoundary m, LSpace (Needle m)) => Manifold m Source #

See Semimanifold and PseudoAffine for the methods. As a Manifold we understand a pseudo-affine space whose Needle space is a well-behaved vector space that is isomorphic to all of the manifold's tangent spaces. It must also be an instance of the SemimanifoldWithBoundary class with explicitly empty boundary (in other words, with no boundary).

Instances

Instances details
(OpenManifold m, ProjectableBoundary m, LSpace (Needle m)) => Manifold m Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

class AdditiveGroup (Needle x) => Semimanifold x where #

Minimal complete definition

Nothing

Associated Types

type Needle x #

The space of “ways” starting from some reference point and going to some particular target point. Hence, the name: like a compass needle, but also with an actual length. For affine spaces, Needle is simply the space of line segments (aka vectors) between two points, i.e. the same as Diff. The AffineManifold constraint makes that requirement explicit.

This space should be isomorphic to the tangent space (and in fact serves an in many ways similar role), however whereas the tangent space of a manifold is really infinitesimally small, needles actually allow macroscopic displacements.

Methods

(.+~^) :: x -> Needle x -> x infixl 6 #

Generalisation of the translation operation .+^ to possibly non-flat manifolds, instead of affine spaces.

(.-~^) :: x -> Needle x -> x infixl 6 #

Shorthand for \p v -> p .+~^ negateV v, which should obey the asymptotic law

p .-~^ v .+~^ v ≅ p

Meaning: if v is scaled down with sufficiently small factors η, then the difference (p.-~^v.+~^v) .-~. p should eventually scale down even faster: as O (η²). For large vectors, it may however behave differently, except in flat spaces (where all this should be equivalent to the AffineSpace instance).

semimanifoldWitness :: SemimanifoldWitness x #

Instances

Instances details
Semimanifold Rational 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Rational #

Semimanifold ℝP² Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type Needle ℝP² #

Semimanifold Double 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Double #

Semimanifold Float 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle Float #

AdditiveGroup (DualVector (Needle (VRep m))) => Semimanifold (GenericNeedle' m) 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (GenericNeedle' m) #

Methods

(.+~^) :: GenericNeedle' m -> Needle (GenericNeedle' m) -> GenericNeedle' m #

(.-~^) :: GenericNeedle' m -> Needle (GenericNeedle' m) -> GenericNeedle' m #

semimanifoldWitness :: SemimanifoldWitness (GenericNeedle' m) #

AdditiveGroup v => Semimanifold (DualVectorFromBasis v) 
Instance details

Defined in Math.LinearMap.Category.Instances.Deriving

Associated Types

type Needle (DualVectorFromBasis v) #

Methods

(.+~^) :: DualVectorFromBasis v -> Needle (DualVectorFromBasis v) -> DualVectorFromBasis v #

(.-~^) :: DualVectorFromBasis v -> Needle (DualVectorFromBasis v) -> DualVectorFromBasis v #

semimanifoldWitness :: SemimanifoldWitness (DualVectorFromBasis v) #

(PseudoAffine x, VectorSpace (Needle x)) => Semimanifold (Shade x) Source # 
Instance details

Defined in Data.Manifold.Shade

Associated Types

type Needle (Shade x) #

AffineManifold x => Semimanifold (Shade' x) Source # 
Instance details

Defined in Data.Manifold.Shade

Associated Types

type Needle (Shade' x) #

(LinearSpace v, FiniteFreeSpace v, FiniteFreeSpace (DualVector v), StiefelScalar (Scalar v)) => Semimanifold (Stiefel1 v) Source # 
Instance details

Defined in Data.Manifold.Types

Associated Types

type Needle (Stiefel1 v) #

AdditiveGroup (Needle (VRep x)) => Semimanifold (GenericNeedle x) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (GenericNeedle x) #

RealFloat' s => Semimanifold (S²_ s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type Needle (S²_ s) #

RealFloat' r => Semimanifold (S¹_ r) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type Needle (S¹_ r) #

RealFloat' r => Semimanifold (S⁰_ r) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type Needle (S⁰_ r) #

ℝeal r => Semimanifold (ℝP¹_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ℝP¹_ r) #

Semimanifold (ℝP⁰_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ℝP⁰_ r) #

Semimanifold (ZeroDim k) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (ZeroDim k) #

(LinearSpace (a n), Needle (a n) ~ a n) => Semimanifold (Point a n) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type Needle (Point a n) #

Methods

(.+~^) :: Point a n -> Needle (Point a n) -> Point a n #

(.-~^) :: Point a n -> Needle (Point a n) -> Point a n #

semimanifoldWitness :: SemimanifoldWitness (Point a n) #

(Generic1 f, TensorSpace y, TensorSpace (f y), Scalar (f y) ~ Scalar y, Monoidal f (LinearFunction (Scalar y)) (LinearFunction (Scalar y))) => Semimanifold (LinearApplicativeSpace f y) 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (LinearApplicativeSpace f y) #

Methods

(.+~^) :: LinearApplicativeSpace f y -> Needle (LinearApplicativeSpace f y) -> LinearApplicativeSpace f y #

(.-~^) :: LinearApplicativeSpace f y -> Needle (LinearApplicativeSpace f y) -> LinearApplicativeSpace f y #

semimanifoldWitness :: SemimanifoldWitness (LinearApplicativeSpace f y) #

(TensorSpace v, Scalar v ~ s) => Semimanifold (SymmetricTensor s v) 
Instance details

Defined in Math.LinearMap.Category.Instances

Associated Types

type Needle (SymmetricTensor s v) #

(AbstractLinearSpace a, VectorSpaceImplementation a ~ c, AdditiveGroup (DualVector c)) => Semimanifold (AbstractDualVector a c) 
Instance details

Defined in Math.LinearMap.Category.Instances.Deriving

Associated Types

type Needle (AbstractDualVector a c) #

Methods

(.+~^) :: AbstractDualVector a c -> Needle (AbstractDualVector a c) -> AbstractDualVector a c #

(.-~^) :: AbstractDualVector a c -> Needle (AbstractDualVector a c) -> AbstractDualVector a c #

semimanifoldWitness :: SemimanifoldWitness (AbstractDualVector a c) #

Semimanifold x => Semimanifold (WithAny x y) Source # 
Instance details

Defined in Data.Manifold.Shade

Associated Types

type Needle (WithAny x y) #

(ParallelTransporting (->) m f, Semimanifold f, ParallelTransporting (LinearFunction s) (Needle m) (Needle f), s ~ Scalar (Needle m)) => Semimanifold (FibreBundle m f) Source # 
Instance details

Defined in Data.Manifold.FibreBundle

Associated Types

type Needle (FibreBundle m f) #

(Semimanifold a, Semimanifold b) => Semimanifold (a, b) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (a, b) #

Methods

(.+~^) :: (a, b) -> Needle (a, b) -> (a, b) #

(.-~^) :: (a, b) -> Needle (a, b) -> (a, b) #

semimanifoldWitness :: SemimanifoldWitness (a, b) #

Semimanifold a => Semimanifold (Rec0 a s) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (Rec0 a s) #

Methods

(.+~^) :: Rec0 a s -> Needle (Rec0 a s) -> Rec0 a s #

(.-~^) :: Rec0 a s -> Needle (Rec0 a s) -> Rec0 a s #

semimanifoldWitness :: SemimanifoldWitness (Rec0 a s) #

VectorSpace w => Semimanifold (LinearFunction s v w) 
Instance details

Defined in Math.LinearMap.Asserted

Associated Types

type Needle (LinearFunction s v w) #

(AdditiveGroup (DualVector (f p)), AdditiveGroup (DualVector (g p))) => Semimanifold (GenericTupleDual f g p) 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (GenericTupleDual f g p) #

Methods

(.+~^) :: GenericTupleDual f g p -> Needle (GenericTupleDual f g p) -> GenericTupleDual f g p #

(.-~^) :: GenericTupleDual f g p -> Needle (GenericTupleDual f g p) -> GenericTupleDual f g p #

semimanifoldWitness :: SemimanifoldWitness (GenericTupleDual f g p) #

(LinearSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => Semimanifold (LinearMap s v w) 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (LinearMap s v w) #

Methods

(.+~^) :: LinearMap s v w -> Needle (LinearMap s v w) -> LinearMap s v w #

(.-~^) :: LinearMap s v w -> Needle (LinearMap s v w) -> LinearMap s v w #

semimanifoldWitness :: SemimanifoldWitness (LinearMap s v w) #

(TensorSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => Semimanifold (Tensor s v w) 
Instance details

Defined in Math.LinearMap.Category.Class

Associated Types

type Needle (Tensor s v w) #

Methods

(.+~^) :: Tensor s v w -> Needle (Tensor s v w) -> Tensor s v w #

(.-~^) :: Tensor s v w -> Needle (Tensor s v w) -> Tensor s v w #

semimanifoldWitness :: SemimanifoldWitness (Tensor s v w) #

(Atlas x, HasTrie (ChartIndex x), Manifold y, LinearManifold (Needle x), Scalar (Needle x) ~ s, LinearManifold (Needle y), Scalar (Needle y) ~ s) => Semimanifold (Affine s x y) Source # 
Instance details

Defined in Data.Function.Affine

Associated Types

type Needle (Affine s x y) #

Methods

(.+~^) :: Affine s x y -> Needle (Affine s x y) -> Affine s x y #

(.-~^) :: Affine s x y -> Needle (Affine s x y) -> Affine s x y #

semimanifoldWitness :: SemimanifoldWitness (Affine s x y) #

(Semimanifold (f p), Semimanifold (g p)) => Semimanifold (NeedleProductSpace f g p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (NeedleProductSpace f g p) #

(Semimanifold a, Semimanifold b, Semimanifold c) => Semimanifold (a, b, c) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (a, b, c) #

Methods

(.+~^) :: (a, b, c) -> Needle (a, b, c) -> (a, b, c) #

(.-~^) :: (a, b, c) -> Needle (a, b, c) -> (a, b, c) #

semimanifoldWitness :: SemimanifoldWitness (a, b, c) #

(Semimanifold (f p), Semimanifold (g p)) => Semimanifold ((f :*: g) p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle ((f :*: g) p) #

Methods

(.+~^) :: (f :*: g) p -> Needle ((f :*: g) p) -> (f :*: g) p #

(.-~^) :: (f :*: g) p -> Needle ((f :*: g) p) -> (f :*: g) p #

semimanifoldWitness :: SemimanifoldWitness ((f :*: g) p) #

Semimanifold (f p) => Semimanifold (M1 i c f p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Associated Types

type Needle (M1 i c f p) #

Methods

(.+~^) :: M1 i c f p -> Needle (M1 i c f p) -> M1 i c f p #

(.-~^) :: M1 i c f p -> Needle (M1 i c f p) -> M1 i c f p #

semimanifoldWitness :: SemimanifoldWitness (M1 i c f p) #

type Needle' x = DualVector (Needle x) Source #

A co-needle can be understood as a “paper stack”, with which you can measure the length that a needle reaches in a given direction by counting the number of holes punched through them.

class Semimanifold x => PseudoAffine x where #

This is the class underlying what we understand as manifolds.

The interface is almost identical to the better-known AffineSpace class, but we don't require associativity of .+~^ with ^+^ – except in an asymptotic sense for small vectors.

That innocent-looking change makes the class applicable to vastly more general types: while an affine space is basically nothing but a vector space without particularly designated origin, a pseudo-affine space can have nontrivial topology on the global scale, and yet be used in practically the same way as an affine space. At least the usual spheres and tori make good instances, perhaps the class is in fact equivalent to manifolds in their usual maths definition (with an atlas of charts: a family of overlapping regions of the topological space, each homeomorphic to the Needle vector space or some simply-connected subset thereof).

The Semimanifold and PseudoAffine classes can be anyclass-derived or empty-instantiated based on Generic for product types (including newtypes) of existing PseudoAffine instances. For example, the definition

data Cylinder = CylinderPolar { zCyl :: !D¹, φCyl :: !S¹ }
  deriving (Generic, Semimanifold, PseudoAffine)

is equivalent to

data Cylinder = CylinderPolar { zCyl :: !D¹, φCyl :: !S¹ }

data CylinderNeedle = CylinderPolarNeedle { δzCyl :: !(Needle D¹), δφCyl :: !(Needle S¹) }

instance Semimanifold Cylinder where
  type Needle Cylinder = CylinderNeedle
  CylinderPolar z φ .+~^ CylinderPolarNeedle δz δφ
       = CylinderPolar (z.+~^δz) (φ.+~^δφ)

instance PseudoAffine Cylinder where
  CylinderPolar z₁ φ₁ .-~. CylinderPolar z₀ φ₀
       = CylinderPolarNeedle $ z₁.-~.z₀ * φ₁.-~.φ₀
  CylinderPolar z₁ φ₁ .-~! CylinderPolar z₀ φ₀
       = CylinderPolarNeedle (z₁.-~!z₀) (φ₁.-~.φ₀)

Minimal complete definition

Nothing

Methods

(.-~.) :: x -> x -> Maybe (Needle x) infix 6 #

The path reaching from one point to another. Should only yield Nothing if the points are on disjoint segments of a non–path-connected space.

For a connected manifold, you may define this method as

  p.-~.q = pure (p.-~!q)

(.-~!) :: x -> x -> Needle x infix 6 #

Unsafe version of .-~.. If the two points lie in disjoint regions, the behaviour is undefined.

Whenever p and q lie in a connected region, the identity

p .+~^ (q.-~.p) ≡ q

should hold (up to possible floating point rounding etc.). Meanwhile, you will in general have

(p.+~^v).-~^v ≠ p

(though in many instances this is at least for sufficiently small v approximately equal).

pseudoAffineWitness :: PseudoAffineWitness x #

Instances

Instances details
PseudoAffine Rational 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine ℝP² Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

PseudoAffine Double 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine Float 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

AdditiveGroup (DualVector (Needle (VRep m))) => PseudoAffine (GenericNeedle' m) 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: GenericNeedle' m -> GenericNeedle' m -> Maybe (Needle (GenericNeedle' m)) #

(.-~!) :: GenericNeedle' m -> GenericNeedle' m -> Needle (GenericNeedle' m) #

pseudoAffineWitness :: PseudoAffineWitness (GenericNeedle' m) #

AdditiveGroup v => PseudoAffine (DualVectorFromBasis v) 
Instance details

Defined in Math.LinearMap.Category.Instances.Deriving

Methods

(.-~.) :: DualVectorFromBasis v -> DualVectorFromBasis v -> Maybe (Needle (DualVectorFromBasis v)) #

(.-~!) :: DualVectorFromBasis v -> DualVectorFromBasis v -> Needle (DualVectorFromBasis v) #

pseudoAffineWitness :: PseudoAffineWitness (DualVectorFromBasis v) #

(LinearSpace v, FiniteFreeSpace v, FiniteFreeSpace (DualVector v), StiefelScalar (Scalar v)) => PseudoAffine (Stiefel1 v) Source # 
Instance details

Defined in Data.Manifold.Types

AdditiveGroup (Needle (VRep x)) => PseudoAffine (GenericNeedle x) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

RealFloat' s => PseudoAffine (S²_ s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

RealFloat' r => PseudoAffine (S¹_ r) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

RealFloat' r => PseudoAffine (S⁰_ r) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

ℝeal r => PseudoAffine (ℝP¹_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine (ℝP⁰_ r) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

PseudoAffine (ZeroDim k) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

(LinearSpace (a n), Needle (a n) ~ a n) => PseudoAffine (Point a n) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.-~.) :: Point a n -> Point a n -> Maybe (Needle (Point a n)) #

(.-~!) :: Point a n -> Point a n -> Needle (Point a n) #

pseudoAffineWitness :: PseudoAffineWitness (Point a n) #

(Generic1 f, TensorSpace y, TensorSpace (f y), Scalar (f y) ~ Scalar y, Monoidal f (LinearFunction (Scalar y)) (LinearFunction (Scalar y))) => PseudoAffine (LinearApplicativeSpace f y) 
Instance details

Defined in Math.LinearMap.Category.Instances

Methods

(.-~.) :: LinearApplicativeSpace f y -> LinearApplicativeSpace f y -> Maybe (Needle (LinearApplicativeSpace f y)) #

(.-~!) :: LinearApplicativeSpace f y -> LinearApplicativeSpace f y -> Needle (LinearApplicativeSpace f y) #

pseudoAffineWitness :: PseudoAffineWitness (LinearApplicativeSpace f y) #

(TensorSpace v, Scalar v ~ s) => PseudoAffine (SymmetricTensor s v) 
Instance details

Defined in Math.LinearMap.Category.Instances

(AbstractLinearSpace a, VectorSpaceImplementation a ~ c, AdditiveGroup (DualVector c)) => PseudoAffine (AbstractDualVector a c) 
Instance details

Defined in Math.LinearMap.Category.Instances.Deriving

Methods

(.-~.) :: AbstractDualVector a c -> AbstractDualVector a c -> Maybe (Needle (AbstractDualVector a c)) #

(.-~!) :: AbstractDualVector a c -> AbstractDualVector a c -> Needle (AbstractDualVector a c) #

pseudoAffineWitness :: PseudoAffineWitness (AbstractDualVector a c) #

PseudoAffine x => PseudoAffine (WithAny x y) Source # 
Instance details

Defined in Data.Manifold.Shade

(ParallelTransporting (->) m f, PseudoAffine f, ParallelTransporting (LinearFunction s) (Needle m) (Needle f), s ~ Scalar (Needle m)) => PseudoAffine (FibreBundle m f) Source # 
Instance details

Defined in Data.Manifold.FibreBundle

(PseudoAffine a, PseudoAffine b) => PseudoAffine (a, b) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (a, b) -> (a, b) -> Maybe (Needle (a, b)) #

(.-~!) :: (a, b) -> (a, b) -> Needle (a, b) #

pseudoAffineWitness :: PseudoAffineWitness (a, b) #

PseudoAffine a => PseudoAffine (Rec0 a s) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: Rec0 a s -> Rec0 a s -> Maybe (Needle (Rec0 a s)) #

(.-~!) :: Rec0 a s -> Rec0 a s -> Needle (Rec0 a s) #

pseudoAffineWitness :: PseudoAffineWitness (Rec0 a s) #

VectorSpace w => PseudoAffine (LinearFunction s v w) 
Instance details

Defined in Math.LinearMap.Asserted

(AdditiveGroup (DualVector (f p)), AdditiveGroup (DualVector (g p))) => PseudoAffine (GenericTupleDual f g p) 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: GenericTupleDual f g p -> GenericTupleDual f g p -> Maybe (Needle (GenericTupleDual f g p)) #

(.-~!) :: GenericTupleDual f g p -> GenericTupleDual f g p -> Needle (GenericTupleDual f g p) #

pseudoAffineWitness :: PseudoAffineWitness (GenericTupleDual f g p) #

(LinearSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => PseudoAffine (LinearMap s v w) 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: LinearMap s v w -> LinearMap s v w -> Maybe (Needle (LinearMap s v w)) #

(.-~!) :: LinearMap s v w -> LinearMap s v w -> Needle (LinearMap s v w) #

pseudoAffineWitness :: PseudoAffineWitness (LinearMap s v w) #

(TensorSpace v, TensorSpace w, Scalar v ~ s, Scalar w ~ s) => PseudoAffine (Tensor s v w) 
Instance details

Defined in Math.LinearMap.Category.Class

Methods

(.-~.) :: Tensor s v w -> Tensor s v w -> Maybe (Needle (Tensor s v w)) #

(.-~!) :: Tensor s v w -> Tensor s v w -> Needle (Tensor s v w) #

pseudoAffineWitness :: PseudoAffineWitness (Tensor s v w) #

(Atlas x, HasTrie (ChartIndex x), Manifold y, LinearManifold (Needle x), Scalar (Needle x) ~ s, LinearManifold (Needle y), Scalar (Needle y) ~ s) => PseudoAffine (Affine s x y) Source # 
Instance details

Defined in Data.Function.Affine

Methods

(.-~.) :: Affine s x y -> Affine s x y -> Maybe (Needle (Affine s x y)) #

(.-~!) :: Affine s x y -> Affine s x y -> Needle (Affine s x y) #

pseudoAffineWitness :: PseudoAffineWitness (Affine s x y) #

(PseudoAffine (f p), PseudoAffine (g p)) => PseudoAffine (NeedleProductSpace f g p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

(PseudoAffine a, PseudoAffine b, PseudoAffine c) => PseudoAffine (a, b, c) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (a, b, c) -> (a, b, c) -> Maybe (Needle (a, b, c)) #

(.-~!) :: (a, b, c) -> (a, b, c) -> Needle (a, b, c) #

pseudoAffineWitness :: PseudoAffineWitness (a, b, c) #

(PseudoAffine (f p), PseudoAffine (g p)) => PseudoAffine ((f :*: g) p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: (f :*: g) p -> (f :*: g) p -> Maybe (Needle ((f :*: g) p)) #

(.-~!) :: (f :*: g) p -> (f :*: g) p -> Needle ((f :*: g) p) #

pseudoAffineWitness :: PseudoAffineWitness ((f :*: g) p) #

PseudoAffine (f p) => PseudoAffine (M1 i c f p) 
Instance details

Defined in Math.Manifold.Core.PseudoAffine

Methods

(.-~.) :: M1 i c f p -> M1 i c f p -> Maybe (Needle (M1 i c f p)) #

(.-~!) :: M1 i c f p -> M1 i c f p -> Needle (M1 i c f p) #

pseudoAffineWitness :: PseudoAffineWitness (M1 i c f p) #

class (Num s, LinearSpace s, FreeVectorSpace s, Dimensional 1 s) => Num' s #

type RealFloat' s = (RealFrac' s, Floating s) #

Type definitions

Needles

newtype Local x Source #

A point on a manifold, as seen from a nearby reference point.

Constructors

Local 

Fields

Instances

Instances details
Show (Needle x) => Show (Local x) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

showsPrec :: Int -> Local x -> ShowS #

show :: Local x -> String #

showList :: [Local x] -> ShowS #

Metrics

type Metric x = Norm (Needle x) Source #

The word “metric” is used in the sense as in general relativity. Actually this is just the type of scalar products on the tangent space. The actual metric is the function x -> x -> Scalar (Needle x) defined by

\p q -> m |$| (p.-~!q)

type RieMetric x = x -> Metric x Source #

A Riemannian metric assigns each point on a manifold a scalar product on the tangent space. Note that this association is not continuous, because the charts/tangent spaces in the bundle are a priori disjoint. However, for a proper Riemannian metric, all arising expressions of scalar products from needles between points on the manifold ought to be differentiable.

type RieMetric' x = x -> Metric' x Source #

Constraints

data SemimanifoldWitness x where #

This is the reified form of the property that the interior of a semimanifold is a manifold. These constraints would ideally be expressed directly as superclass constraints, but that would require the UndecidableSuperclasses extension, which is not reliable yet.

Also, if all those equality constraints are in scope, GHC tends to infer needlessly complicated types like Needle (Needle (Needle x)), which is the same as just Needle x.

Constructors

SemimanifoldWitness :: forall x. (Semimanifold (Needle x), Needle (Needle x) ~ Needle x) => SemimanifoldWitness x 

type WithField s c x = (c x, s ~ Scalar (Needle x), s ~ Scalar (Needle' x)) Source #

Require some constraint on a manifold, and also fix the type of the manifold's underlying field. For example, WithField ℝ HilbertManifold v constrains v to be a real (i.e., Double-) Hilbert space. Note that for this to compile, you will in general need the -XLiberalTypeSynonyms extension (except if the constraint is an actual type class (like Manifold): only those can always be partially applied, for type constraints this is by default not allowed).

type LocallyScalable s x = (PseudoAffine x, LSpace (Needle x), s ~ Scalar (Needle x), s ~ Scalar (Needle' x), Num' s) Source #

Local functions

type LocalAffine x y = (Needle y, LocalLinear x y) Source #

Misc

alerpB :: (AffineSpace x, VectorSpace (Diff x), Scalar (Diff x) ~ ) => x -> x -> -> x #

Like alerp, but actually restricted to the interval between the points.

palerp :: (PseudoAffine x, VectorSpace (Needle x)) => x -> x -> Maybe (Scalar (Needle x) -> x) #

Interpolate between points, approximately linearly. For points that aren't close neighbours (i.e. lie in an almost flat region), the pathway is basically undefined – save for its end points.

A proper, really well-defined (on global scales) interpolation only makes sense on a Riemannian manifold, as Geodesic.

palerpB :: (PseudoAffine x, VectorSpace (Needle x), Scalar (Needle x) ~ ) => x -> x -> Maybe ( -> x) #

Like palerp, but actually restricted to the interval between the points, with a signature like geodesicBetween rather than alerp.

class (Semimanifold x, Semimanifold ξ, LSpace (Needle x), LSpace (Needle ξ), Scalar (Needle x) ~ Scalar (Needle ξ)) => LocallyCoercible x ξ where Source #

Instances of this class must be diffeomorphic manifolds, and even have canonically isomorphic tangent spaces, so that fromPackedVector . asPackedVector :: Needle x -> Needle ξ defines a meaningful “representational identity“ between these spaces.

Methods

locallyTrivialDiffeomorphism :: x -> ξ Source #

Must be compatible with the isomorphism on the tangent spaces, i.e. locallyTrivialDiffeomorphism (p .+~^ v) ≡ locallyTrivialDiffeomorphism p .+~^ coerceNeedle v

coerceNeedle :: Functor p => p (x, ξ) -> Needle x -+> Needle ξ Source #

coerceNeedle' :: Functor p => p (x, ξ) -> Needle' x -+> Needle' ξ Source #

coerceNorm :: Functor p => p (x, ξ) -> Metric x -> Metric ξ Source #

coerceVariance :: Functor p => p (x, ξ) -> Metric' x -> Metric' ξ Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism ξ x Source #

Instances

Instances details
LocallyCoercible Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V1 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V1 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

NumPrime s => LocallyCoercible (V0 s) (V0 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: V0 s -> V0 s Source #

coerceNeedle :: Functor p => p (V0 s, V0 s) -> Needle (V0 s) -+> Needle (V0 s) Source #

coerceNeedle' :: Functor p => p (V0 s, V0 s) -> Needle' (V0 s) -+> Needle' (V0 s) Source #

coerceNorm :: Functor p => p (V0 s, V0 s) -> Metric (V0 s) -> Metric (V0 s) Source #

coerceVariance :: Functor p => p (V0 s, V0 s) -> Metric' (V0 s) -> Metric' (V0 s) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (V0 s) (V0 s) Source #

NumPrime s => LocallyCoercible (V0 s) (ZeroDim s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

NumPrime s => LocallyCoercible (V1 s) (V1 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: V1 s -> V1 s Source #

coerceNeedle :: Functor p => p (V1 s, V1 s) -> Needle (V1 s) -+> Needle (V1 s) Source #

coerceNeedle' :: Functor p => p (V1 s, V1 s) -> Needle' (V1 s) -+> Needle' (V1 s) Source #

coerceNorm :: Functor p => p (V1 s, V1 s) -> Metric (V1 s) -> Metric (V1 s) Source #

coerceVariance :: Functor p => p (V1 s, V1 s) -> Metric' (V1 s) -> Metric' (V1 s) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (V1 s) (V1 s) Source #

NumPrime s => LocallyCoercible (V2 s) (V2 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: V2 s -> V2 s Source #

coerceNeedle :: Functor p => p (V2 s, V2 s) -> Needle (V2 s) -+> Needle (V2 s) Source #

coerceNeedle' :: Functor p => p (V2 s, V2 s) -> Needle' (V2 s) -+> Needle' (V2 s) Source #

coerceNorm :: Functor p => p (V2 s, V2 s) -> Metric (V2 s) -> Metric (V2 s) Source #

coerceVariance :: Functor p => p (V2 s, V2 s) -> Metric' (V2 s) -> Metric' (V2 s) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (V2 s) (V2 s) Source #

NumPrime s => LocallyCoercible (V3 s) (V3 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: V3 s -> V3 s Source #

coerceNeedle :: Functor p => p (V3 s, V3 s) -> Needle (V3 s) -+> Needle (V3 s) Source #

coerceNeedle' :: Functor p => p (V3 s, V3 s) -> Needle' (V3 s) -+> Needle' (V3 s) Source #

coerceNorm :: Functor p => p (V3 s, V3 s) -> Metric (V3 s) -> Metric (V3 s) Source #

coerceVariance :: Functor p => p (V3 s, V3 s) -> Metric' (V3 s) -> Metric' (V3 s) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (V3 s) (V3 s) Source #

NumPrime s => LocallyCoercible (V4 s) (V4 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: V4 s -> V4 s Source #

coerceNeedle :: Functor p => p (V4 s, V4 s) -> Needle (V4 s) -+> Needle (V4 s) Source #

coerceNeedle' :: Functor p => p (V4 s, V4 s) -> Needle' (V4 s) -+> Needle' (V4 s) Source #

coerceNorm :: Functor p => p (V4 s, V4 s) -> Metric (V4 s) -> Metric (V4 s) Source #

coerceVariance :: Functor p => p (V4 s, V4 s) -> Metric' (V4 s) -> Metric' (V4 s) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (V4 s) (V4 s) Source #

NumPrime s => LocallyCoercible (ZeroDim s) (V0 s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

NumPrime s => LocallyCoercible (ZeroDim s) (ZeroDim s) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V2 ) (, ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V3 ) (, (, )) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V3 ) ((, ), ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (V4 ) ((, ), (, )) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (, ) (V2 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (, (, )) (V3 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible ((, ), ) (V3 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible ((, ), (, )) (V4 ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (, ) (, ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

LocallyCoercible (, (, )) (, (, )) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: (, (, )) -> (, (, )) Source #

coerceNeedle :: Functor p => p ((, (, )), (, (, ))) -> Needle (, (, )) -+> Needle (, (, )) Source #

coerceNeedle' :: Functor p => p ((, (, )), (, (, ))) -> Needle' (, (, )) -+> Needle' (, (, )) Source #

coerceNorm :: Functor p => p ((, (, )), (, (, ))) -> Metric (, (, )) -> Metric (, (, )) Source #

coerceVariance :: Functor p => p ((, (, )), (, (, ))) -> Metric' (, (, )) -> Metric' (, (, )) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (, (, )) (, (, )) Source #

LocallyCoercible ((, ), ) ((, ), ) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: ((, ), ) -> ((, ), ) Source #

coerceNeedle :: Functor p => p (((, ), ), ((, ), )) -> Needle ((, ), ) -+> Needle ((, ), ) Source #

coerceNeedle' :: Functor p => p (((, ), ), ((, ), )) -> Needle' ((, ), ) -+> Needle' ((, ), ) Source #

coerceNorm :: Functor p => p (((, ), ), ((, ), )) -> Metric ((, ), ) -> Metric ((, ), ) Source #

coerceVariance :: Functor p => p (((, ), ), ((, ), )) -> Metric' ((, ), ) -> Metric' ((, ), ) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism ((, ), ) ((, ), ) Source #

(Semimanifold a, Semimanifold b, Semimanifold c, LSpace (Needle a), LSpace (Needle b), LSpace (Needle c), Scalar (Needle a) ~ Scalar (Needle b), Scalar (Needle b) ~ Scalar (Needle c)) => LocallyCoercible ((a, b), c) (a, (b, c)) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: ((a, b), c) -> (a, (b, c)) Source #

coerceNeedle :: Functor p => p (((a, b), c), (a, (b, c))) -> Needle ((a, b), c) -+> Needle (a, (b, c)) Source #

coerceNeedle' :: Functor p => p (((a, b), c), (a, (b, c))) -> Needle' ((a, b), c) -+> Needle' (a, (b, c)) Source #

coerceNorm :: Functor p => p (((a, b), c), (a, (b, c))) -> Metric ((a, b), c) -> Metric (a, (b, c)) Source #

coerceVariance :: Functor p => p (((a, b), c), (a, (b, c))) -> Metric' ((a, b), c) -> Metric' (a, (b, c)) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism (a, (b, c)) ((a, b), c) Source #

(Semimanifold a, Semimanifold b, Semimanifold c, LSpace (Needle a), LSpace (Needle b), LSpace (Needle c), Scalar (Needle a) ~ Scalar (Needle b), Scalar (Needle b) ~ Scalar (Needle c)) => LocallyCoercible (a, (b, c)) ((a, b), c) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

locallyTrivialDiffeomorphism :: (a, (b, c)) -> ((a, b), c) Source #

coerceNeedle :: Functor p => p ((a, (b, c)), ((a, b), c)) -> Needle (a, (b, c)) -+> Needle ((a, b), c) Source #

coerceNeedle' :: Functor p => p ((a, (b, c)), ((a, b), c)) -> Needle' (a, (b, c)) -+> Needle' ((a, b), c) Source #

coerceNorm :: Functor p => p ((a, (b, c)), ((a, b), c)) -> Metric (a, (b, c)) -> Metric ((a, b), c) Source #

coerceVariance :: Functor p => p ((a, (b, c)), ((a, b), c)) -> Metric' (a, (b, c)) -> Metric' ((a, b), c) Source #

oppositeLocalCoercion :: CanonicalDiffeomorphism ((a, b), c) (a, (b, c)) Source #

class ImpliesMetric s where Source #

Associated Types

type MetricRequirement s x :: Constraint Source #

Instances

Instances details
ImpliesMetric Norm Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Associated Types

type MetricRequirement Norm x Source #

ImpliesMetric Shade Source # 
Instance details

Defined in Data.Manifold.Shade

Associated Types

type MetricRequirement Shade x Source #

ImpliesMetric Shade' Source # 
Instance details

Defined in Data.Manifold.Shade

Associated Types

type MetricRequirement Shade' x Source #

coerceMetric :: forall x ξ. (LocallyCoercible x ξ, LSpace (Needle ξ)) => RieMetric ξ -> RieMetric x Source #

coerceMetric' :: forall x ξ. (LocallyCoercible x ξ, LSpace (Needle ξ)) => RieMetric' ξ -> RieMetric' x Source #

class PseudoAffine m => Connected m where Source #

A connected manifold is one where any point can be reached by translation from any other point.

Minimal complete definition

Nothing

Methods

(.−.) :: m -> m -> Needle m infix 6 Source #

Safe version of (.-~.).

Instances

Instances details
Connected ℝ² Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝ³ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝ¹ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝ⁴ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.−.) :: -> -> Needle Source #

Connected Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.−.) :: -> -> Needle Source #

Connected Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.−.) :: -> -> Needle Source #

Connected ℝP² Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝP¹ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝP⁰ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Connected ℝ⁰ Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

(Connected x, Connected y, PseudoAffine (FibreBundle x y)) => Connected (FibreBundle x y) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.−.) :: FibreBundle x y -> FibreBundle x y -> Needle (FibreBundle x y) Source #

(Connected x, Connected y) => Connected (x, y) Source # 
Instance details

Defined in Data.Manifold.PseudoAffine

Methods

(.−.) :: (x, y) -> (x, y) -> Needle (x, y) Source #

Orphan instances

PseudoAffine ℝP² Source # 
Instance details

Semimanifold ℝP² Source # 
Instance details

Associated Types

type Needle ℝP² #

RealFloat' s => PseudoAffine (S²_ s) Source # 
Instance details

RealFloat' r => PseudoAffine (S¹_ r) Source # 
Instance details

RealFloat' r => PseudoAffine (S⁰_ r) Source # 
Instance details

RealFloat' s => Semimanifold (S²_ s) Source # 
Instance details

Associated Types

type Needle (S²_ s) #

RealFloat' r => Semimanifold (S¹_ r) Source # 
Instance details

Associated Types

type Needle (S¹_ r) #

RealFloat' r => Semimanifold (S⁰_ r) Source # 
Instance details

Associated Types

type Needle (S⁰_ r) #

(LinearSpace (a n), Needle (a n) ~ a n) => PseudoAffine (Point a n) Source # 
Instance details

Methods

(.-~.) :: Point a n -> Point a n -> Maybe (Needle (Point a n)) #

(.-~!) :: Point a n -> Point a n -> Needle (Point a n) #

pseudoAffineWitness :: PseudoAffineWitness (Point a n) #

(LinearSpace (a n), Needle (a n) ~ a n) => Semimanifold (Point a n) Source # 
Instance details

Associated Types

type Needle (Point a n) #

Methods

(.+~^) :: Point a n -> Needle (Point a n) -> Point a n #

(.-~^) :: Point a n -> Needle (Point a n) -> Point a n #

semimanifoldWitness :: SemimanifoldWitness (Point a n) #