manifolds-0.5.0.4: Coordinate-free hypersurfaces

Copyright (c) Justus Sagemüller 2015 GPL v3 (@) jsag $hvl.no experimental portable None Haskell2010 Data.Manifold.TreeCover Description Synopsis # Shades data Shade x where Source # A Shade is a very crude description of a region within a manifold. It can be interpreted as either an ellipsoid shape, or as the Gaussian peak of a normal distribution (use http://hackage.haskell.org/package/manifold-random for actually sampling from that distribution). For a precise description of an arbitrarily-shaped connected subset of a manifold, there is Region, whose implementation is vastly more complex. Constructors  Shade Fields:: (Semimanifold x, SimpleSpace (Needle x)) => { _shadeCtr :: !(Interior x) , _shadeExpanse :: !(Metric' x) } -> Shade x Instances  Source # Instance detailsDefined in Data.Manifold.Shade Associated Types MethodsinferMetric :: (MetricRequirement Shade x, LSpace (Needle x)) => Shade x -> Metric x Source #inferMetric' :: (MetricRequirement Shade x, LSpace (Needle x)) => Shade x -> Metric' x Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsshadeCtr :: Lens' (Shade x) (Interior x) Source #occlusion :: (PseudoAffine x, SimpleSpace (Needle x), s ~ Scalar (Needle x), RealFloat' s) => Shade x -> x -> s Source #factoriseShade :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade (x, y) -> (Shade x, Shade y) Source #coerceShade :: (Manifold x, Manifold y, LocallyCoercible x y, SimpleSpace (Needle y)) => Shade x -> Shade y Source #orthoShades :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade x -> Shade y -> Shade (x, y) Source #linIsoTransformShade :: (SimpleSpace x, SimpleSpace y, Scalar x ~ Scalar y, Num' (Scalar x)) => (x +> y) -> Shade x -> Shade y Source #projectShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SimpleSpace (Needle x), SemiInner (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade y -> Shade x Source #embedShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SemiInner (Needle x), SimpleSpace (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade x -> Shade y Source # (Show (Interior x), Show (Metric' x), WithField ℝ PseudoAffine x) => Show (Shade x) Source # Instance detailsDefined in Data.Manifold.Shade MethodsshowsPrec :: Int -> Shade x -> ShowS #show :: Shade x -> String #showList :: [Shade x] -> ShowS # Source # Instance detailsDefined in Data.Manifold.Shade Associated Typestype Needle (Shade x) :: Type #type Interior (Shade x) :: Type # Methods(.+~^) :: Interior (Shade x) -> Needle (Shade x) -> Shade x #fromInterior :: Interior (Shade x) -> Shade x #toInterior :: Shade x -> Maybe (Interior (Shade x)) #translateP :: Tagged (Shade x) (Interior (Shade x) -> Needle (Shade x) -> Interior (Shade x)) #(.-~^) :: Interior (Shade x) -> Needle (Shade x) -> Shade x # LtdErrorShow x => Show (Shade x) Source # Instance detailsDefined in Data.Manifold.Shade MethodsshowsPrec :: Int -> Shade x -> ShowS #show :: Shade x -> String #showList :: [Shade x] -> ShowS # (WithField ℝ PseudoAffine x, Geodesic (Interior x), SimpleSpace (Needle x)) => Geodesic (Shade x) Source # Instance detailsDefined in Data.Manifold.Shade MethodsgeodesicBetween :: Shade x -> Shade x -> Maybe (D¹ -> Shade x) Source #middleBetween :: Shade x -> Shade x -> Maybe (Shade x) Source # Source # Instance detailsDefined in Data.Manifold.Shade type MetricRequirement Shade x = (Manifold x, SimpleSpace (Needle x)) type Interior (Shade x) Source # Instance detailsDefined in Data.Manifold.Shade type Interior (Shade x) = Shade x type Needle (Shade x) Source # Instance detailsDefined in Data.Manifold.Shade type Needle (Shade x) = Needle x pattern (:±) :: () => (Semimanifold x, SimpleSpace (Needle x)) => Interior x -> [Needle x] -> Shade x infixl 6 Source # Span a Shade from a center point and multiple deviation-vectors. data Shade' x Source # A “co-shade” can describe ellipsoid regions as well, but unlike Shade it can be unlimited / infinitely wide in some directions. It does OTOH need to have nonzero thickness, which Shade needs not. Constructors  Shade' Fields_shade'Ctr :: !(Interior x) _shade'Narrowness :: !(Metric x) Instances  Source # Instance detailsDefined in Data.Manifold.Shade Associated Types MethodsinferMetric :: (MetricRequirement Shade' x, LSpace (Needle x)) => Shade' x -> Metric x Source #inferMetric' :: (MetricRequirement Shade' x, LSpace (Needle x)) => Shade' x -> Metric' x Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsshadeCtr :: Lens' (Shade' x) (Interior x) Source #occlusion :: (PseudoAffine x, SimpleSpace (Needle x), s ~ Scalar (Needle x), RealFloat' s) => Shade' x -> x -> s Source #factoriseShade :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade' (x, y) -> (Shade' x, Shade' y) Source #coerceShade :: (Manifold x, Manifold y, LocallyCoercible x y, SimpleSpace (Needle y)) => Shade' x -> Shade' y Source #orthoShades :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade' x -> Shade' y -> Shade' (x, y) Source #linIsoTransformShade :: (SimpleSpace x, SimpleSpace y, Scalar x ~ Scalar y, Num' (Scalar x)) => (x +> y) -> Shade' x -> Shade' y Source #projectShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SimpleSpace (Needle x), SemiInner (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade' y -> Shade' x Source #embedShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SemiInner (Needle x), SimpleSpace (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade' x -> Shade' y Source # LtdErrorShow x => Show (Shade' x) Source # Instance detailsDefined in Data.Manifold.Shade MethodsshowsPrec :: Int -> Shade' x -> ShowS #show :: Shade' x -> String #showList :: [Shade' x] -> ShowS # Source # Instance detailsDefined in Data.Manifold.Shade Associated Typestype Needle (Shade' x) :: Type #type Interior (Shade' x) :: Type # Methods(.+~^) :: Interior (Shade' x) -> Needle (Shade' x) -> Shade' x #fromInterior :: Interior (Shade' x) -> Shade' x #toInterior :: Shade' x -> Maybe (Interior (Shade' x)) #translateP :: Tagged (Shade' x) (Interior (Shade' x) -> Needle (Shade' x) -> Interior (Shade' x)) #(.-~^) :: Interior (Shade' x) -> Needle (Shade' x) -> Shade' x # LtdErrorShow x => Show (Shade' x) Source # Instance detailsDefined in Data.Manifold.Shade MethodsshowsPrec :: Int -> Shade' x -> ShowS #show :: Shade' x -> String #showList :: [Shade' x] -> ShowS # Source # Instance detailsDefined in Data.Manifold.Shade MethodsgeodesicBetween :: Shade' x -> Shade' x -> Maybe (D¹ -> Shade' x) Source #middleBetween :: Shade' x -> Shade' x -> Maybe (Shade' x) Source # Source # Instance detailsDefined in Data.Manifold.Shade type MetricRequirement Shade' x = (Manifold x, SimpleSpace (Needle x)) type Interior (Shade' x) Source # Instance detailsDefined in Data.Manifold.Shade type Interior (Shade' x) = Shade' x type Needle (Shade' x) Source # Instance detailsDefined in Data.Manifold.Shade type Needle (Shade' x) = Needle x (|±|) :: forall x. WithField EuclidSpace x => x -> [Needle x] -> Shade' x infixl 6 Source # Similar to :±, but instead of expanding the shade, each vector restricts it. Iff these form a orthogonal basis (in whatever sense applicable), then both methods will be equivalent. Note that |±| is only possible, as such, in an inner-product space; in general you need reciprocal vectors (Needle') to define a Shade'. class IsShade shade Source # Minimal complete definition Instances  Source # Instance detailsDefined in Data.Manifold.Shade MethodsshadeCtr :: Lens' (Shade' x) (Interior x) Source #occlusion :: (PseudoAffine x, SimpleSpace (Needle x), s ~ Scalar (Needle x), RealFloat' s) => Shade' x -> x -> s Source #factoriseShade :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade' (x, y) -> (Shade' x, Shade' y) Source #coerceShade :: (Manifold x, Manifold y, LocallyCoercible x y, SimpleSpace (Needle y)) => Shade' x -> Shade' y Source #orthoShades :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade' x -> Shade' y -> Shade' (x, y) Source #linIsoTransformShade :: (SimpleSpace x, SimpleSpace y, Scalar x ~ Scalar y, Num' (Scalar x)) => (x +> y) -> Shade' x -> Shade' y Source #projectShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SimpleSpace (Needle x), SemiInner (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade' y -> Shade' x Source #embedShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SemiInner (Needle x), SimpleSpace (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade' x -> Shade' y Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsshadeCtr :: Lens' (Shade x) (Interior x) Source #occlusion :: (PseudoAffine x, SimpleSpace (Needle x), s ~ Scalar (Needle x), RealFloat' s) => Shade x -> x -> s Source #factoriseShade :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade (x, y) -> (Shade x, Shade y) Source #coerceShade :: (Manifold x, Manifold y, LocallyCoercible x y, SimpleSpace (Needle y)) => Shade x -> Shade y Source #orthoShades :: (PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => Shade x -> Shade y -> Shade (x, y) Source #linIsoTransformShade :: (SimpleSpace x, SimpleSpace y, Scalar x ~ Scalar y, Num' (Scalar x)) => (x +> y) -> Shade x -> Shade y Source #projectShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SimpleSpace (Needle x), SemiInner (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade y -> Shade x Source #embedShade :: (Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SemiInner (Needle x), SimpleSpace (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> Shade x -> Shade y Source # ## Lenses shadeCtr :: IsShade shade => Lens' (shade x) (Interior x) Source # Access the center of a Shade or a Shade'. ## Construction pointsShades :: (WithField PseudoAffine x, SimpleSpace (Needle x)) => [Interior x] -> [Shade x] Source # Attempt to find a Shade that describes the distribution of given points. At least in an affine space (and thus locally in any manifold), this can be used to estimate the parameters of a normal distribution from which some points were sampled. Note that some points will be “outside” of the shade, as happens for a normal distribution with some statistical likelyhood. (Use pointsCovers if you need to prevent that.) For nonconnected manifolds it will be necessary to yield separate shades for each connected component. And for an empty input list, there is no shade! Hence the result type is a list. pointsCovers :: forall x. (WithField PseudoAffine x, SimpleSpace (Needle x)) => [Interior x] -> [Shade x] Source # Like pointsShades, but ensure that all points are actually in the shade, i.e. if [Shade x₀ ex] is the result then metric (recipMetric ex) (p-x₀) ≤ 1 for all p in the list. ## Evaluation occlusion :: (IsShade shade, PseudoAffine x, SimpleSpace (Needle x), s ~ Scalar (Needle x), RealFloat' s) => shade x -> x -> s Source # Check the statistical likelihood-density of a point being within a shade. This is taken as a normal distribution. ## Misc factoriseShade :: (IsShade shade, PseudoAffine x, SimpleSpace (Needle x), PseudoAffine y, SimpleSpace (Needle y), Scalar (Needle x) ~ Scalar (Needle y)) => shade (x, y) -> (shade x, shade y) Source # linIsoTransformShade :: (IsShade shade, SimpleSpace x, SimpleSpace y, Scalar x ~ Scalar y, Num' (Scalar x)) => (x +> y) -> shade x -> shade y Source # embedShade :: (IsShade shade, Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SemiInner (Needle x), SimpleSpace (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> shade x -> shade y Source # Include a shade in a higher-dimensional space. Notice that this behaves fundamentally different for Shade and Shade'. For Shade, it gives a “flat image” of the region, whereas for Shade' it gives an “extrusion pillar” pointing in the projection's orthogonal complement. projectShade :: (IsShade shade, Semimanifold x, Semimanifold y, Object (Affine s) (Interior x), Object (Affine s) (Interior y), SimpleSpace (Needle x), SemiInner (Needle y)) => Embedding (Affine s) (Interior x) (Interior y) -> shade y -> shade x Source # Squash a shade down into a lower dimensional space. class (WithField PseudoAffine y, SimpleSpace (Needle y)) => Refinable y Source # Class of manifolds which can use Shade' as a basic set type. This is easily possible for vector spaces with the default implementations. Instances  Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ)convolveMetric :: Functor p => p ℝ -> Metric ℝ -> Metric ℝ -> Metric ℝ Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ⁰)convolveMetric :: Functor p => p ℝ⁰ -> Metric ℝ⁰ -> Metric ℝ⁰ -> Metric ℝ⁰ Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ⁴)convolveMetric :: Functor p => p ℝ⁴ -> Metric ℝ⁴ -> Metric ℝ⁴ -> Metric ℝ⁴ Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ³)convolveMetric :: Functor p => p ℝ³ -> Metric ℝ³ -> Metric ℝ³ -> Metric ℝ³ Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ²)convolveMetric :: Functor p => p ℝ² -> Metric ℝ² -> Metric ℝ² -> Metric ℝ² Source # Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView ℝ¹)convolveMetric :: Functor p => p ℝ¹ -> Metric ℝ¹ -> Metric ℝ¹ -> Metric ℝ¹ Source # (Refinable a, Refinable b, Scalar (DualVector (DualVector (Needle b))) ~ Scalar (DualVector (DualVector (Needle a)))) => Refinable (a, b) Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView (a, b))subShade' :: Shade' (a, b) -> Shade' (a, b) -> Bool Source #refineShade' :: Shade' (a, b) -> Shade' (a, b) -> Maybe (Shade' (a, b)) Source #convolveMetric :: Functor p => p (a, b) -> Metric (a, b) -> Metric (a, b) -> Metric (a, b) Source #convolveShade' :: Shade' (a, b) -> Shade' (Needle (a, b)) -> Shade' (a, b) Source # (SimpleSpace a, SimpleSpace b, Refinable a, Refinable b, Scalar a ~ ℝ, Scalar b ~ ℝ, Scalar (DualVector a) ~ ℝ, Scalar (DualVector b) ~ ℝ, Scalar (DualVector (DualVector a)) ~ ℝ, Scalar (DualVector (DualVector b)) ~ ℝ) => Refinable (LinearMap ℝ a b) Source # Instance detailsDefined in Data.Manifold.Shade MethodsdebugView :: Maybe (DebugView (LinearMap ℝ a b))subShade' :: Shade' (LinearMap ℝ a b) -> Shade' (LinearMap ℝ a b) -> Bool Source #refineShade' :: Shade' (LinearMap ℝ a b) -> Shade' (LinearMap ℝ a b) -> Maybe (Shade' (LinearMap ℝ a b)) Source #convolveMetric :: Functor p => p (LinearMap ℝ a b) -> Metric (LinearMap ℝ a b) -> Metric (LinearMap ℝ a b) -> Metric (LinearMap ℝ a b) Source #convolveShade' :: Shade' (LinearMap ℝ a b) -> Shade' (Needle (LinearMap ℝ a b)) -> Shade' (LinearMap ℝ a b) Source # subShade' :: Refinable y => Shade' y -> Shade' y -> Bool Source # a subShade' b ≡ True means a is fully contained in b, i.e. from minusLogOcclusion' a p < 1 follows also minusLogOcclusion' b p < 1. refineShade' :: Refinable y => Shade' y -> Shade' y -> Maybe (Shade' y) Source # Intersection between two shades. coerceShade :: (IsShade shade, Manifold x, Manifold y, LocallyCoercible x y, SimpleSpace (Needle y)) => shade x -> shade y Source # mixShade's :: forall y. (WithField Manifold y, SimpleSpace (Needle y)) => NonEmpty (Shade' y) -> Maybe (Shade' y) Source # Weakened version of intersectShade's. What this function calculates is rather the weighted mean of ellipsoid regions. If you interpret the shades as uncertain physical measurements with normal distribution, it gives the maximum-likelyhood result for multiple measurements of the same quantity. # Shade trees type ShadeTree x = x Shaded () Source # fromLeafPoints :: forall x. (WithField Manifold x, SimpleSpace (Needle x)) => [x] -> ShadeTree x Source # Build a quite nicely balanced tree from a cloud of points, on any real manifold. fromLeafPoints_ :: forall x y. (WithField Manifold x, SimpleSpace (Needle x)) => [(x, y)] -> x Shaded y Source # onlyLeaves_ :: WithField PseudoAffine x => ShadeTree x -> [x] Source # Left (and, typically, also right) inverse of fromLeafNodes. indexShadeTree :: forall x y. (x Shaded y) -> Int -> Either Int ([x Shaded y], (x, y)) Source # The leaves of a shade tree are numbered. For a given index, this function attempts to find the leaf with that ID, within its immediate environment. treeLeaf :: forall x y f. Functor f => Int -> (y -> f y) -> (x Shaded y) -> Either Int (f (x Shaded y)) Source # Arguments  :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => Maybe (Metric x) For deciding (at the lowest level) what “close” means; this is optional for any tree of depth >1. -> (x Shaded y) The tree to index into -> x Position to look up -> Maybe (Int, ([x Shaded y], (x, y))) Index of the leaf near to the query point, the “path” of environment trees leading down to its position (in decreasing order of size), and actual position+info of the found node. “Inverse indexing” of a tree. This is roughly a nearest-neighbour search, but not guaranteed to give the correct result unless evaluated at the precise position of a tree leaf. ## View helpers entireTree :: forall x y. (WithField PseudoAffine x, SimpleSpace (Needle x)) => (x Shaded y) -> LeafyTree x y Source # onlyNodes :: forall x. (WithField PseudoAffine x, SimpleSpace (Needle x)) => ShadeTree x -> Trees x Source # Imitate the specialised ShadeTree structure with a simpler, generic tree. trunkBranches :: (x Shaded y) -> NonEmpty (LeafIndex, x Shaded y) Source # ## Auxiliary types SimpleTree x ≅ Maybe (x, Trees x)  type Trees = GenericTree [] [] Source # Trees x ≅ [(x, Trees x)]  NonEmptyTree x ≅ (x, Trees x)  newtype GenericTree c b x Source # Constructors  GenericTree FieldstreeBranches :: c (x, GenericTree b b x) Instances  (Functor c, Functor b) => Functor (GenericTree c b) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfmap :: (a -> b0) -> GenericTree c b a -> GenericTree c b b0 #(<$) :: a -> GenericTree c b b0 -> GenericTree c b a # (Foldable c, Foldable b) => Foldable (GenericTree c b) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfold :: Monoid m => GenericTree c b m -> m #foldMap :: Monoid m => (a -> m) -> GenericTree c b a -> m #foldr :: (a -> b0 -> b0) -> b0 -> GenericTree c b a -> b0 #foldr' :: (a -> b0 -> b0) -> b0 -> GenericTree c b a -> b0 #foldl :: (b0 -> a -> b0) -> b0 -> GenericTree c b a -> b0 #foldl' :: (b0 -> a -> b0) -> b0 -> GenericTree c b a -> b0 #foldr1 :: (a -> a -> a) -> GenericTree c b a -> a #foldl1 :: (a -> a -> a) -> GenericTree c b a -> a #toList :: GenericTree c b a -> [a] #null :: GenericTree c b a -> Bool #length :: GenericTree c b a -> Int #elem :: Eq a => a -> GenericTree c b a -> Bool #maximum :: Ord a => GenericTree c b a -> a #minimum :: Ord a => GenericTree c b a -> a #sum :: Num a => GenericTree c b a -> a #product :: Num a => GenericTree c b a -> a # (Traversable c, Traversable b) => Traversable (GenericTree c b) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodstraverse :: Applicative f => (a -> f b0) -> GenericTree c b a -> f (GenericTree c b b0) #sequenceA :: Applicative f => GenericTree c b (f a) -> f (GenericTree c b a) #mapM :: Monad m => (a -> m b0) -> GenericTree c b a -> m (GenericTree c b b0) #sequence :: Monad m => GenericTree c b (m a) -> m (GenericTree c b a) # Eq (c (x, GenericTree b b x)) => Eq (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover Methods(==) :: GenericTree c b x -> GenericTree c b x -> Bool #(/=) :: GenericTree c b x -> GenericTree c b x -> Bool # Show (c (x, GenericTree b b x)) => Show (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover MethodsshowsPrec :: Int -> GenericTree c b x -> ShowS #show :: GenericTree c b x -> String #showList :: [GenericTree c b x] -> ShowS # Generic (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover Associated Typestype Rep (GenericTree c b x) :: Type -> Type # Methodsfrom :: GenericTree c b x -> Rep (GenericTree c b x) x0 #to :: Rep (GenericTree c b x) x0 -> GenericTree c b x # MonadPlus c => Semigroup (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover Methods(<>) :: GenericTree c b x -> GenericTree c b x -> GenericTree c b x #sconcat :: NonEmpty (GenericTree c b x) -> GenericTree c b x #stimes :: Integral b0 => b0 -> GenericTree c b x -> GenericTree c b x # MonadPlus c => Monoid (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsmempty :: GenericTree c b x #mappend :: GenericTree c b x -> GenericTree c b x -> GenericTree c b x #mconcat :: [GenericTree c b x] -> GenericTree c b x # (NFData x, Foldable c, Foldable b) => NFData (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsrnf :: GenericTree c b x -> () # type Rep (GenericTree c b x) Source # Instance detailsDefined in Data.Manifold.TreeCover type Rep (GenericTree c b x) = D1 (MetaData "GenericTree" "Data.Manifold.TreeCover" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" True) (C1 (MetaCons "GenericTree" PrefixI True) (S1 (MetaSel (Just "treeBranches") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (c (x, GenericTree b b x)))))

