manifolds-0.5.0.4: Coordinate-free hypersurfaces

Copyright(c) Justus Sagemüller 2017
LicenseGPL v3
Maintainer(@) jsag $ hvl.no
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Data.Manifold.Web.Internal

Description

 
Synopsis

Documentation

data Neighbourhood x y Source #

Instances
Functor (Neighbourhood x) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fmap :: (a -> b) -> Neighbourhood x a -> Neighbourhood x b #

(<$) :: a -> Neighbourhood x b -> Neighbourhood x a #

Foldable (Neighbourhood x) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fold :: Monoid m => Neighbourhood x m -> m #

foldMap :: Monoid m => (a -> m) -> Neighbourhood x a -> m #

foldr :: (a -> b -> b) -> b -> Neighbourhood x a -> b #

foldr' :: (a -> b -> b) -> b -> Neighbourhood x a -> b #

foldl :: (b -> a -> b) -> b -> Neighbourhood x a -> b #

foldl' :: (b -> a -> b) -> b -> Neighbourhood x a -> b #

foldr1 :: (a -> a -> a) -> Neighbourhood x a -> a #

foldl1 :: (a -> a -> a) -> Neighbourhood x a -> a #

toList :: Neighbourhood x a -> [a] #

null :: Neighbourhood x a -> Bool #

length :: Neighbourhood x a -> Int #

elem :: Eq a => a -> Neighbourhood x a -> Bool #

maximum :: Ord a => Neighbourhood x a -> a #

minimum :: Ord a => Neighbourhood x a -> a #

sum :: Num a => Neighbourhood x a -> a #

product :: Num a => Neighbourhood x a -> a #

Traversable (Neighbourhood x) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Neighbourhood x a -> f (Neighbourhood x b) #

sequenceA :: Applicative f => Neighbourhood x (f a) -> f (Neighbourhood x a) #

mapM :: Monad m => (a -> m b) -> Neighbourhood x a -> m (Neighbourhood x b) #

sequence :: Monad m => Neighbourhood x (m a) -> m (Neighbourhood x a) #

