{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE UnicodeSyntax #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ConstraintKinds #-}
module Data.Manifold.Function.Interpolation (
InterpolationFunction
) where
import Data.Manifold.Types
import Data.Manifold.Types.Primitive ((^))
import Data.Manifold.PseudoAffine
import Data.Manifold.Shade
import Data.Manifold.Web
import Data.Manifold.Web.Internal
import Data.Manifold.Function.LocalModel
import Data.VectorSpace
import Math.LinearMap.Category
import Data.Foldable (toList)
import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import qualified Prelude as Hask
import Control.Category.Constrained.Prelude
import Control.Arrow.Constrained
import Control.Monad.Constrained
import Control.Lens
import Control.Lens.TH
newtype InterpolationFunction ㄇ x y = InterpolationFunction {
InterpolationFunction ㄇ x y -> PointsWeb x (ㄇ x y)
_interpWeb :: PointsWeb x (ㄇ x y)
}
makeLenses ''InterpolationFunction
fromPointsWeb :: (ModellableRelation x y, LocalModel ㄇ)
=> PointsWeb x (Shade' y) -> InterpolationFunction ㄇ x y
fromPointsWeb :: PointsWeb x (Shade' y) -> InterpolationFunction ㄇ x y
fromPointsWeb = PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y
forall (ㄇ :: * -> * -> *) x y.
PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y
InterpolationFunction (PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y)
-> (PointsWeb x (Shade' y) -> PointsWeb x (ㄇ x y))
-> PointsWeb x (Shade' y)
-> InterpolationFunction ㄇ x y
forall κ (k :: κ -> κ -> *) (a :: κ) (b :: κ) (c :: κ).
(Category k, Object k a, Object k b, Object k c) =>
k b c -> k a b -> k a c
. (WebLocally x (Shade' y) -> ㄇ x y)
-> PointsWeb x (Shade' y) -> PointsWeb x (ㄇ x y)
forall x y z.
WithField ℝ Manifold x =>
(WebLocally x y -> z) -> PointsWeb x y -> PointsWeb x z
localFmapWeb (
\WebLocally x (Shade' y)
locInfo -> case [(Needle x, Shade' y)] -> Maybe (ㄇ x y)
forall (ㄇ :: * -> * -> *) x y.
(LocalModel ㄇ, ModellableRelation x y) =>
[(Needle x, Shade' y)] -> Maybe (ㄇ x y)
fitLocally ([(Needle x, Shade' y)] -> Maybe (ㄇ x y))
-> [(Needle x, Shade' y)] -> Maybe (ㄇ x y)
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$
(Needle x
forall v. AdditiveGroup v => v
zeroV, WebLocally x (Shade' y)
locInfoWebLocally x (Shade' y)
-> Getting (Shade' y) (WebLocally x (Shade' y)) (Shade' y)
-> Shade' y
forall s a. s -> Getting a s a -> a
^.Getting (Shade' y) (WebLocally x (Shade' y)) (Shade' y)
forall x y. Lens' (WebLocally x y) y
thisNodeData)
(Needle x, Shade' y)
-> [(Needle x, Shade' y)] -> [(Needle x, Shade' y)]
forall a. a -> [a] -> [a]
: [ (Needle x
ngbx, WebLocally x (Shade' y)
ngbWebLocally x (Shade' y)
-> Getting (Shade' y) (WebLocally x (Shade' y)) (Shade' y)
-> Shade' y
forall s a. s -> Getting a s a -> a
^.Getting (Shade' y) (WebLocally x (Shade' y)) (Shade' y)
forall x y. Lens' (WebLocally x y) y
thisNodeData)
| (Needle x
ngbx,WebLocally x (Shade' y)
ngb) <- [[(Needle x, WebLocally x (Shade' y))]]
-> [(Needle x, WebLocally x (Shade' y))]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[(Needle x, WebLocally x (Shade' y))]]
-> [(Needle x, WebLocally x (Shade' y))])
-> [[(Needle x, WebLocally x (Shade' y))]]
-> [(Needle x, WebLocally x (Shade' y))]
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$ WebLocally x (Shade' y)
-> [WebNodeId] -> [[(Needle x, WebLocally x (Shade' y))]]
forall x y.
WithField ℝ Manifold x =>
WebLocally x y -> [WebNodeId] -> [[(Needle x, WebLocally x y)]]
localOnion WebLocally x (Shade' y)
locInfo []] of
Just ㄇ x y
locModl -> ㄇ x y
locModl )
adjustMetricToModel :: ∀ x y ㄇ . (ModellableRelation x y, LocalModel ㄇ)
=> InterpolationFunction ㄇ x y -> InterpolationFunction ㄇ x y
adjustMetricToModel :: InterpolationFunction ㄇ x y -> InterpolationFunction ㄇ x y
adjustMetricToModel = InterpolationFunction ㄇ x y -> PointsWeb x (ㄇ x y)
forall (ㄇ :: * -> * -> *) x y.
InterpolationFunction ㄇ x y -> PointsWeb x (ㄇ x y)
_interpWeb (InterpolationFunction ㄇ x y -> PointsWeb x (ㄇ x y))
-> (PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y)
-> InterpolationFunction ㄇ x y
-> InterpolationFunction ㄇ x y
forall (k :: * -> * -> *) a b c.
(Category k, Object k a, Object k b, Object k c) =>
k a b -> k b c -> k a c
>>> PointsWeb x (ㄇ x y) -> PointsWeb x (WebLocally x (ㄇ x y))
forall x y.
WithField ℝ Manifold x =>
PointsWeb x y -> PointsWeb x (WebLocally x y)
webLocalInfo
(PointsWeb x (ㄇ x y) -> PointsWeb x (WebLocally x (ㄇ x y)))
-> (PointsWeb x (WebLocally x (ㄇ x y))
-> InterpolationFunction ㄇ x y)
-> PointsWeb x (ㄇ x y)
-> InterpolationFunction ㄇ x y
forall (k :: * -> * -> *) a b c.
(Category k, Object k a, Object k b, Object k c) =>
k a b -> k b c -> k a c
>>> \(PointsWeb Shaded x (Neighbourhood x (WebLocally x (ㄇ x y)))
w) -> PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y
forall (ㄇ :: * -> * -> *) x y.
PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y
InterpolationFunction (PointsWeb x (ㄇ x y) -> InterpolationFunction ㄇ x y)
-> (Shaded x (Neighbourhood x (ㄇ x y)) -> PointsWeb x (ㄇ x y))
-> Shaded x (Neighbourhood x (ㄇ x y))
-> InterpolationFunction ㄇ x y
forall κ (k :: κ -> κ -> *) (a :: κ) (b :: κ) (c :: κ).
(Category k, Object k a, Object k b, Object k c) =>
k b c -> k a b -> k a c
. Shaded x (Neighbourhood x (ㄇ x y)) -> PointsWeb x (ㄇ x y)
forall x y. Shaded x (Neighbourhood x y) -> PointsWeb x y
PointsWeb (Shaded x (Neighbourhood x (ㄇ x y)) -> InterpolationFunction ㄇ x y)
-> Shaded x (Neighbourhood x (ㄇ x y))
-> InterpolationFunction ㄇ x y
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$ (Neighbourhood x (WebLocally x (ㄇ x y)) -> Neighbourhood x (ㄇ x y))
-> Shaded x (Neighbourhood x (WebLocally x (ㄇ x y)))
-> Shaded x (Neighbourhood x (ㄇ x y))
forall (f :: * -> *) (r :: * -> * -> *) (t :: * -> * -> *) a b.
(Functor f r t, Object r a, Object t (f a), Object r b,
Object t (f b)) =>
r a b -> t (f a) (f b)
fmap Neighbourhood x (WebLocally x (ㄇ x y)) -> Neighbourhood x (ㄇ x y)
remetricise Shaded x (Neighbourhood x (WebLocally x (ㄇ x y)))
w
where remetricise :: Neighbourhood x (WebLocally x (ㄇ x y))
-> Neighbourhood x (ㄇ x y)
remetricise :: Neighbourhood x (WebLocally x (ㄇ x y)) -> Neighbourhood x (ㄇ x y)
remetricise Neighbourhood x (WebLocally x (ㄇ x y))
nd = Neighbourhood x (WebLocally x (ㄇ x y))
nd Neighbourhood x (WebLocally x (ㄇ x y))
-> (Neighbourhood x (WebLocally x (ㄇ x y))
-> Neighbourhood x (ㄇ x y))
-> Neighbourhood x (ㄇ x y)
forall a b. a -> (a -> b) -> b
& (WebLocally x (ㄇ x y) -> Identity (ㄇ x y))
-> Neighbourhood x (WebLocally x (ㄇ x y))
-> Identity (Neighbourhood x (ㄇ x y))
forall x y1 y2.
Lens (Neighbourhood x y1) (Neighbourhood x y2) y1 y2
dataAtNode ((WebLocally x (ㄇ x y) -> Identity (ㄇ x y))
-> Neighbourhood x (WebLocally x (ㄇ x y))
-> Identity (Neighbourhood x (ㄇ x y)))
-> ㄇ x y
-> Neighbourhood x (WebLocally x (ㄇ x y))
-> Neighbourhood x (ㄇ x y)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ ㄇ x y
localModel
Neighbourhood x (ㄇ x y)
-> (Neighbourhood x (ㄇ x y) -> Neighbourhood x (ㄇ x y))
-> Neighbourhood x (ㄇ x y)
forall a b. a -> (a -> b) -> b
& (Norm (Needle x) -> Identity (Norm (Needle x)))
-> Neighbourhood x (ㄇ x y) -> Identity (Neighbourhood x (ㄇ x y))
forall x y1. Lens' (Neighbourhood x y1) (Metric x)
localScalarProduct ((Norm (Needle x) -> Identity (Norm (Needle x)))
-> Neighbourhood x (ㄇ x y) -> Identity (Neighbourhood x (ㄇ x y)))
-> Norm (Needle x)
-> Neighbourhood x (ㄇ x y)
-> Neighbourhood x (ㄇ x y)
forall s t a b. ASetter s t a b -> b -> s -> t
.~ Norm (Needle x)
newNorm
where localModel :: ㄇ x y
localModel = Neighbourhood x (WebLocally x (ㄇ x y))
ndNeighbourhood x (WebLocally x (ㄇ x y))
-> Getting (ㄇ x y) (Neighbourhood x (WebLocally x (ㄇ x y))) (ㄇ x y)
-> ㄇ x y
forall s a. s -> Getting a s a -> a
^.(WebLocally x (ㄇ x y) -> Const (ㄇ x y) (WebLocally x (ㄇ x y)))
-> Neighbourhood x (WebLocally x (ㄇ x y))
-> Const (ㄇ x y) (Neighbourhood x (WebLocally x (ㄇ x y)))
forall x y1 y2.
Lens (Neighbourhood x y1) (Neighbourhood x y2) y1 y2
dataAtNode((WebLocally x (ㄇ x y) -> Const (ㄇ x y) (WebLocally x (ㄇ x y)))
-> Neighbourhood x (WebLocally x (ㄇ x y))
-> Const (ㄇ x y) (Neighbourhood x (WebLocally x (ㄇ x y))))
-> ((ㄇ x y -> Const (ㄇ x y) (ㄇ x y))
-> WebLocally x (ㄇ x y) -> Const (ㄇ x y) (WebLocally x (ㄇ x y)))
-> Getting (ㄇ x y) (Neighbourhood x (WebLocally x (ㄇ x y))) (ㄇ x y)
forall κ (k :: κ -> κ -> *) (a :: κ) (b :: κ) (c :: κ).
(Category k, Object k a, Object k b, Object k c) =>
k b c -> k a b -> k a c
.(ㄇ x y -> Const (ㄇ x y) (ㄇ x y))
-> WebLocally x (ㄇ x y) -> Const (ㄇ x y) (WebLocally x (ㄇ x y))
forall x y. Lens' (WebLocally x y) y
thisNodeData
newNorm :: Norm (Needle x)
newNorm = [DualVector (Needle x)] -> Norm (Needle x)
forall v. LSpace v => [DualVector v] -> Seminorm v
spanNorm
[ DualVector (Needle x)
dx DualVector (Needle x) -> ℝ -> DualVector (Needle x)
forall v s.
(VectorSpace v, s ~ Scalar v, Fractional s) =>
v -> s -> v
^/ ((ℝ
0.1 ℝ -> ℝ -> ℝ
forall a. Num a => a -> a -> a
+ Shade y -> y -> ℝ
forall (shade :: * -> *) x s.
(IsShade shade, PseudoAffine x, SimpleSpace (Needle x),
s ~ Scalar (Needle x), RealFloat' s) =>
shade x -> x -> s
occlusion (WebLocally x (ㄇ x y)
ngbWebLocally x (ㄇ x y)
-> Getting (Shade y) (WebLocally x (ㄇ x y)) (Shade y) -> Shade y
forall s a. s -> Getting a s a -> a
^.(ㄇ x y -> Const (Shade y) (ㄇ x y))
-> WebLocally x (ㄇ x y) -> Const (Shade y) (WebLocally x (ㄇ x y))
forall x y. Lens' (WebLocally x y) y
thisNodeData((ㄇ x y -> Const (Shade y) (ㄇ x y))
-> WebLocally x (ㄇ x y) -> Const (Shade y) (WebLocally x (ㄇ x y)))
-> ((Shade y -> Const (Shade y) (Shade y))
-> ㄇ x y -> Const (Shade y) (ㄇ x y))
-> Getting (Shade y) (WebLocally x (ㄇ x y)) (Shade y)
forall κ (k :: κ -> κ -> *) (a :: κ) (b :: κ) (c :: κ).
(Category k, Object k a, Object k b, Object k c) =>
k b c -> k a b -> k a c
.(Shade y -> Const (Shade y) (Shade y))
-> ㄇ x y -> Const (Shade y) (ㄇ x y)
forall (ㄇ :: * -> * -> *) x y.
(LocalModel ㄇ, ModellableRelation x y) =>
Lens' (ㄇ x y) (Shade y)
tweakLocalOffset)
y
ySynth)
ℝ -> ℝ -> ℝ
forall a. Num a => a -> a -> a
* (DualVector (Needle x)
dxDualVector (Needle x) -> Needle x -> Scalar (Needle x)
forall v. LinearSpace v => DualVector v -> v -> Scalar v
<.>^Needle x
δx))
| (Needle x
δx,WebLocally x (ㄇ x y)
ngb) <- [[(Needle x, WebLocally x (ㄇ x y))]]
-> [(Needle x, WebLocally x (ㄇ x y))]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
concat ([[(Needle x, WebLocally x (ㄇ x y))]]
-> [(Needle x, WebLocally x (ㄇ x y))])
-> ([[(Needle x, WebLocally x (ㄇ x y))]]
-> [[(Needle x, WebLocally x (ㄇ x y))]])
-> [[(Needle x, WebLocally x (ㄇ x y))]]
-> [(Needle x, WebLocally x (ㄇ x y))]
forall κ (k :: κ -> κ -> *) (a :: κ) (b :: κ) (c :: κ).
(Category k, Object k a, Object k b, Object k c) =>
k b c -> k a b -> k a c
. WebNodeId
-> [[(Needle x, WebLocally x (ㄇ x y))]]
-> [[(Needle x, WebLocally x (ㄇ x y))]]
forall a. WebNodeId -> [a] -> [a]
take WebNodeId
2 ([[(Needle x, WebLocally x (ㄇ x y))]]
-> [(Needle x, WebLocally x (ㄇ x y))])
-> [[(Needle x, WebLocally x (ㄇ x y))]]
-> [(Needle x, WebLocally x (ㄇ x y))]
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$ WebLocally x (ㄇ x y)
-> [WebNodeId] -> [[(Needle x, WebLocally x (ㄇ x y))]]
forall x y.
WithField ℝ Manifold x =>
WebLocally x y -> [WebNodeId] -> [[(Needle x, WebLocally x y)]]
localOnion (Neighbourhood x (WebLocally x (ㄇ x y))
ndNeighbourhood x (WebLocally x (ㄇ x y))
-> Getting
(WebLocally x (ㄇ x y))
(Neighbourhood x (WebLocally x (ㄇ x y)))
(WebLocally x (ㄇ x y))
-> WebLocally x (ㄇ x y)
forall s a. s -> Getting a s a -> a
^.Getting
(WebLocally x (ㄇ x y))
(Neighbourhood x (WebLocally x (ㄇ x y)))
(WebLocally x (ㄇ x y))
forall x y1 y2.
Lens (Neighbourhood x y1) (Neighbourhood x y2) y1 y2
dataAtNode) []
, let dx :: DualVector (Needle x)
dx = Neighbourhood x (WebLocally x (ㄇ x y))
ndNeighbourhood x (WebLocally x (ㄇ x y))
-> Getting
(Norm (Needle x))
(Neighbourhood x (WebLocally x (ㄇ x y)))
(Norm (Needle x))
-> Norm (Needle x)
forall s a. s -> Getting a s a -> a
^.Getting
(Norm (Needle x))
(Neighbourhood x (WebLocally x (ㄇ x y)))
(Norm (Needle x))
forall x y1. Lens' (Neighbourhood x y1) (Metric x)
localScalarProductNorm (Needle x) -> Needle x -> DualVector (Needle x)
forall v. LSpace v => Norm v -> v -> DualVector v
<$|Needle x
δx
Shade' y
ySynth Metric y
_ = ㄇ x y -> Needle x -> Shade' y
forall (ㄇ :: * -> * -> *) x y.
(LocalModel ㄇ, ModellableRelation x y) =>
ㄇ x y -> Needle x -> Shade' y
evalLocalModel ㄇ x y
localModel Needle x
δx ]
:: Metric x
upsampleAtLargeDist :: (ModellableRelation x y, LocalModel ㄇ)
=> ℝ -> (x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y -> PointsWeb x (Shade' y)
upsampleAtLargeDist :: ℝ
-> (x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y
-> PointsWeb x (Shade' y)
upsampleAtLargeDist ℝ
dmax x -> ㄇ x y -> Needle x -> Shade' y
gapFillFunc (InterpolationFunction PointsWeb x (ㄇ x y)
web)
= MetricChoice x -> [(x, Shade' y)] -> PointsWeb x (Shade' y)
forall x y.
(WithField ℝ Manifold x, SimpleSpace (Needle x)) =>
MetricChoice x -> [(x, y)] -> PointsWeb x y
fromWebNodes (\(Shade x
x Metric' x
_) -> case PointsWeb x (WebLocally x (ㄇ x y))
-> x -> Maybe (x, WebLocally x (ㄇ x y))
forall x y.
(WithField ℝ Manifold x, SimpleSpace (Needle x)) =>
PointsWeb x y -> x -> Maybe (x, y)
nearestNeighbour PointsWeb x (WebLocally x (ㄇ x y))
webI x
x of
Just (x
_,WebLocally x (ㄇ x y)
nearest) -> WebLocally x (ㄇ x y)
nearest WebLocally x (ㄇ x y)
-> Getting (Metric x) (WebLocally x (ㄇ x y)) (Metric x) -> Metric x
forall s a. s -> Getting a s a -> a
^. Getting (Metric x) (WebLocally x (ㄇ x y)) (Metric x)
forall x y. Lens' (WebLocally x y) (Metric x)
nodeLocalScalarProduct) ([(x, Shade' y)] -> PointsWeb x (Shade' y))
-> [(x, Shade' y)] -> PointsWeb x (Shade' y)
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$ do
WebLocally x (ㄇ x y)
local <- PointsWeb x (WebLocally x (ㄇ x y)) -> [WebLocally x (ㄇ x y)]
forall (t :: * -> *) a. Foldable t => t a -> [a]
toList PointsWeb x (WebLocally x (ㄇ x y))
webI
(WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y) -> Getting x (WebLocally x (ㄇ x y)) x -> x
forall s a. s -> Getting a s a -> a
^.Getting x (WebLocally x (ㄇ x y)) x
forall x y. Lens' (WebLocally x y) x
thisNodeCoord, ㄇ x y -> Needle x -> Shade' y
forall (ㄇ :: * -> * -> *) x y.
(LocalModel ㄇ, ModellableRelation x y) =>
ㄇ x y -> Needle x -> Shade' y
evalLocalModel (WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y)
-> Getting (ㄇ x y) (WebLocally x (ㄇ x y)) (ㄇ x y) -> ㄇ x y
forall s a. s -> Getting a s a -> a
^.Getting (ㄇ x y) (WebLocally x (ㄇ x y)) (ㄇ x y)
forall x y. Lens' (WebLocally x y) y
thisNodeData) Needle x
forall v. AdditiveGroup v => v
zeroV) (x, Shade' y) -> [(x, Shade' y)] -> [(x, Shade' y)]
forall a. a -> [a] -> [a]
: do
(WebNodeId
ngId, (Needle x
δx, WebLocally x (ㄇ x y)
ngb)) <- WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y)
-> Getting
[(WebNodeId, (Needle x, WebLocally x (ㄇ x y)))]
(WebLocally x (ㄇ x y))
[(WebNodeId, (Needle x, WebLocally x (ㄇ x y)))]
-> [(WebNodeId, (Needle x, WebLocally x (ㄇ x y)))]
forall s a. s -> Getting a s a -> a
^.Getting
[(WebNodeId, (Needle x, WebLocally x (ㄇ x y)))]
(WebLocally x (ㄇ x y))
[(WebNodeId, (Needle x, WebLocally x (ㄇ x y)))]
forall x y.
Lens' (WebLocally x y) [(WebNodeId, (Needle x, WebLocally x y))]
nodeNeighbours
Bool -> [()]
forall (m :: * -> *) (k :: * -> * -> *).
(MonadPlus m k, Arrow k (->), Function k, UnitObject k ~ (),
Object k Bool) =>
k Bool (m ())
guard (WebNodeId
ngId WebNodeId -> WebNodeId -> Bool
forall a. Ord a => a -> a -> Bool
> WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y)
-> Getting WebNodeId (WebLocally x (ㄇ x y)) WebNodeId -> WebNodeId
forall s a. s -> Getting a s a -> a
^.Getting WebNodeId (WebLocally x (ㄇ x y)) WebNodeId
forall x y. Lens' (WebLocally x y) WebNodeId
thisNodeId
Bool -> Bool -> Bool
&& (WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y)
-> Getting (Metric x) (WebLocally x (ㄇ x y)) (Metric x) -> Metric x
forall s a. s -> Getting a s a -> a
^.Getting (Metric x) (WebLocally x (ㄇ x y)) (Metric x)
forall x y. Lens' (WebLocally x y) (Metric x)
nodeLocalScalarProductMetric x -> Needle x -> Scalar (Needle x)
forall v.
(LSpace v, Floating (Scalar v)) =>
Seminorm v -> v -> Scalar v
|$|Needle x
δx) ℝ -> ℝ -> Bool
forall a. Ord a => a -> a -> Bool
> ℝ
dmax)
(x, Shade' y) -> [(x, Shade' y)]
forall (m :: * -> *) a. Monad m (->) => a -> m a
return ( WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y) -> Getting x (WebLocally x (ㄇ x y)) x -> x
forall s a. s -> Getting a s a -> a
^.Getting x (WebLocally x (ㄇ x y)) x
forall x y. Lens' (WebLocally x y) x
thisNodeCoord x -> Needle x -> x
forall x. Semimanifold x => x -> Needle x -> x
.+~^ Needle x
δxNeedle x -> ℝ -> Needle x
forall v s.
(VectorSpace v, s ~ Scalar v, Fractional s) =>
v -> s -> v
^/ℝ
2
, x -> ㄇ x y -> Needle x -> Shade' y
gapFillFunc (WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y) -> Getting x (WebLocally x (ㄇ x y)) x -> x
forall s a. s -> Getting a s a -> a
^.Getting x (WebLocally x (ㄇ x y)) x
forall x y. Lens' (WebLocally x y) x
thisNodeCoord)
(WebLocally x (ㄇ x y)
localWebLocally x (ㄇ x y)
-> Getting (ㄇ x y) (WebLocally x (ㄇ x y)) (ㄇ x y) -> ㄇ x y
forall s a. s -> Getting a s a -> a
^.Getting (ㄇ x y) (WebLocally x (ㄇ x y)) (ㄇ x y)
forall x y. Lens' (WebLocally x y) y
thisNodeData)
(Needle x
δxNeedle x -> ℝ -> Needle x
forall v s.
(VectorSpace v, s ~ Scalar v, Fractional s) =>
v -> s -> v
^/ℝ
2) )
where webI :: PointsWeb x (WebLocally x (ㄇ x y))
webI = PointsWeb x (ㄇ x y) -> PointsWeb x (WebLocally x (ㄇ x y))
forall x y.
WithField ℝ Manifold x =>
PointsWeb x y -> PointsWeb x (WebLocally x y)
webLocalInfo PointsWeb x (ㄇ x y)
web
autoUpsampleAtLargeDist :: (ModellableRelation x y, LocalModel ㄇ)
=> ℝ -> InterpolationFunction ㄇ x y -> PointsWeb x (Shade' y)
autoUpsampleAtLargeDist :: ℝ -> InterpolationFunction ㄇ x y -> PointsWeb x (Shade' y)
autoUpsampleAtLargeDist ℝ
dmax = ℝ
-> (x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y
-> PointsWeb x (Shade' y)
forall x y (ㄇ :: * -> * -> *).
(ModellableRelation x y, LocalModel ㄇ) =>
ℝ
-> (x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y
-> PointsWeb x (Shade' y)
upsampleAtLargeDist ℝ
dmax ((x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y -> PointsWeb x (Shade' y))
-> (x -> ㄇ x y -> Needle x -> Shade' y)
-> InterpolationFunction ㄇ x y
-> PointsWeb x (Shade' y)
forall (f :: * -> * -> *) a b.
(Function f, Object f a, Object f b) =>
f a b -> a -> b
$ (ㄇ x y -> Needle x -> Shade' y)
-> x -> ㄇ x y -> Needle x -> Shade' y
forall (a :: * -> * -> *) b x.
(WellPointed a, Object a b, ObjectPoint a x) =>
x -> a b x
const ㄇ x y -> Needle x -> Shade' y
forall (ㄇ :: * -> * -> *) x y.
(LocalModel ㄇ, ModellableRelation x y) =>
ㄇ x y -> Needle x -> Shade' y
evalLocalModel