:: c (x, GenericTree b b x) -> GenericTree c b x Source #

U+6733 CJK UNIFIED IDEOGRAPH tree. The main purpose of this is to give GenericTree a more concise Show instance.

# Misc

class HasFlatView f where Source #

Associated Types

type FlatView f x Source #

Methods

flatView :: f x -> FlatView f x Source #

superFlatView :: f x -> [[x]] Source #

Arguments

 :: (WithField ℝ Manifold x, SimpleSpace (Needle x)) => ℝ How near (inverse normalised distance, relative to shade expanse) two shades must be to be merged. If this is zero, any shades in the same connected region of a manifold are merged. -> [Shade x] A list of n shades. -> [Shade x] m ≤ n shades which cover at least the same area.

Attempt to reduce the number of shades to fewer (ideally, a single one). In the simplest cases these should guaranteed cover the same area; for non-flat manifolds it only works in a heuristic sense.

allTwigs :: forall x y. WithField PseudoAffine x => (x Shaded y) -> [Twig x y] Source #

twigsWithEnvirons :: forall x y. (WithField Manifold x, SimpleSpace (Needle x)) => (x Shaded y) -> [(Twig x y, TwigEnviron x y)] Source #

type Twig x y = (Int, x Shaded y) Source #

type TwigEnviron x y = [Twig x y] Source #

