packages feed

ConClusion 0.2.0 → 0.2.1

raw patch · 5 files changed

+48/−47 lines, 5 filesdep ~aesondep ~basePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: aeson, base

API changes (from Hackage documentation)

- ConClusion.Array.Conversion: matH2M :: (Mutable r e, Load r Ix1 e, Element e) => Matrix e -> Matrix r e
+ ConClusion.Array.Conversion: matH2M :: (Manifest r e, Load r Ix1 e, Element e) => Matrix e -> Matrix r e
- ConClusion.Array.Conversion: vecH2M :: (Element e, Mutable r e, Load r Ix1 e) => Vector e -> Vector r e
+ ConClusion.Array.Conversion: vecH2M :: (Element e, Manifest r e, Load r Ix1 e) => Vector e -> Vector r e
- ConClusion.Numeric.Statistics: covariance :: (Numeric r e, Mutable r e, Fractional e) => Matrix r e -> Matrix r e
+ ConClusion.Numeric.Statistics: covariance :: (Numeric r e, Manifest r e, Fractional e) => Matrix r e -> Matrix r e
- ConClusion.Numeric.Statistics: euclidean :: (Mutable r e, Floating e) => DistFn r e
+ ConClusion.Numeric.Statistics: euclidean :: (Manifest r e, Floating e) => DistFn r e
- ConClusion.Numeric.Statistics: hca :: (MonadThrow m, Mutable r e, Mutable r (e, Ix1), Load r Ix1 e, Ord e, Unbox e, Fractional e) => DistFn r e -> JoinStrat e -> Matrix r e -> m (Dendrogram e)
+ ConClusion.Numeric.Statistics: hca :: (MonadThrow m, Manifest r e, Manifest r (e, Ix1), Load r Ix1 e, Ord e, Unbox e, Fractional e) => DistFn r e -> JoinStrat e -> Matrix r e -> m (Dendrogram e)
- ConClusion.Numeric.Statistics: lpNorm :: (Mutable r e, Floating e) => Int -> DistFn r e
+ ConClusion.Numeric.Statistics: lpNorm :: (Manifest r e, Floating e) => Int -> DistFn r e
- ConClusion.Numeric.Statistics: mahalanobis :: (Unbox e, Numeric r e, Mutable r e, Field e, Load r Ix1 e) => DistFn r e
+ ConClusion.Numeric.Statistics: mahalanobis :: (Unbox e, Numeric r e, Manifest r e, Field e, Load r Ix1 e) => DistFn r e
- ConClusion.Numeric.Statistics: manhattan :: (Mutable r e, Floating e) => DistFn r e
+ ConClusion.Numeric.Statistics: manhattan :: (Manifest r e, Floating e) => DistFn r e
- ConClusion.Numeric.Statistics: meanDeviation :: (Source r e, Fractional e, Unbox e, Numeric r e, Mutable r e) => Matrix r e -> Matrix r e
+ ConClusion.Numeric.Statistics: meanDeviation :: (Source r e, Fractional e, Unbox e, Numeric r e, Manifest r e) => Matrix r e -> Matrix r e
- ConClusion.Numeric.Statistics: normalise :: (Ord e, Unbox e, Numeric r e, Fractional e, Mutable r e) => Array r Ix2 e -> Array r Ix2 e
+ ConClusion.Numeric.Statistics: normalise :: (Ord e, Unbox e, Numeric r e, Fractional e, Manifest r e) => Array r Ix2 e -> Array r Ix2 e
- ConClusion.Numeric.Statistics: pca :: (Numeric r Double, Mutable r Double, Load r Ix1 Double, Load r Ix2 Double, MonadThrow m) => Int -> Matrix r Double -> m PCA
+ ConClusion.Numeric.Statistics: pca :: (Numeric r Double, Manifest r Double, Load r Ix1 Double, Load r Ix2 Double, MonadThrow m) => Int -> Matrix r Double -> m PCA

Files

