Copyright | (c) Justus Sagemüller 2015 |
---|---|
License | GPL v3 |
Maintainer | (@) sagemueller $ geo.uni-koeln.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- data Simplex :: Nat -> * -> * where
- (.<.) :: x -> x -> Simplex One x
- makeSimplex :: forall x n. KnownNat n => (x ^ S n) -> Simplex n x
- makeSimplex' :: forall x n. KnownNat n => [x] -> Option (Simplex n x)
- simplexVertices :: forall x n. Simplex n x -> x ^ S n
- simplexVertices' :: forall x n. Simplex n x -> [x]
- data Triangulation (n :: Nat) (x :: *)
- data TriangT t n x m y
- evalTriangT :: forall n x m y. (KnownNat n, HaskMonad m) => (forall t. TriangT t n x m y) -> m y
- runTriangT :: forall n x m y. (forall t. TriangT t n x m y) -> Triangulation n x -> m (y, Triangulation n x)
- doTriangT :: forall n x m y. KnownNat n => (forall t. TriangT t n x m y) -> m (y, Triangulation n x)
- getTriang :: forall t n k x m. (HaskMonad m, KnownNat k, KnownNat n) => TriangT t n x m (Option (Triangulation k x))
- data SimplexIT (t :: *) (n :: Nat) (x :: *)
- simplexITList :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => TriangT t n x m [SimplexIT t k x]
- lookSimplex :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t k x -> TriangT t n x m (Simplex k x)
- lookSplxFacesIT :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> TriangT t n x m (SimplexIT t k x ^ S (S k))
- lookSupersimplicesIT :: forall t m n k j x. (HaskMonad m, KnownNat k, KnownNat j, KnownNat n) => SimplexIT t k x -> TriangT t n x m [SimplexIT t j x]
- tgetSimplexIT :: SimplexIT t n x -> Int
- lookVertexIT :: forall t m n x. (HaskMonad m, KnownNat n) => SimplexIT t Z x -> TriangT t n x m x
- lookSplxVerticesIT :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t k x -> TriangT t n x m (SimplexIT t Z x ^ S k)
- sharedBoundary :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> SimplexIT t (S k) x -> TriangT t n x m (Option (SimplexIT t k x))
- distinctSimplices :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> SimplexIT t (S k) x -> TriangT t n x m (Option (NeighbouringSimplices t k x))
- type NeighbouringSimplices t n x = ((SimplexIT t Z x, SimplexIT t Z x), SimplexIT t n x)
- disjointTriangulation :: forall t m n x. (KnownNat n, HaskMonad m) => Triangulation n x -> TriangT t n x m [SimplexIT t n x]
- mixinTriangulation :: forall t m f k n x. (KnownNat n, KnownNat k, HaskMonad m, Functor f (->) (->)) => (forall s. TriangT s n x m (f (SimplexIT s k x))) -> TriangT t n x m (f (SimplexIT t k x))
- type HaskMonad m = (Applicative m, Monad m)
- liftInTriangT :: forall t n x m μ y. (HaskMonad m, MonadTrans μ) => TriangT t n x m y -> TriangT t n x (μ m) y
- unliftInTriangT :: forall t n x m μ y. (HaskMonad m, MonadTrans μ) => (forall m' a. μ m a -> m a) -> TriangT t n x (μ m) y -> TriangT t n x m y
- data Nat
- type Zero = Z
- type One = S Zero
- type Two = S One
- type Three = S Two
- type Succ = S
Simplices
data Simplex :: Nat -> * -> * where Source #
An n-simplex is a connection of n+1 points in a simply connected region of a manifold.
Construction
makeSimplex :: forall x n. KnownNat n => (x ^ S n) -> Simplex n x Source #
makeSimplex' :: forall x n. KnownNat n => [x] -> Option (Simplex n x) Source #
Deconstruction
simplexVertices :: forall x n. Simplex n x -> x ^ S n Source #
simplexVertices' :: forall x n. Simplex n x -> [x] Source #
Simplicial complexes
data Triangulation (n :: Nat) (x :: *) Source #
An n-dimensional abstract simplicial complex is a collection of n-simplices
which are “glued together” in some way. The preferred way to construct
such complexes is to run a TriangT
builder.
Functor (Triangulation n) Source # | |
Show x => Show (Triangulation n x) Source # | |
KnownNat n => Semigroup (Triangulation n x) Source # | Combine two triangulations (assumed as disjoint) to a single, non-connected complex. |
KnownNat n => Monoid (Triangulation n x) Source # | |
Triangulation-builder monad
data TriangT t n x m y Source #
A “conservative” state monad containing a Triangulation
. It
can be extended by new simplices, which can then be indexed using SimplexIT
.
The universally-quantified t
argument ensures you can't index simplices that
don't actually exist in this triangulation.
evalTriangT :: forall n x m y. (KnownNat n, HaskMonad m) => (forall t. TriangT t n x m y) -> m y Source #
runTriangT :: forall n x m y. (forall t. TriangT t n x m y) -> Triangulation n x -> m (y, Triangulation n x) Source #
doTriangT :: forall n x m y. KnownNat n => (forall t. TriangT t n x m y) -> m (y, Triangulation n x) Source #
getTriang :: forall t n k x m. (HaskMonad m, KnownNat k, KnownNat n) => TriangT t n x m (Option (Triangulation k x)) Source #
Subsimplex-references
simplexITList :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => TriangT t n x m [SimplexIT t k x] Source #
lookSimplex :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t k x -> TriangT t n x m (Simplex k x) Source #
lookSplxFacesIT :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> TriangT t n x m (SimplexIT t k x ^ S (S k)) Source #
Reference the k-faces of a given simplex in a triangulation.
lookSupersimplicesIT :: forall t m n k j x. (HaskMonad m, KnownNat k, KnownNat j, KnownNat n) => SimplexIT t k x -> TriangT t n x m [SimplexIT t j x] Source #
tgetSimplexIT :: SimplexIT t n x -> Int Source #
A unique (for the given dimension) ID of a triagulation's simplex. It is the index
where that simplex can be found in the simplexITList
.
lookVertexIT :: forall t m n x. (HaskMonad m, KnownNat n) => SimplexIT t Z x -> TriangT t n x m x Source #
lookSplxVerticesIT :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t k x -> TriangT t n x m (SimplexIT t Z x ^ S k) Source #
sharedBoundary :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> SimplexIT t (S k) x -> TriangT t n x m (Option (SimplexIT t k x)) Source #
distinctSimplices :: forall t m n k x. (HaskMonad m, KnownNat k, KnownNat n) => SimplexIT t (S k) x -> SimplexIT t (S k) x -> TriangT t n x m (Option (NeighbouringSimplices t k x)) Source #
Building triangulations
disjointTriangulation :: forall t m n x. (KnownNat n, HaskMonad m) => Triangulation n x -> TriangT t n x m [SimplexIT t n x] Source #
Import an entire triangulation, as disjoint from everything already in the monad.
mixinTriangulation :: forall t m f k n x. (KnownNat n, KnownNat k, HaskMonad m, Functor f (->) (->)) => (forall s. TriangT s n x m (f (SimplexIT s k x))) -> TriangT t n x m (f (SimplexIT t k x)) Source #
Import a triangulation like with disjointTriangulation
,
together with references to some of its subsimplices.
Misc util
type HaskMonad m = (Applicative m, Monad m) Source #
liftInTriangT :: forall t n x m μ y. (HaskMonad m, MonadTrans μ) => TriangT t n x m y -> TriangT t n x (μ m) y Source #
unliftInTriangT :: forall t n x m μ y. (HaskMonad m, MonadTrans μ) => (forall m' a. μ m a -> m a) -> TriangT t n x (μ m) y -> TriangT t n x m y Source #
Mainly intended to be used as a data kind. Of course, we'd rather use GHC.TypeLits naturals, but they aren't mature enough yet.