(WithField PseudoAffine x, SimpleSpace (Needle x), Show (Needle' x), Show y) => Show (Neighbourhood x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Generic (Neighbourhood x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Associated Types

type Rep (Neighbourhood x y) :: Type -> Type #

Methods

from :: Neighbourhood x y -> Rep (Neighbourhood x y) x0 #

to :: Rep (Neighbourhood x y) x0 -> Neighbourhood x y #

(NFData x, NFData (Metric x), NFData (Needle' x), NFData y) => NFData (Neighbourhood x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

rnf :: Neighbourhood x y -> () #

type Rep (Neighbourhood x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

type Rep (Neighbourhood x y) = D1 (MetaData "Neighbourhood" "Data.Manifold.Web.Internal" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" False) (C1 (MetaCons "Neighbourhood" PrefixI True) ((S1 (MetaSel (Just "_dataAtNode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 y) :*: S1 (MetaSel (Just "_neighbours") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector WebNodeIdOffset))) :*: (S1 (MetaSel (Just "_localScalarProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Metric x)) :*: S1 (MetaSel (Just "_webBoundaryAtNode") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Needle' x))))))

dataAtNode :: forall x y y. Lens (Neighbourhood x y) (Neighbourhood x y) y y Source #

data WebLocally x y Source #

Instances
Functor (WebLocally x) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fmap :: (a -> b) -> WebLocally x a -> WebLocally x b #

(<$) :: a -> WebLocally x b -> WebLocally x a #

WithField Manifold x => Comonad (WebLocally x) Source #

fmap from the co-Kleisli category of WebLocally.

Instance details

Defined in Data.Manifold.Web.Internal

Methods

extract :: WebLocally x a -> a #

duplicate :: WebLocally x a -> WebLocally x (WebLocally x a) #

extend :: (WebLocally x a -> b) -> WebLocally x a -> WebLocally x b #

Generic (WebLocally x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Associated Types

type Rep (WebLocally x y) :: Type -> Type #

Methods

from :: WebLocally x y -> Rep (WebLocally x y) x0 #

to :: Rep (WebLocally x y) x0 -> WebLocally x y #

type Rep (WebLocally x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

type Rep (WebLocally x y) = D1 (MetaData "WebLocally" "Data.Manifold.Web.Internal" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" False) (C1 (MetaCons "LocalWebInfo" PrefixI True) ((S1 (MetaSel (Just "_thisNodeCoord") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 x) :*: (S1 (MetaSel (Just "_thisNodeData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 y) :*: S1 (MetaSel (Just "_thisNodeId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 WebNodeId))) :*: (S1 (MetaSel (Just "_nodeNeighbours") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(WebNodeId, (Needle x, WebLocally x y))]) :*: (S1 (MetaSel (Just "_nodeLocalScalarProduct") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Metric x)) :*: S1 (MetaSel (Just "_webBoundingPlane") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe (Needle' x)))))))

thisNodeData :: forall x y. Lens' (WebLocally x y) y Source #

thisNodeCoord :: forall x y. Lens' (WebLocally x y) x Source #

nodeNeighbours :: forall x y. Lens' (WebLocally x y) [(WebNodeId, (Needle x, WebLocally x y))] Source #

newtype PointsWeb :: * -> * -> * where Source #

A PointsWeb is almost, but not quite a mesh. It is a stongly connected† directed graph, backed by a tree for fast nearest-neighbour lookup of points.

†In general, there can be disconnected components, but every connected component is strongly connected.

Constructors

PointsWeb 

Fields

Instances
Functor (PointsWeb a) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fmap :: (a0 -> b) -> PointsWeb a a0 -> PointsWeb a b #

(<$) :: a0 -> PointsWeb a b -> PointsWeb a a0 #

Foldable (PointsWeb a) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fold :: Monoid m => PointsWeb a m -> m #

foldMap :: Monoid m => (a0 -> m) -> PointsWeb a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> PointsWeb a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> PointsWeb a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> PointsWeb a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> PointsWeb a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> PointsWeb a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> PointsWeb a a0 -> a0 #

toList :: PointsWeb a a0 -> [a0] #

null :: PointsWeb a a0 -> Bool #

length :: PointsWeb a a0 -> Int #

elem :: Eq a0 => a0 -> PointsWeb a a0 -> Bool #

maximum :: Ord a0 => PointsWeb a a0 -> a0 #

minimum :: Ord a0 => PointsWeb a a0 -> a0 #

sum :: Num a0 => PointsWeb a a0 -> a0 #

product :: Num a0 => PointsWeb a a0 -> a0 #

Traversable (PointsWeb a) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

traverse :: Applicative f => (a0 -> f b) -> PointsWeb a a0 -> f (PointsWeb a b) #

sequenceA :: Applicative f => PointsWeb a (f a0) -> f (PointsWeb a a0) #

mapM :: Monad m => (a0 -> m b) -> PointsWeb a a0 -> m (PointsWeb a b) #

sequence :: Monad m => PointsWeb a (m a0) -> m (PointsWeb a a0) #

Foldable (PointsWeb x) ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

ffoldl :: (ObjectPair (->) a b, ObjectPair (->) a (PointsWeb x b)) => ((a, b) -> a) -> (a, PointsWeb x b) -> a #

foldMap :: (Object (->) a, Object (->) (PointsWeb x a), Semigroup m, Monoid m, Object (->) m, Object (->) m) => (a -> m) -> PointsWeb x a -> m #

Generic (PointsWeb a b) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Associated Types

type Rep (PointsWeb a b) :: Type -> Type #

Methods

from :: PointsWeb a b -> Rep (PointsWeb a b) x #

to :: Rep (PointsWeb a b) x -> PointsWeb a b #

(NFData x, NFData (Metric x), NFData (Needle' x), NFData y) => NFData (PointsWeb x y) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

rnf :: PointsWeb x y -> () #

type Rep (PointsWeb a b) Source # 
Instance details

Defined in Data.Manifold.Web.Internal

type Rep (PointsWeb a b) = D1 (MetaData "PointsWeb" "Data.Manifold.Web.Internal" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" True) (C1 (MetaCons "PointsWeb" PrefixI True) (S1 (MetaSel (Just "webNodeRsc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Shaded a (Neighbourhood a b)))))

data WebChunk x y Source #

thisChunk :: forall x y. Lens' (WebChunk x y) (PointsWeb x y) Source #

thisNodeOnly :: forall x y. Lens' (NodeInWeb x y) (x, Neighbourhood x y) Source #

data PathStep x y Source #

Constructors

PathStep 

pathStepStart :: forall x y. Lens' (PathStep x y) (WebLocally x y) Source #

pathStepEnd :: forall x y. Lens' (PathStep x y) (WebLocally x y) Source #

type MetricChoice x = Shade x -> Metric x Source #

traverseInnermostChunks :: forall f x y z. Applicative f => (WebChunk x y -> f (PointsWeb x z)) -> PointsWeb x y -> f (PointsWeb x z) Source #

traverseNodesInEnvi :: forall f x y z. Applicative f => (NodeInWeb x y -> f (Neighbourhood x z)) -> PointsWeb x y -> f (PointsWeb x z) Source #

ixedFoci :: [a] -> [((Int, a), [a])] Source #

pumpHalfspace Source #

Arguments

:: (SimpleSpace v, Scalar v ~ ) 
=> Norm v 
-> v

A vector v for which we want dv.^v ≥ 0.

-> (DualVector v, [v])

A plane dv₀ and some vectors ws with dv₀.^w ≥ 0, which should also fulfill dv.^w ≥ 0.

-> Maybe (DualVector v)

The plane dv fulfilling these properties, if possible.

data LinkingBadness r Source #

Constructors

LinkingBadness 

Fields

  • gatherDirectionsBadness :: !r

    Prefer picking neighbours at right angles to the currently-explored-boundary. This is needed while we still have to link to points in different spatial directions.

  • closeSystemBadness :: !r

    Prefer points directly opposed to the current boundary. This is useful when the system of directions is already complete and we want a nicely symmetric “ball” of neighbours around each point.

Instances
Functor LinkingBadness Source # 
Instance details

Defined in Data.Manifold.Web.Internal

Methods

fmap :: (a -> b) -> LinkingBadness a -> LinkingBadness b #

(<$) :: a -> LinkingBadness b -> LinkingBadness a #

linkingUndesirability Source #

Arguments

::

Absolute-square distance (euclidean norm squared)

->

Directional distance (distance from wall containing all already known neighbours)

-> LinkingBadness

“Badness” of this point as the next neighbour to link to. In gatherDirections mode this is large if the point is far away, but also if it is right normal to the wall. The reason we punish this is that adding two points directly opposed to each other would lead to an ill-defined wall orientation, i.e. wrong normals on the web boundary.

bestNeighbours :: forall i v. (SimpleSpace v, Scalar v ~ ) => Norm v -> [(i, v)] -> ([i], Maybe (DualVector v)) Source #

bestNeighbours' :: forall i v. (SimpleSpace v, Scalar v ~ ) => Norm v -> [(i, v)] -> ([(i, v)], Maybe (DualVector v)) Source #

gatherGoodNeighbours :: forall i v. (SimpleSpace v, Scalar v ~ ) => Norm v -> Variance v -> DualVector v -> [v] -> [(i, v)] -> [(i, v)] -> ([(i, v)], Maybe (DualVector v)) Source #

extractSmallestOn :: Ord b => (a -> Maybe b) -> [a] -> Maybe (a, [a]) Source #

pathsTowards :: forall x y. (WithField Manifold x, HasCallStack) => WebNodeId -> PointsWeb x y -> [[y]] Source #

traversePathInIWeb :: forall φ x y. (WithField Manifold x, Monad φ, HasCallStack) => [WebNodeId] -> (PathStep x y -> φ y) -> PointsWeb x (WebLocally x y) -> φ (PointsWeb x (WebLocally x y)) Source #

traversePathsTowards Source #

Arguments

:: (WithField Manifold x, Monad φ, Monad f, HasCallStack) 
=> WebNodeId

The node towards which the paths should converge.

-> (PathStep x y -> φ y)

The action which to traverse along each path.

-> (forall υ. WebLocally x y -> φ υ -> f υ)

Initialisation/evaluation for each path-traversal.

-> PointsWeb x y 
-> f (PointsWeb x y)