Copyright | (c) Justus Sagemüller 2016 |
---|---|
License | GPL v3 |
Maintainer | (@) jsag $ hvl.no |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data PointsWeb :: * -> * -> *
- fromWebNodes :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> [(x, y)] -> PointsWeb x y
- fromShadeTree_auto :: forall x. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => ShadeTree x -> PointsWeb x ()
- fromShadeTree :: forall x. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => (Shade x -> Metric x) -> ShadeTree x -> PointsWeb x ()
- fromShaded :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> (x `Shaded` y) -> PointsWeb x y
- nearestNeighbour :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => PointsWeb x y -> x -> Maybe (x, y)
- indexWeb :: PointsWeb x y -> WebNodeId -> Maybe (x, y)
- toGraph :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => PointsWeb x y -> (Graph, Vertex -> (x, y))
- webBoundary :: WithField ℝ Manifold x => PointsWeb x y -> [(Cutplane x, y)]
- sliceWeb_lin :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x), Geodesic x, Geodesic y) => PointsWeb x y -> Cutplane x -> [(x, y)]
- sampleWeb_2Dcartesian_lin :: (x ~ ℝ, y ~ ℝ, Geodesic z) => PointsWeb (x, y) z -> ((x, x), Int) -> ((y, y), Int) -> [(y, [(x, Maybe z)])]
- sampleEntireWeb_2Dcartesian_lin :: (x ~ ℝ, y ~ ℝ, Geodesic z) => PointsWeb (x, y) z -> Int -> Int -> [(y, [(x, Maybe z)])]
- localFocusWeb :: WithField ℝ Manifold x => PointsWeb x y -> PointsWeb x ((x, y), [(Needle x, y)])
- differentiateUncertainWebFunction :: forall x y. ModellableRelation x y => PointsWeb x (Shade' y) -> PointsWeb x (Shade' (LocalLinear x y))
- differentiate²UncertainWebFunction :: forall x y. ModellableRelation x y => PointsWeb x (Shade' y) -> PointsWeb x (Shade' (Needle x ⊗〃+> Needle y))
- localModels_CGrid :: forall x y ㄇ. (ModellableRelation x y, LocalModel ㄇ) => PointsWeb x (Shade' y) -> [(x, ㄇ x y)]
- iterateFilterDEqn_static :: (ModellableRelation x y, MonadPlus m, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y))
- iterateFilterDEqn_pathwise :: (ModellableRelation x y, MonadPlus m, Traversable m, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y))
- iterateFilterDEqn_static_selective :: (ModellableRelation x y, MonadPlus m, badness ~ ℝ, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> (x -> iy -> badness) -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y))
- filterDEqnSolutions_adaptive :: forall x y ㄇ ð badness m. (ModellableRelation x y, AffineManifold y, badness ~ ℝ, Monad m, LocalModel ㄇ) => MetricChoice x -> InconsistencyStrategy m x (Shade' y) -> DifferentialEqn ㄇ x y -> (x -> Shade' y -> badness) -> PointsWeb x (SolverNodeState x y) -> m (PointsWeb x (SolverNodeState x y))
- iterateFilterDEqn_adaptive :: (ModellableRelation x y, AffineManifold y, LocalModel ㄇ, Monad m) => MetricChoice x -> InconsistencyStrategy m x (Shade' y) -> DifferentialEqn ㄇ x y -> (x -> Shade' y -> ℝ) -> PointsWeb x (Shade' y) -> [PointsWeb x (Shade' y)]
- data InconsistencyStrategy m x y where
- newtype InformationMergeStrategy n m y' y = InformationMergeStrategy {
- mergeInformation :: y -> n y' -> m y
- naïve :: (NonEmpty y -> y) -> InformationMergeStrategy [] Identity (x, y) y
- inconsistencyAware :: (NonEmpty y -> m y) -> InformationMergeStrategy [] m (x, y) y
- indicateInconsistencies :: (NonEmpty υ -> Maybe υ) -> InformationMergeStrategy [] (Except (PropagationInconsistency x υ)) (x, υ) υ
- postponeInconsistencies :: Monad m => (NonEmpty υ -> Maybe υ) -> InformationMergeStrategy [] (WriterT [PropagationInconsistency x υ] m) (x, υ) υ
- data PropagationInconsistency x υ
- = PropagationInconsistency {
- _inconsistentPropagatedData :: [(x, υ)]
- _inconsistentAPrioriData :: υ
- | PropagationInconsistencies [PropagationInconsistency x υ]
- = PropagationInconsistency {
- data ConvexSet x
- = EmptyConvex
- | ConvexSet {
- convexSetHull :: Shade' x
- convexSetIntersectors :: [Shade' x]
- ellipsoid :: Shade' x -> ConvexSet x
- ellipsoidSet :: Embedding (->) (Maybe (Shade' x)) (ConvexSet x)
- coerceWebDomain :: forall a b y. (Manifold a, Manifold b, LocallyCoercible a b, SimpleSpace (Needle b)) => PointsWeb a y -> PointsWeb b y
- rescanPDELocally :: forall x y ㄇ. (ModellableRelation x y, LocalModel ㄇ) => DifferentialEqn ㄇ x y -> WebLocally x (Shade' y) -> Maybe (Shade' y)
- localOnion :: forall x y. WithField ℝ Manifold x => WebLocally x y -> [WebNodeId] -> [[(Needle x, WebLocally x y)]]
- webOnions :: forall x y. WithField ℝ Manifold x => PointsWeb x y -> PointsWeb x [[(x, y)]]
- knitShortcuts :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> PointsWeb x y -> PointsWeb x y
The web data type
data PointsWeb :: * -> * -> * 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.
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))))) |
Construction
fromWebNodes :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> [(x, y)] -> PointsWeb x y Source #
fromShadeTree_auto :: forall x. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => ShadeTree x -> PointsWeb x () Source #
fromShadeTree :: forall x. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => (Shade x -> Metric x) -> ShadeTree x -> PointsWeb x () Source #
:: (WithField ℝ Manifold x, SimpleSpace (Needle x)) | |
=> MetricChoice x | Local scalar-product generator. You can always
use |
-> (x `Shaded` y) | Source tree. |
-> PointsWeb x y |
Lookup
nearestNeighbour :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => PointsWeb x y -> x -> Maybe (x, y) Source #
fmap
from the co-Kleisli category of WebLocally
.
toGraph :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => PointsWeb x y -> (Graph, Vertex -> (x, y)) Source #
Decomposition
sliceWeb_lin :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x), Geodesic x, Geodesic y) => PointsWeb x y -> Cutplane x -> [(x, y)] Source #
Fetch a point between any two neighbouring web nodes on opposite sides of the plane, and linearly interpolate the values onto the cut plane.
sampleWeb_2Dcartesian_lin :: (x ~ ℝ, y ~ ℝ, Geodesic z) => PointsWeb (x, y) z -> ((x, x), Int) -> ((y, y), Int) -> [(y, [(x, Maybe z)])] Source #
sampleEntireWeb_2Dcartesian_lin :: (x ~ ℝ, y ~ ℝ, Geodesic z) => PointsWeb (x, y) z -> Int -> Int -> [(y, [(x, Maybe z)])] Source #
Local environments
localFocusWeb :: WithField ℝ Manifold x => PointsWeb x y -> PointsWeb x ((x, y), [(Needle x, y)]) Source #
Uncertain functions
differentiateUncertainWebFunction :: forall x y. ModellableRelation x y => PointsWeb x (Shade' y) -> PointsWeb x (Shade' (LocalLinear x y)) Source #
differentiate²UncertainWebFunction :: forall x y. ModellableRelation x y => PointsWeb x (Shade' y) -> PointsWeb x (Shade' (Needle x ⊗〃+> Needle y)) Source #
localModels_CGrid :: forall x y ㄇ. (ModellableRelation x y, LocalModel ㄇ) => PointsWeb x (Shade' y) -> [(x, ㄇ x y)] Source #
Calculate a quadratic fit with uncertainty margin centered around the connection between any two adjacent nodes. In case of a regular grid (which we by no means require here!) this corresponds to the vector quantities of an Arakawa type C/D grid (cf. A. Arakawa, V.R. Lamb (1977): Computational design of the basic dynamical processes of the UCLA general circulation model)
Differential equations
Fixed resolution
iterateFilterDEqn_static :: (ModellableRelation x y, MonadPlus m, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y)) Source #
iterateFilterDEqn_pathwise :: (ModellableRelation x y, MonadPlus m, Traversable m, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y)) Source #
iterateFilterDEqn_static_selective :: (ModellableRelation x y, MonadPlus m, badness ~ ℝ, LocalModel ㄇ) => InformationMergeStrategy [] m (x, Shade' y) iy -> Embedding (->) (Shade' y) iy -> (x -> iy -> badness) -> DifferentialEqn ㄇ x y -> PointsWeb x (Shade' y) -> Cofree m (PointsWeb x (Shade' y)) Source #
Automatic resolution
filterDEqnSolutions_adaptive Source #
:: (ModellableRelation x y, AffineManifold y, badness ~ ℝ, Monad m, LocalModel ㄇ) | |
=> MetricChoice x | Scalar product on the domain, for regularising the web. |
-> InconsistencyStrategy m x (Shade' y) | |
-> DifferentialEqn ㄇ x y | |
-> (x -> Shade' y -> badness) | |
-> PointsWeb x (SolverNodeState x y) | |
-> m (PointsWeb x (SolverNodeState x y)) |
iterateFilterDEqn_adaptive Source #
:: (ModellableRelation x y, AffineManifold y, LocalModel ㄇ, Monad m) | |
=> MetricChoice x | Scalar product on the domain, for regularising the web. |
-> InconsistencyStrategy m x (Shade' y) | |
-> DifferentialEqn ㄇ x y | |
-> (x -> Shade' y -> ℝ) | Badness function for local results. |
-> PointsWeb x (Shade' y) | |
-> [PointsWeb x (Shade' y)] |
Configuration
data InconsistencyStrategy m x y where Source #
AbortOnInconsistency :: InconsistencyStrategy Maybe x y | |
IgnoreInconsistencies :: InconsistencyStrategy Identity x y | |
HighlightInconsistencies :: y -> InconsistencyStrategy Identity x y |
Instances
Functor (InconsistencyStrategy m x) Source # | |
Defined in Data.Manifold.Web fmap :: (a -> b) -> InconsistencyStrategy m x a -> InconsistencyStrategy m x b # (<$) :: a -> InconsistencyStrategy m x b -> InconsistencyStrategy m x a # |
newtype InformationMergeStrategy n m y' y Source #
InformationMergeStrategy | |
|
inconsistencyAware :: (NonEmpty y -> m y) -> InformationMergeStrategy [] m (x, y) y Source #
indicateInconsistencies :: (NonEmpty υ -> Maybe υ) -> InformationMergeStrategy [] (Except (PropagationInconsistency x υ)) (x, υ) υ Source #
postponeInconsistencies :: Monad m => (NonEmpty υ -> Maybe υ) -> InformationMergeStrategy [] (WriterT [PropagationInconsistency x υ] m) (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 υ # |
Misc
EmptyConvex | |
ConvexSet | |
|
coerceWebDomain :: forall a b y. (Manifold a, Manifold b, LocallyCoercible a b, SimpleSpace (Needle b)) => PointsWeb a y -> PointsWeb b y Source #
rescanPDELocally :: forall x y ㄇ. (ModellableRelation x y, LocalModel ㄇ) => DifferentialEqn ㄇ x y -> WebLocally x (Shade' y) -> Maybe (Shade' y) Source #
localOnion :: forall x y. WithField ℝ Manifold x => WebLocally x y -> [WebNodeId] -> [[(Needle x, WebLocally x y)]] Source #
knitShortcuts :: forall x y. (WithField ℝ Manifold x, SimpleSpace (Needle x)) => MetricChoice x -> PointsWeb x y -> PointsWeb x y Source #
Consider at each node not just the connections to already known neighbours, but also the connections to their neighbours. If these next-neighbours turn out to be actually situated closer, link to them directly.