manifold-random 0.3.0.0 → 0.4.0.0
raw patch · 2 files changed
+14/−7 lines, 2 filesdep ~manifoldsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: manifolds
API changes (from Hackage documentation)
Files
- Data/Random/Manifold.hs +12/−5
- manifold-random.cabal +2/−2
Data/Random/Manifold.hs view
@@ -21,6 +21,7 @@ import Data.Manifold.TreeCover import Data.Semigroup+import Data.Maybe (catMaybes) import Data.Random @@ -40,7 +41,7 @@ shadeT' :: (PseudoAffine x, SimpleSpace (Needle x), Scalar (Needle x) ~ ℝ) => Interior x -> Variance (Needle x) -> RVarT m x shadeT' ctr expa = ((ctr.+~^) . sumV) <$> mapM (\v -> (v^*) <$> stdNormalT) eigSpan- where eigSpan = normSpanningSystem expa+ where eigSpan = varianceSpanningSystem expa -- | A shade can be considered a specification for a generalised normal distribution. -- @@ -59,7 +60,12 @@ ( WithField ℝ Manifold x, SimpleSpace (Needle x) , WithField ℝ Manifold y, SimpleSpace (Needle y) ) => Int -> Shade x -> (x -> Shade y) -> RVarT m (x`Shaded`y)-uncertainFunctionSamplesT n shx f = do+uncertainFunctionSamplesT n shx f = case ( dualSpaceWitness :: DualNeedleWitness x+ , dualSpaceWitness :: DualNeedleWitness y+ , boundarylessWitness :: BoundarylessWitness x+ , pseudoAffineWitness :: PseudoAffineWitness y ) of+ ( DualSpaceWitness, DualSpaceWitness, BoundarylessWitness+ ,PseudoAffineWitness (SemimanifoldWitness BoundarylessWitness) ) -> do domainSpls <- replicateM n $ rvarT shx pts <- forM domainSpls $ \x -> do y <- rvarT $ f x@@ -84,16 +90,17 @@ mkControlSample ((x,y):css) $ confidence + occlusion shl (x,y) css <- mkControlSample [] 0- let [Shade (xCtrl,yCtrl) expaCtrl :: Shade (x,y)] = pointsShades css+ let [Shade (xCtrl,yCtrl) expaCtrl :: Shade (x,y)]+ = pointsShades . catMaybes $ toInterior<$>css yCtrl :: Interior y expayCtrl = dualNorm . snd $ summandSpaceNorms expaCtrl jCtrl = dependence expaCtrl jFin = jOrig^*η ^+^ jCtrl^*η'- Option (Just δx) = xlc.-~.xCtrl+ Just δx = xlc.-~.xCtrl η, η' :: ℝ η = nPerTwig / (nPerTwig + fromIntegral (length css)) η' = 1 - η- Option (Just δy) = yCtrl.-~.ylc+ Just δy = yCtrl.-~.ylc return ( xlc .+~^ δx^*η' , ( Shade' (ylc .+~^ δy^*η') (scaleNorm (sqrt η) expay <> scaleNorm (sqrt η') expayCtrl)
manifold-random.cabal view
@@ -2,7 +2,7 @@ -- documentation, see http://haskell.org/cabal/users-guide/ name: manifold-random-version: 0.3.0.0+version: 0.4.0.0 synopsis: Sampling random points on general manifolds. -- description: homepage: https://github.com/leftaroundabout/manifolds@@ -26,7 +26,7 @@ -- other-extensions: build-depends: base >=4.7 && <5 , random-fu >=0.2 && <0.3- , manifolds >=0.3 && < 0.3.1+ , manifolds == 0.4.0.0 , constrained-categories , semigroups , vector-space