ConClusion.cabal view
@@ -1,18 +1,18 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.34.6.+-- This file has been generated from package.yaml by hpack version 0.34.7. -- -- see: https://github.com/sol/hpack  name:           ConClusion-version:        0.2.0+version:        0.2.1 synopsis:       Cluster algorithms, PCA, and chemical conformere analysis description:    Please see the README on GitLab at <https://gitlab.com/theoretical-chemistry-jena/quantum-chemistry/ConfoCluster> category:       Statistics, Chemistry bug-reports:    https://gitlab.com/theoretical-chemistry-jena/quantum-chemistry/ConfoCluster/-/issues author:         Phillip Seeber maintainer:     phillip.seeber@googlemail.com-copyright:      2021 Phillip Seeber+copyright:      2022 Phillip Seeber license:        AGPL-3 license-file:   LICENSE.md build-type:     Simple@@ -62,9 +62,9 @@       NamedFieldPuns   ghc-options: -Wall -Wno-unused-top-binds -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints   build-depends:-      aeson >=1.5 && <2.1+      aeson >=1.5 && <2.2     , attoparsec >=0.13.0.0 && <0.15-    , base >=4.7 && <4.17+    , base >=4.7 && <4.18     , containers >=0.6.0.0 && <0.7     , formatting >=7.1.0 && <7.2     , hmatrix >=0.20.0 && <0.21@@ -106,9 +106,9 @@   ghc-options: -Wall -Wno-unused-top-binds -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N   build-depends:       ConClusion-    , aeson >=1.5 && <2.1+    , aeson >=1.5 && <2.2     , attoparsec >=0.13.0.0 && <0.15-    , base >=4.7 && <4.17+    , base >=4.7 && <4.18     , cmdargs >=0.10.0 && <0.11     , containers >=0.6.0.0 && <0.7     , formatting >=7.1.0 && <7.2
src/ConClusion/Array/Conversion.hs view
@@ -22,7 +22,7 @@  -- | Converts a vector from the HMatrix package to the Massiv representation. {-# SCC vecH2M #-}-vecH2M :: (Element e, Mutable r e, Load r Ix1 e) => VectorS.Vector e -> Massiv.Vector r e+vecH2M :: (Element e, Manifest r e, Load r Ix1 e) => VectorS.Vector e -> Massiv.Vector r e vecH2M hVec = fromVector' Seq (Sz $ VectorS.length hVec) hVec  -- | Converts a vector from the Massiv representation to the HMatrix representation.@@ -32,7 +32,7 @@  -- | Converts a matrix from the HMatrix representation to the Massiv representation. {-# SCC matH2M #-}-matH2M :: (Mutable r e, Load r Ix1 e, Element e) => LA.Matrix e -> Massiv.Matrix r e+matH2M :: (Manifest r e, Load r Ix1 e, Element e) => LA.Matrix e -> Massiv.Matrix r e matH2M hMat = Massiv.resize' (Sz $ nRows :. nCols) . vecH2M . LA.flatten $ hMat   where     nRows = LA.rows hMat
src/ConClusion/Array/Util.hs view
@@ -70,8 +70,8 @@   | isEmpty vec = throwM $ SizeEmptyException (Massiv.size vec)   | ixStart >= nElems = throwM $ IndexOutOfBoundsException (Sz nElems) ixStart   | otherwise = do-    let (minE, minIx) = unsafePerformIO $ ifoldlP minFold startAcc chFold startAcc searchVec-    return (minE, minIx + ixStart + 1)+      let (minE, minIx) = unsafePerformIO $ ifoldlP minFold startAcc chFold startAcc searchVec+      return (minE, minIx + ixStart + 1)   where     Sz nElems = Massiv.size vec     searchVec = Massiv.drop (Sz $ ixStart + 1) vec
src/ConClusion/BinaryTree.hs view
@@ -35,8 +35,8 @@ root (Leaf e) = e root (Node e _ _) = e --- | Steps down each branch of a tree until some criterion is satisfied or the end of the branch is--- reached. Each end of the branch is added to a result.+-- | Steps down each branch of a tree until some criterion is satisfied or the +-- end of the branch is reached. Each end of the branch is added to a result. takeBranchesWhile :: (a -> Bool) -> BinTree a -> Massiv.Vector DL a takeBranchesWhile chk tree = go tree (Massiv.empty @DL)   where@@ -47,8 +47,9 @@           rAcc = go r lAcc        in if chk v then rAcc else vAcc --- | Takes the first value in each branch, that does not fullfill the criterion anymore and adds it--- to the result. Terminal leafes of the branches are always taken.+-- | Takes the first value in each branch, that does not fullfill the criterion +-- anymore and adds it to the result. Terminal leafes of the branches are always+-- taken. takeLeafyBranchesWhile :: (a -> Bool) -> BinTree a -> Massiv.Vector DL a takeLeafyBranchesWhile chk tree = go tree (Massiv.empty @DL)   where
src/ConClusion/Numeric/Statistics.hs view
@@ -57,8 +57,8 @@ -- | Solves eigenvalue problem of a square matrix and obtains its eigenvalues and eigenvectors. {-# SCC eig #-} eig ::-  ( -- Mutable r1 Ix1 (Complex Double),-    -- Mutable r2 Ix1 (Complex Double),+  ( -- Manifest r1 Ix1 (Complex Double),+    -- Manifest r2 Ix1 (Complex Double),     LA.Field e,     Manifest r3 e,     Manifest r1 (Complex Double),@@ -85,8 +85,8 @@     MonadThrow m,     Source r1 e,     Source r2 e,-    Mutable r1 e,-    Mutable r2 e,+    Manifest r1 e,+    Manifest r2 e,     Unbox e,     Ord e   ) =>@@ -148,7 +148,7 @@ transformToPCABasis ::   ( -- Source (R r) Ix2 e,     -- Extract r Ix2 e,-    Mutable r e,+    Manifest r e,     Numeric r e,     MonadThrow m   ) =>@@ -182,7 +182,7 @@ {-# SCC pca #-} pca ::   ( Numeric r Double,-    Mutable r Double,+    Manifest r Double,     Load r Ix1 Double,     Load r Ix2 Double,     MonadThrow m@@ -246,7 +246,7 @@     Fractional e,     Unbox e,     Numeric r e,-    Mutable r e+    Manifest r e   ) =>   Matrix r e ->   Matrix r e@@ -264,7 +264,7 @@ -- -- The feature matrix should be in mean deviation form, see 'meanDeviation'. {-# SCC covariance #-}-covariance :: (Numeric r e, Mutable r e, Fractional e) => Matrix r e -> Matrix r e+covariance :: (Numeric r e, Manifest r e, Fractional e) => Matrix r e -> Matrix r e covariance x = (1 / (fromIntegral n - 1)) *. (x !><! (compute . transpose $ x))   where     Sz (_ :. n) = size x@@ -275,7 +275,7 @@     Unbox e,     Numeric r e,     Fractional e,-    Mutable r e+    Manifest r e   ) =>   Array r Ix2 e ->   Array r Ix2 e@@ -321,7 +321,7 @@ --   d(\mathbf{a}, \mathbf{b}) = \left( \sum \limits_{i=1}^n \lvert \mathbf{a}_i - \mathbf{b}_i \rvert ^p \right) ^ \frac{1}{p} -- \] {-# SCC lpNorm #-}-lpNorm :: (Mutable r e, Floating e) => Int -> DistFn r e+lpNorm :: (Manifest r e, Floating e) => Int -> DistFn r e lpNorm p = compute . buildDistMat zipFn foldFn 0   where     zipFn a b = (^ p) . abs $ a - b@@ -332,7 +332,7 @@ --   d(\mathbf{a}, \mathbf{b}) = \sum \limits_{i=1}^n \lvert \mathbf{a}_i - \mathbf{b}_i \rvert -- \] {-# SCC manhattan #-}-manhattan :: (Mutable r e, Floating e) => DistFn r e+manhattan :: (Manifest r e, Floating e) => DistFn r e manhattan = lpNorm 1  -- | The Euclidean distance between two vectors. Specialisation of the \(L_p\) norm for \(p = 2\).@@ -340,7 +340,7 @@ --   d(\mathbf{a}, \mathbf{b}) = \sqrt{\sum \limits_{i=1}^n (\mathbf{a}_i - \mathbf{b}_i)^2} -- \] {-# SCC euclidean #-}-euclidean :: (Mutable r e, Floating e) => DistFn r e+euclidean :: (Manifest r e, Floating e) => DistFn r e euclidean = lpNorm 2  -- | Mahalanobis distance between points. Suitable for non correlated axes.@@ -349,7 +349,7 @@ -- \] -- where \(\mathbf{S}\) is the covariance matrix. {-# SCC mahalanobis #-}-mahalanobis :: (Unbox e, Numeric r e, Mutable r e, LA.Field e, Load r Ix1 e) => DistFn r e+mahalanobis :: (Unbox e, Numeric r e, Manifest r e, LA.Field e, Load r Ix1 e) => DistFn r e mahalanobis points =   let a = transposeOuter @D @Ix3 . expandOuter (Sz n) const $ points       b = transposeInner a@@ -503,7 +503,7 @@ -- API. type DendroAcc e = Vector B (Dendrogram e) --- | Mutable version of the dendrogram accumulator.+-- | Manifest version of the dendrogram accumulator. type DendroAccM m e = MArray (PrimState m) B Ix1 (Dendrogram e)  -- | Cut a 'Dendrogram' at a given distance and obtain all clusters from it.@@ -577,8 +577,8 @@ {-# SCC hca #-} hca ::   ( MonadThrow m,-    Mutable r e,-    Mutable r (e, Ix1),+    Manifest r e,+    Manifest r (e, Ix1),     Load r Ix1 e,     Ord e,     Unbox e,@@ -624,10 +624,10 @@     PrimMonad m,     MonadUnliftIO m,     PrimState m ~ RealWorld,-    Mutable r e,+    Manifest r e,     -- OuterSlice r Ix2 e,     -- Manifest (R r) Ix1 e,-    Mutable r (e, Ix1),+    Manifest r (e, Ix1),     Shape r Ix1,     Fractional e,     Ord e@@ -685,7 +685,7 @@ getJoinCandidates ::   ( MonadThrow m,     PrimMonad m,-    Mutable r (e, Ix1),+    Manifest r (e, Ix1),     Ord e   ) =>   MArray (PrimState m) r Ix1 (e, Ix1) ->@@ -709,8 +709,8 @@     PrimState m ~ RealWorld,     -- OuterSlice r Ix2 e,     -- Manifest (R r) Ix1 e,-    Mutable r (e, Ix1),-    Mutable r e,+    Manifest r (e, Ix1),+    Manifest r e,     Shape r Ix1,     Ord e   ) =>@@ -785,7 +785,7 @@   ( MonadThrow m,     PrimMonad m,     MonadUnliftIO m,-    Mutable r e,+    Manifest r e,     Fractional e   ) =>   JoinStrat e ->@@ -822,8 +822,8 @@   ( MonadThrow m,     PrimMonad m,     MonadUnliftIO m,-    Mutable r (e, Ix1),-    Mutable r e+    Manifest r (e, Ix1),+    Manifest r e   ) =>   Ix1 ->   Ix1 ->@@ -853,8 +853,8 @@   ( MonadThrow m,     MonadUnliftIO m,     PrimMonad m,-    Mutable r e,-    Mutable r (e, Ix1),+    Manifest r e,+    Manifest r (e, Ix1),     Ord e   ) =>   Ix1 ->@@ -890,8 +890,8 @@     PrimMonad m,     RealWorld ~ PrimState m,     MonadUnliftIO m,-    Mutable r (e, Ix1),-    Mutable r e,+    Manifest r (e, Ix1),+    Manifest r e,     Shape r Ix1,     Ord e   ) =>@@ -919,8 +919,8 @@ {-# SCC nearestNeighbours #-} nearestNeighbours ::   ( MonadThrow m,-    Mutable r e,-    Mutable r (e, Ix1),+    Manifest r e,+    Manifest r (e, Ix1),     Load r Ix1 e,     -- OuterSlice r Ix2 e,     -- Source (R r) Ix1 e,@@ -949,8 +949,8 @@     RealWorld ~ PrimState m,     MonadThrow m,     MonadUnliftIO m,-    Mutable r e,-    Mutable r (e, Ix1)+    Manifest r e,+    Manifest r (e, Ix1)   ) =>   Ix1 ->   IntSet ->