Copyright | (c) Justus Sagemüller 2017 |
---|---|
License | GPL v3 |
Maintainer | (@) jsag $ hvl.no |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- type WebNodeId = Int
- type WebNodeIdOffset = Int
- data Neighbourhood x y = Neighbourhood {
- _dataAtNode :: y
- _neighbours :: Vector WebNodeIdOffset
- _localScalarProduct :: Metric x
- _webBoundaryAtNode :: Maybe (Needle' x)
- webBoundaryAtNode :: forall x y. Lens' (Neighbourhood x y) (Maybe (Needle' x))
- neighbours :: forall x y. Lens' (Neighbourhood x y) (Vector WebNodeIdOffset)
- localScalarProduct :: forall x y. Lens' (Neighbourhood x y) (Metric x)
- dataAtNode :: forall x y y. Lens (Neighbourhood x y) (Neighbourhood x y) y y
- data WebLocally x y = LocalWebInfo {
- _thisNodeCoord :: x
- _thisNodeData :: y
- _thisNodeId :: WebNodeId
- _nodeNeighbours :: [(WebNodeId, (Needle x, WebLocally x y))]
- _nodeLocalScalarProduct :: Metric x
- _webBoundingPlane :: Maybe (Needle' x)
- webBoundingPlane :: forall x y. Lens' (WebLocally x y) (Maybe (Needle' x))
- thisNodeId :: forall x y. Lens' (WebLocally x y) WebNodeId
- thisNodeData :: forall x y. Lens' (WebLocally x y) y
- thisNodeCoord :: forall x y. Lens' (WebLocally x y) x
- nodeNeighbours :: forall x y. Lens' (WebLocally x y) [(WebNodeId, (Needle x, WebLocally x y))]
- nodeLocalScalarProduct :: forall x y. Lens' (WebLocally x y) (Metric x)
- data NeighbourhoodVector x = NeighbourhoodVector {
- _nvectId :: Int
- _theNVect :: Needle x
- _nvectNormal :: Needle' x
- _nvectLength :: Scalar (Needle x)
- _otherNeighboursOverlap :: Scalar (Needle x)
- theNVect :: forall x. Lens' (NeighbourhoodVector x) (Needle x)
- otherNeighboursOverlap :: forall x. Lens' (NeighbourhoodVector x) (Scalar (Needle x))
- nvectNormal :: forall x. Lens' (NeighbourhoodVector x) (Needle' x)
- nvectLength :: forall x. Lens' (NeighbourhoodVector x) (Scalar (Needle x))
- nvectId :: forall x. Lens' (NeighbourhoodVector x) Int
- data PropagationInconsistency x υ
- = PropagationInconsistency {
- _inconsistentPropagatedData :: [(x, υ)]
- _inconsistentAPrioriData :: υ
- | PropagationInconsistencies [PropagationInconsistency x υ]
- = PropagationInconsistency {
- inconsistentPropagatedData :: forall x υ. Traversal' (PropagationInconsistency x υ) [(x, υ)]
- inconsistentAPrioriData :: forall x υ. Traversal' (PropagationInconsistency x υ) υ
- newtype PointsWeb :: * -> * -> * where
- data WebChunk x y = WebChunk {
- _thisChunk :: PointsWeb x y
- _layersAroundChunk :: [(x `Shaded` Neighbourhood x y, WebNodeId)]
- thisChunk :: forall x y. Lens' (WebChunk x y) (PointsWeb x y)
- layersAroundChunk :: forall x y. Lens' (WebChunk x y) [(Shaded x (Neighbourhood x y), WebNodeId)]
- data NodeInWeb x y = NodeInWeb {
- _thisNodeOnly :: (x, Neighbourhood x y)
- _layersAroundNode :: [(x `Shaded` Neighbourhood x y, WebNodeId)]
- thisNodeOnly :: forall x y. Lens' (NodeInWeb x y) (x, Neighbourhood x y)
- layersAroundNode :: forall x y. Lens' (NodeInWeb x y) [(Shaded x (Neighbourhood x y), WebNodeId)]
- data PathStep x y = PathStep {
- _pathStepStart :: WebLocally x y
- _pathStepEnd :: WebLocally x y
- pathStepStart :: forall x y. Lens' (PathStep x y) (WebLocally x y)
- pathStepEnd :: forall x y. Lens' (PathStep x y) (WebLocally x y)
- type MetricChoice x = Shade x -> Metric x
- traverseInnermostChunks :: forall f x y z. Applicative f => (WebChunk x y -> f (PointsWeb x z)) -> PointsWeb x y -> f (PointsWeb x z)
- traverseNodesInEnvi :: forall f x y z. Applicative f => (NodeInWeb x y -> f (Neighbourhood x z)) -> PointsWeb x y -> f (PointsWeb x z)
- fmapNodesInEnvi :: (NodeInWeb x y -> Neighbourhood x z) -> PointsWeb x y -> PointsWeb x z
- ixedFoci :: [a] -> [((Int, a), [a])]
- indexWeb :: PointsWeb x y -> WebNodeId -> Maybe (x, y)
- unsafeIndexWebData :: PointsWeb x y -> WebNodeId -> y
- jumpNodeOffset :: WebNodeIdOffset -> NodeInWeb x y -> NodeInWeb x y
- webAroundChunk :: WebChunk x y -> PointsWeb x y
- zoomoutWebChunk :: WebNodeIdOffset -> WebChunk x y -> (WebChunk x y, WebNodeId)
- pickNodeInWeb :: PointsWeb x y -> WebNodeId -> NodeInWeb x y
- webLocalInfo :: forall x y. WithField ℝ Manifold x => PointsWeb x y -> PointsWeb x (WebLocally x y)
- localFmapWeb :: WithField ℝ Manifold x => (WebLocally x y -> z) -> PointsWeb x y -> PointsWeb x z
- tweakWebGeometry :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> (WebLocally x y -> [WebNodeId]) -> PointsWeb x y -> PointsWeb x y
- bidirectionaliseWebLinks :: forall x y. PointsWeb x y -> PointsWeb x y
- pumpHalfspace :: forall v. (SimpleSpace v, Scalar v ~ ℝ) => Norm v -> v -> (DualVector v, [v]) -> Maybe (DualVector v)
- smallPseudorandSeq :: [ℝ]
- data LinkingBadness r = LinkingBadness {
- gatherDirectionsBadness :: !r
- closeSystemBadness :: !r
- linkingUndesirability :: ℝ -> ℝ -> LinkingBadness ℝ
- bestNeighbours :: forall i v. (SimpleSpace v, Scalar v ~ ℝ) => Norm v -> [(i, v)] -> ([i], Maybe (DualVector v))
- bestNeighbours' :: forall i v. (SimpleSpace v, Scalar v ~ ℝ) => Norm v -> [(i, v)] -> ([(i, v)], Maybe (DualVector v))
- gatherGoodNeighbours :: forall i v. (SimpleSpace v, Scalar v ~ ℝ) => Norm v -> Variance v -> DualVector v -> [v] -> [(i, v)] -> [(i, v)] -> ([(i, v)], Maybe (DualVector v))
- extractSmallestOn :: Ord b => (a -> Maybe b) -> [a] -> Maybe (a, [a])
- type WNIPath = [WebNodeId]
- type NodeSet = IntSet
- pathsTowards :: forall x y. (WithField ℝ Manifold x, HasCallStack) => WebNodeId -> PointsWeb x y -> [[y]]
- traversePathInIWeb :: forall φ x y. (WithField ℝ Manifold x, Monad φ, HasCallStack) => [WebNodeId] -> (PathStep x y -> φ y) -> PointsWeb x (WebLocally x y) -> φ (PointsWeb x (WebLocally x y))
- traversePathsTowards :: forall f φ x y. (WithField ℝ Manifold x, Monad φ, Monad f, HasCallStack) => WebNodeId -> (PathStep x y -> φ y) -> (forall υ. WebLocally x y -> φ υ -> f υ) -> PointsWeb x y -> f (PointsWeb x y)
Documentation
type WebNodeIdOffset = Int Source #
data Neighbourhood x y Source #
Neighbourhood | |
|
Instances
webBoundaryAtNode :: forall x y. Lens' (Neighbourhood x y) (Maybe (Needle' x)) Source #
neighbours :: forall x y. Lens' (Neighbourhood x y) (Vector WebNodeIdOffset) Source #
localScalarProduct :: forall x y. Lens' (Neighbourhood x y) (Metric x) Source #
dataAtNode :: forall x y y. Lens (Neighbourhood x y) (Neighbourhood x y) y y Source #
data WebLocally x y Source #
LocalWebInfo | |
|
Instances
webBoundingPlane :: forall x y. Lens' (WebLocally x y) (Maybe (Needle' x)) Source #
thisNodeId :: forall x y. Lens' (WebLocally x y) WebNodeId Source #
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 #
nodeLocalScalarProduct :: forall x y. Lens' (WebLocally x y) (Metric x) Source #
data NeighbourhoodVector x Source #
NeighbourhoodVector | |
|
otherNeighboursOverlap :: forall x. Lens' (NeighbourhoodVector x) (Scalar (Needle x)) Source #
nvectNormal :: forall x. Lens' (NeighbourhoodVector x) (Needle' x) Source #
nvectLength :: forall x. Lens' (NeighbourhoodVector x) (Scalar (Needle x)) Source #
data PropagationInconsistency x υ Source #
PropagationInconsistency | |
| |
PropagationInconsistencies [PropagationInconsistency x υ] |
Instances
(Show x, Show υ) => Show (PropagationInconsistency x υ) Source # | |
Defined in Data.Manifold.Web.Internal showsPrec :: Int -> PropagationInconsistency x υ -> ShowS # show :: PropagationInconsistency x υ -> String # showList :: [PropagationInconsistency x υ] -> ShowS # | |
Semigroup (PropagationInconsistency x υ) Source # | |
Defined in Data.Manifold.Web.Internal (<>) :: PropagationInconsistency x υ -> PropagationInconsistency x υ -> PropagationInconsistency x υ # sconcat :: NonEmpty (PropagationInconsistency x υ) -> PropagationInconsistency x υ # stimes :: Integral b => b -> PropagationInconsistency x υ -> PropagationInconsistency x υ # | |
Monoid (PropagationInconsistency x υ) Source # | |
Defined in Data.Manifold.Web.Internal mempty :: PropagationInconsistency x υ # mappend :: PropagationInconsistency x υ -> PropagationInconsistency x υ -> PropagationInconsistency x υ # mconcat :: [PropagationInconsistency x υ] -> PropagationInconsistency x υ # |
inconsistentPropagatedData :: forall x υ. Traversal' (PropagationInconsistency x υ) [(x, υ)] Source #
inconsistentAPrioriData :: forall x υ. Traversal' (PropagationInconsistency x υ) υ 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.
PointsWeb | |
|
Instances
Functor (PointsWeb a) Source # | |
Foldable (PointsWeb a) Source # | |
Defined in Data.Manifold.Web.Internal 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 # | |
Traversable (PointsWeb a) Source # | |
Defined in Data.Manifold.Web.Internal | |
Foldable (PointsWeb x) ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) Source # | |
Generic (PointsWeb a b) Source # | |
(NFData x, NFData (Metric x), NFData (Needle' x), NFData y) => NFData (PointsWeb x y) Source # | |
Defined in Data.Manifold.Web.Internal | |
type Rep (PointsWeb a b) Source # | |
Defined in Data.Manifold.Web.Internal type Rep (PointsWeb a b) = D1 (MetaData "PointsWeb" "Data.Manifold.Web.Internal" "manifolds-0.5.1.0-1Kt2fUEXtjvw812WS2MXA" True) (C1 (MetaCons "PointsWeb" PrefixI True) (S1 (MetaSel (Just "webNodeRsc") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Shaded a (Neighbourhood a b))))) |
WebChunk | |
|
layersAroundChunk :: forall x y. Lens' (WebChunk x y) [(Shaded x (Neighbourhood x y), WebNodeId)] Source #
NodeInWeb | |
|
thisNodeOnly :: forall x y. Lens' (NodeInWeb x y) (x, Neighbourhood x y) Source #
layersAroundNode :: forall x y. Lens' (NodeInWeb x y) [(Shaded x (Neighbourhood x y), WebNodeId)] Source #
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 #
fmapNodesInEnvi :: (NodeInWeb x y -> Neighbourhood x z) -> PointsWeb x y -> PointsWeb x z Source #
unsafeIndexWebData :: PointsWeb x y -> WebNodeId -> y Source #
jumpNodeOffset :: WebNodeIdOffset -> NodeInWeb x y -> NodeInWeb x y Source #
webAroundChunk :: WebChunk x y -> PointsWeb x y Source #
zoomoutWebChunk :: WebNodeIdOffset -> WebChunk x y -> (WebChunk x y, WebNodeId) Source #
webLocalInfo :: forall x y. WithField ℝ Manifold x => PointsWeb x y -> PointsWeb x (WebLocally x y) Source #
localFmapWeb :: WithField ℝ Manifold x => (WebLocally x y -> z) -> PointsWeb x y -> PointsWeb x z Source #
tweakWebGeometry :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> (WebLocally x y -> [WebNodeId]) -> PointsWeb x y -> PointsWeb x y Source #
bidirectionaliseWebLinks :: forall x y. PointsWeb x y -> PointsWeb x y Source #
:: (SimpleSpace v, Scalar v ~ ℝ) | |
=> Norm v | |
-> v | A vector |
-> (DualVector v, [v]) | A plane |
-> Maybe (DualVector v) | The plane |
smallPseudorandSeq :: [ℝ] Source #
data LinkingBadness r Source #
LinkingBadness | |
|
Instances
Functor LinkingBadness Source # | |
Defined in Data.Manifold.Web.Internal fmap :: (a -> b) -> LinkingBadness a -> LinkingBadness b # (<$) :: a -> LinkingBadness b -> LinkingBadness a # |
linkingUndesirability Source #
:: ℝ | 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 #
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 #
:: (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) |