flexTwigsShading :: forall x y f. (WithField Manifold x, WithField Manifold y, SimpleSpace (Needle x), SimpleSpace (Needle y), Applicative f) => (Shade' (x, y) -> f (x, (Shade' y, LocalLinear x y))) -> (x Shaded y) -> f (x Shaded y) Source #

traverseTrunkBranchChoices :: Applicative f => ((Int, x Shaded y) -> (x Shaded y) -> f (x Shaded z)) -> (x Shaded y) -> f (x Shaded z) Source #

data Shaded x y Source #

Constructors

 PlainLeaves [(x, y)] DisjointBranches !LeafCount (NonEmpty (x Shaded y)) OverlappingBranches !LeafCount !(Shade x) (NonEmpty (DBranch x y))
Instances
 Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfmap :: (a -> b) -> Shaded x a -> Shaded x b #(<$) :: a -> Shaded x b -> Shaded x a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfold :: Monoid m => Shaded x m -> m #foldMap :: Monoid m => (a -> m) -> Shaded x a -> m #foldr :: (a -> b -> b) -> b -> Shaded x a -> b #foldr' :: (a -> b -> b) -> b -> Shaded x a -> b #foldl :: (b -> a -> b) -> b -> Shaded x a -> b #foldl' :: (b -> a -> b) -> b -> Shaded x a -> b #foldr1 :: (a -> a -> a) -> Shaded x a -> a #foldl1 :: (a -> a -> a) -> Shaded x a -> a #toList :: Shaded x a -> [a] #null :: Shaded x a -> Bool #length :: Shaded x a -> Int #elem :: Eq a => a -> Shaded x a -> Bool #maximum :: Ord a => Shaded x a -> a #minimum :: Ord a => Shaded x a -> a #sum :: Num a => Shaded x a -> a #product :: Num a => Shaded x a -> a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodstraverse :: Applicative f => (a -> f b) -> Shaded x a -> f (Shaded x b) #sequenceA :: Applicative f => Shaded x (f a) -> f (Shaded x a) #mapM :: Monad m => (a -> m b) -> Shaded x a -> m (Shaded x b) #sequence :: Monad m => Shaded x (m a) -> m (Shaded x a) # Source # WRT union. Instance detailsDefined in Data.Manifold.TreeCover Methods(<>) :: ShadeTree x -> ShadeTree x -> ShadeTree x #sconcat :: NonEmpty (ShadeTree x) -> ShadeTree x #stimes :: Integral b => b -> ShadeTree x -> ShadeTree x # (WithField ℝ Manifold x, SimpleSpace (Needle x)) => Monoid (ShadeTree x) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsmappend :: ShadeTree x -> ShadeTree x -> ShadeTree x #mconcat :: [ShadeTree x] -> ShadeTree x # (WithField ℝ PseudoAffine x, Show x, Show (Interior x), Show (Needle' x), Show (Metric' x)) => Show (Shaded x ()) Source # Instance detailsDefined in Data.Manifold.TreeCover MethodsshowsPrec :: Int -> Shaded x () -> ShowS #show :: Shaded x () -> String #showList :: [Shaded x ()] -> ShowS # Generic (Shaded x y) Source # Instance detailsDefined in Data.Manifold.TreeCover Associated Typestype Rep (Shaded x y) :: Type -> Type # Methodsfrom :: Shaded x y -> Rep (Shaded x y) x0 #to :: Rep (Shaded x y) x0 -> Shaded x y # (NFData x, NFData (Needle' x), NFData y) => NFData (DBranch x y) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsrnf :: DBranch x y -> () # (NFData x, NFData (Needle' x), NFData y) => NFData (Shaded x y) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsrnf :: Shaded x y -> () # type Rep (Shaded x y) Source # Instance detailsDefined in Data.Manifold.TreeCover type Rep (Shaded x y) fmapShaded :: (Semimanifold x, SimpleSpace (Needle x)) => (y -> υ) -> (x Shaded y) -> x Shaded υ Source # constShaded :: y -> (x Shaded y₀) -> x Shaded y Source # zipTreeWithList :: (x Shaded w) -> NonEmpty y -> x Shaded (w, y) Source # stiAsIntervalMapping :: (x ~ , y ~ ) => (x Shaded y) -> [(x, ((y, Diff y), LinearMap x y))] Source # type DBranch x y = DBranch' x (x Shaded y) Source # data DBranch' x c Source # Constructors  DBranch FieldsboughDirection :: !(Needle' x) boughContents :: !(Hourglass c) Instances  Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfmap :: (a -> b) -> DBranch' x a -> DBranch' x b #(<$) :: a -> DBranch' x b -> DBranch' x a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfold :: Monoid m => DBranch' x m -> m #foldMap :: Monoid m => (a -> m) -> DBranch' x a -> m #foldr :: (a -> b -> b) -> b -> DBranch' x a -> b #foldr' :: (a -> b -> b) -> b -> DBranch' x a -> b #foldl :: (b -> a -> b) -> b -> DBranch' x a -> b #foldl' :: (b -> a -> b) -> b -> DBranch' x a -> b #foldr1 :: (a -> a -> a) -> DBranch' x a -> a #foldl1 :: (a -> a -> a) -> DBranch' x a -> a #toList :: DBranch' x a -> [a] #null :: DBranch' x a -> Bool #length :: DBranch' x a -> Int #elem :: Eq a => a -> DBranch' x a -> Bool #maximum :: Ord a => DBranch' x a -> a #minimum :: Ord a => DBranch' x a -> a #sum :: Num a => DBranch' x a -> a #product :: Num a => DBranch' x a -> a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodstraverse :: Applicative f => (a -> f b) -> DBranch' x a -> f (DBranch' x b) #sequenceA :: Applicative f => DBranch' x (f a) -> f (DBranch' x a) #mapM :: Monad m => (a -> m b) -> DBranch' x a -> m (DBranch' x b) #sequence :: Monad m => DBranch' x (m a) -> m (DBranch' x a) # (WithField ℝ PseudoAffine x, Show (Needle' x), Show c) => Show (DBranch' x c) Source # Instance detailsDefined in Data.Manifold.TreeCover MethodsshowsPrec :: Int -> DBranch' x c -> ShowS #show :: DBranch' x c -> String #showList :: [DBranch' x c] -> ShowS # Generic (DBranch' x c) Source # Instance detailsDefined in Data.Manifold.TreeCover Associated Typestype Rep (DBranch' x c) :: Type -> Type # Methodsfrom :: DBranch' x c -> Rep (DBranch' x c) x0 #to :: Rep (DBranch' x c) x0 -> DBranch' x c # (NFData x, NFData (Needle' x), NFData y) => NFData (DBranch x y) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsrnf :: DBranch x y -> () # type Rep (DBranch' x c) Source # Instance detailsDefined in Data.Manifold.TreeCover type Rep (DBranch' x c) = D1 (MetaData "DBranch'" "Data.Manifold.TreeCover" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" False) (C1 (MetaCons "DBranch" PrefixI True) (S1 (MetaSel (Just "boughDirection") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Needle' x)) :*: S1 (MetaSel (Just "boughContents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Hourglass c))))

