Copyright | (c) Justus Sagemüller 2016 |
---|---|
License | GPL v3 |
Maintainer | (@) jsag $ hvl.no |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type ℝeal r = (RealFloat r, PseudoAffine r, Semimanifold r, Needle r ~ r)
- data SemimanifoldWitness x where
- SemimanifoldWitness :: (Semimanifold (Needle x), Needle (Needle x) ~ Needle x) => SemimanifoldWitness x
- data PseudoAffineWitness x where
- PseudoAffineWitness :: PseudoAffine (Needle x) => SemimanifoldWitness x -> PseudoAffineWitness x
- class AdditiveGroup (Needle x) => Semimanifold x where
- type Needle x :: *
- (.+~^) :: x -> Needle x -> x
- (.-~^) :: x -> Needle x -> x
- semimanifoldWitness :: SemimanifoldWitness x
- class Semimanifold x => PseudoAffine x where
- (.-~.) :: x -> x -> Maybe (Needle x)
- (.-~!) :: HasCallStack => x -> x -> Needle x
- pseudoAffineWitness :: PseudoAffineWitness x
- data FibreBundle b f = FibreBundle {
- baseSpace :: !b
- fibreSpace :: !f
- type TangentBundle m = FibreBundle m (Needle m)
- palerp :: forall x. (PseudoAffine x, VectorSpace (Needle x)) => x -> x -> Maybe (Scalar (Needle x) -> x)
- palerpB :: forall x. (PseudoAffine x, VectorSpace (Needle x), Scalar (Needle x) ~ ℝ) => x -> x -> Maybe (D¹ -> x)
- alerpB :: forall x. (AffineSpace x, VectorSpace (Diff x), Scalar (Diff x) ~ ℝ) => x -> x -> D¹ -> x
- tau :: RealFloat r => r
- toS¹range :: RealFloat r => r -> r
- toℝP¹range :: RealFloat r => r -> r
- toUnitrange :: RealFloat r => r -> r
- data NeedleProductSpace f g p = NeedleProductSpace !(Needle (f p)) !(Needle (g p))
- newtype GenericNeedle x = GenericNeedle {
- getGenericNeedle :: Needle (VRep x)
- type VRep x = Rep x Void
- data CD¹ x = CD¹ {}
- data Cℝay x = Cℝay {
- hParamCℝay :: !(Scalar (Needle x))
- pParamCℝay :: !x
Documentation
type ℝeal r = (RealFloat r, PseudoAffine r, Semimanifold r, Needle r ~ r) Source #
data SemimanifoldWitness x where Source #
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
, which is
the same as just Needle
(Needle
(Needle
x))
.Needle
x
SemimanifoldWitness :: (Semimanifold (Needle x), Needle (Needle x) ~ Needle x) => SemimanifoldWitness x |
data PseudoAffineWitness x where Source #
PseudoAffineWitness :: PseudoAffine (Needle x) => SemimanifoldWitness x -> PseudoAffineWitness x |
class AdditiveGroup (Needle x) => Semimanifold x where Source #
Nothing
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.
type Needle x = GenericNeedle x
(.+~^) :: x -> Needle x -> x infixl 6 Source #
Generalisation of the translation operation .+^
to possibly non-flat
manifolds, instead of affine spaces.
default (.+~^) :: (Generic x, Semimanifold (VRep x), Needle x ~ GenericNeedle x) => x -> Needle x -> x Source #
(.-~^) :: x -> Needle x -> x infixl 6 Source #
Shorthand for \p v -> p .+~^
, which should obey the asymptotic lawnegateV
v
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 Source #
default semimanifoldWitness :: (Semimanifold (Needle x), Needle (Needle x) ~ Needle x) => SemimanifoldWitness x Source #
Instances
class Semimanifold x => PseudoAffine x where Source #
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₀) (φ₁.-~.φ₀)
Nothing
(.-~.) :: x -> x -> Maybe (Needle x) infix 6 Source #
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)
default (.-~.) :: (Generic x, PseudoAffine (VRep x), Needle x ~ GenericNeedle x) => x -> x -> Maybe (Needle x) Source #
(.-~!) :: HasCallStack => x -> x -> Needle x infix 6 Source #
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).
default (.-~!) :: (Generic x, PseudoAffine (VRep x), Needle x ~ GenericNeedle x) => x -> x -> Needle x Source #
pseudoAffineWitness :: PseudoAffineWitness x Source #
default pseudoAffineWitness :: PseudoAffine (Needle x) => PseudoAffineWitness x Source #
Instances
data FibreBundle b f Source #
A fibre bundle combines points in the base space b
with points in the fibre
f
. The type FibreBundle b f
is thus isomorphic to the tuple space (b,f)
, but
it can have a different topology, the prime example being TangentBundle
, where
nearby points may have differently-oriented tangent spaces.
FibreBundle | |
|
Instances
Generic (FibreBundle b f) Source # | |
Defined in Math.Manifold.Core.PseudoAffine type Rep (FibreBundle b f) :: Type -> Type # from :: FibreBundle b f -> Rep (FibreBundle b f) x # to :: Rep (FibreBundle b f) x -> FibreBundle b f # | |
(Show b, Show f) => Show (FibreBundle b f) Source # | |
Defined in Math.Manifold.Core.PseudoAffine showsPrec :: Int -> FibreBundle b f -> ShowS # show :: FibreBundle b f -> String # showList :: [FibreBundle b f] -> ShowS # | |
type Rep (FibreBundle b f) Source # | |
Defined in Math.Manifold.Core.PseudoAffine type Rep (FibreBundle b f) = D1 ('MetaData "FibreBundle" "Math.Manifold.Core.PseudoAffine" "manifolds-core-0.6.1.0-7JLeNpkgg097AjSvrWgCob" 'False) (C1 ('MetaCons "FibreBundle" 'PrefixI 'True) (S1 ('MetaSel ('Just "baseSpace") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 b) :*: S1 ('MetaSel ('Just "fibreSpace") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 f))) |
type TangentBundle m = FibreBundle m (Needle m) Source #
Points on a manifold, combined with vectors in the respective tangent space.
palerp :: forall x. (PseudoAffine x, VectorSpace (Needle x)) => x -> x -> Maybe (Scalar (Needle x) -> x) Source #
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 :: forall x. (PseudoAffine x, VectorSpace (Needle x), Scalar (Needle x) ~ ℝ) => x -> x -> Maybe (D¹ -> x) Source #
Like palerp
, but actually restricted to the interval between the points,
with a signature like geodesicBetween
rather than alerp
.
alerpB :: forall x. (AffineSpace x, VectorSpace (Diff x), Scalar (Diff x) ~ ℝ) => x -> x -> D¹ -> x Source #
Like alerp
, but actually restricted to the interval between the points.
toℝP¹range :: RealFloat r => r -> r Source #
toUnitrange :: RealFloat r => r -> r Source #
data NeedleProductSpace f g p Source #
NeedleProductSpace !(Needle (f p)) !(Needle (g p)) |
Instances
newtype GenericNeedle x Source #
GenericNeedle | |
|
Instances
A (closed) cone over a space x
is the product of x
with the closed interval D¹
of “heights”,
except on its “tip”: here, x
is smashed to a single point.
This construct becomes (homeomorphic-to-) an actual geometric cone (and to D²
) in the
special case x =
.S¹
Instances
Generic (CD¹ x) Source # | |
(Show x, Show (Scalar (Needle x))) => Show (CD¹ x) Source # | |
type Rep (CD¹ x) Source # | |
Defined in Math.Manifold.Core.PseudoAffine type Rep (CD¹ x) = D1 ('MetaData "CD\185" "Math.Manifold.Core.PseudoAffine" "manifolds-core-0.6.1.0-7JLeNpkgg097AjSvrWgCob" 'False) (C1 ('MetaCons "CD\185" 'PrefixI 'True) (S1 ('MetaSel ('Just "hParamCD\185") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Scalar (Needle x))) :*: S1 ('MetaSel ('Just "pParamCD\185") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 x))) |
An open cone is homeomorphic to a closed cone without the “lid”,
i.e. without the “last copy” of x
, at the far end of the height
interval. Since that means the height does not include its supremum, it is actually
more natural to express it as the entire real ray, hence the name.
Cℝay | |
|
Instances
Generic (Cℝay x) Source # | |
(Show x, Show (Scalar (Needle x))) => Show (Cℝay x) Source # | |
type Rep (Cℝay x) Source # | |
Defined in Math.Manifold.Core.PseudoAffine type Rep (Cℝay x) = D1 ('MetaData "C\8477ay" "Math.Manifold.Core.PseudoAffine" "manifolds-core-0.6.1.0-7JLeNpkgg097AjSvrWgCob" 'False) (C1 ('MetaCons "C\8477ay" 'PrefixI 'True) (S1 ('MetaSel ('Just "hParamC\8477ay") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Scalar (Needle x))) :*: S1 ('MetaSel ('Just "pParamC\8477ay") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 x))) |