data Hourglass s Source #

Hourglass as the geometric shape (two opposing ~conical volumes, sharing only a single point in the middle); has nothing to do with time.

Constructors

 Hourglass FieldsupperBulb, lowerBulb :: !s
Instances
 Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfmap :: (a -> b) -> Hourglass a -> Hourglass b #(<\$) :: a -> Hourglass b -> Hourglass a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodspure :: a -> Hourglass a #(<*>) :: Hourglass (a -> b) -> Hourglass a -> Hourglass b #liftA2 :: (a -> b -> c) -> Hourglass a -> Hourglass b -> Hourglass c #(*>) :: Hourglass a -> Hourglass b -> Hourglass b #(<*) :: Hourglass a -> Hourglass b -> Hourglass a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsfold :: Monoid m => Hourglass m -> m #foldMap :: Monoid m => (a -> m) -> Hourglass a -> m #foldr :: (a -> b -> b) -> b -> Hourglass a -> b #foldr' :: (a -> b -> b) -> b -> Hourglass a -> b #foldl :: (b -> a -> b) -> b -> Hourglass a -> b #foldl' :: (b -> a -> b) -> b -> Hourglass a -> b #foldr1 :: (a -> a -> a) -> Hourglass a -> a #foldl1 :: (a -> a -> a) -> Hourglass a -> a #toList :: Hourglass a -> [a] #null :: Hourglass a -> Bool #length :: Hourglass a -> Int #elem :: Eq a => a -> Hourglass a -> Bool #maximum :: Ord a => Hourglass a -> a #minimum :: Ord a => Hourglass a -> a #sum :: Num a => Hourglass a -> a #product :: Num a => Hourglass a -> a # Source # Instance detailsDefined in Data.Manifold.TreeCover Methodstraverse :: Applicative f => (a -> f b) -> Hourglass a -> f (Hourglass b) #sequenceA :: Applicative f => Hourglass (f a) -> f (Hourglass a) #mapM :: Monad m => (a -> m b) -> Hourglass a -> m (Hourglass b) #sequence :: Monad m => Hourglass (m a) -> m (Hourglass a) # Foldable Hourglass ((->) :: Type -> Type -> Type) ((->) :: Type -> Type -> Type) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsffoldl :: (ObjectPair (->) a b, ObjectPair (->) a (Hourglass b)) => ((a, b) -> a) -> (a, Hourglass b) -> a #foldMap :: (Object (->) a, Object (->) (Hourglass a), Semigroup m, Monoid m, Object (->) m, Object (->) m) => (a -> m) -> Hourglass a -> m # Show s => Show (Hourglass s) Source # Instance detailsDefined in Data.Manifold.TreeCover MethodsshowsPrec :: Int -> Hourglass s -> ShowS #show :: Hourglass s -> String #showList :: [Hourglass s] -> ShowS # Source # Instance detailsDefined in Data.Manifold.TreeCover Associated Typestype Rep (Hourglass s) :: Type -> Type # Methodsfrom :: Hourglass s -> Rep (Hourglass s) x #to :: Rep (Hourglass s) x -> Hourglass s # Semigroup s => Semigroup (Hourglass s) Source # Instance detailsDefined in Data.Manifold.TreeCover Methods(<>) :: Hourglass s -> Hourglass s -> Hourglass s #sconcat :: NonEmpty (Hourglass s) -> Hourglass s #stimes :: Integral b => b -> Hourglass s -> Hourglass s # (Monoid s, Semigroup s) => Monoid (Hourglass s) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsmappend :: Hourglass s -> Hourglass s -> Hourglass s #mconcat :: [Hourglass s] -> Hourglass s # NFData s => NFData (Hourglass s) Source # Instance detailsDefined in Data.Manifold.TreeCover Methodsrnf :: Hourglass s -> () # type Rep (Hourglass s) Source # Instance detailsDefined in Data.Manifold.TreeCover type Rep (Hourglass s) = D1 (MetaData "Hourglass" "Data.Manifold.TreeCover" "manifolds-0.5.0.4-6GwRmY3UiHT7UoKQdgtNWh" False) (C1 (MetaCons "Hourglass" PrefixI True) (S1 (MetaSel (Just "upperBulb") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 s) :*: S1 (MetaSel (Just "lowerBulb") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 s)))

unsafeFmapTree :: (NonEmpty (x, y) -> NonEmpty (ξ, υ)) -> (Needle' x -> Needle' ξ) -> (Shade x -> Shade ξ) -> (x Shaded y) -> ξ Shaded υ Source #

## External

type AffineManifold m = (Atlas m, Manifold m, AffineSpace m, Needle m ~ Diff m, HasTrie (ChartIndex m)) Source #

The AffineSpace class plus manifold constraints.